From a8a45d589de22d3e31d2c39521fb93819522abdb Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Thu, 13 Feb 2025 21:38:57 +0100 Subject: [PATCH] Add recipes to Space Age recipe productivity technologies --- lignumis/info.json | 2 +- .../prototypes/content/mid-game-recipes.lua | 51 ++++++++++++++----- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/lignumis/info.json b/lignumis/info.json index d0f7dfe..e716d03 100644 --- a/lignumis/info.json +++ b/lignumis/info.json @@ -12,7 +12,7 @@ "flib", "PlanetsLib >= 1.1.26", "astroponics >= 1.2.0", - "cf-lib >= 0.0.2", + "cf-lib >= 0.0.4", "mf-core >= 1.0.3", "mf-buildings >= 1.0.7", "mf-logistics >= 1.0.1", diff --git a/lignumis/prototypes/content/mid-game-recipes.lua b/lignumis/prototypes/content/mid-game-recipes.lua index 1943ea7..7dec68e 100644 --- a/lignumis/prototypes/content/mid-game-recipes.lua +++ b/lignumis/prototypes/content/mid-game-recipes.lua @@ -1,4 +1,5 @@ local space_age_item_sounds = require("__space-age__.prototypes.item_sounds") +local Technology = require("__cf-lib__/data/Technology") data:extend({ { @@ -158,7 +159,7 @@ data:extend({ ingredients = { { type = "item", name = "gold-plate", amount = 20 }, { type = "item", name = "plastic-bar", amount = 7 }, - { type = "item", name = "lumber", amount = 4 } + { type = "item", name = "lumber", amount = 4 } }, results = { { type = "item", name = "low-density-structure", amount = 2 } }, allow_productivity = true, @@ -212,17 +213,43 @@ data:extend({ } }) -table.assign(data.raw.technology["plastics"].effects, { - { type = "unlock-recipe", recipe = "cupriavidus-necator-starter" }, - { type = "unlock-recipe", recipe = "cupriavidus-necator" }, - { type = "unlock-recipe", recipe = "plastic-from-cupriavidus-necator" }, - { type = "unlock-recipe", recipe = "plastic-from-dead-cupriavidus-necator" } +local plastics = Technology:new("plastics") +plastics:addRecipe("cupriavidus-necator-starter") +plastics:addRecipe("cupriavidus-necator") +plastics:addRecipe("plastic-from-cupriavidus-necator") +plastics:addRecipe("plastic-from-dead-cupriavidus-necator") + +local lds = Technology:new("low-density-structure") +lds:addRecipe("low-density-structure-gold") + +local rocket_fuel = Technology:new("rocket-fuel") +rocket_fuel:addRecipe("rocket-fuel-from-wood-pulp-and-peat") + +local agriculture = Technology:new("agriculture") +agriculture:addRecipe("nutrients-from-wood-pulp") + +local plastic_productivity = Technology:new("plastic-bar-productivity") +plastic_productivity:addEffect({ + type = "change-recipe-productivity", + recipe = "plastic-from-cupriavidus-necator", + change = 0.1 +}) +plastic_productivity:addEffect({ + type = "change-recipe-productivity", + recipe = "plastic-from-dead-cupriavidus-necator", + change = 0.1 }) -table.insert(data.raw.technology["low-density-structure"].effects, - { type = "unlock-recipe", recipe = "low-density-structure-gold" }) +local lds_productivity = Technology:new("low-density-structure-productivity") +lds_productivity:addEffect({ + type = "change-recipe-productivity", + recipe = "low-density-structure-gold", + change = 0.1 +}) -table.insert(data.raw.technology["rocket-fuel"].effects, - { type = "unlock-recipe", recipe = "rocket-fuel-from-wood-pulp-and-peat" }) - -table.insert(data.raw.technology["agriculture"].effects, { type = "unlock-recipe", recipe = "nutrients-from-wood-pulp" }) +local rocket_fuel_productivity = Technology:new("rocket-fuel-productivity") +rocket_fuel_productivity:addEffect({ + type = "change-recipe-productivity", + recipe = "rocket-fuel-from-wood-pulp-and-peat", + change = 0.1 +}) \ No newline at end of file