diff --git a/worlds/pokemon_rb/locations.py b/worlds/pokemon_rb/locations.py index ec6375859bb9..4f1b55a00dd7 100644 --- a/worlds/pokemon_rb/locations.py +++ b/worlds/pokemon_rb/locations.py @@ -795,7 +795,7 @@ def __init__(self, flag): 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), diff --git a/worlds/pokemon_rb/regions.py b/worlds/pokemon_rb/regions.py index cc788dd2ba5c..431b23f49a6a 100644 --- a/worlds/pokemon_rb/regions.py +++ b/worlds/pokemon_rb/regions.py @@ -1456,7 +1456,9 @@ def pair(a, b): 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 cerulean_city_problem(): "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 cerulean_city_problem(): ] 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 dead_end(entrances_copy, e): 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 dead_end(entrances_copy, e): # 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(