Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 07fc63026f | |||
|
|
590a09a597 | ||
| 7e42a3d1ef | |||
| 1ffd52046f | |||
| 118d4470a3 | |||
| d40a5a50c0 | |||
| 5f2379afd0 | |||
| b6f7b0316a | |||
| 83b639cbec |
BIN
.assets/Agricultural.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
.assets/Automation.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
.assets/Chemical.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
.assets/Cryogenic.png
Executable file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
.assets/Electromagnetic.png
Executable file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
.assets/Logistic.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
.assets/Metallurgic.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
.assets/Military.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
.assets/Production.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
.assets/Promethium.png
Executable file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
.assets/Space.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
.assets/Utility.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
34
.github/workflows/release.yaml
vendored
Normal 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 }}
|
||||
249
.releaserc
@@ -1,73 +1,184 @@
|
||||
{
|
||||
"branches": ["main"],
|
||||
"plugins":
|
||||
"branches": [
|
||||
"master"
|
||||
],
|
||||
"plugins": [
|
||||
[
|
||||
[
|
||||
"@semantic-release/commit-analyzer",
|
||||
{
|
||||
"preset": "conventionalcommits",
|
||||
"releaseRules":
|
||||
[
|
||||
{ "breaking": true, "release": "major" },
|
||||
{ "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",
|
||||
{
|
||||
"preset": "conventionalcommits",
|
||||
"writerOpts":
|
||||
{
|
||||
"headerPartial": "---------------------------------------------------------------------------------------------------\nVersion: {{version}}\nDate: {{#if date}}{{date}}{{else}}????{{/if}}\n",
|
||||
"footerPartial": "",
|
||||
"commitPartial": "{{#if scope}}[{{scope}}] {{/if}}{{~subject}}",
|
||||
"mainTemplate": "{{> header}}\n{{#each commitGroups}}\n {{title}}:\n{{#each commits}}\n - {{> commit root=@root}}\n{{/each}}\n{{/each}}",
|
||||
},
|
||||
"presetConfig":
|
||||
{
|
||||
"types":
|
||||
[
|
||||
{ "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" },
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
"semantic-release-factorio",
|
||||
[
|
||||
"@semantic-release/github",
|
||||
{ "assets": [{ "path": "*_*.*.*.zip", "label": "Packaged Mod" }] },
|
||||
],
|
||||
["@semantic-release/git", { "assets": ["changelog.txt", "info.json"] }],
|
||||
"@semantic-release/commit-analyzer",
|
||||
{
|
||||
"preset": "conventionalcommits",
|
||||
"releaseRules": [
|
||||
{
|
||||
"breaking": true,
|
||||
"release": "major"
|
||||
},
|
||||
{
|
||||
"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",
|
||||
{
|
||||
"preset": "conventionalcommits",
|
||||
"writerOpts": {
|
||||
"headerPartial": "---------------------------------------------------------------------------------------------------\nVersion: {{version}}\nDate: {{#if date}}{{date}}{{else}}????{{/if}}\n",
|
||||
"footerPartial": "",
|
||||
"commitPartial": "{{#if scope}}[{{scope}}] {{/if}}{{~subject}}",
|
||||
"mainTemplate": "{{> header}}\n{{#each commitGroups}}\n {{title}}:\n{{#each commits}}\n - {{> commit root=@root}}\n{{/each}}\n{{/each}}"
|
||||
},
|
||||
"presetConfig": {
|
||||
"types": [
|
||||
{
|
||||
"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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"semantic-release-factorio",
|
||||
[
|
||||
"@semantic-release/github",
|
||||
{
|
||||
"assets": [
|
||||
{
|
||||
"path": "*_*.*.*.zip",
|
||||
"label": "Packaged Mod"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/git",
|
||||
{
|
||||
"assets": [
|
||||
"changelog.txt",
|
||||
"info.json"
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
14
README.md
@@ -75,7 +75,7 @@ Multipliers are applied in a specific order, and the last one applied is the one
|
||||
1. **Global** multipliers
|
||||
2. **Pack** multipliers.
|
||||
- Applies per-pack in this order:
|
||||
           
|
||||
![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
|
||||
- **Essential**
|
||||
- **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.
|
||||
- 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-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/
|
||||
|
||||
@@ -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
|
||||
Date: 12. 12. 2024
|
||||
Date: 2024-12-12
|
||||
Major Features:
|
||||
- Initial release.
|
||||
- Global, Essential, Interplanetary & Infinite Research Multipliers
|
||||
- Science Pack Research Multipliers
|
||||
- initial release
|
||||
- added Global, Essential, Interplanetary & Infinite Research Multipliers
|
||||
- added Science Pack Research Multipliers
|
||||
@@ -120,12 +120,11 @@ local interplanetary_science_packs = as_set({
|
||||
function table.contains(table, element)
|
||||
for _, value in pairs(table) do
|
||||
if value == element then
|
||||
return true
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
function is_essential_research(name)
|
||||
return essential_research[name] == true;
|
||||
@@ -136,13 +135,20 @@ function is_infinite_research(name)
|
||||
return data.raw.technology[name].unit.count == nil;
|
||||
end
|
||||
|
||||
--
|
||||
-- This function expects that the technology exists, and follows the TechnologyUnit type specification properly
|
||||
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
|
||||
return true;
|
||||
end
|
||||
end
|
||||
|
||||
return false;
|
||||
end
|
||||
|
||||
@@ -161,10 +167,13 @@ function multiply(current, next)
|
||||
end
|
||||
end
|
||||
|
||||
for name, technology in pairs(data.raw.technology) do
|
||||
-- skip trigger technology
|
||||
function calculate(name, 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
|
||||
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
|
||||
|
||||
-- default to the global multiplier
|
||||
@@ -200,7 +209,7 @@ for name, technology in pairs(data.raw.technology) do
|
||||
end
|
||||
end
|
||||
|
||||
-- debug printing
|
||||
-- debug printing
|
||||
if (technology.unit) then
|
||||
if (technology.unit.count ~= nil) then
|
||||
log(name .. " : " .. technology.unit.count .. " -> x" .. multiplier)
|
||||
@@ -213,10 +222,10 @@ for name, technology in pairs(data.raw.technology) do
|
||||
|
||||
-- don't apply multiplier if it would do nothing
|
||||
if (multiplier == 1) then
|
||||
goto continue;
|
||||
return
|
||||
elseif (multiplier <= 0) then
|
||||
log("Multiplier is less than 0, skipping " .. name .. " (" .. multiplier .. ")")
|
||||
goto continue;
|
||||
return
|
||||
end
|
||||
|
||||
-- Multiplier has been calculated, apply it
|
||||
@@ -232,11 +241,15 @@ for name, technology in pairs(data.raw.technology) do
|
||||
else
|
||||
-- simple count
|
||||
if (multiplier < 1) then
|
||||
technology.unit.count = math.max(math.ceil(technology.unit.count*multiplier), 1)
|
||||
technology.unit.count = math.max(math.ceil(technology.unit.count * multiplier), 1)
|
||||
else
|
||||
technology.unit.count = technology.unit.count*multiplier;
|
||||
technology.unit.count = technology.unit.count * multiplier;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
::continue::
|
||||
end
|
||||
for name, technology in pairs(data.raw.technology) do
|
||||
xpcall(calculate, function(err)
|
||||
log("Error in technology " .. name .. ": " .. err)
|
||||
end, name, technology)
|
||||
end
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
{
|
||||
"name": "research-multipliers",
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.0",
|
||||
"title": "Research Multipliers",
|
||||
"author": "Xevion",
|
||||
"homepage": "https://github.com/Xevion/research-multipliers",
|
||||
"description": "Advanced customizable multipliers for research, including pack, category, infinite, and individual technology multipliers.",
|
||||
"factorio_version": "2.0",
|
||||
"dependencies": ["base >= 2.0.0", "? space-age"],
|
||||
"dependencies": [
|
||||
"base >= 2.0.0",
|
||||
"? space-age"
|
||||
],
|
||||
"quality_required": false,
|
||||
"space_travel_required": false,
|
||||
"spoiling_required": false,
|
||||
"freezing_required": false,
|
||||
"segmented_units_required": false
|
||||
}
|
||||
}
|
||||