diff --git a/src/field/trainer.ts b/src/field/trainer.ts index 6dd5eed2a8e..c208fa59192 100644 --- a/src/field/trainer.ts +++ b/src/field/trainer.ts @@ -263,6 +263,17 @@ export default class Trainer extends Phaser.GameObjects.Container { let ret: EnemyPokemon; this.scene.executeWithSeedOffset(() => { + if (Overrides.TRAINER_PARTY_OVERRIDE?.length) { + ret = this.scene.addEnemyPokemon( + getPokemonSpecies(Overrides.TRAINER_PARTY_OVERRIDE[index % Overrides.TRAINER_PARTY_OVERRIDE.length]), + level, + !this.isDouble() || !(index % 2) + ? TrainerSlot.TRAINER + : TrainerSlot.TRAINER_PARTNER + ); + return; + } + const template = this.getPartyTemplate(); const strength: PartyMemberStrength = template.getStrength(index); diff --git a/src/overrides.ts b/src/overrides.ts index 00b309f18a7..ea1e20aab42 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -123,6 +123,17 @@ class DefaultOverrides { * Force enemy AI to always switch pkmn */ readonly TRAINER_ALWAYS_SWITCHES_OVERRIDE: boolean = false; + /** + * Force enemy trainer battles to always pick pkmn in this order. If the + * trainer would have more Pokemon than in the array, it will wrap around to + * the beginning. If the trainer would have less Pokemon than in the array, + * it will ignore the extras. + * + * Has no effect on wild battles. Only affects newly generated trainers (eg, + * won't work on a saved trainer wave). OPP_SPECIES_OVERRIDE and other OPP_ + * overrides will supercede this value. + */ + readonly TRAINER_PARTY_OVERRIDE: Species[] = []; // ------------- // EGG OVERRIDES