From c6e1079ca077595e6a2244c349a33a82a047068c Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Tue, 7 Jan 2025 22:50:02 +0100 Subject: [PATCH] Adjust vanilla technologies --- README.md | 2 +- lignumis/changelog.txt | 1 + lignumis/data-updates.lua | 3 ++- lignumis/data.lua | 11 ++++++++++- lignumis/prototypes/integrations/updates.lua | 1 + .../integrations/vanilla-updates.lua | 18 ++++++++++++++++++ lignumis/prototypes/integrations/vanilla.lua | 10 ++++++++++ 7 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 lignumis/prototypes/integrations/updates.lua create mode 100644 lignumis/prototypes/integrations/vanilla-updates.lua diff --git a/README.md b/README.md index fcbbcaa..bc2d456 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,6 @@ The following mods can be a great addition for this mod: Sorted by priority -- Adjust vanilla technologies - Add end-game stuff - Add burner radar - Balance resources @@ -40,6 +39,7 @@ Unsorted - Compatibility with [Noble Metals](https://mods.factorio.com/mod/bzgold) once it's updated - Optimize images - Add noise to non-Lignumis entities brought in later +- Add deep core mining ## Credits diff --git a/lignumis/changelog.txt b/lignumis/changelog.txt index d99167a..f3eaf43 100644 --- a/lignumis/changelog.txt +++ b/lignumis/changelog.txt @@ -8,6 +8,7 @@ Date: 07.01.2025 - Balance technology "Basic construction robotics (copper)" - Balance "noise" pollution - Move 2 damage research levels to Lignumis + - Adjust vanilla technologies --------------------------------------------------------------------------------------------------- Version: 0.0.4 Date: 06.01.2025 diff --git a/lignumis/data-updates.lua b/lignumis/data-updates.lua index e3e118d..bac377e 100644 --- a/lignumis/data-updates.lua +++ b/lignumis/data-updates.lua @@ -1 +1,2 @@ -require("prototypes/content/updates") \ No newline at end of file +require("prototypes/content/updates") +require("prototypes/integrations/updates") \ No newline at end of file diff --git a/lignumis/data.lua b/lignumis/data.lua index 75c3f98..dc657df 100644 --- a/lignumis/data.lua +++ b/lignumis/data.lua @@ -1,5 +1,14 @@ +Lignumis = { + science_blacklist = { + "deep-miner", + "logistic-system", + "space-platform-thruster", + "kovarex-enrichment-process" + } +} + require("__cf-lib__/util") require("prototypes/content/data") require("prototypes/integrations/data") -require("prototypes/compatibility/data") \ No newline at end of file +require("prototypes/compatibility/data") diff --git a/lignumis/prototypes/integrations/updates.lua b/lignumis/prototypes/integrations/updates.lua new file mode 100644 index 0000000..168d98d --- /dev/null +++ b/lignumis/prototypes/integrations/updates.lua @@ -0,0 +1 @@ +require("vanilla-updates") \ No newline at end of file diff --git a/lignumis/prototypes/integrations/vanilla-updates.lua b/lignumis/prototypes/integrations/vanilla-updates.lua new file mode 100644 index 0000000..2453157 --- /dev/null +++ b/lignumis/prototypes/integrations/vanilla-updates.lua @@ -0,0 +1,18 @@ +-- Add wood and steam science packs as ingredients to technologies that require Nauvis science packs. +-- It skips technologies that are available before coming back to Lignumis. + +for _, technology in pairs(data.raw.technology) do + if technology.unit and technology.unit.ingredients and not table.contains(Lignumis.science_blacklist, technology.name) then + local ingredients = technology.unit.ingredients + local noMatches = table.filter(ingredients, function(ingredient) + return table.contains({ "wood-science-pack", "steam-science-pack" }, ingredient[1]) + end) + local yesMatches = table.filter(ingredients, function(ingredient) + return table.contains({ "utility-science-pack", "production-science-pack", "space-science-pack" }, ingredient[1]) + end) + if #noMatches == 0 and #yesMatches > 0 then + table.insert(technology.unit.ingredients, { "wood-science-pack", 1 }) + table.insert(technology.unit.ingredients, { "steam-science-pack", 1 }) + end + end +end \ No newline at end of file diff --git a/lignumis/prototypes/integrations/vanilla.lua b/lignumis/prototypes/integrations/vanilla.lua index 20b7183..aaeedd8 100644 --- a/lignumis/prototypes/integrations/vanilla.lua +++ b/lignumis/prototypes/integrations/vanilla.lua @@ -1,3 +1,5 @@ +local Technology = require("__cf-lib__/data/Technology") + -- Burner mining drill local drill = data.raw["mining-drill"]["burner-mining-drill"] @@ -252,6 +254,14 @@ table.insert(physical_damage_technology_4.effects, { local weapon_speed_technology_4 = data.raw.technology["weapon-shooting-speed-4"] weapon_speed_technology_4.prerequisites = { "weapon-shooting-speed-3", "military-science-pack" } +local production_science_pack_technology = Technology:new("production-science-pack") +production_science_pack_technology:replacePrerequisite("advanced-material-processing-2", "space-platform-thruster") +production_science_pack_technology:addIngredients({ "wood-science-pack", "steam-science-pack" }) + +local utility_science_pack_technology = Technology:new("utility-science-pack") +utility_science_pack_technology:setPrerequisites({ "space-platform-thruster" }) +utility_science_pack_technology:addIngredients({ "wood-science-pack", "steam-science-pack" }) + -- Equipment