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:
1 parent
3e99ed6bb6
commit
4f0b1fdcfb
4 files changed
+13
-5
No files matched your search
@@ -167,6 +167,10 @@ export abstract class PokemonSpeciesForm {
|
||||
return this.getRegion() > Region.NORMAL;
|
||||
}
|
||||
|
||||
isTrainerForbidden(): boolean {
|
||||
return [ Species.ETERNAL_FLOETTE, Species.BLOODMOON_URSALUNA ].includes(this.speciesId);
|
||||
}
|
||||
|
||||
isRareRegional(): boolean {
|
||||
switch (this.getRegion()) {
|
||||
case Region.HISUI:
|
||||
@@ -613,7 +617,8 @@ export default class PokemonSpecies extends PokemonSpeciesForm {
|
||||
&& pokemonPrevolutions.hasOwnProperty(species.speciesId) === hasPrevolution
|
||||
&& species.pseudoLegendary === pseudoLegendary
|
||||
&& species.legendary === legendary
|
||||
&& species.mythical === mythical;
|
||||
&& species.mythical === mythical
|
||||
&& (this.isTrainerForbidden() || !species.isTrainerForbidden());
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user