DKC3: Add missing indirect conditions (#5073)

A couple of Entrance access rules were checking for being able to reach
a Location, but a Location first checks for being able to reach its
parent Region, so it needs to be registered that access to that parent
Region can give access to the Entrance.
This commit is contained in:
Mysteryem
2025-06-02 17:06:54 +01:00
committed by GitHub
parent 99142fd662
commit 04c707f874

View File

@@ -802,8 +802,10 @@ def connect_regions(world: World, level_list):
for i in range(0, len(kremwood_forest_levels) - 1): for i in range(0, len(kremwood_forest_levels) - 1):
connect(world, world.player, names, LocationName.kremwood_forest_region, kremwood_forest_levels[i]) connect(world, world.player, names, LocationName.kremwood_forest_region, kremwood_forest_levels[i])
connect(world, world.player, names, LocationName.kremwood_forest_region, kremwood_forest_levels[-1], connection = connect(world, world.player, names, LocationName.kremwood_forest_region, kremwood_forest_levels[-1],
lambda state: (state.can_reach(LocationName.riverside_race_flag, "Location", world.player))) lambda state: (state.can_reach(LocationName.riverside_race_flag, "Location", world.player)))
world.multiworld.register_indirect_condition(world.get_location(LocationName.riverside_race_flag).parent_region,
connection)
# Cotton-Top Cove Connections # Cotton-Top Cove Connections
cotton_top_cove_levels = [ cotton_top_cove_levels = [
@@ -837,8 +839,11 @@ def connect_regions(world: World, level_list):
connect(world, world.player, names, LocationName.mekanos_region, LocationName.sky_high_secret_region, connect(world, world.player, names, LocationName.mekanos_region, LocationName.sky_high_secret_region,
lambda state: (state.has(ItemName.bowling_ball, world.player, 1))) lambda state: (state.has(ItemName.bowling_ball, world.player, 1)))
else: else:
connect(world, world.player, names, LocationName.mekanos_region, LocationName.sky_high_secret_region, connection = connect(world, world.player, names, LocationName.mekanos_region,
lambda state: (state.can_reach(LocationName.bleaks_house, "Location", world.player))) LocationName.sky_high_secret_region,
lambda state: (state.can_reach(LocationName.bleaks_house, "Location", world.player)))
world.multiworld.register_indirect_condition(world.get_location(LocationName.bleaks_house).parent_region,
connection)
# K3 Connections # K3 Connections
k3_levels = [ k3_levels = [
@@ -946,3 +951,4 @@ def connect(world: World, player: int, used_names: typing.Dict[str, int], source
source_region.exits.append(connection) source_region.exits.append(connection)
connection.connect(target_region) connection.connect(target_region)
return connection