diff --git a/worlds/AM2R/locations.py b/worlds/AM2R/locations.py index 75b23cb1a0c5..1124324fc19e 100644 --- a/worlds/AM2R/locations.py +++ b/worlds/AM2R/locations.py @@ -1,7 +1,7 @@ from typing import List, Tuple, Optional, Callable, NamedTuple from BaseClasses import MultiWorld, CollectionState from .rules import AM2RLogic -from .options import MetroidsAreChecks +from .options import MetroidsAreChecks, is_option_enabled EventId: Optional[int] = None @@ -130,7 +130,7 @@ def get_location_datas(world: Optional[MultiWorld], player: Optional[int]): LocationData("Research Station", "The Last Metroid is in Captivity", EventId), ] - if MetroidsAreChecks == MetroidsAreChecks.option_exclude_A6 or MetroidsAreChecks.option_include_A6: + if not world or is_option_enabled(world, player, "MetroidsAreChecks"): location_table += ( #metroids # todo remove or place locked items below when option not enabled diff --git a/worlds/AM2R/regions.py b/worlds/AM2R/regions.py index 82cc109e36c5..de4cd77256a2 100644 --- a/worlds/AM2R/regions.py +++ b/worlds/AM2R/regions.py @@ -139,10 +139,12 @@ def create_regions_and_locations(world: MultiWorld, player: int): # tester connect(world, player, "The Tower", "Tester Lower", logic.AM2R_can_bomb), connect(world, player, "The Tower", "Tester Upper", logic.AM2R_can_bomb), - connect(world, player, "Tester Lower", "Tester Upper"), - connect(world, player, "Tester Upper", "Tester Lower"), - connect(world, player, "Tester Lower", "The Tower"), - connect(world, player, "Tester Upper", "The Tower"), + connect(world, player, "Tester Lower", "Tester"), + connect(world, player, "Tester", "Tester Lower"), + connect(world, player, "Tester", "Tester Upper"), + connect(world, player, "Tester Upper", "Tester"), + connect(world, player, "Tester Lower", "The Tower", logic.AM2R_can_bomb), + connect(world, player, "Tester Upper", "The Tower", logic.AM2R_can_bomb), # A5 connect(world, player, "Underwater Distribution Center", "EMP"), connect(world, player, "EMP", "Underwater Distribution Center"), diff --git a/worlds/AM2R/rules.py b/worlds/AM2R/rules.py index 3c502a008664..278581f58146 100644 --- a/worlds/AM2R/rules.py +++ b/worlds/AM2R/rules.py @@ -32,27 +32,29 @@ def AM2R_has_ballspark(self, state: CollectionState) -> bool: def AM2R_can_down(self, state: CollectionState) -> bool: amount = get_option_value(MultiWorld, self.player, "MetroidsRequired") + check_state = get_option_value(MultiWorld, self.player, "MetroidsAreChecks") - if MetroidsAreChecks == MetroidsAreChecks.option_exclude_A6 or MetroidsAreChecks.option_include_A6: + if check_state >= 1: return state.has("Metroid", self.player, amount) \ - and state.has_all({"Speed Booster", "Ice Beam", "Super Missile"}, self.player) \ - and self.AM2R_can_fly(state) and self.AM2R_can_bomb(state) and (state.has("Screw Attack", self.player) or state.has("Power Bomb", self.player)) + and state.has("Ice Beam", self.player) and self.AM2R_can_spider(state) and self.AM2R_can_bomb(state) \ + and (state.has("Screw Attack", self.player) or state.has("Power Bomb", self.player)) else: return state.has_all({"Speed Booster", "Ice Beam", "Super Missile"}, self.player) \ and self.AM2R_can_fly(state) and self.AM2R_can_bomb(state) and (state.has("Screw Attack", self.player) or state.has("Power Bomb", self.player)) def AM2R_can_lab(self, state: CollectionState) -> bool: amount = get_option_value(MultiWorld, self.player, "MetroidsRequired") + check_state = get_option_value(MultiWorld, self.player, "MetroidsAreChecks") - if MetroidsAreChecks == MetroidsAreChecks.option_include_A6: + if check_state == 2: amount += 5 return state.has("Metroid", self.player, amount) \ - and state.has_all({"Speed Booster", "Ice Beam", "Super Missile"}, self.player) \ - and self.AM2R_can_fly(state) and self.AM2R_can_bomb(state) and (state.has("Screw Attack", self.player) or state.has("Power Bomb", self.player)) - elif MetroidsAreChecks == MetroidsAreChecks.option_exclude_A6: + and state.has("Ice Beam", self.player) and self.AM2R_can_spider(state) and self.AM2R_can_bomb(state) \ + and (state.has("Screw Attack", self.player) or state.has("Power Bomb", self.player)) + elif check_state == 1: return state.has("Metroid", self.player, amount) \ - and state.has_all({"Speed Booster", "Ice Beam", "Super Missile"}, self.player) \ - and self.AM2R_can_fly(state) and self.AM2R_can_bomb(state) and (state.has("Screw Attack", self.player) or state.has("Power Bomb", self.player)) + and state.has("Ice Beam", self.player) and self.AM2R_can_spider(state) and self.AM2R_can_bomb(state) \ + and (state.has("Screw Attack", self.player) or state.has("Power Bomb", self.player)) else: return state.has_all({"Speed Booster", "Ice Beam", "Super Missile"}, self.player) \ and self.AM2R_can_fly(state) and self.AM2R_can_bomb(state) and (state.has("Screw Attack", self.player) or state.has("Power Bomb", self.player))