asteroid crushing
This commit is contained in:
parent
bd96ca7464
commit
6e983851e3
4 changed files with 19 additions and 2 deletions
|
|
@ -749,13 +749,26 @@ end
|
|||
function util.add_effect(technology_name, effect)
|
||||
local technology = data.raw.technology[technology_name]
|
||||
if technology then
|
||||
log("2")
|
||||
if not technology.effects then technology.effects = {} end
|
||||
if effect and effect.type == "unlock-recipe" then
|
||||
if not data.raw.recipe[effect.recipe] then
|
||||
return
|
||||
end
|
||||
table.insert(technology.effects, effect)
|
||||
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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue