From 6e983851e3d7a09e939e8fb36501605473a3b522 Mon Sep 17 00:00:00 2001 From: Brevven Date: Mon, 7 Apr 2025 20:52:33 -0700 Subject: [PATCH] asteroid crushing --- changelog.txt | 3 +++ data-util.lua | 15 ++++++++++++++- info.json | 2 +- zirconium-asteroid-updates.lua | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 31c3b5a..b36767a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,7 @@ --------------------------------------------------------------------------------------------------- +Version: 2.1.8 +Date: 2025-04-07 +--------------------------------------------------------------------------------------------------- Version: 2.1.7 Date: 2025-03-22 Changes: diff --git a/data-util.lua b/data-util.lua index 2ab06b4..eacab34 100644 --- a/data-util.lua +++ b/data-util.lua @@ -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 diff --git a/info.json b/info.json index e11f833..13a5aa5 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzzirconium", - "version": "2.1.7", + "version": "2.1.8", "factorio_version": "2.0", "title": "Zirconium", "author": "Brevven", diff --git a/zirconium-asteroid-updates.lua b/zirconium-asteroid-updates.lua index f10d75f..84be43b 100644 --- a/zirconium-asteroid-updates.lua +++ b/zirconium-asteroid-updates.lua @@ -36,4 +36,5 @@ if mods["space-age"] then }, }) util.add_unlock("advanced-asteroid-processing", "advanced-oxide-asteroid-crushing-zirc") + util.add_to_productivity_research("asteroid-productivity", "advanced-oxide-asteroid-crushing-zirc") end