Skip to content

Commit

Permalink
more logic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehseezed committed Oct 29, 2023
1 parent 76dbacf commit 8aa77d0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions worlds/AM2R/locations.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions worlds/AM2R/regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
20 changes: 11 additions & 9 deletions worlds/AM2R/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit 8aa77d0

Please sign in to comment.