From aeda1374982122fa93202cab9646331d69eb6bef Mon Sep 17 00:00:00 2001 From: StructuralMike <66819228+StructuralMike@users.noreply.github.com> Date: Fri, 5 Mar 2021 21:43:41 +0100 Subject: [PATCH] Simple switch rules --- BaseClasses.py | 4 ++-- Rules.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index a594331a..2d0ead39 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -578,10 +578,10 @@ class CollectionState(object): def can_reach_blue(self, region, player): - return region in self.reachable_regions[player] and self.reachable_regions[player][region] in [CrystalBarrier.Blue, CrystalBarrier.Either] + return region in self.reachable_regions[player] and self.reachable_regions[player][region] in [CrystalBarrier.Blue, CrystalBarrier.Either] and self.can_hit_switch(player) def can_reach_orange(self, region, player): - return region in self.reachable_regions[player] and self.reachable_regions[player][region] in [CrystalBarrier.Orange, CrystalBarrier.Either] + return region in self.reachable_regions[player] and self.reachable_regions[player][region] in [CrystalBarrier.Orange, CrystalBarrier.Either] and self.can_hit_switch(player) def _do_not_flood_the_keys(self, reachable_events): adjusted_checks = list(reachable_events) diff --git a/Rules.py b/Rules.py index d10abf2b..8b689e78 100644 --- a/Rules.py +++ b/Rules.py @@ -419,13 +419,13 @@ def bomb_rules(world, player): 'Paradox Cave Upper - Left', 'Paradox Cave Upper - Right', 'Hype Cave - Top', 'Hype Cave - Middle Right', 'Hype Cave - Middle Left', 'Hype Cave - Bottom'] for location in bonkable_items: - add_rule(world.get_location(entrance, player), lambda state: state.can_use_bombs(player) or state.has_Boots(player)) + add_rule(world.get_location(location, player), lambda state: state.can_use_bombs(player) or state.has_Boots(player)) for location in bombable_items: - add_rule(world.get_location(entrance, player), lambda state: state.can_use_bombs(player)) + add_rule(world.get_location(location, player), lambda state: state.can_use_bombs(player)) cave_kill_locations = ['Mini Moldorm Cave - Far Left', 'Mini Moldorm Cave - Far Right', 'Mini Moldorm Cave - Left', 'Mini Moldorm Cave - Right', 'Mini Moldorm Cave - Generous Guy'] for location in cave_kill_locations: - add_rule(world.get_location(entrance, player), lambda state: state.can_kill_most_things(player) or state.can_use_bombs(player)) + add_rule(world.get_location(location, player), lambda state: state.can_kill_most_things(player) or state.can_use_bombs(player)) paradox_switch_chests = ['Paradox Cave Lower - Far Left', 'Paradox Cave Lower - Left', 'Paradox Cave Lower - Right', 'Paradox Cave Lower - Far Right', 'Paradox Cave Lower - Middle'] for location in paradox_switch_chests: @@ -471,7 +471,7 @@ def bomb_rules(world, player): for door in doors_to_bomb_check: if door.kind(world) in [DoorKind.Dashable]: add_rule(door.entrance, lambda state: state.can_use_bombs(player) or state.has_Boots(player)) - elif door.kind(door) in [DoorKind.Bombable]: + elif door.kind(world) in [DoorKind.Bombable]: add_rule(door.entrance, lambda state: state.can_use_bombs(player)) def default_rules(world, player):