Skip to content

Commit

Permalink
Pokémon R/B: Fix move intervention (ArchipelagoMW#2687)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alchav authored and Jouramie committed Feb 28, 2024
1 parent 6855b64 commit cedb116
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions worlds/pokemon_rb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,9 @@ def pre_fill(self) -> None:
location.show_in_spoiler = False

def intervene(move, test_state):
if self.multiworld.randomize_wild_pokemon[self.player]:
move_bit = pow(2, poke_data.hm_moves.index(move) + 2)
viable_mons = [mon for mon in self.local_poke_data if self.local_poke_data[mon]["tms"][6] & move_bit]
if self.multiworld.randomize_wild_pokemon[self.player] and viable_mons:
accessible_slots = [loc for loc in self.multiworld.get_reachable_locations(test_state, self.player) if
loc.type == "Wild Encounter"]

Expand All @@ -363,8 +365,6 @@ def number_of_zones(mon):
zones.add(loc.name.split(" - ")[0])
return len(zones)

move_bit = pow(2, poke_data.hm_moves.index(move) + 2)
viable_mons = [mon for mon in self.local_poke_data if self.local_poke_data[mon]["tms"][6] & move_bit]
placed_mons = [slot.item.name for slot in accessible_slots]

if self.multiworld.area_1_to_1_mapping[self.player]:
Expand Down

0 comments on commit cedb116

Please sign in to comment.