electronics sound and gleba tint

This commit is contained in:
Brevven 2025-03-21 22:24:38 -07:00
parent f3c368adb1
commit d9f0bf5fa4
4 changed files with 50 additions and 24 deletions

View file

@ -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 Version: 2.1.8
Date: 2025-03-03 Date: 2025-03-03
Changes: Changes:

View file

@ -14,19 +14,21 @@ util.set_main_product("se-glass-vulcanite", "glass")
util.add_to_product("se-core-fragment-omni", "tin-ore", -4) util.add_to_product("se-core-fragment-omni", "tin-ore", -4)
-- Electronic circuits need final fixes -- Electronic circuits need final fixes
local amt_ec = util.get_amount("electronic-circuit-stone", "electronic-circuit") function modify_ec(recipe_name, to_replace)
if amt_ec == 1 then if not to_replace then
util.multiply_recipe("electronic-circuit-stone", 2) to_replace = "copper-cable"
util.set_recipe_time("electronic-circuit-stone", 0.5) -- faster but more complex 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 end
util.replace_some_ingredient("electronic-circuit-stone", "copper-cable", 1, "solder", 1) modify_ec("electronic-circuit")
modify_ec("electronic-circuit-stone")
amt_ec = util.get_amount("electronic-circuit") modify_ec("electronic-circuit-wood")
if amt_ec == 1 then modify_ec("electronic-circuit-aluminum", "aluminum-cable")
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)
if mods.RenaiTransportation then if mods.RenaiTransportation then
for i, recipe in pairs(data.raw.recipe) do for i, recipe in pairs(data.raw.recipe) do

View file

@ -157,6 +157,7 @@ function util.add_shiftite_recipe(item, shiftites, quantity)
end end
-- Add the gleba rock. If it exists, still add resource to mine from it -- 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) function util.add_gleba_rock(resource, amount_min, amount_max)
if (not data.raw.planet.gleba or if (not data.raw.planet.gleba or
not data.raw.planet.gleba.map_gen_settings or -- attempted compatibility fixes 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", name = "gleba-rock",
localised_name = {"entity-name.big-rock"}, localised_name = {"entity-name.big-rock"},
flags = {"placeable-neutral", "placeable-off-grid"}, 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", subgroup = "grass",
order = "b[decorative]-l[rock]-a[big]", order = "b[decorative]-l[rock]-a[big]",
deconstruction_alternative = "big-rock", 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", filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-01.png",
tint = gleba_tint,
width = 209, width = 209,
height = 138, height = 138,
shift = {0.304688, -0.4}, 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", filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-02.png",
tint = gleba_tint,
width = 165, width = 165,
height = 129, height = 129,
shift = {0.0, 0.0390625}, 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", filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-03.png",
tint = gleba_tint,
width = 151, width = 151,
height = 139, height = 139,
shift = {0.151562, 0.0}, 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", filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-04.png",
tint = gleba_tint,
width = 216, width = 216,
height = 110, height = 110,
shift = {0.390625, 0.0}, 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", filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-05.png",
tint = gleba_tint,
width = 154, width = 154,
height = 147, height = 147,
shift = {0.328125, 0.0703125}, 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", filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-06.png",
tint = gleba_tint,
width = 154, width = 154,
height = 132, height = 132,
shift = {0.16875, -0.1}, 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", filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-07.png",
tint = gleba_tint,
width = 193, width = 193,
height = 130, height = 130,
shift = {0.3, -0.2}, 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", filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-08.png",
tint = gleba_tint,
width = 136, width = 136,
height = 117, height = 117,
shift = {0.0, 0.0}, 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", filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-09.png",
tint = gleba_tint,
width = 157, width = 157,
height = 115, height = 115,
shift = {0.1, 0.0}, 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", filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-10.png",
tint = gleba_tint,
width = 198, width = 198,
height = 153, height = 153,
shift = {0.325, -0.1}, 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", filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-11.png",
tint = gleba_tint,
width = 190, width = 190,
height = 115, height = 115,
shift = {0.453125, 0.0}, 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", filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-12.png",
tint = gleba_tint,
width = 229, width = 229,
height = 126, height = 126,
shift = {0.539062, -0.015625}, 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", filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-13.png",
tint = gleba_tint,
width = 151, width = 151,
height = 125, height = 125,
shift = {0.0703125, 0.179688}, 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", filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-14.png",
tint = gleba_tint,
width = 137, width = 137,
height = 117, height = 117,
shift = {0.160938, 0.0}, 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", filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-15.png",
tint = gleba_tint,
width = 201, width = 201,
height = 141, height = 141,
shift = {0.242188, -0.195312}, 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", filename = "__base__/graphics/decorative/sand-rock/big-sand-rock-16.png",
tint = gleba_tint,
width = 209, width = 209,
height = 154, height = 154,
shift = {0.351562, -0.1}, shift = {0.351562, -0.1},
@ -1672,16 +1689,17 @@ end
function util.remove_prior_unlocks(tech, recipe) function util.remove_prior_unlocks(tech, recipe)
if data.raw.technology[tech].prerequisites then if data.raw.technology[tech].prerequisites then
for i, prerequisite in pairs(data.raw.technology[tech].prerequisites) do 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 end
end end
function remove_prior_unlocks(tech, recipe, depth) function remove_prior_unlocks(tech, recipe, processed)
if depth > 10000 then if processed[tech] then
log("Infinite recursion detected, backing out.") print("Already processed ".. tech .. " returning")
return return
end end
processed[tech] = true
local technology = data.raw.technology[tech] local technology = data.raw.technology[tech]
if technology then if technology then
log("Removing prior unlocks for ".. tech) 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 for i, prerequisite in pairs(technology.prerequisites) do
if string.sub(prerequisite, 1, 3) ~= 'ei_' then if string.sub(prerequisite, 1, 3) ~= 'ei_' then
-- log("BZZZ removing prior unlocks for " .. recipe .. " from " .. tech ..", checking " .. prerequisite) -- Handy Debug :| -- 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 end
end end
@ -1714,16 +1732,17 @@ function util.replace_ingredients_prior_to(tech, old, new, multiplier)
end end
if data.raw.technology[tech].prerequisites then if data.raw.technology[tech].prerequisites then
for i, prerequisite in pairs(data.raw.technology[tech].prerequisites) do 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 end
end end
function replace_ingredients_prior_to(tech, old, new, multiplier, depth) function replace_ingredients_prior_to(tech, old, new, multiplier, processed)
if depth > 10000 then if processed[tech] then
log("Infinite recursion detected, backing out.") print("Already processed ".. tech .. " returning")
return return
end end
processed[tech] = true
log("Replacing for tech "..tech) log("Replacing for tech "..tech)
local technology = data.raw.technology[tech] local technology = data.raw.technology[tech]
if technology then 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 for i, prerequisite in pairs(technology.prerequisites) do
-- log("BZZZ checking " .. prerequisite) -- Handy Debug :| -- log("BZZZ checking " .. prerequisite) -- Handy Debug :|
if string.sub(prerequisite, 1, 3) ~= 'ei_' then 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 end
end end

View file

@ -1,6 +1,6 @@
{ {
"name": "bztin", "name": "bztin",
"version": "2.1.8", "version": "2.1.9",
"factorio_version": "2.0", "factorio_version": "2.0",
"title": "Tin", "title": "Tin",
"author": "Brevven", "author": "Brevven",