9 Commits

Author SHA1 Message Date
07fc63026f chore: reformat changelog.txt, fixed crappy auto-release [skip ci] 2025-04-17 00:53:07 -05:00
semantic-release-bot
590a09a597 chore(release): 0.2.0 [skip ci]
---------------------------------------------------------------------------------------------------
Version: 0.2.0
Date: 2025-04-17
  Features:
    - version 0.1.1 release
  Bugfixes:
    - extra type conformity check for TechnologyUnit to prevent unexpected NPEs
    - update .releaserc, use 'master' branch, reformat to proper JSON
2025-04-17 05:48:26 +00:00
7e42a3d1ef fix: update .releaserc, use 'master' branch, reformat to proper JSON 2025-04-17 00:48:02 -05:00
1ffd52046f feat: version 0.1.1 release 2025-04-17 00:48:02 -05:00
118d4470a3 chore: minor lua reformat 2025-04-17 00:48:02 -05:00
d40a5a50c0 fix: extra type conformity check for TechnologyUnit to prevent unexpected NPEs 2025-04-17 00:48:02 -05:00
5f2379afd0 README, switch to more maintainable asset URLs 2024-12-12 03:39:11 -06:00
b6f7b0316a Add release script (disabled) 2024-12-12 03:38:50 -06:00
83b639cbec Add assets 2024-12-12 03:38:38 -06:00
18 changed files with 271 additions and 91 deletions

BIN
.assets/Agricultural.png Executable file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
.assets/Automation.png Executable file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
.assets/Chemical.png Executable file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
.assets/Cryogenic.png Executable file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
.assets/Electromagnetic.png Executable file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
.assets/Logistic.png Executable file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
.assets/Metallurgic.png Executable file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
.assets/Military.png Executable file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
.assets/Production.png Executable file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
.assets/Promethium.png Executable file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
.assets/Space.png Executable file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
.assets/Utility.png Executable file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

34
.github/workflows/release.yaml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Release
permissions: write-all
on:
push:
branches:
- master
workflow_dispatch:
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install release dependencies
run: |
npm install semantic-release@^24 \
@semantic-release/git@^10 semantic-release-factorio@^1.5.1 \
conventional-changelog-conventionalcommits@^8
- name: Run semantic-release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FACTORIO_TOKEN: ${{ secrets.FACTORIO_TOKEN }}

View File

