Skip to content

Commit

Permalink
Check game mode for wave 20 trainer evo ban
Browse files Browse the repository at this point in the history
  • Loading branch information
Fontbane committed Dec 16, 2024
1 parent fe0ce0e commit 0ebbd9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/data/pokemon-species.ts
Original file line number Diff line number Diff line change
Expand Up @@ -670,9 +670,6 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
}

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);
}

Expand Down
3 changes: 3 additions & 0 deletions src/data/trainer-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,9 @@ function getGymLeaderPartyTemplate(scene: BattleScene) {
export function getRandomPartyMemberFunc(speciesPool: Species[], trainerSlot: TrainerSlot = TrainerSlot.TRAINER, ignoreEvolution: boolean = false, postProcess?: (enemyPokemon: EnemyPokemon) => void) {
return (scene: BattleScene, level: number, strength: PartyMemberStrength) => {
let species = Utils.randSeedItem(speciesPool);
if (scene.gameMode.isClassic && scene.currentBattle.waveIndex === 20) {
ignoreEvolution = true;
}
if (!ignoreEvolution) {
species = getPokemonSpecies(species).getTrainerSpeciesForLevel(level, true, strength, scene.currentBattle.waveIndex);
}
Expand Down

0 comments on commit 0ebbd9c

Please sign in to comment.