Skip to content

Commit

Permalink
Pokemon Emerald: Fix opponents learning non-randomized TMs (#3025)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zunawe authored Mar 29, 2024
1 parent 5d9d4ed commit 4391d1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions worlds/pokemon_emerald/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,14 +569,6 @@ def generate_output(self, output_directory: str) -> None:
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():
Expand All @@ -591,6 +583,14 @@ def generate_output(self, output_directory: str) -> None:
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
Expand Down
2 changes: 1 addition & 1 deletion worlds/pokemon_emerald/opponents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4391d1f

Please sign in to comment.