Check game mode for wave 20 trainer evo ban

This commit is contained in:
AJ Fontaine 2024-12-16 17:51:45 -05:00
parent fe0ce0e27f
commit 0ebbd9ce24
2 changed files with 3 additions and 3 deletions

View File

@ -670,9 +670,6 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
} }
getTrainerSpeciesForLevel(level: number, allowEvolving: boolean = false, strength: PartyMemberStrength, currentWave: number = 0): Species { getTrainerSpeciesForLevel(level: number, allowEvolving: boolean = false, strength: PartyMemberStrength, currentWave: number = 0): Species {
if (currentWave === 20) { //Don't allow first gym leader wave 20 to evolve their mons
allowEvolving = false;
}
return this.getSpeciesForLevel(level, allowEvolving, true, strength, currentWave); return this.getSpeciesForLevel(level, allowEvolving, true, strength, currentWave);
} }

View File

@ -1170,6 +1170,9 @@ function getGymLeaderPartyTemplate(scene: BattleScene) {
export function getRandomPartyMemberFunc(speciesPool: Species[], trainerSlot: TrainerSlot = TrainerSlot.TRAINER, ignoreEvolution: boolean = false, postProcess?: (enemyPokemon: EnemyPokemon) => void) { export function getRandomPartyMemberFunc(speciesPool: Species[], trainerSlot: TrainerSlot = TrainerSlot.TRAINER, ignoreEvolution: boolean = false, postProcess?: (enemyPokemon: EnemyPokemon) => void) {
return (scene: BattleScene, level: number, strength: PartyMemberStrength) => { return (scene: BattleScene, level: number, strength: PartyMemberStrength) => {
let species = Utils.randSeedItem(speciesPool); let species = Utils.randSeedItem(speciesPool);
if (scene.gameMode.isClassic && scene.currentBattle.waveIndex === 20) {
ignoreEvolution = true;
}
if (!ignoreEvolution) { if (!ignoreEvolution) {
species = getPokemonSpecies(species).getTrainerSpeciesForLevel(level, true, strength, scene.currentBattle.waveIndex); species = getPokemonSpecies(species).getTrainerSpeciesForLevel(level, true, strength, scene.currentBattle.waveIndex);
} }