Skip to content

Commit ed948e3

Browse files
authored
sm64ex: Add missing indirect condition for BitFS randomized entrance (ArchipelagoMW#3926)
The Bowser in the Fire Sea randomized entrance has an access rule that requires being able to reach "DDD: Board Bowser's Sub", but being able to reach a location also requires being able to reach the region that location is in, so an indirect condition is required.
1 parent 7621889 commit ed948e3

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

worlds/sm64ex/Regions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,10 @@ def create_regions(world: MultiWorld, options: SM64Options, player: int):
246246
regBitS.subregions = [bits_top]
247247

248248

249-
def connect_regions(world: MultiWorld, player: int, source: str, target: str, rule=None):
249+
def connect_regions(world: MultiWorld, player: int, source: str, target: str, rule=None) -> Entrance:
250250
sourceRegion = world.get_region(source, player)
251251
targetRegion = world.get_region(target, player)
252-
sourceRegion.connect(targetRegion, rule=rule)
252+
return sourceRegion.connect(targetRegion, rule=rule)
253253

254254

255255
def create_region(name: str, player: int, world: MultiWorld) -> SM64Region:

worlds/sm64ex/Rules.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,12 @@ def set_rules(world, options: SM64Options, player: int, area_connections: dict,
9292
connect_regions(world, player, "Hazy Maze Cave", randomized_entrances_s["Cavern of the Metal Cap"])
9393
connect_regions(world, player, "Basement", randomized_entrances_s["Vanish Cap under the Moat"],
9494
rf.build_rule("GP"))
95-
connect_regions(world, player, "Basement", randomized_entrances_s["Bowser in the Fire Sea"],
96-
lambda state: state.has("Power Star", player, star_costs["BasementDoorCost"]) and
97-
state.can_reach("DDD: Board Bowser's Sub", 'Location', player))
95+
entrance = connect_regions(world, player, "Basement", randomized_entrances_s["Bowser in the Fire Sea"],
96+
lambda state: state.has("Power Star", player, star_costs["BasementDoorCost"]) and
97+
state.can_reach("DDD: Board Bowser's Sub", 'Location', player))
98+
# Access to "DDD: Board Bowser's Sub" does not require access to other locations or regions, so the only region that
99+
# needs to be registered is its parent region.
100+
world.register_indirect_condition(world.get_location("DDD: Board Bowser's Sub", player).parent_region, entrance)
98101

99102
connect_regions(world, player, "Menu", "Second Floor", lambda state: state.has("Second Floor Key", player) or state.has("Progressive Key", player, 2))
100103

0 commit comments

Comments
 (0)