sm64ex: Add missing indirect condition for BitFS randomized entrance (#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.
This commit is contained in:
parent
7621889b8b
commit
ed948e3e5b
|
@ -246,10 +246,10 @@ def create_regions(world: MultiWorld, options: SM64Options, player: int):
|
|||
regBitS.subregions = [bits_top]
|
||||
|
||||
|
||||
def connect_regions(world: MultiWorld, player: int, source: str, target: str, rule=None):
|
||||
def connect_regions(world: MultiWorld, player: int, source: str, target: str, rule=None) -> Entrance:
|
||||
sourceRegion = world.get_region(source, player)
|
||||
targetRegion = world.get_region(target, player)
|
||||
sourceRegion.connect(targetRegion, rule=rule)
|
||||
return sourceRegion.connect(targetRegion, rule=rule)
|
||||
|
||||
|
||||
def create_region(name: str, player: int, world: MultiWorld) -> SM64Region:
|
||||
|
|
|
@ -92,9 +92,12 @@ def set_rules(world, options: SM64Options, player: int, area_connections: dict,
|
|||
connect_regions(world, player, "Hazy Maze Cave", randomized_entrances_s["Cavern of the Metal Cap"])
|
||||
connect_regions(world, player, "Basement", randomized_entrances_s["Vanish Cap under the Moat"],
|
||||
rf.build_rule("GP"))
|
||||
connect_regions(world, player, "Basement", randomized_entrances_s["Bowser in the Fire Sea"],
|
||||
lambda state: state.has("Power Star", player, star_costs["BasementDoorCost"]) and
|
||||
state.can_reach("DDD: Board Bowser's Sub", 'Location', player))
|
||||
entrance = connect_regions(world, player, "Basement", randomized_entrances_s["Bowser in the Fire Sea"],
|
||||
lambda state: state.has("Power Star", player, star_costs["BasementDoorCost"]) and
|
||||
state.can_reach("DDD: Board Bowser's Sub", 'Location', player))
|
||||
# Access to "DDD: Board Bowser's Sub" does not require access to other locations or regions, so the only region that
|
||||
# needs to be registered is its parent region.
|
||||
world.register_indirect_condition(world.get_location("DDD: Board Bowser's Sub", player).parent_region, entrance)
|
||||
|
||||
connect_regions(world, player, "Menu", "Second Floor", lambda state: state.has("Second Floor Key", player) or state.has("Progressive Key", player, 2))
|
||||
|
||||
|
|
Loading…
Reference in New Issue