From 4391d1f4c13cdf2295481d8c51f9ef8f58bf8347 Mon Sep 17 00:00:00 2001 From: Bryce Wilson Date: Thu, 28 Mar 2024 18:05:39 -0600 Subject: [PATCH] Pokemon Emerald: Fix opponents learning non-randomized TMs (#3025) --- worlds/pokemon_emerald/__init__.py | 16 ++++++++-------- worlds/pokemon_emerald/opponents.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/worlds/pokemon_emerald/__init__.py b/worlds/pokemon_emerald/__init__.py index 65bcce3a..c7f060a7 100644 --- a/worlds/pokemon_emerald/__init__.py +++ b/worlds/pokemon_emerald/__init__.py @@ -569,14 +569,6 @@ class PokemonEmeraldWorld(World): self.modified_misc_pokemon = copy.deepcopy(emerald_data.misc_pokemon) self.modified_starters = copy.deepcopy(emerald_data.starters) - randomize_abilities(self) - randomize_learnsets(self) - randomize_tm_hm_compatibility(self) - randomize_legendary_encounters(self) - randomize_misc_pokemon(self) - randomize_opponent_parties(self) - randomize_starters(self) - # Modify catch rate min_catch_rate = min(self.options.min_catch_rate.value, 255) for species in self.modified_species.values(): @@ -591,6 +583,14 @@ class PokemonEmeraldWorld(World): new_moves.add(new_move) self.modified_tmhm_moves[i] = new_move + randomize_abilities(self) + randomize_learnsets(self) + randomize_tm_hm_compatibility(self) + randomize_legendary_encounters(self) + randomize_misc_pokemon(self) + randomize_opponent_parties(self) + randomize_starters(self) + create_patch(self, output_directory) del self.modified_trainers diff --git a/worlds/pokemon_emerald/opponents.py b/worlds/pokemon_emerald/opponents.py index f4852825..09e94754 100644 --- a/worlds/pokemon_emerald/opponents.py +++ b/worlds/pokemon_emerald/opponents.py @@ -80,7 +80,7 @@ def randomize_opponent_parties(world: "PokemonEmeraldWorld") -> None: per_species_tmhm_moves[new_species.species_id] = sorted({ world.modified_tmhm_moves[i] for i, is_compatible in enumerate(int_to_bool_array(new_species.tm_hm_compatibility)) - if is_compatible + if is_compatible and world.modified_tmhm_moves[i] not in world.blacklisted_moves }) # TMs and HMs compatible with the species