From 33b0d4178f4c99817b85b56040d316fd0270827d Mon Sep 17 00:00:00 2001 From: KiwiHawk <59639+KiwiHawk@users.noreply.github.com> Date: Wed, 29 May 2024 23:43:11 +1200 Subject: [PATCH] Power armor ingredients and prerequisites --- bobwarfare/prototypes/recipe/armor-recipe.lua | 4 +- .../prototypes/recipe/recipe-updates.lua | 49 ++++++++++--------- bobwarfare/prototypes/technology/armor.lua | 6 ++- .../technology/technology-updates.lua | 43 +++++++++------- 4 files changed, 57 insertions(+), 45 deletions(-) diff --git a/bobwarfare/prototypes/recipe/armor-recipe.lua b/bobwarfare/prototypes/recipe/armor-recipe.lua index 663048dba..3f9bcf527 100644 --- a/bobwarfare/prototypes/recipe/armor-recipe.lua +++ b/bobwarfare/prototypes/recipe/armor-recipe.lua @@ -33,8 +33,8 @@ data:extend({ { "processing-unit", 50 }, { "steel-plate", 25 }, { "iron-plate", 25 }, - { "effectivity-module-3", 5 }, - { "speed-module-3", 5 }, + { "effectivity-module-2", 5 }, + { "speed-module-2", 5 }, }, result = "bob-power-armor-mk3", }, diff --git a/bobwarfare/prototypes/recipe/recipe-updates.lua b/bobwarfare/prototypes/recipe/recipe-updates.lua index 87c65fb33..5cf6dc59b 100644 --- a/bobwarfare/prototypes/recipe/recipe-updates.lua +++ b/bobwarfare/prototypes/recipe/recipe-updates.lua @@ -300,28 +300,33 @@ if data.raw.item["diamond-5"] then bobmods.lib.recipe.add_ingredient("bob-laser-turret-5", { "diamond-5", 1 }) end -if data.raw.module["effectivity-module-4"] then - bobmods.lib.recipe.replace_ingredient("bob-power-armor-mk3", "effectivity-module-3", "effectivity-module-4") -end - -if data.raw.module["speed-module-4"] then - bobmods.lib.recipe.replace_ingredient("bob-power-armor-mk3", "speed-module-3", "speed-module-4") -end - -if data.raw.module["effectivity-module-6"] then - bobmods.lib.recipe.replace_ingredient("bob-power-armor-mk4", "effectivity-module-3", "effectivity-module-6") -end - -if data.raw.module["speed-module-6"] then - bobmods.lib.recipe.replace_ingredient("bob-power-armor-mk4", "speed-module-3", "speed-module-6") -end - -if data.raw.module["effectivity-module-8"] then - bobmods.lib.recipe.replace_ingredient("bob-power-armor-mk5", "effectivity-module-3", "effectivity-module-8") -end - -if data.raw.module["speed-module-8"] then - bobmods.lib.recipe.replace_ingredient("bob-power-armor-mk5", "speed-module-3", "speed-module-8") +if mods["bobmodules"] then + if data.raw.module["effectivity-module-4"] then + bobmods.lib.recipe.replace_ingredient("bob-power-armor-mk3", "effectivity-module-2", "effectivity-module-4") + end + + if data.raw.module["speed-module-4"] then + bobmods.lib.recipe.replace_ingredient("bob-power-armor-mk3", "speed-module-2", "speed-module-4") + end + + if data.raw.module["effectivity-module-6"] then + bobmods.lib.recipe.replace_ingredient("bob-power-armor-mk4", "effectivity-module-3", "effectivity-module-6") + end + + if data.raw.module["speed-module-6"] then + bobmods.lib.recipe.replace_ingredient("bob-power-armor-mk4", "speed-module-3", "speed-module-6") + end + + if data.raw.module["effectivity-module-8"] then + bobmods.lib.recipe.replace_ingredient("bob-power-armor-mk5", "effectivity-module-3", "effectivity-module-8") + end + + if data.raw.module["speed-module-8"] then + bobmods.lib.recipe.replace_ingredient("bob-power-armor-mk5", "speed-module-3", "speed-module-8") + end +else + bobmods.lib.recipe.replace_ingredient("power-armor-mk2", "speed-module-2", "speed-module") + bobmods.lib.recipe.replace_ingredient("power-armor-mk2", "effectivity-module-2", "effectivity-module") end if data.raw.item["alien-artifact"] then diff --git a/bobwarfare/prototypes/technology/armor.lua b/bobwarfare/prototypes/technology/armor.lua index e0f1d22a5..66128e6c7 100644 --- a/bobwarfare/prototypes/technology/armor.lua +++ b/bobwarfare/prototypes/technology/armor.lua @@ -61,9 +61,9 @@ data:extend({ icon = "__bobwarfare__/graphics/icons/technology/power-armor-mk3.png", icon_size = 64, prerequisites = { - "effectivity-module-3", + "effectivity-module-2", "power-armor-mk2", - "speed-module-3", + "speed-module-2", "production-science-pack", }, effects = { @@ -93,6 +93,8 @@ data:extend({ icon_size = 64, prerequisites = { "bob-power-armor-3", + "effectivity-module-3", + "speed-module-3", "utility-science-pack", }, effects = { diff --git a/bobwarfare/prototypes/technology/technology-updates.lua b/bobwarfare/prototypes/technology/technology-updates.lua index 17f449caf..4cf2c9632 100644 --- a/bobwarfare/prototypes/technology/technology-updates.lua +++ b/bobwarfare/prototypes/technology/technology-updates.lua @@ -526,30 +526,35 @@ if data.raw.recipe["gun-cotton-synthetic"] then bobmods.lib.tech.add_recipe_unlock("cordite-processing", "gun-cotton-synthetic") end -if data.raw.technology["speed-module-4"] then - bobmods.lib.tech.remove_prerequisite("bob-power-armor-3", "speed-module-3") - bobmods.lib.tech.add_prerequisite("bob-power-armor-3", "speed-module-4") -end +if mods["bobmodules"] then + if data.raw.technology["speed-module-4"] then + bobmods.lib.tech.remove_prerequisite("bob-power-armor-3", "speed-module-2") + bobmods.lib.tech.add_prerequisite("bob-power-armor-3", "speed-module-4") + end -if data.raw.technology["effectivity-module-4"] then - bobmods.lib.tech.remove_prerequisite("bob-power-armor-3", "effectivity-module-3") - bobmods.lib.tech.add_prerequisite("bob-power-armor-3", "effectivity-module-4") -end + if data.raw.technology["effectivity-module-4"] then + bobmods.lib.tech.remove_prerequisite("bob-power-armor-3", "effectivity-module-2") + bobmods.lib.tech.add_prerequisite("bob-power-armor-3", "effectivity-module-4") + end -if data.raw.technology["speed-module-6"] then - bobmods.lib.tech.add_prerequisite("bob-power-armor-4", "speed-module-6") -end + if data.raw.technology["speed-module-6"] then + bobmods.lib.tech.add_prerequisite("bob-power-armor-4", "speed-module-6") + end -if data.raw.technology["effectivity-module-6"] then - bobmods.lib.tech.add_prerequisite("bob-power-armor-4", "effectivity-module-6") -end + if data.raw.technology["effectivity-module-6"] then + bobmods.lib.tech.add_prerequisite("bob-power-armor-4", "effectivity-module-6") + end -if data.raw.technology["speed-module-8"] then - bobmods.lib.tech.add_prerequisite("bob-power-armor-5", "speed-module-8") -end + if data.raw.technology["speed-module-8"] then + bobmods.lib.tech.add_prerequisite("bob-power-armor-5", "speed-module-8") + end -if data.raw.technology["effectivity-module-8"] then - bobmods.lib.tech.add_prerequisite("bob-power-armor-5", "effectivity-module-8") + if data.raw.technology["effectivity-module-8"] then + bobmods.lib.tech.add_prerequisite("bob-power-armor-5", "effectivity-module-8") + end +else + bobmods.lib.tech.replace_prerequisite("power-armor-mk2", "speed-module-2", "speed-module") + bobmods.lib.tech.replace_prerequisite("power-armor-mk2", "effectivity-module-2", "effectivity-module") end if mods["boblogistics"] then