[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
This commit is contained in:
parent
cefd92bee8
commit
095634fe6d
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue