From 2d6c40ce9f245add012e9f51a981c5cd664a5918 Mon Sep 17 00:00:00 2001 From: KiwiHawk <59639+KiwiHawk@users.noreply.github.com> Date: Wed, 29 May 2024 22:48:00 +1200 Subject: [PATCH 01/10] Add check before replacing tech By default, electric engine is blue science. However a couple of Bob's mods move it to green science. In this case, angels-components-mechanical-4 is too high a tier prerequisite. --- angelsindustries/info.json | 2 +- .../overrides/global-components-recipe.lua | 6 ++++- .../prototypes/angels-functions.lua | 22 +++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/angelsindustries/info.json b/angelsindustries/info.json index 8765cefd8..b59f00257 100644 --- a/angelsindustries/info.json +++ b/angelsindustries/info.json @@ -8,7 +8,7 @@ "homepage": "https://forums.factorio.com/viewforum.php?f=185", "description": "Adds industrial equipment as well as the tools you need to expand and grow your base. Adds extra components [BETA] and a tech [ALPHA] overhaul.", "dependencies": [ - "angelsrefining >= 0.12.1", + "angelsrefining >= 0.12.8", "angelspetrochem >= 0.9.25", "angelssmelting >= 0.6.17", "angelsbioprocessing >= 0.7.21", diff --git a/angelsindustries/prototypes/overrides/global-components-recipe.lua b/angelsindustries/prototypes/overrides/global-components-recipe.lua index a7e2ff52e..56bf54301 100644 --- a/angelsindustries/prototypes/overrides/global-components-recipe.lua +++ b/angelsindustries/prototypes/overrides/global-components-recipe.lua @@ -16,5 +16,9 @@ if angelsmods.industries.components then OV.global_replace_item("engine-unit", "motor-2") OV.global_replace_technology("engine", "angels-components-mechanical-2") OV.global_replace_item("electric-engine-unit", "motor-4") - OV.global_replace_technology("electric-engine", "angels-components-mechanical-4") + if angelsmods.functions.tech_uses_science_pack("electric-engine", "chemical-science-pack") then + OV.global_replace_technology("electric-engine", "angels-components-mechanical-4") + else + OV.global_replace_technology("electric-engine", "angels-components-mechanical-3") + end end diff --git a/angelsrefining/prototypes/angels-functions.lua b/angelsrefining/prototypes/angels-functions.lua index 1c7606617..ed47a9c23 100644 --- a/angelsrefining/prototypes/angels-functions.lua +++ b/angelsrefining/prototypes/angels-functions.lua @@ -2068,3 +2068,25 @@ function angelsmods.functions.set_next_upgrade(crafting_machine_type, crafting_m --check upgrade_category angelsmods.functions.set_fast_replace_category(crafting_machine_type, crafting_machine_name, next_upgrade) end + +------------------------------------------------------------------------------- +-- CHECK IF TECH USES SCIENCE PACK -------------------------------------------- +------------------------------------------------------------------------------- +function angelsmods.functions.tech_uses_science_pack(tech_name, pack) + if type(tech_name) == "string" then + local technology = data.raw.technology[tech_name] + if technology then + technology = technology.normal or technology.expensive or technology + if technology.unit and technology.unit.ingredients then + local addit = true + for i, ingredient in pairs(technology.unit.ingredients) do + if ingredient[1] == pack or ingredient.name == pack then + return true + end + end + end + end + end + + return false +end From 747c81dbd68b5d83687a5bb8f839866793170e43 Mon Sep 17 00:00:00 2001 From: KiwiHawk <59639+KiwiHawk@users.noreply.github.com> Date: Wed, 29 May 2024 23:54:14 +1200 Subject: [PATCH 02/10] Adjust equipment/armor tech tiers --- .../overrides/components-bobs-recipe-update.lua | 1 - .../overrides/global-tech-bobs-packs.lua | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua b/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua index 72be6a906..e4e21a25e 100644 --- a/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua +++ b/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua @@ -108,7 +108,6 @@ if angelsmods.industries.components then }) OV.remove_prereq("exoskeleton-equipment", "electric-engine") OV.add_prereq("exoskeleton-equipment", "angels-components-mechanical-3") - OV.add_prereq("exoskeleton-equipment", "tech-orange-circuit") end ----------------------------------------------------------------------------- diff --git a/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua b/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua index 425578fe8..b11c4aa7b 100644 --- a/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua +++ b/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua @@ -324,6 +324,9 @@ if angelsmods.industries.tech then AI.pack_replace("follower-robot-count-1", "green", "orange") AI.pack_replace("follower-robot-count-2", "green", "orange") OV.remove_prereq("walking-vehicle", "production-science-pack") + --Modular/Power Armor + AI.pack_replace("modular-armor", "orange", "red") + AI.pack_replace("power-armor-mk2", "blue", "orange") end ------------------------------------------------------------------------------- @@ -354,15 +357,20 @@ if angelsmods.industries.tech then ------------------------------------------------------------------------------- if mods["bobequipment"] then --adds bob personal equipment stuffs - AI.pack_replace("personal-roboport-equipment", "green", "orange") - AI.pack_replace("personal-roboport-modular-equipment-1", "green", "orange") - AI.pack_replace("exoskeleton-equipment", "green", "orange") - AI.pack_replace("solar-panel-equipment-2", "green", "orange") + AI.pack_replace("personal-roboport-equipment", "blue", "orange") + AI.pack_replace("personal-roboport-modular-equipment-1", "blue", "orange") + AI.pack_replace("exoskeleton-equipment", "blue", "green") + AI.pack_replace("exoskeleton-equipment-2", "blue", "orange") + OV.remove_prereq("exoskeleton-equipment-2", "advanced-electronics-2") + OV.remove_prereq("exoskeleton-equipment-3", "production-science-pack") + AI.pack_replace("solar-panel-equipment", "orange", "green") + AI.pack_replace("solar-panel-equipment-2", "blue", "orange") AI.pack_replace("solar-panel-equipment-4", "blue", "yellow") OV.remove_prereq("bob-energy-shield-equipment-3", "production-science-pack") OV.remove_prereq("bob-battery-equipment-4", "production-science-pack") OV.remove_prereq("bob-battery-equipment-6", "tech-yellow-packs") OV.remove_prereq("personal-laser-defense-equipment-3", "production-science-pack") + OV.remove_prereq("night-vision-3", "production-science-pack") end ------------------------------------------------------------------------------- From 6aab5393a17fe6335425667fc8686523b493d026 Mon Sep 17 00:00:00 2001 From: KiwiHawk <59639+KiwiHawk@users.noreply.github.com> Date: Thu, 30 May 2024 00:06:06 +1200 Subject: [PATCH 03/10] Adjust equipment/armor tech tiers --- .../prototypes/overrides/components-bobs-recipe-update.lua | 1 + angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua b/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua index e4e21a25e..ec6c65f4c 100644 --- a/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua +++ b/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua @@ -108,6 +108,7 @@ if angelsmods.industries.components then }) OV.remove_prereq("exoskeleton-equipment", "electric-engine") OV.add_prereq("exoskeleton-equipment", "angels-components-mechanical-3") + OV.remove_science_pack("exoskeleton-equipment", "chemical-science-pack") end ----------------------------------------------------------------------------- diff --git a/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua b/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua index b11c4aa7b..958330c21 100644 --- a/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua +++ b/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua @@ -327,6 +327,7 @@ if angelsmods.industries.tech then --Modular/Power Armor AI.pack_replace("modular-armor", "orange", "red") AI.pack_replace("power-armor-mk2", "blue", "orange") + OV.remove_prereq("power-armor-mk2", "military-3") end ------------------------------------------------------------------------------- From 84cdddcbbd7012abafc42157c58c350e300e886f Mon Sep 17 00:00:00 2001 From: KiwiHawk <59639+KiwiHawk@users.noreply.github.com> Date: Thu, 30 May 2024 00:17:07 +1200 Subject: [PATCH 04/10] Adjust equipment/armor tech tiers Low density structures are are a higher tech tier --- .../overrides/components-bobs-recipe-update.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua b/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua index ec6c65f4c..0841bddb2 100644 --- a/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua +++ b/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua @@ -219,5 +219,15 @@ if angelsmods.industries.components then OV.add_prereq("bob-boiler-2", "angels-components-construction-2") end + ----------------------------------------------------------------------------- + -- BOB WARFARE -------------------------------------------------------------- + ----------------------------------------------------------------------------- + if mods["bobwarfare"] then + if angelsmods.industries.tech then + OV.remove_prereq("power-armor-mk2", "low-density-structure") + OV.remove_input("power-armor-mk2", "low-density-structure") + end + end + OV.execute() end From 89704a92e24980d05adf08780b18e21fb52e91a3 Mon Sep 17 00:00:00 2001 From: KiwiHawk <59639+KiwiHawk@users.noreply.github.com> Date: Thu, 30 May 2024 00:30:15 +1200 Subject: [PATCH 05/10] Reverting previous change --- .../prototypes/overrides/global-tech-bobs-packs.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua b/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua index 958330c21..703c21944 100644 --- a/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua +++ b/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua @@ -358,8 +358,8 @@ if angelsmods.industries.tech then ------------------------------------------------------------------------------- if mods["bobequipment"] then --adds bob personal equipment stuffs - AI.pack_replace("personal-roboport-equipment", "blue", "orange") - AI.pack_replace("personal-roboport-modular-equipment-1", "blue", "orange") + AI.pack_replace("personal-roboport-equipment", "green", "orange") + AI.pack_replace("personal-roboport-modular-equipment-1", "green", "orange") AI.pack_replace("exoskeleton-equipment", "blue", "green") AI.pack_replace("exoskeleton-equipment-2", "blue", "orange") OV.remove_prereq("exoskeleton-equipment-2", "advanced-electronics-2") From d9e28ade54871e8a8f1087d215fd26ca9e6a32f3 Mon Sep 17 00:00:00 2001 From: KiwiHawk <59639+KiwiHawk@users.noreply.github.com> Date: Thu, 30 May 2024 00:49:19 +1200 Subject: [PATCH 06/10] Burner Phase setting can be enabled without Burner Assemblers --- .../prototypes/overrides/global-tech-bobs-cores.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/angelsindustries/prototypes/overrides/global-tech-bobs-cores.lua b/angelsindustries/prototypes/overrides/global-tech-bobs-cores.lua index a2bd27bf9..89a1e559e 100644 --- a/angelsindustries/prototypes/overrides/global-tech-bobs-cores.lua +++ b/angelsindustries/prototypes/overrides/global-tech-bobs-cores.lua @@ -302,9 +302,11 @@ if angelsmods.industries.tech then end if settings.startup["bobmods-burnerphase"].value then - AI.core_replace("automation", "basic", "processing") AI.core_replace("steam-power", "energy", "basic") - AI.core_replace("steam-automation", "processing", "basic") + if data.raw.technology["basic-automation"] then + AI.core_replace("automation", "basic", "processing") + AI.core_replace("steam-automation", "processing", "basic") + end end end From cc456854d27c2bcdefb94a1a3da07f2db41d1c3d Mon Sep 17 00:00:00 2001 From: KiwiHawk <59639+KiwiHawk@users.noreply.github.com> Date: Sun, 2 Jun 2024 12:28:44 +1200 Subject: [PATCH 07/10] Unit test: mod settings change Removed duplicate setting Moved setting to correct heading --- angelsdev-unit-test/python/unit_test_configuration.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/angelsdev-unit-test/python/unit_test_configuration.py b/angelsdev-unit-test/python/unit_test_configuration.py index 970d8bb03..a6297c9bc 100644 --- a/angelsdev-unit-test/python/unit_test_configuration.py +++ b/angelsdev-unit-test/python/unit_test_configuration.py @@ -40,8 +40,6 @@ def addConfiguration(cls:UnitTestConfiguration, configName:str, modList:list[str UnitTestConfiguration.addDefaultSetting("startup", "angels-enable-tech", False) # BobPower -UnitTestConfiguration.addDefaultSetting("startup", "bobmods-burnerphase", False) # TODO: add testing cases if we want to support this -UnitTestConfiguration.addDefaultSetting("startup", "bobmods-revamp-rtg", True) UnitTestConfiguration.addDefaultSetting("startup", "bobmods-power-poles", True) UnitTestConfiguration.addDefaultSetting("startup", "bobmods-power-steam", True) UnitTestConfiguration.addDefaultSetting("startup", "bobmods-power-fluid-generator", True) @@ -78,6 +76,7 @@ def addConfiguration(cls:UnitTestConfiguration, configName:str, modList:list[str UnitTestConfiguration.addDefaultSetting("startup", "bobmods-revamp-hardmode", True) # BobOther +UnitTestConfiguration.addDefaultSetting("startup", "bobmods-burnerphase", False) # TODO: add testing cases if we want to support this UnitTestConfiguration.addDefaultSetting("startup", "bobmods-mining-miningaxes", True) UnitTestConfiguration.addDefaultSetting("startup", "bobmods-plates-purewater", True) UnitTestConfiguration.addDefaultSetting("startup", "bobmods-ores-unsortedgems", True) From 42fe0a4ee49405a54c36c6117edb66340e685ddd Mon Sep 17 00:00:00 2001 From: KiwiHawk <59639+KiwiHawk@users.noreply.github.com> Date: Sun, 2 Jun 2024 12:30:46 +1200 Subject: [PATCH 08/10] Unit test update: Bob modules Modules can be considered same tier as when they are unlocked. No need for them to be after --- .../unit-tests/unit-test-006.lua | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/angelsdev-unit-test/unit-tests/unit-test-006.lua b/angelsdev-unit-test/unit-tests/unit-test-006.lua index 088f8a2d4..92ca8444b 100644 --- a/angelsdev-unit-test/unit-tests/unit-test-006.lua +++ b/angelsdev-unit-test/unit-tests/unit-test-006.lua @@ -116,20 +116,13 @@ local function calculate_science_pack_level() if game.active_mods["bobmodules"] and settings.startup["bobmods-modules-enable-modules-lab"].value then for pack_name, pack_level in pairs({ -- bobs module science packs - ["speed-processor"] = 50 - + (science_pack_level["angels-science-pack-orange"] or science_pack_level["logistic-science-pack"]), - ["effectivity-processor"] = 50 - + (science_pack_level["angels-science-pack-orange"] or science_pack_level["logistic-science-pack"]), - ["productivity-processor"] = 50 - + (science_pack_level["angels-science-pack-orange"] or science_pack_level["logistic-science-pack"]), - ["pollution-clean-processor"] = 50 - + (science_pack_level["angels-science-pack-orange"] or science_pack_level["logistic-science-pack"]), - ["pollution-create-processor"] = 50 - + (science_pack_level["angels-science-pack-orange"] or science_pack_level["logistic-science-pack"]), - ["module-circuit-board"] = science_pack_level["angels-science-pack-blue"] - or science_pack_level["chemical-science-pack"], - ["module-case"] = science_pack_level["angels-science-pack-yellow"] - or science_pack_level["production-science-pack"], + ["speed-processor"] = (science_pack_level["angels-science-pack-orange"] or science_pack_level["logistic-science-pack"]), + ["effectivity-processor"] = (science_pack_level["angels-science-pack-orange"] or science_pack_level["logistic-science-pack"]), + ["productivity-processor"] = (science_pack_level["angels-science-pack-orange"] or science_pack_level["logistic-science-pack"]), + ["pollution-clean-processor"] = (science_pack_level["angels-science-pack-orange"] or science_pack_level["logistic-science-pack"]), + ["pollution-create-processor"] = (science_pack_level["angels-science-pack-orange"] or science_pack_level["logistic-science-pack"]), + ["module-circuit-board"] = (science_pack_level["angels-science-pack-blue"] or science_pack_level["chemical-science-pack"]), + ["module-case"] = (science_pack_level["angels-science-pack-yellow"] or science_pack_level["production-science-pack"]), }) do science_pack_level[pack_name] = pack_level end From d594dcef6d699b0b9568a7ec0c74482f0e063d09 Mon Sep 17 00:00:00 2001 From: KiwiHawk <59639+KiwiHawk@users.noreply.github.com> Date: Sun, 2 Jun 2024 12:50:43 +1200 Subject: [PATCH 09/10] Armor ingredients and prerequisites --- .../overrides/components-bobs-recipe-update.lua | 8 ++++++++ .../prototypes/overrides/global-tech-bobs-packs.lua | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua b/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua index 0841bddb2..19a9cb26b 100644 --- a/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua +++ b/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua @@ -223,6 +223,14 @@ if angelsmods.industries.components then -- BOB WARFARE -------------------------------------------------------------- ----------------------------------------------------------------------------- if mods["bobwarfare"] then + OV.patch_recipes({ + { + name = "power-armor", + ingredients = { + { type = "item", name = "circuit-green-loaded", amount = "circuit-orange-loaded" }, + }, + }, + }) if angelsmods.industries.tech then OV.remove_prereq("power-armor-mk2", "low-density-structure") OV.remove_input("power-armor-mk2", "low-density-structure") diff --git a/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua b/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua index 703c21944..7885125a3 100644 --- a/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua +++ b/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua @@ -325,7 +325,7 @@ if angelsmods.industries.tech then AI.pack_replace("follower-robot-count-2", "green", "orange") OV.remove_prereq("walking-vehicle", "production-science-pack") --Modular/Power Armor - AI.pack_replace("modular-armor", "orange", "red") + AI.pack_replace("modular-armor", "orange", "green") AI.pack_replace("power-armor-mk2", "blue", "orange") OV.remove_prereq("power-armor-mk2", "military-3") end From 2bc2d09f0d1cd8622d6dd885ce04af1f75c19c6e Mon Sep 17 00:00:00 2001 From: KiwiHawk <59639+KiwiHawk@users.noreply.github.com> Date: Sun, 2 Jun 2024 15:15:44 +1200 Subject: [PATCH 10/10] Updating changelog --- angelsindustries/changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/angelsindustries/changelog.txt b/angelsindustries/changelog.txt index f4d7f704a..6cf413b3e 100644 --- a/angelsindustries/changelog.txt +++ b/angelsindustries/changelog.txt @@ -5,6 +5,7 @@ Date: ??? - Added item description to Gravitational analyzer (984) - Adjusted the recipes and science packs for Bob's Assembling Machines when Components or Technology Overhauls are enabled (985) - Tech Overhaul: Hid Steam science pack from Bob's Technology mod (986) + - Adjust ingredients and tech prerequisites for Power armor and equipment when using Bob's mods (989) Bugfixes: - Fixed potential softlock with Tech Overhaul and Bob's Technology mod (986) ---------------------------------------------------------------------------------------------------