@@ -1,73 +1,184 @@
{ {
"branches": ["main"], "branches": [
"plugins": "master"
[ ],
"plugins": [
[ [
"@semantic-release/commit-analyzer", "@semantic-release/commit-analyzer",
{ {
"preset": "conventionalcommits", "preset": "conventionalcommits",
"releaseRules": "releaseRules": [
[ {
{ "breaking": true, "release": "major" }, "breaking": true,
{ "type": "info", "release": "patch" }, "release": "major"
{ "type": "feat", "release": "minor" },
{ "type": "feature", "release": "minor" },
{ "type": "gui", "release": "patch" },
{ "type": "balance", "release": "patch" },
{ "type": "perf", "release": "patch" },
{ "type": "performance", "release": "patch" },
{ "type": "compat", "release": "patch" },
{ "type": "compatibility", "release": "patch" },
{ "type": "fix", "release": "patch" },
{ "type": "graphics", "release": "patch" },
{ "type": "sound", "release": "patch" },
{ "type": "locale", "release": "patch" },
{ "type": "translate", "release": "patch" },
{ "type": "control", "release": "patch" },
{ "type": "other", "release": "patch" },
],
}, },
{
"type": "info",
"release": "patch"
},
{
"type": "feat",
"release": "minor"
},
{
"type": "feature",
"release": "minor"
},
{
"type": "gui",
"release": "patch"
},
{
"type": "balance",
"release": "patch"
},
{
"type": "perf",
"release": "patch"
},
{
"type": "performance",
"release": "patch"
},
{
"type": "compat",
"release": "patch"
},
{
"type": "compatibility",
"release": "patch"
},
{
"type": "fix",
"release": "patch"
},
{
"type": "graphics",
"release": "patch"
},
{
"type": "sound",
"release": "patch"
},
{
"type": "locale",
"release": "patch"
},
{
"type": "translate",
"release": "patch"
},
{
"type": "control",
"release": "patch"
},
{
"type": "other",
"release": "patch"
}
]
}
], ],
[ [
"@semantic-release/release-notes-generator", "@semantic-release/release-notes-generator",
{ {
"preset": "conventionalcommits", "preset": "conventionalcommits",
"writerOpts": "writerOpts": {
{
"headerPartial": "---------------------------------------------------------------------------------------------------\nVersion: {{version}}\nDate: {{#if date}}{{date}}{{else}}????{{/if}}\n", "headerPartial": "---------------------------------------------------------------------------------------------------\nVersion: {{version}}\nDate: {{#if date}}{{date}}{{else}}????{{/if}}\n",
"footerPartial": "", "footerPartial": "",
"commitPartial": "{{#if scope}}[{{scope}}] {{/if}}{{~subject}}", "commitPartial": "{{#if scope}}[{{scope}}] {{/if}}{{~subject}}",
"mainTemplate": "{{> header}}\n{{#each commitGroups}}\n {{title}}:\n{{#each commits}}\n - {{> commit root=@root}}\n{{/each}}\n{{/each}}", "mainTemplate": "{{> header}}\n{{#each commitGroups}}\n {{title}}:\n{{#each commits}}\n - {{> commit root=@root}}\n{{/each}}\n{{/each}}"
}, },
"presetConfig": "presetConfig": {
"types": [
{ {
"types": "type": "info",
[ "section": "Info"
{ "type": "info", "section": "Info" },
{ "type": "feat", "section": "Features" },
{ "type": "feature", "section": "Features" },
{ "type": "gui", "section": "Gui" },
{ "type": "balance", "section": "Balancing" },
{ "type": "perf", "section": "Optimizations" },
{ "type": "performance", "section": "Optimizations" },
{ "type": "compat", "section": "Compatibility" },
{ "type": "compatibility", "section": "Compatibility" },
{ "type": "fix", "section": "Bugfixes" },
{ "type": "graphics", "section": "Graphics" },
{ "type": "sound", "section": "Sounds" },
{ "type": "locale", "section": "Locale" },
{ "type": "translate", "section": "Translation" },
{ "type": "control", "section": "Control" },
{ "type": "other", "section": "Changes" },
],
}, },
{
"type": "feat",
"section": "Features"
}, },
{
"type": "feature",
"section": "Features"
},
{
"type": "gui",
"section": "Gui"
},
{
"type": "balance",
"section": "Balancing"
},
{
"type": "perf",
"section": "Optimizations"
},
{
"type": "performance",
"section": "Optimizations"
},
{
"type": "compat",
"section": "Compatibility"
},
{
"type": "compatibility",
"section": "Compatibility"
},
{
"type": "fix",
"section": "Bugfixes"
},
{
"type": "graphics",
"section": "Graphics"
},
{
"type": "sound",
"section": "Sounds"
},
{
"type": "locale",
"section": "Locale"
},
{
"type": "translate",
"section": "Translation"
},
{
"type": "control",
"section": "Control"
},
{
"type": "other",
"section": "Changes"
}
]
}
}
], ],
"semantic-release-factorio", "semantic-release-factorio",
[ [
"@semantic-release/github", "@semantic-release/github",
{ "assets": [{ "path": "*_*.*.*.zip", "label": "Packaged Mod" }] }, {
], "assets": [
["@semantic-release/git", { "assets": ["changelog.txt", "info.json"] }], {
], "path": "*_*.*.*.zip",
"label": "Packaged Mod"
}
]
}
],
[
"@semantic-release/git",
{
"assets": [
"changelog.txt",
"info.json"
]
}
]
]
} }

