From 395b5e17f6f40385952053bea8cb7d5dbf8b4a1f Mon Sep 17 00:00:00 2001 From: Brevven Date: Mon, 7 Apr 2025 22:56:00 -0700 Subject: [PATCH] asteroid productivity --- changelog.txt | 5 +++++ data-util.lua | 11 ++++++++++- info.json | 2 +- tin-recipe.lua | 1 + 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 7aec1ee..eb765bd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 2.1.11 +Date: 2025-04-08 + Changes: + - Space Age: Asteroid crushing recipe now affected by productivity research +--------------------------------------------------------------------------------------------------- Version: 2.1.10 Date: 2025-03-22 Changes: diff --git a/data-util.lua b/data-util.lua index 2ab06b4..f121833 100644 --- a/data-util.lua +++ b/data-util.lua @@ -754,8 +754,17 @@ function util.add_effect(technology_name, effect) if not data.raw.recipe[effect.recipe] then return end - table.insert(technology.effects, effect) end + table.insert(technology.effects, effect) + 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 + 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 3e0789a..c34af88 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bztin", - "version": "2.1.10", + "version": "2.1.11", "factorio_version": "2.0", "title": "Tin", "author": "Brevven", diff --git a/tin-recipe.lua b/tin-recipe.lua index 51722cb..c429870 100644 --- a/tin-recipe.lua +++ b/tin-recipe.lua @@ -569,5 +569,6 @@ data:extend({ }, }) util.add_unlock("space-platform-thruster", "metallic-asteroid-crushing-tin") +util.add_to_productivity_research("asteroid-productivity", "metallic-asteroid-crushing-tin") end end