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) 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 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) --------------------------------------------------------------------------------------------------- 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/components-bobs-recipe-update.lua b/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua index 72be6a906..19a9cb26b 100644 --- a/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua +++ b/angelsindustries/prototypes/overrides/components-bobs-recipe-update.lua @@ -108,7 +108,7 @@ 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") + OV.remove_science_pack("exoskeleton-equipment", "chemical-science-pack") end ----------------------------------------------------------------------------- @@ -219,5 +219,23 @@ if angelsmods.industries.components then OV.add_prereq("bob-boiler-2", "angels-components-construction-2") end + ----------------------------------------------------------------------------- + -- 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") + end + end + OV.execute() end 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/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 diff --git a/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua b/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua index 425578fe8..7885125a3 100644 --- a/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua +++ b/angelsindustries/prototypes/overrides/global-tech-bobs-packs.lua @@ -324,6 +324,10 @@ 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", "green") + AI.pack_replace("power-armor-mk2", "blue", "orange") + OV.remove_prereq("power-armor-mk2", "military-3") end ------------------------------------------------------------------------------- @@ -356,13 +360,18 @@ if angelsmods.industries.tech 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("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 ------------------------------------------------------------------------------- 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