View File

@@ -75,7 +75,7 @@ Multipliers are applied in a specific order, and the last one applied is the one
1. **Global** multipliers 1. **Global** multipliers
2. **Pack** multipliers. 2. **Pack** multipliers.
- Applies per-pack in this order: - Applies per-pack in this order:
![Automation](./.assets/Automation.png) ![Logistic](./.assets/Logistic.png) ![Military](./.assets/Military.png) ![Chemical](./.assets/Chemical.png) ![Production](./.assets/Production.png) ![Utility](./.assets/Utility.png) ![Space](./.assets/Space.png) ![Metallurgic](./.assets/Metallurgic.png) ![Electromagnetic](./.assets/Electromagnetic.png) ![Agricultural](./.assets/Agricultural.png) ![Cryogenic](./.assets/Cryogenic.png) ![Promethium](./.assets/Promethium.png) ![Automation][automation-icon] ![Logistic][logistic-icon] ![Military][military-icon] ![Chemical][chemical-icon] ![Production][production-icon] ![Utility][utility-icon] ![Space][space-icon] ![Metallurgic][metallurgic-icon] ![Electromagnetic][electromagnetic-icon] ![Agricultural][agricultural-icon] ![Cryogenic][cryogenic-icon] ![Promethium][promethium-icon]
3. **Category** multipliers 3. **Category** multipliers
- **Essential** - **Essential**
- **Interplanetary** - **Interplanetary**
@@ -95,6 +95,18 @@ Categories are the way this mod groups technologies together for easier configur
- This does not include the 'finite' level upgrade technologies, such as inserter capacity, transport belt capacity, or level 1-6 of worker robot speed. - This does not include the 'finite' level upgrade technologies, such as inserter capacity, transport belt capacity, or level 1-6 of worker robot speed.
- I may consider adding on an option to include these in the future. - I may consider adding on an option to include these in the future.
[automation-icon]: ./.assets/Automation.png
[logistic-icon]: ./.assets/Logistic.png
[military-icon]: ./.assets/Military.png
[chemical-icon]: ./.assets/Chemical.png
[production-icon]: ./.assets/Production.png
[utility-icon]: ./.assets/Utility.png
[space-icon]: ./.assets/Space.png
[metallurgic-icon]: ./.assets/Metallurgic.png
[electromagnetic-icon]: ./.assets/Electromagnetic.png
[agricultural-icon]: ./.assets/Agricultural.png
[cryogenic-icon]: ./.assets/Cryogenic.png
[promethium-icon]: ./.assets/Promethium.png
[factorio-mods-page]: https://mods.factorio.com/mod/research-multipliers [factorio-mods-page]: https://mods.factorio.com/mod/research-multipliers
[factorio-download-count-badge]: https://img.shields.io/badge/dynamic/json?color=orange&label=Factorio&query=downloads_count&suffix=%20downloads&url=https%3A%2F%2Fmods.factorio.com%2Fapi%2Fmods%2Fresearch-multipliers&style=flat [factorio-download-count-badge]: https://img.shields.io/badge/dynamic/json?color=orange&label=Factorio&query=downloads_count&suffix=%20downloads&url=https%3A%2F%2Fmods.factorio.com%2Fapi%2Fmods%2Fresearch-multipliers&style=flat
[github-latest-release]: https://github.com/Xevion/research-multipliers/releases/ [github-latest-release]: https://github.com/Xevion/research-multipliers/releases/

View File

@@ -1,7 +1,14 @@
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
Version: 0.2.0
Date: 2025-04-17
Bugfixes:
- fixed rare issue improper TechnologyUnit objects in other mods would cause a NPE crash
Minor Features:
- added error handling with 'xpcall' to prevent full crashes, instead logging exceptions
---------------------------------------------------------------------------------------------------
Version: 0.1.0 Version: 0.1.0
Date: 12. 12. 2024 Date: 2024-12-12
Major Features: Major Features:
- Initial release. - initial release
- Global, Essential, Interplanetary & Infinite Research Multipliers - added Global, Essential, Interplanetary & Infinite Research Multipliers
- Science Pack Research Multipliers - added Science Pack Research Multipliers

