Fix namebox not updating with theme

Fix namebox not updating with theme; ban certain species from being used by trainers
This commit is contained in:
Flashfyre committed 2024-04-04 18:00:21 -04:00
1 parent 3e99ed6bb6
commit 4f0b1fdcfb
4 files changed
+13 -5

No files matched your search

+2 -2
View File
@@ -212,7 +212,7 @@ export class TrainerConfig {
this.battleBgm = 'battle_trainer';
this.victoryBgm = 'victory_trainer';
this.partyTemplates = [ trainerPartyTemplates.TWO_AVG ];
this.speciesFilter = species => allowLegendaries || (!species.legendary && !species.pseudoLegendary && !species.mythical);
this.speciesFilter = species => (allowLegendaries || (!species.legendary && !species.pseudoLegendary && !species.mythical)) && !species.isTrainerForbidden();
}
getKey(): string {
@@ -509,7 +509,7 @@ function getRandomPartyMemberFunc(speciesPool: Species[], trainerSlot: TrainerSl
function getSpeciesFilterRandomPartyMemberFunc(speciesFilter: PokemonSpeciesFilter, trainerSlot: TrainerSlot = TrainerSlot.TRAINER, allowLegendaries?: boolean, postProcess?: (EnemyPokemon: EnemyPokemon) => void): PartyMemberFunc {
const originalSpeciesFilter = speciesFilter;
speciesFilter = (species: PokemonSpecies) => allowLegendaries || (!species.legendary && !species.pseudoLegendary && !species.mythical) && originalSpeciesFilter(species);
speciesFilter = (species: PokemonSpecies) => (allowLegendaries || (!species.legendary && !species.pseudoLegendary && !species.mythical)) && !species.isTrainerForbidden() && originalSpeciesFilter(species);
return (scene: BattleScene, level: integer, strength: PartyMemberStrength) => {
const ret = scene.addEnemyPokemon(getPokemonSpecies(scene.randomSpecies(scene.currentBattle.waveIndex, level, false, speciesFilter).getTrainerSpeciesForLevel(level, true, strength)), level, trainerSlot, undefined, undefined, postProcess);
return ret;