diff --git a/TODO b/TODO index 9f61c75..914136e 100644 --- a/TODO +++ b/TODO @@ -33,3 +33,4 @@ compat: cargo ships editor extensions (test surface separation) train fuel types for refuelers + automatic recipe creation diff --git a/cybersyn/changelog.txt b/cybersyn/changelog.txt index 7366f98..e801eb6 100644 --- a/cybersyn/changelog.txt +++ b/cybersyn/changelog.txt @@ -3,6 +3,8 @@ Version: 1.2.14 Date: 2023-3-14 Features: - Added opt-in WIP trains, inventory, and station manager gui (highly experimental, use at your own risk) + Changes: + - Improved the recipe derivation logic for the cybernetic combinator, in all modpacks it should now consistently be about as difficult to craft as an arthmetic combinator. Vanilla recipe is unchanged, but several overhaul mods will receive new recipes. Bugfixes: - Provider override thresholds now correctly override the required train capacity as well; fix contributed by shopt - Fixed a rare crash relating to an uninitialized network mask on a new station diff --git a/cybersyn/data-final-fixes.lua b/cybersyn/data-final-fixes.lua index 176c80e..b3cf5dd 100644 --- a/cybersyn/data-final-fixes.lua +++ b/cybersyn/data-final-fixes.lua @@ -1,10 +1,29 @@ +flib = require("__flib__.table") +require('scripts.constants') --Credit to modo-lv for submitting the following code if mods["nullius"] then - -- Place combinator in the same subgroup as the regular train stop - data.raw["recipe"][COMBINATOR_NAME].subgroup = data.raw["train-stop"]["train-stop"].subgroup - data.raw["item"][COMBINATOR_NAME].subgroup = data.raw["item"]["train-stop"].subgroup - -- Nullius makes modded technologies part of its research tree - -- Place combinator in the same place on the research tree as LTN - table.insert(data.raw.technology["nullius-broadcasting-1"].prerequisites, "cybersyn-train-network") + -- Place combinator in the same subgroup as the regular train stop + data.raw["recipe"][COMBINATOR_NAME].subgroup = data.raw["train-stop"]["train-stop"].subgroup + data.raw["item"][COMBINATOR_NAME].subgroup = data.raw["item"]["train-stop"].subgroup + -- Nullius makes modded technologies part of its research tree + -- Place combinator in the same place on the research tree as LTN + table.insert(data.raw.technology["nullius-broadcasting-1"].prerequisites, "cybersyn-train-network") end + +-- Reset the combinator recipe back to arithmetic combinator recipe in case a mod has changed it +local recipe = flib.deep_copy(data.raw["recipe"]["arithmetic-combinator"].ingredients) +for k, _ in pairs(recipe) do + local mult = 2 + for i, _ in pairs(recipe) do + if recipe[k][i] == "copper-cable" then + mult = 4 + end + end + for i, _ in pairs(recipe) do + if type(recipe[k][i]) == "number" then + recipe[k][i] = mult*recipe[k][i] + end + end +end +data.raw["recipe"][COMBINATOR_NAME].ingredients = recipe diff --git a/cybersyn/prototypes/tech.lua b/cybersyn/prototypes/tech.lua index 4e64122..21367ac 100644 --- a/cybersyn/prototypes/tech.lua +++ b/cybersyn/prototypes/tech.lua @@ -1,9 +1,10 @@ --By Mami combinator_recipe = flib.copy_prototype(data.raw["recipe"]["arithmetic-combinator"], COMBINATOR_NAME) -combinator_recipe.ingredients = { - {"copper-cable", 20}, - {"electronic-circuit", 10}, -} +--- Recipe is set in data-fixes-final, but in vanilla it should match below +--combinator_recipe.ingredients = { +-- {"copper-cable", 20}, +-- {"electronic-circuit", 10},aww +--} combinator_recipe.enabled = false combinator_recipe.subgroup = data.raw["recipe"]["train-stop"].subgroup