View File

@@ -126,7 +126,6 @@ function table.contains(table, element)
return false return false
end end
function is_essential_research(name) function is_essential_research(name)
return essential_research[name] == true; return essential_research[name] == true;
end end
@@ -136,13 +135,20 @@ function is_infinite_research(name)
return data.raw.technology[name].unit.count == nil; return data.raw.technology[name].unit.count == nil;
end end
-- -- This function expects that the technology exists, and follows the TechnologyUnit type specification properly
function is_interplanetary_research(name) function is_interplanetary_research(name)
for _, ingredient in pairs(data.raw.technology[name].unit.ingredients) do local technology = data.raw.technology[name];
if technology.unit == nil then
return false;
end
for _, ingredient in pairs(technology.unit.ingredients) do
if interplanetary_science_packs[ingredient[1]] then if interplanetary_science_packs[ingredient[1]] then
return true; return true;
end end
end end
return false; return false;
end end
@@ -161,10 +167,13 @@ function multiply(current, next)
end end
end end
for name, technology in pairs(data.raw.technology) do function calculate(name, technology)
-- skip trigger technology -- Skip trigger technology, or technologies that don't properly provide a `unit`, `unit.ingredients`, or `unit.count` property
if (technology.research_trigger ~= nil) then if (technology.research_trigger ~= nil) then
goto continue; return;
elseif (technology.unit == nil or technology.unit.ingredients == nil) then
log("Skipping non-trigger technology \"" ..
name .. "\" because it doesn't properly define a unit, it's ingredients, and/or a count.")
end end
-- default to the global multiplier -- default to the global multiplier
@@ -213,10 +222,10 @@ for name, technology in pairs(data.raw.technology) do
-- don't apply multiplier if it would do nothing -- don't apply multiplier if it would do nothing
if (multiplier == 1) then if (multiplier == 1) then
goto continue; return
elseif (multiplier <= 0) then elseif (multiplier <= 0) then
log("Multiplier is less than 0, skipping " .. name .. " (" .. multiplier .. ")") log("Multiplier is less than 0, skipping " .. name .. " (" .. multiplier .. ")")
goto continue; return
end end
-- Multiplier has been calculated, apply it -- Multiplier has been calculated, apply it
@@ -237,6 +246,10 @@ for name, technology in pairs(data.raw.technology) do
technology.unit.count = technology.unit.count * multiplier; technology.unit.count = technology.unit.count * multiplier;
end end
end end
end
::continue::
for name, technology in pairs(data.raw.technology) do
xpcall(calculate, function(err)
log("Error in technology " .. name .. ": " .. err)
end, name, technology)
end end

View File

@@ -1,12 +1,15 @@
{ {
"name": "research-multipliers", "name": "research-multipliers",
"version": "0.1.0", "version": "0.2.0",
"title": "Research Multipliers", "title": "Research Multipliers",
"author": "Xevion", "author": "Xevion",
"homepage": "https://github.com/Xevion/research-multipliers", "homepage": "https://github.com/Xevion/research-multipliers",
"description": "Advanced customizable multipliers for research, including pack, category, infinite, and individual technology multipliers.", "description": "Advanced customizable multipliers for research, including pack, category, infinite, and individual technology multipliers.",
"factorio_version": "2.0", "factorio_version": "2.0",
"dependencies": ["base >= 2.0.0", "? space-age"], "dependencies": [
"base >= 2.0.0",
"? space-age"
],
"quality_required": false, "quality_required": false,
"space_travel_required": false, "space_travel_required": false,
"spoiling_required": false, "spoiling_required": false,