diff --git a/changelog.txt b/changelog.txt index b1959b2..911217e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 2.1.9 +Date: 2025-03-04 + Changes: + - Align various electronic circuit recipes to all use solder +--------------------------------------------------------------------------------------------------- Version: 2.1.8 Date: 2025-03-03 Changes: diff --git a/data-final-fixes.lua b/data-final-fixes.lua index 20fcaec..0a81f25 100644 --- a/data-final-fixes.lua +++ b/data-final-fixes.lua @@ -14,19 +14,21 @@ util.set_main_product("se-glass-vulcanite", "glass") util.add_to_product("se-core-fragment-omni", "tin-ore", -4) -- Electronic circuits need final fixes -local amt_ec = util.get_amount("electronic-circuit-stone", "electronic-circuit") -if amt_ec == 1 then - util.multiply_recipe("electronic-circuit-stone", 2) - util.set_recipe_time("electronic-circuit-stone", 0.5) -- faster but more complex +function modify_ec(recipe_name, to_replace) + if not to_replace then + to_replace = "copper-cable" + end + local amt_ec = util.get_amount(recipe_name, "electronic-circuit") + if amt_ec == 1 then + util.multiply_recipe(recipe_name, 2) + util.set_recipe_time(recipe_name, 0.5) -- faster but more complex + end + util.replace_some_ingredient(recipe_name, to_replace, 1, "solder", 1) end -util.replace_some_ingredient("electronic-circuit-stone", "copper-cable", 1, "solder", 1) - -amt_ec = util.get_amount("electronic-circuit") -if amt_ec == 1 then - util.multiply_recipe("electronic-circuit", 2) - util.set_recipe_time("electronic-circuit-stone", 0.5) -- faster but more complex -end -util.replace_some_ingredient("electronic-circuit", "copper-cable", 1, "solder", 1) +modify_ec("electronic-circuit") +modify_ec("electronic-circuit-stone") +modify_ec("electronic-circuit-wood") +modify_ec("electronic-circuit-aluminum", "aluminum-cable") if mods.RenaiTransportation then for i, recipe in pairs(data.raw.recipe) do diff --git a/data-util.lua b/data-util.lua index 2ab6faf..59b6bcb 100644 --- a/data-util.lua +++ b/data-util.lua @@ -157,6 +157,7 @@ function util.add_shiftite_recipe(item, shiftites, quantity) end -- Add the gleba rock. If it exists, still add resource to mine from it +local gleba_tint = {.6, .8, 1} function util.add_gleba_rock(resource, amount_min, amount_max) if (not data.raw.planet.gleba or not data.raw.planet.gleba.map_gen_settings or -- attempted compatibility fixes @@ -176,7 +177,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) name = "gleba-rock", localised_name = {"entity-name.big-rock"}, flags = {"placeable-neutral", "placeable-off-grid"}, - icon = "__base__/graphics/icons/big-sand-rock.png", + icons = {{icon = "__base__/graphics/icons/big-sand-rock.png", tint=gleba_tint}}, subgroup = "grass", order = "b[decorative]-l[rock]-a[big]", deconstruction_alternative = "big-rock", @@ -227,6 +228,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) { { filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-01.png", + tint = gleba_tint, width = 209, height = 138, shift = {0.304688, -0.4}, @@ -234,6 +236,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) }, { filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-02.png", + tint = gleba_tint, width = 165, height = 129, shift = {0.0, 0.0390625}, @@ -241,6 +244,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) }, { filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-03.png", + tint = gleba_tint, width = 151, height = 139, shift = {0.151562, 0.0}, @@ -248,6 +252,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) }, { filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-04.png", + tint = gleba_tint, width = 216, height = 110, shift = {0.390625, 0.0}, @@ -255,6 +260,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) }, { filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-05.png", + tint = gleba_tint, width = 154, height = 147, shift = {0.328125, 0.0703125}, @@ -262,6 +268,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) }, { filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-06.png", + tint = gleba_tint, width = 154, height = 132, shift = {0.16875, -0.1}, @@ -269,6 +276,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) }, { filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-07.png", + tint = gleba_tint, width = 193, height = 130, shift = {0.3, -0.2}, @@ -276,6 +284,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) }, { filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-08.png", + tint = gleba_tint, width = 136, height = 117, shift = {0.0, 0.0}, @@ -283,6 +292,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) }, { filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-09.png", + tint = gleba_tint, width = 157, height = 115, shift = {0.1, 0.0}, @@ -290,6 +300,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) }, { filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-10.png", + tint = gleba_tint, width = 198, height = 153, shift = {0.325, -0.1}, @@ -297,6 +308,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) }, { filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-11.png", + tint = gleba_tint, width = 190, height = 115, shift = {0.453125, 0.0}, @@ -304,6 +316,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) }, { filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-12.png", + tint = gleba_tint, width = 229, height = 126, shift = {0.539062, -0.015625}, @@ -311,6 +324,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) }, { filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-13.png", + tint = gleba_tint, width = 151, height = 125, shift = {0.0703125, 0.179688}, @@ -318,6 +332,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) }, { filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-14.png", + tint = gleba_tint, width = 137, height = 117, shift = {0.160938, 0.0}, @@ -325,6 +340,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) }, { filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-15.png", + tint = gleba_tint, width = 201, height = 141, shift = {0.242188, -0.195312}, @@ -332,6 +348,7 @@ function util.add_gleba_rock(resource, amount_min, amount_max) }, { filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-16.png", + tint = gleba_tint, width = 209, height = 154, shift = {0.351562, -0.1}, @@ -1672,16 +1689,17 @@ end function util.remove_prior_unlocks(tech, recipe) if data.raw.technology[tech].prerequisites then for i, prerequisite in pairs(data.raw.technology[tech].prerequisites) do - remove_prior_unlocks(prerequisite, recipe, 0) + remove_prior_unlocks(prerequisite, recipe, {}) end end end -function remove_prior_unlocks(tech, recipe, depth) - if depth > 10000 then - log("Infinite recursion detected, backing out.") +function remove_prior_unlocks(tech, recipe, processed) + if processed[tech] then + print("Already processed ".. tech .. " returning") return end + processed[tech] = true local technology = data.raw.technology[tech] if technology then log("Removing prior unlocks for ".. tech) @@ -1690,7 +1708,7 @@ function remove_prior_unlocks(tech, recipe, depth) for i, prerequisite in pairs(technology.prerequisites) do if string.sub(prerequisite, 1, 3) ~= 'ei_' then -- log("BZZZ removing prior unlocks for " .. recipe .. " from " .. tech ..", checking " .. prerequisite) -- Handy Debug :| - remove_prior_unlocks(prerequisite, recipe, depth+1) + remove_prior_unlocks(prerequisite, recipe, processed) end end end @@ -1714,16 +1732,17 @@ function util.replace_ingredients_prior_to(tech, old, new, multiplier) end if data.raw.technology[tech].prerequisites then for i, prerequisite in pairs(data.raw.technology[tech].prerequisites) do - replace_ingredients_prior_to(prerequisite, old, new, multiplier, 0) + replace_ingredients_prior_to(prerequisite, old, new, multiplier, {}) end end end -function replace_ingredients_prior_to(tech, old, new, multiplier, depth) - if depth > 10000 then - log("Infinite recursion detected, backing out.") +function replace_ingredients_prior_to(tech, old, new, multiplier, processed) + if processed[tech] then + print("Already processed ".. tech .. " returning") return end + processed[tech] = true log("Replacing for tech "..tech) local technology = data.raw.technology[tech] if technology then @@ -1739,7 +1758,7 @@ function replace_ingredients_prior_to(tech, old, new, multiplier, depth) for i, prerequisite in pairs(technology.prerequisites) do -- log("BZZZ checking " .. prerequisite) -- Handy Debug :| if string.sub(prerequisite, 1, 3) ~= 'ei_' then - replace_ingredients_prior_to(prerequisite, old, new, multiplier, depth + 1) + replace_ingredients_prior_to(prerequisite, old, new, multiplier, processed) end end end diff --git a/info.json b/info.json index 5914000..1cfa0b1 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bztin", - "version": "2.1.8", + "version": "2.1.9", "factorio_version": "2.0", "title": "Tin", "author": "Brevven",