From e6eff51d703e1c4fb8daabb0ce75b736ccd8ff9b Mon Sep 17 00:00:00 2001 From: Ehseezed Date: Sat, 4 Nov 2023 14:59:52 -0500 Subject: [PATCH] Better handling of metroids not being checks leaves locations in the pool but forces a "Metroid" item to them --- worlds/am2r/__init__.py | 51 +++++++++++++++- worlds/am2r/locations.py | 125 +++++++++++++++++++-------------------- 2 files changed, 110 insertions(+), 66 deletions(-) diff --git a/worlds/am2r/__init__.py b/worlds/am2r/__init__.py index 021fafd1abdb..489cb5d426ca 100644 --- a/worlds/am2r/__init__.py +++ b/worlds/am2r/__init__.py @@ -3,7 +3,7 @@ from .locations import get_location_datas, EventId from .regions import create_regions_and_locations from BaseClasses import Tutorial, Item -from .options import AM2R_options +from .options import AM2R_options, MetroidsAreChecks from worlds.AutoWorld import World, WebWorld @@ -45,6 +45,55 @@ def create_item(self, name: str) -> Item: return items.create_item(self.player, name) def create_items(self) -> None: + if self.options.MetroidsAreChecks != MetroidsAreChecks.option_include_A6: + self.multiworld.get_location("Deep Caves: Little Bro", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Deep Caves: Big Sis", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Omega Nest: SA-X Queen Lucina", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Omega Nest: Epsilon", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Omega Nest: Druid", self.player).place_locked_item(self.create_item("Metroid")) + if self.options.MetroidsAreChecks == MetroidsAreChecks.option_disabled: + self.multiworld.get_location("The Forgotten Alpha", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Golden Temple: Metroid above Spider Ball", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Golden Temple Nest: Moe", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Golden Temple Nest: Larry", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Golden Temple Nest: Curly", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Main Caves: Freddy Fazbear", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Hydro Station: Turbine Terror", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Hydro Station: The Lookout", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Hydro Station: Recent Guardian", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Hydro Nest: Spiderman Decent", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Hydro Nest: Carnage Awful", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Hydro Nest: Venom Awesome", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Hydro Nest: Something More Something Awesome",self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Industrial Nest: Mimolette", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Industrial Nest: The Big Cheese", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Industrial Nest: Mohwir", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Industrial Nest: Chirn", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Industrial Nest: BHHarbinger", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Industrial Nest: The Abyssal Creature", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Industrial Complex: Sisyphus", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Industrial Complex: And then there\'s this Asshole",self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Inside Industrial: Guardian of Doom Treadmill",self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Inside Industrial: Rawsome1234 by the Lava",self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Dual Alphas: Marco", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Dual Alphas: Polo", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Mines: Unga", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Mines: Gunga", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("The Tower: Patricia", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("The Tower: Variable \"GUH\"", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Ruler of The Tower: Slagathor", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("The Tower: Anakin", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("The Tower: Mr.Sandman", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("The Tower: Xander", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("EMP: Sir Zeta Commander of the Alpha Squadron", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Alpha Squadron: Timmy", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Alpha Squadron: Tommy", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Alpha Squadron: Terry", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Alpha Squadron: Telly", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Alpha Squadron: Martin", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Underwater: Gamma Bros Mario", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("Underwater: Gamma Bros Luigi", self.player).place_locked_item(self.create_item("Metroid")) + self.multiworld.get_location("The Last Metroid is in Captivity", self.player).place_locked_item(self.create_item("The Galaxy is at Peace")) items.create_all_items(self.multiworld, self.player) diff --git a/worlds/am2r/locations.py b/worlds/am2r/locations.py index 0aca6103ca4e..57d75655d61c 100644 --- a/worlds/am2r/locations.py +++ b/worlds/am2r/locations.py @@ -128,71 +128,66 @@ def get_location_datas(world: Optional[MultiWorld], player: Optional[int]): LocationData("Deep Caves", "Deep Caves: After Omega", 8680088), LocationData("Research Station", "The Last Metroid is in Captivity", EventId), - ] - if not world or is_option_enabled(world, player, "MetroidsAreChecks"): - location_table += ( - #metroids - # todo remove or place locked items below when option not enabled - LocationData("First Alpha", "The Forgotten Alpha", 8680100), - - LocationData("Golden Temple", "Golden Temple: Metroid above Spider Ball", 8680101, logic.AM2R_can_spider), - LocationData("Golden Temple Nest", "Golden Temple Nest: Moe", 8680102, logic.AM2R_can_bomb), # Loj - LocationData("Golden Temple Nest", "Golden Temple Nest: Larry", 8680103, logic.AM2R_can_bomb), # Loj - LocationData("Golden Temple Nest", "Golden Temple Nest: Curly", 8680104, logic.AM2R_can_bomb), # Loj - - LocationData("Main Caves", "Main Caves: Freddy Fazbear", 8680105), # Epsilon - LocationData("Hydro Station", "Hydro Station: Turbine Terror", 8680106), # Xander - LocationData("Hydro Station", "Hydro Station: The Lookout", 8680107, logic.AM2R_can_schmove), # Xander - LocationData("Hydro Station", "Hydro Station: Recent Guardian", 8680108), # ANX - - LocationData("Hydro Nest", "Hydro Nest: Spiderman Decent", 8680109), - LocationData("Hydro Nest", "Hydro Nest: Carnage Awful", 8680110), - LocationData("Hydro Nest", "Hydro Nest: Venom Awesome", 8680111), - LocationData("Hydro Nest", "Hydro Nest: Something More Something Awesome", 8680112), - - LocationData("Industrial Complex Nest", "Industrial Nest: Mimolette", 8680113, lambda state: state.has("Speed Booster", player) or state.has("Super Missile", player)), - LocationData("Industrial Complex Nest", "Industrial Nest: The Big Cheese", 8680114, lambda state: state.has("Speed Booster", player) or state.has("Super Missile", player)), - LocationData("Industrial Complex Nest", "Industrial Nest: Mohwir", 8680115, lambda state: logic.AM2R_can_bomb(state) and (state.has("Speed Booster", player) or state.has("Super Missile", player))), - LocationData("Industrial Complex Nest", "Industrial Nest: Chirn", 8680116, lambda state: logic.AM2R_can_bomb(state) and (state.has("Speed Booster", player) or state.has("Super Missile", player))), - LocationData("Industrial Complex Nest", "Industrial Nest: BHHarbinger", 8680117, lambda state: logic.AM2R_can_bomb(state) and (state.has("Speed Booster", player) or state.has("Super Missile", player))), - LocationData("Industrial Complex Nest", "Industrial Nest: The Abyssal Creature", 8680118, lambda state: logic.AM2R_can_bomb(state) and state.has("Spider Ball", player) and (state.has("Speed Booster", player) or state.has("Super Missile", player))), - - LocationData("Pre Industrial Complex", "Industrial Complex: Sisyphus", 8680119, logic.AM2R_can_spider), # Mimo - LocationData("Pre Industrial Complex", "Industrial Complex: And then there\'s this Asshole", 8680120, logic.AM2R_can_spider), # ANX - - LocationData("Industrial Complex", "Inside Industrial: Guardian of Doom Treadmill", 8680121, lambda state: state.has("Speed Booster", player) and logic.AM2R_can_bomb(state)), - LocationData("Industrial Complex", "Inside Industrial: Rawsome1234 by the Lava", 8680122, lambda state: state.has("Speed Booster", player) and logic.AM2R_can_bomb(state)), - - LocationData("GFS Thoth", "Dual Alphas: Marco", 8680123), # Epsilon - LocationData("GFS Thoth", "Dual Alphas: Polo", 8680124), # Epsilon - - LocationData("Mines", "Mines: Unga", 8680125, lambda state: state.has("Super Missile", player) and (state.has("Space Jump", player) or state.has("Spider Ball", player))), - LocationData("Mines", "Mines: Gunga", 8680126, lambda state: state.has("Super Missile", player) and (state.has("Space Jump", player) or state.has("Spider Ball", player))), - - LocationData("The Tower", "The Tower: Patricia", 8680127, logic.AM2R_can_fly), # Mahan - LocationData("The Tower", "The Tower: Variable \"GUH\"", 8680128, logic.AM2R_can_fly), # ANX - LocationData("The Tower", "Ruler of The Tower: Slagathor", 8680129, logic.AM2R_can_schmove), # Rawsome - LocationData("The Tower", "The Tower: Anakin", 8680130, logic.AM2R_can_bomb), # Xander - LocationData("The Tower", "The Tower: Mr.Sandman", 8680131, logic.AM2R_can_fly), # Xander - LocationData("The Tower", "The Tower: Xander", 8680132, lambda state: state.has("Space Jump", player)), - - LocationData("EMP", "EMP: Sir Zeta Commander of the Alpha Squadron", 8680133, logic.AM2R_can_bomb), # Lucina - - LocationData("Pipe Hell R", "Alpha Squadron: Timmy", 8680134), # Lucina - LocationData("Pipe Hell R", "Alpha Squadron: Tommy", 8680135), # Lucina - LocationData("Pipe Hell R", "Alpha Squadron: Terry", 8680136), # Lucina - LocationData("Pipe Hell R", "Alpha Squadron: Telly", 8680137), # Lucina - LocationData("Pipe Hell R", "Alpha Squadron: Martin", 8680138), - - LocationData("Underwater Distro Connection", "Underwater: Gamma Bros Mario", 8680139), # Lucina - LocationData("Underwater Distro Connection", "Underwater: Gamma Bros Luigi", 8680140), # Lucina - - LocationData("Deep Caves", "Deep Caves: Little Bro", 8680141), - LocationData("Deep Caves", "Deep Caves: Big Sis", 8680142), - LocationData("Omega Nest", "Omega Nest: SA-X Queen Lucina", 8680143), - LocationData("Omega Nest", "Omega Nest: Epsilon", 8680144), - LocationData("Omega Nest", "Omega Nest: Druid", 8680145), - ) + LocationData("First Alpha", "The Forgotten Alpha", 8680100), + + LocationData("Golden Temple", "Golden Temple: Metroid above Spider Ball", 8680101, logic.AM2R_can_spider), + LocationData("Golden Temple Nest", "Golden Temple Nest: Moe", 8680102, logic.AM2R_can_bomb), # Loj + LocationData("Golden Temple Nest", "Golden Temple Nest: Larry", 8680103, logic.AM2R_can_bomb), # Loj + LocationData("Golden Temple Nest", "Golden Temple Nest: Curly", 8680104, logic.AM2R_can_bomb), # Loj + + LocationData("Main Caves", "Main Caves: Freddy Fazbear", 8680105), # Epsilon + LocationData("Hydro Station", "Hydro Station: Turbine Terror", 8680106), # Xander + LocationData("Hydro Station", "Hydro Station: The Lookout", 8680107, logic.AM2R_can_schmove), # Xander + LocationData("Hydro Station", "Hydro Station: Recent Guardian", 8680108), # ANX + + LocationData("Hydro Nest", "Hydro Nest: Spiderman Decent", 8680109), + LocationData("Hydro Nest", "Hydro Nest: Carnage Awful", 8680110), + LocationData("Hydro Nest", "Hydro Nest: Venom Awesome", 8680111), + LocationData("Hydro Nest", "Hydro Nest: Something More Something Awesome", 8680112), + + LocationData("Industrial Complex Nest", "Industrial Nest: Mimolette", 8680113, lambda state: state.has("Speed Booster", player) or state.has("Super Missile", player)), + LocationData("Industrial Complex Nest", "Industrial Nest: The Big Cheese", 8680114, lambda state: state.has("Speed Booster", player) or state.has("Super Missile", player)), + LocationData("Industrial Complex Nest", "Industrial Nest: Mohwir", 8680115, lambda state: logic.AM2R_can_bomb(state) and (state.has("Speed Booster", player) or state.has("Super Missile", player))), + LocationData("Industrial Complex Nest", "Industrial Nest: Chirn", 8680116, lambda state: logic.AM2R_can_bomb(state) and (state.has("Speed Booster", player) or state.has("Super Missile", player))), + LocationData("Industrial Complex Nest", "Industrial Nest: BHHarbinger", 8680117, lambda state: logic.AM2R_can_bomb(state) and (state.has("Speed Booster", player) or state.has("Super Missile", player))), + LocationData("Industrial Complex Nest", "Industrial Nest: The Abyssal Creature", 8680118, lambda state: logic.AM2R_can_bomb(state) and state.has("Spider Ball", player) and (state.has("Speed Booster", player) or state.has("Super Missile", player))), + + LocationData("Pre Industrial Complex", "Industrial Complex: Sisyphus", 8680119, logic.AM2R_can_spider), # Mimo + LocationData("Pre Industrial Complex", "Industrial Complex: And then there\'s this Asshole", 8680120, logic.AM2R_can_spider), # ANX + + LocationData("Industrial Complex", "Inside Industrial: Guardian of Doom Treadmill", 8680121, lambda state: state.has("Speed Booster", player) and logic.AM2R_can_bomb(state)), + LocationData("Industrial Complex", "Inside Industrial: Rawsome1234 by the Lava", 8680122, lambda state: state.has("Speed Booster", player) and logic.AM2R_can_bomb(state)), + + LocationData("GFS Thoth", "Dual Alphas: Marco", 8680123), # Epsilon + LocationData("GFS Thoth", "Dual Alphas: Polo", 8680124), # Epsilon + + LocationData("Mines", "Mines: Unga", 8680125, lambda state: state.has("Super Missile", player) and (state.has("Space Jump", player) or state.has("Spider Ball", player))), + LocationData("Mines", "Mines: Gunga", 8680126, lambda state: state.has("Super Missile", player) and (state.has("Space Jump", player) or state.has("Spider Ball", player))), + + LocationData("The Tower", "The Tower: Patricia", 8680127, logic.AM2R_can_fly), # Mahan + LocationData("The Tower", "The Tower: Variable \"GUH\"", 8680128, logic.AM2R_can_fly), # ANX + LocationData("The Tower", "Ruler of The Tower: Slagathor", 8680129, logic.AM2R_can_schmove), # Rawsome + LocationData("The Tower", "The Tower: Anakin", 8680130, logic.AM2R_can_bomb), # Xander + LocationData("The Tower", "The Tower: Mr.Sandman", 8680131, logic.AM2R_can_fly), # Xander + LocationData("The Tower", "The Tower: Xander", 8680132, lambda state: state.has("Space Jump", player)), + + LocationData("EMP", "EMP: Sir Zeta Commander of the Alpha Squadron", 8680133, logic.AM2R_can_bomb), # Lucina + + LocationData("Pipe Hell R", "Alpha Squadron: Timmy", 8680134), # Lucina + LocationData("Pipe Hell R", "Alpha Squadron: Tommy", 8680135), # Lucina + LocationData("Pipe Hell R", "Alpha Squadron: Terry", 8680136), # Lucina + LocationData("Pipe Hell R", "Alpha Squadron: Telly", 8680137), # Lucina + LocationData("Pipe Hell R", "Alpha Squadron: Martin", 8680138), + + LocationData("Underwater Distro Connection", "Underwater: Gamma Bros Mario", 8680139), # Lucina + LocationData("Underwater Distro Connection", "Underwater: Gamma Bros Luigi", 8680140), # Lucina + + LocationData("Deep Caves", "Deep Caves: Little Bro", 8680141), + LocationData("Deep Caves", "Deep Caves: Big Sis", 8680142), + LocationData("Omega Nest", "Omega Nest: SA-X Queen Lucina", 8680143), + LocationData("Omega Nest", "Omega Nest: Epsilon", 8680144), + LocationData("Omega Nest", "Omega Nest: Druid", 8680145), + ] return tuple(location_table)