asteroid crushing

This commit is contained in:
Brevven 2025-04-07 20:38:59 -07:00
parent c40e682a77
commit ca40c0f1f8
4 changed files with 21 additions and 2 deletions

View file

@ -1,4 +1,9 @@
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
Version: 2.0.23
Date: 2025-04-07
Changes:
- Space Age: Asteroid crushing recipe now affected by productivity research
---------------------------------------------------------------------------------------------------
Version: 2.0.22 Version: 2.0.22
Date: 2025-03-22 Date: 2025-03-22
Changes: Changes:

View file

@ -749,13 +749,26 @@ end
function util.add_effect(technology_name, effect) function util.add_effect(technology_name, effect)
local technology = data.raw.technology[technology_name] local technology = data.raw.technology[technology_name]
if technology then if technology then
log("2")
if not technology.effects then technology.effects = {} end if not technology.effects then technology.effects = {} end
if effect and effect.type == "unlock-recipe" then if effect and effect.type == "unlock-recipe" then
if not data.raw.recipe[effect.recipe] then if not data.raw.recipe[effect.recipe] then
return return
end end
table.insert(technology.effects, effect)
end end
log("3")
table.insert(technology.effects, effect)
log(serpent.block(technology.effects))
end
end
-- Make a technology boost productivity for a recipe
function util.add_to_productivity_research(technology_name, recipe_name, amount)
if not amount then amount = 0.1 end
local recipe = data.raw.recipe[recipe_name]
if recipe then
log("1")
util.add_effect(technology_name, { type = "change-recipe-productivity", recipe = recipe_name, change = amount})
end end
end end

View file

@ -1,6 +1,6 @@
{ {
"name": "bzlead", "name": "bzlead",
"version": "2.0.22", "version": "2.0.23",
"factorio_version": "2.0", "factorio_version": "2.0",
"title": "Lead", "title": "Lead",
"author": "Brevven", "author": "Brevven",

View file

@ -44,6 +44,7 @@ if mods["space-age"] then
}, },
}) })
util.add_unlock("space-platform-thruster", "alternative-metallic-asteroid-crushing") util.add_unlock("space-platform-thruster", "alternative-metallic-asteroid-crushing")
util.add_to_productivity_research("asteroid-productivity", "alternative-metallic-asteroid-crushing")
end end