Pokémon R/B: Door Shuffle fixes (#2314)
* Door shuffle fixes * Add Rt 23's Victory Road exit door to list of unreachable outdoor entrances
This commit is contained in:
parent
e27aeac2e5
commit
13b68ecb15
|
@ -795,7 +795,7 @@ location_data = [
|
|||
LocationData("Pewter Gym", "Defeat Brock", "Defeat Brock", event=True),
|
||||
LocationData("Cerulean Gym", "Defeat Misty", "Defeat Misty", event=True),
|
||||
LocationData("Vermilion Gym", "Defeat Lt. Surge", "Defeat Lt. Surge", event=True),
|
||||
LocationData("Celadon Gym", "Defeat Erika", "Defeat Erika", event=True),
|
||||
LocationData("Celadon Gym-C", "Defeat Erika", "Defeat Erika", event=True),
|
||||
LocationData("Fuchsia Gym", "Defeat Koga", "Defeat Koga", event=True),
|
||||
LocationData("Cinnabar Gym", "Defeat Blaine", "Defeat Blaine", event=True),
|
||||
LocationData("Saffron Gym-C", "Defeat Sabrina", "Defeat Sabrina", event=True),
|
||||
|
|
|
@ -1456,7 +1456,9 @@ mansion_stair_destinations = [
|
|||
unreachable_outdoor_entrances = [
|
||||
"Route 4-C to Mt Moon B1F-NE",
|
||||
"Fuchsia City-Good Rod House Backyard to Fuchsia Good Rod House",
|
||||
"Cerulean City-Badge House Backyard to Cerulean Badge House"
|
||||
"Cerulean City-Badge House Backyard to Cerulean Badge House",
|
||||
# TODO: This doesn't need to be forced if fly location is Pokemon League?
|
||||
"Route 23-N to Victory Road 2F-E"
|
||||
]
|
||||
|
||||
|
||||
|
@ -2220,7 +2222,7 @@ def create_regions(self):
|
|||
"Cinnabar Gym - Blaine Prize", "Viridian Gym - Giovanni Prize"]:
|
||||
badge_locs.append(multiworld.get_location(loc, player))
|
||||
multiworld.random.shuffle(badges)
|
||||
while badges[3].name == "Cascade Badge" and multiworld.badges_needed_for_hm_moves[player] == "on":
|
||||
while badges[3].name == "Cascade Badge" and multiworld.badges_needed_for_hm_moves[player]:
|
||||
multiworld.random.shuffle(badges)
|
||||
for badge, loc in zip(badges, badge_locs):
|
||||
loc.place_locked_item(badge)
|
||||
|
@ -2266,10 +2268,10 @@ def create_regions(self):
|
|||
]
|
||||
|
||||
def adds_reachable_entrances(entrances_copy, item):
|
||||
state.collect(item, False)
|
||||
state_copy = state.copy()
|
||||
state_copy.collect(item, False)
|
||||
ret = len([entrance for entrance in entrances_copy if entrance in reachable_entrances or
|
||||
entrance.parent_region.can_reach(state)]) > len(reachable_entrances)
|
||||
state.remove(item)
|
||||
entrance.parent_region.can_reach(state_copy)]) > len(reachable_entrances)
|
||||
return ret
|
||||
|
||||
def dead_end(entrances_copy, e):
|
||||
|
@ -2304,9 +2306,16 @@ def create_regions(self):
|
|||
starting_entrances = len(entrances)
|
||||
dc_connected = []
|
||||
event_locations = self.multiworld.get_filled_locations(player)
|
||||
rock_tunnel_entrances = [entrance for entrance in entrances if "Rock Tunnel" in entrance.name]
|
||||
entrances = [entrance for entrance in entrances if entrance not in rock_tunnel_entrances]
|
||||
while entrances:
|
||||
state.update_reachable_regions(player)
|
||||
state.sweep_for_events(locations=event_locations)
|
||||
|
||||
if rock_tunnel_entrances and logic.rock_tunnel(state, player):
|
||||
entrances += rock_tunnel_entrances
|
||||
rock_tunnel_entrances = None
|
||||
|
||||
reachable_entrances = [entrance for entrance in entrances if entrance in reachable_entrances or
|
||||
entrance.parent_region.can_reach(state)]
|
||||
assert reachable_entrances, \
|
||||
|
@ -2328,12 +2337,8 @@ def create_regions(self):
|
|||
# entrances list is empty while it's being sorted, must pass a copy to iterate through
|
||||
entrances_copy = entrances.copy()
|
||||
if multiworld.door_shuffle[player] == "decoupled":
|
||||
if len(reachable_entrances) <= 8 and not logic.rock_tunnel(state, player):
|
||||
entrances.sort(key=lambda e: 1 if "Rock Tunnel" in e.name else 2 if e.connected_region is not
|
||||
None else 3 if e not in reachable_entrances else 0)
|
||||
else:
|
||||
entrances.sort(key=lambda e: 1 if e.connected_region is not None else 2 if e not in
|
||||
reachable_entrances else 0)
|
||||
entrances.sort(key=lambda e: 1 if e.connected_region is not None else 2 if e not in
|
||||
reachable_entrances else 0)
|
||||
assert entrances[0].connected_region is None,\
|
||||
"Ran out of valid reachable entrances in Pokemon Red and Blue door shuffle"
|
||||
elif len(reachable_entrances) > (1 if multiworld.door_shuffle[player] == "insanity" else 8) and len(
|
||||
|
|
Loading…
Reference in New Issue