From 47dd36456e6393b436319852626858ddc3324c28 Mon Sep 17 00:00:00 2001 From: Alchav <59858495+Alchav@users.noreply.github.com> Date: Thu, 11 Jan 2024 18:49:54 -0500 Subject: [PATCH] =?UTF-8?q?Pok=C3=A9mon=20R/B:=20Fix=20move=20intervention?= =?UTF-8?q?=20(#2687)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worlds/pokemon_rb/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worlds/pokemon_rb/__init__.py b/worlds/pokemon_rb/__init__.py index 5a94a8b5ff26..169ff1d59f1e 100644 --- a/worlds/pokemon_rb/__init__.py +++ b/worlds/pokemon_rb/__init__.py @@ -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"] @@ -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]: