From 095634fe6d1661bfcaef0d4b51ecd523dba19e7a Mon Sep 17 00:00:00 2001 From: AJ Fontaine <36677462+Fontbane@users.noreply.github.com> Date: Sun, 23 Feb 2025 14:21:24 -0500 Subject: [PATCH] [Bug] Fix Gym Leaders fought on wave 20 not evolving mons when fought later in the run (#5370) * Fix repeat Plains GLs not evolving first mons * Add null check --- src/data/pokemon-species.ts | 6 +++++- src/data/trainer-config.ts | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index ff9fbdf0bc8..06704666153 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -830,7 +830,11 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali } } - if (!allowEvolving || !pokemonEvolutions.hasOwnProperty(this.speciesId)) { + if ( // If evolutions shouldn't happen, add more cases here :) + !allowEvolving + || !pokemonEvolutions.hasOwnProperty(this.speciesId) + || globalScene.currentBattle?.waveIndex === 20 && globalScene.gameMode.isClassic && globalScene.currentBattle.trainer + ) { return this.speciesId; } diff --git a/src/data/trainer-config.ts b/src/data/trainer-config.ts index d9aab528e72..1b646fc6478 100644 --- a/src/data/trainer-config.ts +++ b/src/data/trainer-config.ts @@ -1247,9 +1247,6 @@ function getGymLeaderPartyTemplate() { export function getRandomPartyMemberFunc(speciesPool: Species[], trainerSlot: TrainerSlot = TrainerSlot.TRAINER, ignoreEvolution: boolean = false, postProcess?: (enemyPokemon: EnemyPokemon) => void) { return (level: number, strength: PartyMemberStrength) => { let species = Utils.randSeedItem(speciesPool); - if (globalScene.gameMode.isClassic && globalScene.currentBattle.waveIndex === 20) { - ignoreEvolution = true; - } if (!ignoreEvolution) { species = getPokemonSpecies(species).getTrainerSpeciesForLevel(level, true, strength, globalScene.currentBattle.waveIndex); }