diff --git a/src/data/trainers/trainer-config.ts b/src/data/trainers/trainer-config.ts index 2870fd7f808..2b81406bf6c 100644 --- a/src/data/trainers/trainer-config.ts +++ b/src/data/trainers/trainer-config.ts @@ -45,6 +45,11 @@ import { coerceArray, isNullOrUndefined, randSeedInt, randSeedIntRange, randSeed import { getPokemonSpecies } from "#utils/pokemon-utils"; import { toCamelCase, toTitleCase } from "#utils/strings"; import i18next from "i18next"; +import { mysteryEventTrainers } from "./trainers-init/mystery-event-trainers"; +import { evilAdminTrainers } from "./trainers-init/evil-organizations/evil-leaders-trainers"; +import { rivalTrainer } from "./trainers-init/rival-trainer"; +import { championTrainers } from "./trainers-init/champion-trainers"; +import { eliteFourTrainers } from "./trainers-init/elite-four-trainers"; /** Minimum BST for Pokemon generated onto the Elite Four's teams */ const ELITE_FOUR_MINIMUM_BST = 460; @@ -959,6 +964,15 @@ export class TrainerConfig { let t = 0; +let trainerCounter = 0; +export function nextTrainerId() : number { + return ++trainerCounter; +} +export function setTrainerId(trainerID: number) : number { + trainerCounter = trainerID; + return trainerCounter +} + /** * Randomly selects one of the `Species` from `speciesPool`, determines its evolution, level, and strength. * Then adds Pokemon to globalScene. @@ -2926,3193 +2940,9 @@ export const trainerConfigs: TrainerConfigs = { .initForGymLeader(signatureSpecies["GRUSHA"], true, PokemonType.ICE, true, -1) .setMixedBattleBgm("battle_paldea_gym"), - [TrainerType.LORELEI]: new TrainerConfig((t = TrainerType.LORELEI)) - .initForEliteFour(signatureSpecies["LORELEI"], false, PokemonType.ICE, 2) - .setBattleBgm("battle_kanto_gym") - .setMixedBattleBgm("battle_kanto_gym") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.DEWGONG], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 0; // Thick Fat - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.SLOWBRO, SpeciesId.GALAR_SLOWBRO], TrainerSlot.TRAINER, true, p => { - // Tera Ice Slowbro/G-Slowbro - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.ICE_BEAM)) { - // Check if Ice Beam is in the moveset, if not, replace the third move with Ice Beam. - p.moveset[2] = new PokemonMove(MoveId.ICE_BEAM); - } - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.JYNX])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.CLOYSTER, SpeciesId.ALOLA_SANDSLASH])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.LAPRAS], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.BRUNO]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["BRUNO"], true, PokemonType.FIGHTING, 2) - .setBattleBgm("battle_kanto_gym") - .setMixedBattleBgm("battle_kanto_gym") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.HITMONLEE, SpeciesId.HITMONCHAN, SpeciesId.HITMONTOP])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.STEELIX], TrainerSlot.TRAINER, true, p => { - // Tera Fighting Steelix - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.BODY_PRESS)) { - // Check if Body Press is in the moveset, if not, replace the third move with Body Press. - p.moveset[2] = new PokemonMove(MoveId.BODY_PRESS); - } - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.POLIWRATH])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.ANNIHILAPE])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.MACHAMP], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.AGATHA]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["AGATHA"], false, PokemonType.GHOST, 2) - .setBattleBgm("battle_kanto_gym") - .setMixedBattleBgm("battle_kanto_gym") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.MISMAGIUS])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.ARBOK, SpeciesId.WEEZING], TrainerSlot.TRAINER, true, p => { - // Tera Ghost Arbok/Weezing - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { - // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. - p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); - } - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.ALOLA_MAROWAK])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.CURSOLA])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.GENGAR], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.LANCE]: new TrainerConfig(++t) - .setName("Lance") - .initForEliteFour(signatureSpecies["LANCE"], true, PokemonType.DRAGON, 2) - .setBattleBgm("battle_kanto_gym") - .setMixedBattleBgm("battle_kanto_gym") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.KINGDRA])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.GYARADOS, SpeciesId.AERODACTYL], TrainerSlot.TRAINER, true, p => { - // Tera Dragon Gyarados/Aerodactyl - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { - // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. - p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); - } - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.ALOLA_EXEGGUTOR])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.SALAMENCE])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.DRAGONITE], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.WILL]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["WILL"], true, PokemonType.PSYCHIC, 2) - .setBattleBgm("battle_johto_gym") - .setMixedBattleBgm("battle_johto_gym") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.JYNX])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.SLOWKING, SpeciesId.GALAR_SLOWKING])) // Tera Psychic Slowking/G-Slowking - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.EXEGGUTOR])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.WYRDEER, SpeciesId.FARIGIRAF])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.XATU], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.KOGA]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["KOGA"], true, PokemonType.POISON, 2) - .setBattleBgm("battle_johto_gym") - .setMixedBattleBgm("battle_johto_gym") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.VENOMOTH], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 1; // Tinted Lens - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.MUK, SpeciesId.WEEZING])) // Tera Poison Muk/Weezing - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.TENTACRUEL])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.SNEASLER, SpeciesId.OVERQWIL])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.CROBAT], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.KAREN]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["KAREN"], false, PokemonType.DARK, 2) - .setBattleBgm("battle_johto_gym") - .setMixedBattleBgm("battle_johto_gym") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.UMBREON])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.GENGAR], TrainerSlot.TRAINER, true, p => { - // Tera Dark Gengar - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.DARK_PULSE)) { - // Check if Dark Pulse is in the moveset, if not, replace the third move with Dark Pulse. - p.moveset[2] = new PokemonMove(MoveId.DARK_PULSE); - } - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.HONCHKROW])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.WEAVILE])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.HOUNDOOM], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.SIDNEY]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["SIDNEY"], true, PokemonType.DARK, 2) - .setMixedBattleBgm("battle_hoenn_elite") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.MIGHTYENA], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 0; // Intimidate - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.OBSTAGOON])) // Tera Dark Obstagoon - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.SHIFTRY, SpeciesId.CACTURNE])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.SHARPEDO, SpeciesId.CRAWDAUNT])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.ABSOL], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.PHOEBE]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["PHOEBE"], false, PokemonType.GHOST, 2) - .setMixedBattleBgm("battle_hoenn_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.SABLEYE])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.BANETTE])) // Tera Ghost Banette - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.DRIFBLIM, SpeciesId.MISMAGIUS])) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.ORICORIO, SpeciesId.ALOLA_MAROWAK], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.formIndex = p.species.speciesId === SpeciesId.ORICORIO ? 3 : 0; // Oricorio-Sensu - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.DUSKNOIR], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.GLACIA]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["GLACIA"], false, PokemonType.ICE, 2) - .setMixedBattleBgm("battle_hoenn_elite") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.ABOMASNOW], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 0; // Snow Warning - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.GLALIE])) // Tera Ice Glalie - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.FROSLASS])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.ALOLA_NINETALES])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.WALREIN], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.DRAKE]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["DRAKE"], true, PokemonType.DRAGON, 2) - .setMixedBattleBgm("battle_hoenn_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.ALTARIA])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.DHELMISE], TrainerSlot.TRAINER, true, p => { - // Tera Dragon Dhelmise - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { - // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. - p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); - } - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.FLYGON])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.KINGDRA])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.SALAMENCE], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.AARON]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["AARON"], true, PokemonType.BUG, 5) - .setBattleBgm("battle_sinnoh_gym") - .setMixedBattleBgm("battle_sinnoh_gym") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.YANMEGA])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.HERACROSS])) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.VESPIQUEN])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.SCIZOR, SpeciesId.KLEAVOR])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.DRAPION], TrainerSlot.TRAINER, true, p => { - // Tera Bug Drapion - p.setBoss(true, 2); - p.abilityIndex = 1; // Sniper - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.X_SCISSOR)) { - // Check if X-Scissor is in the moveset, if not, replace the third move with X-Scissor. - p.moveset[2] = new PokemonMove(MoveId.X_SCISSOR); - } - }), - ), - [TrainerType.BERTHA]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["BERTHA"], false, PokemonType.GROUND, 2) - .setBattleBgm("battle_sinnoh_gym") - .setMixedBattleBgm("battle_sinnoh_gym") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.WHISCASH])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.HIPPOWDON], TrainerSlot.TRAINER, true, p => { - // Tera Ground Hippowdon - p.abilityIndex = 0; // Sand Stream - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GLISCOR])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.MAMOSWINE, SpeciesId.URSALUNA])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.RHYPERIOR], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.abilityIndex = 1; // Solid Rock - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.FLINT]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["FLINT"], true, PokemonType.FIRE, 2) - .setBattleBgm("battle_sinnoh_gym") - .setMixedBattleBgm("battle_sinnoh_gym") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.RAPIDASH])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.STEELIX, SpeciesId.LOPUNNY], TrainerSlot.TRAINER, true, p => { - // Tera Fire Steelix/Lopunny - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { - // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. - p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); - } - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.INFERNAPE])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.ARCANINE, SpeciesId.HISUI_ARCANINE])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.MAGMORTAR], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.LUCIAN]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["LUCIAN"], true, PokemonType.PSYCHIC, 2) - .setBattleBgm("battle_sinnoh_gym") - .setMixedBattleBgm("battle_sinnoh_gym") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.ESPEON, SpeciesId.ALAKAZAM])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.FARIGIRAF])) // Tera Psychic Farigiraf - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.BRONZONG])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.MR_RIME, SpeciesId.HISUI_BRAVIARY])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.GALLADE], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.abilityIndex = 1; // Sharpness - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.SHAUNTAL]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["SHAUNTAL"], false, PokemonType.GHOST, 2) - .setMixedBattleBgm("battle_unova_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.COFAGRIGUS])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.GOLURK])) // Tera Ghost Golurk - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.JELLICENT])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.MISMAGIUS, SpeciesId.FROSLASS])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.CHANDELURE], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.MARSHAL]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["MARSHAL"], true, PokemonType.FIGHTING, 2) - .setMixedBattleBgm("battle_unova_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.THROH, SpeciesId.SAWK])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.MIENSHAO])) // Tera Fighting Mienshao - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.EMBOAR])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.BRELOOM, SpeciesId.TOXICROAK])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.CONKELDURR], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.GRIMSLEY]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["GRIMSLEY"], true, PokemonType.DARK, 2) - .setMixedBattleBgm("battle_unova_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.LIEPARD])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.KROOKODILE])) // Tera Dark Krookodile - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.SCRAFTY])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.ZOROARK, SpeciesId.HISUI_SAMUROTT])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.KINGAMBIT], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.CAITLIN]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["CAITLIN"], false, PokemonType.PSYCHIC, 2) - .setMixedBattleBgm("battle_unova_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.MUSHARNA])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.REUNICLUS])) // Tera Psychic Reuniclus - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.GALLADE], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 1; // Sharpness - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.SIGILYPH, SpeciesId.HISUI_BRAVIARY])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.GOTHITELLE], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.MALVA]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["MALVA"], false, PokemonType.FIRE, 2) - .setMixedBattleBgm("battle_kalos_elite") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.PYROAR], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.gender = Gender.FEMALE; - }), - ) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.HOUNDOOM])) // Tera Fire Houndoom - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.TORKOAL], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 1; // Drought - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.CHANDELURE, SpeciesId.DELPHOX])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.TALONFLAME], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.SIEBOLD]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["SIEBOLD"], true, PokemonType.WATER, 2) - .setMixedBattleBgm("battle_kalos_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.CLAWITZER])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.GYARADOS])) // Tera Water Gyarados - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.STARMIE])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.BLASTOISE, SpeciesId.DONDOZO])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.BARBARACLE], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.abilityIndex = 1; // Tough Claws - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.WIKSTROM]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["WIKSTROM"], true, PokemonType.STEEL, 2) - .setMixedBattleBgm("battle_kalos_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.KLEFKI])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.CERULEDGE], TrainerSlot.TRAINER, true, p => { - // Tera Steel Ceruledge - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.IRON_HEAD)) { - // Check if Iron Head is in the moveset, if not, replace the third move with Iron Head. - p.moveset[2] = new PokemonMove(MoveId.IRON_HEAD); - } - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.SCIZOR])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.CORVIKNIGHT])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.AEGISLASH], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.DRASNA]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["DRASNA"], false, PokemonType.DRAGON, 2) - .setMixedBattleBgm("battle_kalos_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.DRAGALGE])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.GARCHOMP])) // Tera Dragon Garchomp - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.ALTARIA])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.DRUDDIGON])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.NOIVERN], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.HALA]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["HALA"], true, PokemonType.FIGHTING, 2) - .setMixedBattleBgm("battle_alola_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.HARIYAMA])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.INCINEROAR], TrainerSlot.TRAINER, true, p => { - // Tera Fighting Incineroar - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.CROSS_CHOP)) { - // Check if Cross Chop is in the moveset, if not, replace the third move with Cross Chop. - p.moveset[2] = new PokemonMove(MoveId.CROSS_CHOP); - } - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.BEWEAR])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.POLIWRATH, SpeciesId.ANNIHILAPE])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.CRABOMINABLE], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.MOLAYNE]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["MOLAYNE"], true, PokemonType.STEEL, 2) - .setMixedBattleBgm("battle_alola_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.KLEFKI])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.ALOLA_SANDSLASH])) // Tera Steel A-Sandslash - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.MAGNEZONE])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.METAGROSS, SpeciesId.KINGAMBIT])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.ALOLA_DUGTRIO], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.OLIVIA]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["OLIVIA"], false, PokemonType.ROCK, 2) - .setMixedBattleBgm("battle_alola_elite") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.GIGALITH], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 1; // Sand Stream - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.PROBOPASS])) // Tera Rock Probopass - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.ALOLA_GOLEM])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.RELICANTH, SpeciesId.CARBINK])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.LYCANROC], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.formIndex = 1; - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.ACEROLA]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["ACEROLA"], false, PokemonType.GHOST, 2) - .setMixedBattleBgm("battle_alola_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.DRIFBLIM])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.MIMIKYU])) // Tera Ghost Mimikyu - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.DHELMISE])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.FROSLASS])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.PALOSSAND], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.KAHILI]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["KAHILI"], false, PokemonType.FLYING, 2) - .setMixedBattleBgm("battle_alola_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.HAWLUCHA])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.DECIDUEYE], TrainerSlot.TRAINER, true, p => { - // Tera Flying Decidueye - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.BRAVE_BIRD)) { - // Check if Brave Bird is in the moveset, if not, replace the third move with Brave Bird. - p.moveset[2] = new PokemonMove(MoveId.BRAVE_BIRD); - } - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.BRAVIARY, SpeciesId.MANDIBUZZ])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.ORICORIO])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.TOUCANNON], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.MARNIE_ELITE]: new TrainerConfig(++t) - .setName("Marnie") - .initForEliteFour(signatureSpecies["MARNIE_ELITE"], false, PokemonType.DARK, 2) - .setMixedBattleBgm("battle_galar_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.LIEPARD])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.TOXICROAK], TrainerSlot.TRAINER, true, p => { - // Tera Dark Toxicroak - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.SUCKER_PUNCH)) { - // Check if Sucker Punch is in the moveset, if not, replace the third move with Sucker Punch. - p.moveset[2] = new PokemonMove(MoveId.SUCKER_PUNCH); - } - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.SCRAFTY, SpeciesId.PANGORO])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.MORPEKO])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.GRIMMSNARL], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.NESSA_ELITE]: new TrainerConfig(++t) - .setName("Nessa") - .initForEliteFour(signatureSpecies["NESSA_ELITE"], false, PokemonType.WATER, 2) - .setMixedBattleBgm("battle_galar_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.GOLISOPOD])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.EISCUE], TrainerSlot.TRAINER, true, p => { - // Tera Water Eiscue - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.LIQUIDATION)) { - // Check if Liquidation is in the moveset, if not, replace the third move with Liquidation. - p.moveset[2] = new PokemonMove(MoveId.LIQUIDATION); - } - }), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.PELIPPER], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 1; // Drizzle - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.TOXAPEX])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.DREDNAW], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.BEA_ELITE]: new TrainerConfig(++t) - .setName("Bea") - .initForEliteFour(signatureSpecies["BEA_ELITE"], false, PokemonType.FIGHTING, 2) - .setMixedBattleBgm("battle_galar_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.HAWLUCHA])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.SIRFETCHD])) // Tera Fighting Sirfetch'd - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GRAPPLOCT, SpeciesId.FALINKS])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.HITMONTOP])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.MACHAMP], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.ALLISTER_ELITE]: new TrainerConfig(++t) - .setName("Allister") - .initForEliteFour(signatureSpecies["ALLISTER_ELITE"], true, PokemonType.GHOST, 2) - .setMixedBattleBgm("battle_galar_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.DUSKNOIR])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.RUNERIGUS])) // Tera Ghost Runerigus - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.POLTEAGEIST, SpeciesId.SINISTCHA])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.CURSOLA])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.GENGAR], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.RAIHAN_ELITE]: new TrainerConfig(++t) - .setName("Raihan") - .initForEliteFour(signatureSpecies["RAIHAN_ELITE"], true, PokemonType.DRAGON, 2) - .setMixedBattleBgm("battle_galar_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.FLYGON])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.TORKOAL], TrainerSlot.TRAINER, true, p => { - // Tera Dragon Torkoal - p.abilityIndex = 1; // Drought - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { - // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. - p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); - } - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GOODRA])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.TURTONATOR])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.ARCHALUDON], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.RIKA]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["RIKA"], false, PokemonType.GROUND, 5) - .setMixedBattleBgm("battle_paldea_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.DUGTRIO])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.DONPHAN])) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.SWAMPERT, SpeciesId.TORTERRA])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.CAMERUPT])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.CLODSIRE], TrainerSlot.TRAINER, true, p => { - // Tera Ground Clodsire - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.POPPY]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["POPPY"], false, PokemonType.STEEL, 5) - .setMixedBattleBgm("battle_paldea_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.COPPERAJAH])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.MAGNEZONE])) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.BRONZONG, SpeciesId.CORVIKNIGHT], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = p.species.speciesId === SpeciesId.BRONZONG ? 0 : 1; // Levitate Bronzong, Unnerve Corviknight - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.STEELIX])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.TINKATON], TrainerSlot.TRAINER, true, p => { - // Tera Steel Tinkaton - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.LARRY_ELITE]: new TrainerConfig(++t) - .setName("Larry") - .initForEliteFour(signatureSpecies["LARRY_ELITE"], true, PokemonType.FLYING, 5) - .setMixedBattleBgm("battle_paldea_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.ALTARIA])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.BOMBIRDIER])) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.TROPIUS])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.STARAPTOR])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.FLAMIGO], TrainerSlot.TRAINER, true, p => { - // Tera Flying Flamigo - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.HASSEL]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["HASSEL"], true, PokemonType.DRAGON, 5) - .setMixedBattleBgm("battle_paldea_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.NOIVERN])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.DRAGALGE])) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.FLAPPLE, SpeciesId.APPLETUN, SpeciesId.HYDRAPPLE])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.HAXORUS])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.BAXCALIBUR], TrainerSlot.TRAINER, true, p => { - // Tera Dragon Baxcalibur - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.CRISPIN]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["CRISPIN"], true, PokemonType.FIRE, 2) - .setMixedBattleBgm("battle_bb_elite") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.ROTOM], TrainerSlot.TRAINER, true, p => { - p.formIndex = 1; // Heat Rotom - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.EXEGGUTOR], TrainerSlot.TRAINER, true, p => { - // Tera Fire Exeggutor - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { - // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. - p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); - } - }), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.TALONFLAME], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.SUNNY_DAY)) { - // Check if Sunny Day is in the moveset, if not, replace the third move with Sunny Day. - p.moveset[2] = new PokemonMove(MoveId.SUNNY_DAY); - } - }), - ) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.MAGMORTAR])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.BLAZIKEN], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.AMARYS]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["AMARYS"], false, PokemonType.STEEL, 2) - .setMixedBattleBgm("battle_bb_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.SKARMORY])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.REUNICLUS], TrainerSlot.TRAINER, true, p => { - // Tera Steel Reuniclus - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.FLASH_CANNON)) { - // Check if Flash Cannon is in the moveset, if not, replace the third move with Flash Cannon. - p.moveset[2] = new PokemonMove(MoveId.FLASH_CANNON); - } - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.EMPOLEON])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.SCIZOR])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.METAGROSS], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - [TrainerType.LACEY]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["LACEY"], false, PokemonType.FAIRY, 5) - .setMixedBattleBgm("battle_bb_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.WHIMSICOTT])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.PRIMARINA])) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GRANBULL])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.ALCREMIE])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.EXCADRILL], TrainerSlot.TRAINER, true, p => { - // Tera Fairy Excadrill - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { - // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. - p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); - } - }), - ), - [TrainerType.DRAYTON]: new TrainerConfig(++t) - .initForEliteFour(signatureSpecies["DRAYTON"], true, PokemonType.DRAGON, 2) - .setMixedBattleBgm("battle_bb_elite") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.DRAGONITE])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.SCEPTILE], TrainerSlot.TRAINER, true, p => { - // Tera Dragon Sceptile - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.DUAL_CHOP)) { - // Check if Dual Chop is in the moveset, if not, replace the third move with Dual Chop. - p.moveset[2] = new PokemonMove(MoveId.DUAL_CHOP); - } - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.HAXORUS])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.KINGDRA, SpeciesId.DRACOVISH])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.ARCHALUDON], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ), - - [TrainerType.BLUE]: new TrainerConfig((t = TrainerType.BLUE)) - .initForChampion(true) - .setBattleBgm("battle_kanto_champion") - .setMixedBattleBgm("battle_kanto_champion") - .setHasDouble("blue_red_double") - .setDoubleTrainerType(TrainerType.RED) - .setDoubleTitle("champion_double") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.ALAKAZAM])) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc( - [SpeciesId.ARCANINE, SpeciesId.EXEGGUTOR, SpeciesId.GYARADOS], - TrainerSlot.TRAINER, - true, - p => { - p.generateAndPopulateMoveset(); - p.teraType = p.species.type1; - }, - ), - ) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.RHYPERIOR, SpeciesId.ELECTIVIRE])) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.MACHAMP])) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.HO_OH], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - p.abilityIndex = 2; // Regenerator - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.PIDGEOT], TrainerSlot.TRAINER, true, p => { - p.formIndex = 1; // Mega Pidgeot - p.generateAndPopulateMoveset(); - p.generateName(); - p.gender = Gender.MALE; - p.setBoss(true, 2); - }), - ) - .setInstantTera(1), // Tera Fire Arcanine, Tera Grass Exeggutor, Tera Water Gyarados - [TrainerType.RED]: new TrainerConfig(++t) - .initForChampion(true) - .setBattleBgm("battle_johto_champion") - .setMixedBattleBgm("battle_johto_champion") - .setHasDouble("red_blue_double") - .setDoubleTrainerType(TrainerType.BLUE) - .setDoubleTitle("champion_double") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.PIKACHU], TrainerSlot.TRAINER, true, p => { - p.formIndex = 1; // Partner Pikachu - p.gender = Gender.MALE; - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.VOLT_TACKLE)) { - // Check if Volt Tackle is in the moveset, if not, replace the first move with Volt Tackle. - p.moveset[0] = new PokemonMove(MoveId.VOLT_TACKLE); - } - }), - ) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.MEGANIUM, SpeciesId.TYPHLOSION, SpeciesId.FERALIGATR])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.ESPEON, SpeciesId.UMBREON, SpeciesId.SYLVEON])) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.SNORLAX])) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.LUGIA], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - p.abilityIndex = 2; // Multiscale - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc( - [SpeciesId.VENUSAUR, SpeciesId.CHARIZARD, SpeciesId.BLASTOISE], - TrainerSlot.TRAINER, - true, - p => { - p.formIndex = 1; // Mega Venusaur, Mega Charizard X, or Mega Blastoise - p.generateAndPopulateMoveset(); - p.generateName(); - p.gender = Gender.MALE; - p.setBoss(true, 2); - }, - ), - ) - .setInstantTera(0), // Tera Electric Pikachu - [TrainerType.LANCE_CHAMPION]: new TrainerConfig(++t) - .setName("Lance") - .initForChampion(true) - .setBattleBgm("battle_johto_champion") - .setMixedBattleBgm("battle_johto_champion") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.GYARADOS, SpeciesId.KINGDRA])) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.AERODACTYL])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.CHARIZARD])) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc( - [SpeciesId.TYRANITAR, SpeciesId.GARCHOMP, SpeciesId.HYDREIGON], - TrainerSlot.TRAINER, - true, - p => { - p.abilityIndex = 2; // Unnerve Tyranitar, Rough Skin Garchomp, Levitate Hydreigon - p.generateAndPopulateMoveset(); - }, - ), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.SALAMENCE], TrainerSlot.TRAINER, true, p => { - p.formIndex = 1; // Mega Salamence - p.generateAndPopulateMoveset(); - p.generateName(); - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.DRAGONITE], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.abilityIndex = 2; // Multiscale - p.gender = Gender.MALE; - p.setBoss(true, 2); - p.teraType = PokemonType.DRAGON; - }), - ) - .setInstantTera(5), // Tera Dragon Dragonite - [TrainerType.STEVEN]: new TrainerConfig(++t) - .initForChampion(true) - .setBattleBgm("battle_hoenn_champion_g5") - .setMixedBattleBgm("battle_hoenn_champion_g6") - .setHasDouble("steven_wallace_double") - .setDoubleTrainerType(TrainerType.WALLACE) - .setDoubleTitle("champion_double") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.GIGALITH], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 1; // Sand Stream - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.SKARMORY, SpeciesId.CLAYDOL])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.AGGRON])) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.GOLURK, SpeciesId.RUNERIGUS], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 0; // Iron Fist Golurk, Wandering Spirit Runerigus - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc( - [SpeciesId.REGIROCK, SpeciesId.REGICE, SpeciesId.REGISTEEL], - TrainerSlot.TRAINER, - true, - p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }, - ), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.METAGROSS], TrainerSlot.TRAINER, true, p => { - p.formIndex = 1; // Mega Metagross - p.generateAndPopulateMoveset(); - p.generateName(); - p.setBoss(true, 2); - }), - ) - .setInstantTera(4), // Tera Rock Regirock / Ice Regice / Steel Registeel - [TrainerType.WALLACE]: new TrainerConfig(++t) - .initForChampion(true) - .setBattleBgm("battle_hoenn_champion_g5") - .setMixedBattleBgm("battle_hoenn_champion_g6") - .setHasDouble("wallace_steven_double") - .setDoubleTrainerType(TrainerType.STEVEN) - .setDoubleTitle("champion_double") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.PELIPPER], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 1; // Drizzle - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.LUDICOLO], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 0; // Swift Swim - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.TENTACRUEL, SpeciesId.WALREIN], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = p.species.speciesId === SpeciesId.TENTACRUEL ? 2 : 0; // Rain Dish Tentacruel, Thick Fat Walrein - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.LATIAS, SpeciesId.LATIOS], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.generateName(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.SWAMPERT], TrainerSlot.TRAINER, true, p => { - p.formIndex = 1; // Mega Swampert - p.generateAndPopulateMoveset(); - p.generateName(); - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.MILOTIC], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.gender = Gender.FEMALE; - p.setBoss(true, 2); - }), - ) - .setInstantTera(5), // Tera Water Milotic - [TrainerType.CYNTHIA]: new TrainerConfig(++t) - .initForChampion(false) - .setBattleBgm("battle_sinnoh_champion") - .setMixedBattleBgm("battle_sinnoh_champion") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.SPIRITOMB])) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.MILOTIC, SpeciesId.ROSERADE, SpeciesId.HISUI_ARCANINE])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.TOGEKISS], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.teraType = p.species.type1; - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.LUCARIO])) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.GIRATINA], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.GARCHOMP], TrainerSlot.TRAINER, true, p => { - p.formIndex = 1; // Mega Garchomp - p.generateAndPopulateMoveset(); - p.generateName(); - p.gender = Gender.FEMALE; - p.setBoss(true, 2); - }), - ) - .setInstantTera(2), // Tera Fairy Togekiss - [TrainerType.ALDER]: new TrainerConfig(++t) - .initForChampion(true) - .setHasDouble("alder_iris_double") - .setDoubleTrainerType(TrainerType.IRIS) - .setDoubleTitle("champion_double") - .setBattleBgm("battle_champion_alder") - .setMixedBattleBgm("battle_champion_alder") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.BOUFFALANT, SpeciesId.BRAVIARY])) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc( - [SpeciesId.HISUI_LILLIGANT, SpeciesId.HISUI_ZOROARK, SpeciesId.BASCULEGION], - TrainerSlot.TRAINER, - true, - p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ROGUE_BALL; - }, - ), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.CHANDELURE, SpeciesId.KROOKODILE, SpeciesId.REUNICLUS, SpeciesId.CONKELDURR]), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.KELDEO], TrainerSlot.TRAINER, true, p => { - p.pokeball = PokeballType.ROGUE_BALL; - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.SECRET_SWORD)) { - // Check if Secret Sword is in the moveset, if not, replace the third move with Secret Sword. - p.moveset[2] = new PokemonMove(MoveId.SECRET_SWORD); - } - p.formIndex = 1; // Resolute Form - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.ZEKROM], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.VOLCARONA], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.gender = Gender.MALE; - p.setBoss(true, 2); - p.teraType = PokemonType.FIRE; - }), - ) - .setInstantTera(5), // Tera Fire Volcarona - [TrainerType.IRIS]: new TrainerConfig(++t) - .initForChampion(false) - .setBattleBgm("battle_champion_iris") - .setMixedBattleBgm("battle_champion_iris") - .setHasDouble("iris_alder_double") - .setDoubleTrainerType(TrainerType.ALDER) - .setDoubleTitle("champion_double") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.DRUDDIGON])) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.ARCHEOPS], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 2; // Emergency Exit - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.LAPRAS], TrainerSlot.TRAINER, true, p => { - p.formIndex = 1; // G-Max Lapras - p.generateAndPopulateMoveset(); - p.generateName(); - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.AGGRON, SpeciesId.HYDREIGON, SpeciesId.ARCHALUDON])) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.RESHIRAM], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.HAXORUS], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 1; // Mold Breaker - p.generateAndPopulateMoveset(); - p.gender = Gender.FEMALE; - p.setBoss(true, 2); - }), - ) - .setInstantTera(5), // Tera Dragon Haxorus - [TrainerType.DIANTHA]: new TrainerConfig(++t) - .initForChampion(false) - .setMixedBattleBgm("battle_kalos_champion") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.HAWLUCHA])) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.TREVENANT, SpeciesId.GOURGEIST], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 2; // Harvest Trevenant, Insomnia Gourgeist - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.TYRANTRUM, SpeciesId.AURORUS], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.abilityIndex = 2; // Rock Head Tyrantrum, Snow Warning Aurorus - p.teraType = p.species.type2!; - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GOODRA])) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.XERNEAS], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.GARDEVOIR], TrainerSlot.TRAINER, true, p => { - p.formIndex = 1; // Mega Gardevoir - p.generateAndPopulateMoveset(); - p.generateName(); - p.gender = Gender.FEMALE; - p.setBoss(true, 2); - }), - ) - .setInstantTera(2), // Tera Dragon Tyrantrum / Ice Aurorus - [TrainerType.KUKUI]: new TrainerConfig(++t) - .initForChampion(true) - .setMixedBattleBgm("battle_champion_kukui") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.LYCANROC], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.formIndex = 2; // Dusk Lycanroc - }), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.MAGNEZONE, SpeciesId.ALOLA_NINETALES], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.abilityIndex = p.species.speciesId === SpeciesId.MAGNEZONE ? 1 : 2; // Sturdy Magnezone, Snow Warning Ninetales - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc( - [SpeciesId.TORNADUS, SpeciesId.THUNDURUS, SpeciesId.LANDORUS], - TrainerSlot.TRAINER, - true, - p => { - p.formIndex = 1; // Therian Formes - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ROGUE_BALL; - }, - ), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.TAPU_LELE, SpeciesId.TAPU_FINI], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.abilityIndex = 0; // Psychic / Misty Surge - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.SNORLAX], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.formIndex = 1; // G-Max Snorlax - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.INCINEROAR, SpeciesId.HISUI_DECIDUEYE], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.gender = Gender.MALE; - p.teraType = p.species.type2!; - p.setBoss(true, 2); - }), - ) - .setInstantTera(5), // Tera Dark Incineroar / Fighting Hisuian Decidueye - [TrainerType.HAU]: new TrainerConfig(++t) - .initForChampion(true) - .setMixedBattleBgm("battle_alola_champion") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.ALOLA_RAICHU])) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.NOIVERN], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 1; // Infiltrator - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.BLACEPHALON, SpeciesId.STAKATAKA], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ROGUE_BALL; - }), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.TAPU_KOKO, SpeciesId.TAPU_BULU], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.abilityIndex = 0; // Electric / Grassy Surge - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.SOLGALEO], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.DECIDUEYE, SpeciesId.PRIMARINA], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.setBoss(true, 2); - p.gender = p.species.speciesId === SpeciesId.PRIMARINA ? Gender.FEMALE : Gender.MALE; - p.teraType = p.species.speciesId === SpeciesId.PRIMARINA ? PokemonType.WATER : PokemonType.GHOST; - }), - ) - .setInstantTera(5), // Tera Ghost Decidueye, Water Primarina - [TrainerType.LEON]: new TrainerConfig(++t) - .initForChampion(true) - .setMixedBattleBgm("battle_galar_champion") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.AEGISLASH])) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc( - [SpeciesId.RHYPERIOR, SpeciesId.SEISMITOAD, SpeciesId.MR_RIME], - TrainerSlot.TRAINER, - true, - p => { - p.abilityIndex = 1; // Solid Rock Rhyperior, Poison Touch Seismitoad, Screen Cleaner Mr. Rime - p.generateAndPopulateMoveset(); - }, - ), - ) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.DRAGAPULT])) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.RILLABOOM, SpeciesId.CINDERACE, SpeciesId.INTELEON])) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.ZACIAN], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.CHARIZARD], TrainerSlot.TRAINER, true, p => { - p.formIndex = 3; // G-Max Charizard - p.generateAndPopulateMoveset(); - p.generateName(); - p.gender = Gender.MALE; - p.setBoss(true, 2); - }), - ) - .setInstantTera(3), // Tera Grass Rillaboom, Fire Cinderace, Water Inteleon - [TrainerType.MUSTARD]: new TrainerConfig(++t) - .initForChampion(true) - .setMixedBattleBgm("battle_mustard") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.MIENSHAO], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.CORVIKNIGHT], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.GALAR_SLOWBRO, SpeciesId.GALAR_SLOWKING], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.abilityIndex = p.species.speciesId === SpeciesId.GALAR_SLOWBRO ? 0 : 2; // Quick Draw Galar Slowbro, Regenerator Galar Slowking - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.VENUSAUR, SpeciesId.BLASTOISE], TrainerSlot.TRAINER, true, p => { - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.KOMMO_O], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.URSHIFU], TrainerSlot.TRAINER, true, p => { - p.formIndex = randSeedIntRange(2, 3); // Random G-Max Urshifu form - p.generateName(); - p.gender = Gender.MALE; - p.pokeball = PokeballType.ULTRA_BALL; - p.setBoss(true, 2); - if (p.formIndex === 2) { - p.moveset[0] = new PokemonMove(MoveId.WICKED_BLOW); - p.moveset[1] = new PokemonMove(MoveId.BRICK_BREAK); - p.moveset[2] = new PokemonMove(randSeedItem([MoveId.FIRE_PUNCH, MoveId.THUNDER_PUNCH, MoveId.ICE_PUNCH])); - p.moveset[3] = new PokemonMove(MoveId.FOCUS_ENERGY); - } else if (p.formIndex === 3) { - p.moveset[0] = new PokemonMove(MoveId.SURGING_STRIKES); - p.moveset[1] = new PokemonMove(MoveId.BRICK_BREAK); - p.moveset[2] = new PokemonMove(randSeedItem([MoveId.FIRE_PUNCH, MoveId.THUNDER_PUNCH, MoveId.ICE_PUNCH])); - p.moveset[3] = new PokemonMove(MoveId.FOCUS_ENERGY); - } - }), - ) - .setInstantTera(4), // Tera Fighting Kommo-o - [TrainerType.GEETA]: new TrainerConfig(++t) - .initForChampion(false) - .setMixedBattleBgm("battle_champion_geeta") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.GLIMMORA], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.gender = Gender.MALE; - p.setBoss(true, 2); - }), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.ESPATHRA], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 0; // Opportunist - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.BAXCALIBUR])) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.CHESNAUGHT, SpeciesId.DELPHOX, SpeciesId.GRENINJA])) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.MIRAIDON], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.KINGAMBIT], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { - // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. - p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); - } - p.abilityIndex = 1; // Supreme Overlord - p.teraType = PokemonType.FLYING; - }), - ) - .setInstantTera(5), // Tera Flying Kingambit - [TrainerType.NEMONA]: new TrainerConfig(++t) - .initForChampion(false) - .setMixedBattleBgm("battle_champion_nemona") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.LYCANROC], TrainerSlot.TRAINER, true, p => { - p.formIndex = 0; // Midday form - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.PAWMOT])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.DUDUNSPARCE], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 0; // Serene Grace - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.ARMAROUGE, SpeciesId.CERULEDGE])) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.KORAIDON], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc( - [SpeciesId.MEOWSCARADA, SpeciesId.SKELEDIRGE, SpeciesId.QUAQUAVAL], - TrainerSlot.TRAINER, - true, - p => { - p.generateAndPopulateMoveset(); - p.gender = Gender.MALE; - p.setBoss(true, 2); - p.teraType = p.species.type2!; - }, - ), - ) - .setInstantTera(5), // Tera Dark Meowscarada, Ghost Skeledirge, Fighting Quaquaval - [TrainerType.KIERAN]: new TrainerConfig(++t) - .initForChampion(true) - .setMixedBattleBgm("battle_champion_kieran") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.POLIWRATH, SpeciesId.POLITOED])) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.INCINEROAR, SpeciesId.GRIMMSNARL], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.abilityIndex = p.species.speciesId === SpeciesId.INCINEROAR ? 2 : 0; // Intimidate Incineroar, Prankster Grimmsnarl - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.DRAGONITE], TrainerSlot.TRAINER, true, p => { - p.abilityIndex = 2; // Multiscale - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.URSALUNA, SpeciesId.BLOODMOON_URSALUNA], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.TERAPAGOS], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_STARSTORM)) { - // Check if Tera Starstorm is in the moveset, if not, replace the first move with Tera Starstorm. - p.moveset[0] = new PokemonMove(MoveId.TERA_STARSTORM); - } - p.pokeball = PokeballType.MASTER_BALL; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.HYDRAPPLE], TrainerSlot.TRAINER, true, p => { - p.gender = Gender.MALE; - p.setBoss(true, 2); - p.teraType = PokemonType.FIGHTING; - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { - // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. - p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); - } - }), - ) - .setInstantTera(5), // Tera Fighting Hydrapple - - [TrainerType.RIVAL]: new TrainerConfig((t = TrainerType.RIVAL)) - .setName("Finn") - .setHasGenders("Ivy") - .setHasCharSprite() - .setTitle("Rival") - .setStaticParty() - .setEncounterBgm(TrainerType.RIVAL) - .setBattleBgm("battle_rival") - .setMixedBattleBgm("battle_rival") - .setPartyTemplates(trainerPartyTemplates.RIVAL) - .setModifierRewardFuncs( - () => modifierTypes.SUPER_EXP_CHARM, - () => modifierTypes.EXP_SHARE, - ) - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc( - [ - SpeciesId.BULBASAUR, - SpeciesId.CHARMANDER, - SpeciesId.SQUIRTLE, - SpeciesId.CHIKORITA, - SpeciesId.CYNDAQUIL, - SpeciesId.TOTODILE, - SpeciesId.TREECKO, - SpeciesId.TORCHIC, - SpeciesId.MUDKIP, - SpeciesId.TURTWIG, - SpeciesId.CHIMCHAR, - SpeciesId.PIPLUP, - SpeciesId.SNIVY, - SpeciesId.TEPIG, - SpeciesId.OSHAWOTT, - SpeciesId.CHESPIN, - SpeciesId.FENNEKIN, - SpeciesId.FROAKIE, - SpeciesId.ROWLET, - SpeciesId.LITTEN, - SpeciesId.POPPLIO, - SpeciesId.GROOKEY, - SpeciesId.SCORBUNNY, - SpeciesId.SOBBLE, - SpeciesId.SPRIGATITO, - SpeciesId.FUECOCO, - SpeciesId.QUAXLY, - ], - TrainerSlot.TRAINER, - true, - p => (p.abilityIndex = 0), - ), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc( - [ - SpeciesId.PIDGEY, - SpeciesId.HOOTHOOT, - SpeciesId.TAILLOW, - SpeciesId.STARLY, - SpeciesId.PIDOVE, - SpeciesId.FLETCHLING, - SpeciesId.PIKIPEK, - SpeciesId.ROOKIDEE, - SpeciesId.WATTREL, - ], - TrainerSlot.TRAINER, - true, - ), - ), - [TrainerType.RIVAL_2]: new TrainerConfig(++t) - .setName("Finn") - .setHasGenders("Ivy") - .setHasCharSprite() - .setTitle("Rival") - .setStaticParty() - .setMoneyMultiplier(1.25) - .setEncounterBgm(TrainerType.RIVAL) - .setBattleBgm("battle_rival") - .setMixedBattleBgm("battle_rival") - .setPartyTemplates(trainerPartyTemplates.RIVAL_2) - .setModifierRewardFuncs(() => modifierTypes.EXP_SHARE) - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc( - [ - SpeciesId.IVYSAUR, - SpeciesId.CHARMELEON, - SpeciesId.WARTORTLE, - SpeciesId.BAYLEEF, - SpeciesId.QUILAVA, - SpeciesId.CROCONAW, - SpeciesId.GROVYLE, - SpeciesId.COMBUSKEN, - SpeciesId.MARSHTOMP, - SpeciesId.GROTLE, - SpeciesId.MONFERNO, - SpeciesId.PRINPLUP, - SpeciesId.SERVINE, - SpeciesId.PIGNITE, - SpeciesId.DEWOTT, - SpeciesId.QUILLADIN, - SpeciesId.BRAIXEN, - SpeciesId.FROGADIER, - SpeciesId.DARTRIX, - SpeciesId.TORRACAT, - SpeciesId.BRIONNE, - SpeciesId.THWACKEY, - SpeciesId.RABOOT, - SpeciesId.DRIZZILE, - SpeciesId.FLORAGATO, - SpeciesId.CROCALOR, - SpeciesId.QUAXWELL, - ], - TrainerSlot.TRAINER, - true, - p => (p.abilityIndex = 0), - ), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc( - [ - SpeciesId.PIDGEOTTO, - SpeciesId.HOOTHOOT, - SpeciesId.TAILLOW, - SpeciesId.STARAVIA, - SpeciesId.TRANQUILL, - SpeciesId.FLETCHINDER, - SpeciesId.TRUMBEAK, - SpeciesId.CORVISQUIRE, - SpeciesId.WATTREL, - ], - TrainerSlot.TRAINER, - true, - ), - ) - .setPartyMemberFunc( - 2, - getSpeciesFilterRandomPartyMemberFunc( - (species: PokemonSpecies) => - !pokemonEvolutions.hasOwnProperty(species.speciesId) - && !pokemonPrevolutions.hasOwnProperty(species.speciesId) - && species.baseTotal >= 450, - ), - ), - [TrainerType.RIVAL_3]: new TrainerConfig(++t) - .setName("Finn") - .setHasGenders("Ivy") - .setHasCharSprite() - .setTitle("Rival") - .setStaticParty() - .setMoneyMultiplier(1.5) - .setEncounterBgm(TrainerType.RIVAL) - .setBattleBgm("battle_rival") - .setMixedBattleBgm("battle_rival") - .setPartyTemplates(trainerPartyTemplates.RIVAL_3) - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc( - [ - SpeciesId.VENUSAUR, - SpeciesId.CHARIZARD, - SpeciesId.BLASTOISE, - SpeciesId.MEGANIUM, - SpeciesId.TYPHLOSION, - SpeciesId.FERALIGATR, - SpeciesId.SCEPTILE, - SpeciesId.BLAZIKEN, - SpeciesId.SWAMPERT, - SpeciesId.TORTERRA, - SpeciesId.INFERNAPE, - SpeciesId.EMPOLEON, - SpeciesId.SERPERIOR, - SpeciesId.EMBOAR, - SpeciesId.SAMUROTT, - SpeciesId.CHESNAUGHT, - SpeciesId.DELPHOX, - SpeciesId.GRENINJA, - SpeciesId.DECIDUEYE, - SpeciesId.INCINEROAR, - SpeciesId.PRIMARINA, - SpeciesId.RILLABOOM, - SpeciesId.CINDERACE, - SpeciesId.INTELEON, - SpeciesId.MEOWSCARADA, - SpeciesId.SKELEDIRGE, - SpeciesId.QUAQUAVAL, - ], - TrainerSlot.TRAINER, - true, - p => (p.abilityIndex = 0), - ), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc( - [ - SpeciesId.PIDGEOT, - SpeciesId.NOCTOWL, - SpeciesId.SWELLOW, - SpeciesId.STARAPTOR, - SpeciesId.UNFEZANT, - SpeciesId.TALONFLAME, - SpeciesId.TOUCANNON, - SpeciesId.CORVIKNIGHT, - SpeciesId.KILOWATTREL, - ], - TrainerSlot.TRAINER, - true, - ), - ) - .setPartyMemberFunc( - 2, - getSpeciesFilterRandomPartyMemberFunc( - (species: PokemonSpecies) => - !pokemonEvolutions.hasOwnProperty(species.speciesId) - && !pokemonPrevolutions.hasOwnProperty(species.speciesId) - && species.baseTotal >= 450, - ), - ) - .setSpeciesFilter(species => species.baseTotal >= 540), - [TrainerType.RIVAL_4]: new TrainerConfig(++t) - .setName("Finn") - .setHasGenders("Ivy") - .setHasCharSprite() - .setTitle("Rival") - .setBoss() - .setStaticParty() - .setMoneyMultiplier(1.75) - .setEncounterBgm(TrainerType.RIVAL) - .setBattleBgm("battle_rival_2") - .setMixedBattleBgm("battle_rival_2") - .setPartyTemplates(trainerPartyTemplates.RIVAL_4) - .setModifierRewardFuncs(() => modifierTypes.TERA_ORB) - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc( - [ - SpeciesId.VENUSAUR, - SpeciesId.CHARIZARD, - SpeciesId.BLASTOISE, - SpeciesId.MEGANIUM, - SpeciesId.TYPHLOSION, - SpeciesId.FERALIGATR, - SpeciesId.SCEPTILE, - SpeciesId.BLAZIKEN, - SpeciesId.SWAMPERT, - SpeciesId.TORTERRA, - SpeciesId.INFERNAPE, - SpeciesId.EMPOLEON, - SpeciesId.SERPERIOR, - SpeciesId.EMBOAR, - SpeciesId.SAMUROTT, - SpeciesId.CHESNAUGHT, - SpeciesId.DELPHOX, - SpeciesId.GRENINJA, - SpeciesId.DECIDUEYE, - SpeciesId.INCINEROAR, - SpeciesId.PRIMARINA, - SpeciesId.RILLABOOM, - SpeciesId.CINDERACE, - SpeciesId.INTELEON, - SpeciesId.MEOWSCARADA, - SpeciesId.SKELEDIRGE, - SpeciesId.QUAQUAVAL, - ], - TrainerSlot.TRAINER, - true, - p => { - p.abilityIndex = 0; - p.teraType = p.species.type1; - }, - ), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc( - [ - SpeciesId.PIDGEOT, - SpeciesId.NOCTOWL, - SpeciesId.SWELLOW, - SpeciesId.STARAPTOR, - SpeciesId.UNFEZANT, - SpeciesId.TALONFLAME, - SpeciesId.TOUCANNON, - SpeciesId.CORVIKNIGHT, - SpeciesId.KILOWATTREL, - ], - TrainerSlot.TRAINER, - true, - ), - ) - .setPartyMemberFunc( - 2, - getSpeciesFilterRandomPartyMemberFunc( - (species: PokemonSpecies) => - !pokemonEvolutions.hasOwnProperty(species.speciesId) - && !pokemonPrevolutions.hasOwnProperty(species.speciesId) - && species.baseTotal >= 450, - ), - ) - .setSpeciesFilter(species => species.baseTotal >= 540) - .setInstantTera(0), // Tera starter to primary type - [TrainerType.RIVAL_5]: new TrainerConfig(++t) - .setName("Finn") - .setHasGenders("Ivy") - .setHasCharSprite() - .setTitle("Rival") - .setBoss() - .setStaticParty() - .setMoneyMultiplier(2.25) - .setEncounterBgm(TrainerType.RIVAL) - .setBattleBgm("battle_rival_3") - .setMixedBattleBgm("battle_rival_3") - .setPartyTemplates(trainerPartyTemplates.RIVAL_5) - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc( - [ - SpeciesId.VENUSAUR, - SpeciesId.CHARIZARD, - SpeciesId.BLASTOISE, - SpeciesId.MEGANIUM, - SpeciesId.TYPHLOSION, - SpeciesId.FERALIGATR, - SpeciesId.SCEPTILE, - SpeciesId.BLAZIKEN, - SpeciesId.SWAMPERT, - SpeciesId.TORTERRA, - SpeciesId.INFERNAPE, - SpeciesId.EMPOLEON, - SpeciesId.SERPERIOR, - SpeciesId.EMBOAR, - SpeciesId.SAMUROTT, - SpeciesId.CHESNAUGHT, - SpeciesId.DELPHOX, - SpeciesId.GRENINJA, - SpeciesId.DECIDUEYE, - SpeciesId.INCINEROAR, - SpeciesId.PRIMARINA, - SpeciesId.RILLABOOM, - SpeciesId.CINDERACE, - SpeciesId.INTELEON, - SpeciesId.MEOWSCARADA, - SpeciesId.SKELEDIRGE, - SpeciesId.QUAQUAVAL, - ], - TrainerSlot.TRAINER, - true, - p => { - p.setBoss(true, 2); - p.abilityIndex = 0; - p.teraType = p.species.type1; - }, - ), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc( - [ - SpeciesId.PIDGEOT, - SpeciesId.NOCTOWL, - SpeciesId.SWELLOW, - SpeciesId.STARAPTOR, - SpeciesId.UNFEZANT, - SpeciesId.TALONFLAME, - SpeciesId.TOUCANNON, - SpeciesId.CORVIKNIGHT, - SpeciesId.KILOWATTREL, - ], - TrainerSlot.TRAINER, - true, - ), - ) - .setPartyMemberFunc( - 2, - getSpeciesFilterRandomPartyMemberFunc( - (species: PokemonSpecies) => - !pokemonEvolutions.hasOwnProperty(species.speciesId) - && !pokemonPrevolutions.hasOwnProperty(species.speciesId) - && species.baseTotal >= 450, - ), - ) - .setSpeciesFilter(species => species.baseTotal >= 540) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.RAYQUAZA], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 3); - p.pokeball = PokeballType.MASTER_BALL; - p.shiny = timedEventManager.getClassicTrainerShinyChance() === 0; - p.variant = 1; - }), - ) - .setInstantTera(0), // Tera starter to primary type - [TrainerType.RIVAL_6]: new TrainerConfig(++t) - .setName("Finn") - .setHasGenders("Ivy") - .setHasCharSprite() - .setTitle("Rival") - .setBoss() - .setStaticParty() - .setMoneyMultiplier(3) - .setEncounterBgm("final") - .setBattleBgm("battle_rival_3") - .setMixedBattleBgm("battle_rival_3") - .setPartyTemplates(trainerPartyTemplates.RIVAL_6) - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc( - [ - SpeciesId.VENUSAUR, - SpeciesId.CHARIZARD, - SpeciesId.BLASTOISE, - SpeciesId.MEGANIUM, - SpeciesId.TYPHLOSION, - SpeciesId.FERALIGATR, - SpeciesId.SCEPTILE, - SpeciesId.BLAZIKEN, - SpeciesId.SWAMPERT, - SpeciesId.TORTERRA, - SpeciesId.INFERNAPE, - SpeciesId.EMPOLEON, - SpeciesId.SERPERIOR, - SpeciesId.EMBOAR, - SpeciesId.SAMUROTT, - SpeciesId.CHESNAUGHT, - SpeciesId.DELPHOX, - SpeciesId.GRENINJA, - SpeciesId.DECIDUEYE, - SpeciesId.INCINEROAR, - SpeciesId.PRIMARINA, - SpeciesId.RILLABOOM, - SpeciesId.CINDERACE, - SpeciesId.INTELEON, - SpeciesId.MEOWSCARADA, - SpeciesId.SKELEDIRGE, - SpeciesId.QUAQUAVAL, - ], - TrainerSlot.TRAINER, - true, - p => { - p.setBoss(true, 3); - p.abilityIndex = 0; - p.teraType = p.species.type1; - p.generateAndPopulateMoveset(); - }, - ), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc( - [ - SpeciesId.PIDGEOT, - SpeciesId.NOCTOWL, - SpeciesId.SWELLOW, - SpeciesId.STARAPTOR, - SpeciesId.UNFEZANT, - SpeciesId.TALONFLAME, - SpeciesId.TOUCANNON, - SpeciesId.CORVIKNIGHT, - SpeciesId.KILOWATTREL, - ], - TrainerSlot.TRAINER, - true, - p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }, - ), - ) - .setPartyMemberFunc( - 2, - getSpeciesFilterRandomPartyMemberFunc( - (species: PokemonSpecies) => - !pokemonEvolutions.hasOwnProperty(species.speciesId) - && !pokemonPrevolutions.hasOwnProperty(species.speciesId) - && species.baseTotal >= 450, - ), - ) - .setSpeciesFilter(species => species.baseTotal >= 540) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.RAYQUAZA], TrainerSlot.TRAINER, true, p => { - p.setBoss(); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - p.shiny = timedEventManager.getClassicTrainerShinyChance() === 0; - p.variant = 1; - p.formIndex = 1; // Mega Rayquaza - p.generateName(); - }), - ) - .setInstantTera(0), // Tera starter to primary type - - [TrainerType.ROCKET_BOSS_GIOVANNI_1]: new TrainerConfig((t = TrainerType.ROCKET_BOSS_GIOVANNI_1)) - .setName("Giovanni") - .initForEvilTeamLeader("Rocket Boss", []) - .setMixedBattleBgm("battle_rocket_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.PERSIAN], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.gender = Gender.MALE; - }), - ) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.DUGTRIO, SpeciesId.ALOLA_DUGTRIO])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.HONCHKROW])) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.NIDOQUEEN, SpeciesId.NIDOKING])) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.KANGASKHAN], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.formIndex = 1; // Mega Kangaskhan - p.generateName(); - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.RHYPERIOR], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.abilityIndex = 1; // Solid Rock - p.setBoss(true, 2); - }), - ), - [TrainerType.ROCKET_BOSS_GIOVANNI_2]: new TrainerConfig(++t) - .setName("Giovanni") - .initForEvilTeamLeader("Rocket Boss", [], true) - .setMixedBattleBgm("battle_rocket_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.RHYPERIOR], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.abilityIndex = 1; // Solid Rock - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.NIDOKING, SpeciesId.NIDOQUEEN], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.abilityIndex = 2; // Sheer Force - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.HONCHKROW], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.SUCKER_PUNCH)) { - // Check if Sucker Punch is in the moveset, if not, replace the third move with Sucker Punch. - p.moveset[2] = new PokemonMove(MoveId.SUCKER_PUNCH); - } - }), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.KANGASKHAN], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.formIndex = 1; // Mega Kangaskhan - p.generateName(); - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc( - [SpeciesId.ARTICUNO, SpeciesId.ZAPDOS, SpeciesId.MOLTRES], - TrainerSlot.TRAINER, - true, - p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.abilityIndex = 2; // Snow Cloak Articuno, Static Zapdos, Flame Body Moltres - p.setBoss(true, 2); - }, - ), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.MEWTWO], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ), - [TrainerType.MAXIE]: new TrainerConfig(++t) - .setName("Maxie") - .initForEvilTeamLeader("Magma Boss", []) - .setMixedBattleBgm("battle_aqua_magma_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.TORKOAL], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.abilityIndex = 1; // Drought - }), - ) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.SOLROCK])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.WEEZING, SpeciesId.GALAR_WEEZING])) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.SCOVILLAIN], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.abilityIndex = 0; // Chlorophyll - }), - ) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.DONPHAN])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.CAMERUPT], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.formIndex = 1; // Mega Camerupt - p.generateName(); - p.gender = Gender.MALE; - }), - ), - [TrainerType.MAXIE_2]: new TrainerConfig(++t) - .setName("Maxie") - .initForEvilTeamLeader("Magma Boss", [], true) - .setMixedBattleBgm("battle_aqua_magma_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.TYPHLOSION, SpeciesId.SOLROCK], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.NINETALES, SpeciesId.TORKOAL], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - if (p.species.speciesId === SpeciesId.NINETALES) { - p.abilityIndex = 2; // Drought - } else if (p.species.speciesId === SpeciesId.TORKOAL) { - p.abilityIndex = 1; // Drought - } - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.SCOVILLAIN], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.abilityIndex = 0; // Chlorophyll - }), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.GREAT_TUSK], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ROGUE_BALL; - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.CAMERUPT], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.formIndex = 1; // Mega Camerupt - p.generateName(); - p.gender = Gender.MALE; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.GROUDON], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ), - [TrainerType.ARCHIE]: new TrainerConfig(++t) - .setName("Archie") - .initForEvilTeamLeader("Aqua Boss", []) - .setMixedBattleBgm("battle_aqua_magma_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.PELIPPER], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.abilityIndex = 1; // Drizzle - }), - ) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.WAILORD])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.MUK, SpeciesId.ALOLA_MUK])) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.LUDICOLO])) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.QWILFISH], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.abilityIndex = 1; // Swift Swim - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.SHARPEDO], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.formIndex = 1; // Mega Sharpedo - p.generateName(); - p.gender = Gender.MALE; - }), - ), - [TrainerType.ARCHIE_2]: new TrainerConfig(++t) - .setName("Archie") - .initForEvilTeamLeader("Aqua Boss", [], true) - .setMixedBattleBgm("battle_aqua_magma_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.LUDICOLO, SpeciesId.EMPOLEON], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.POLITOED, SpeciesId.PELIPPER], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - if (p.species.speciesId === SpeciesId.POLITOED) { - p.abilityIndex = 2; // Drizzle - } else if (p.species.speciesId === SpeciesId.PELIPPER) { - p.abilityIndex = 1; // Drizzle - } - }), - ) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.DHELMISE])) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.OVERQWIL], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.abilityIndex = 1; // Swift Swim - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.SHARPEDO], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.formIndex = 1; // Mega Sharpedo - p.generateName(); - p.gender = Gender.MALE; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.KYOGRE], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ), - [TrainerType.CYRUS]: new TrainerConfig(++t) - .setName("Cyrus") - .initForEvilTeamLeader("Galactic Boss", []) - .setMixedBattleBgm("battle_galactic_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.GYARADOS])) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.CROBAT, SpeciesId.HONCHKROW])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.MAGNEZONE])) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.UXIE, SpeciesId.MESPRIT, SpeciesId.AZELF])) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.HOUNDOOM], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.WEAVILE], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.gender = Gender.MALE; - }), - ), - [TrainerType.CYRUS_2]: new TrainerConfig(++t) - .setName("Cyrus") - .initForEvilTeamLeader("Galactic Boss", [], true) - .setMixedBattleBgm("battle_galactic_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.CROBAT, SpeciesId.HONCHKROW], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.MAGNEZONE])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.UXIE, SpeciesId.MESPRIT, SpeciesId.AZELF], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ROGUE_BALL; - }), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.HOUNDOOM], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.formIndex = 1; // Mega Houndoom - p.generateName(); - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.WEAVILE], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.gender = Gender.MALE; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.DIALGA, SpeciesId.PALKIA], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ), - [TrainerType.GHETSIS]: new TrainerConfig(++t) - .setName("Ghetsis") - .initForEvilTeamLeader("Plasma Boss", []) - .setMixedBattleBgm("battle_plasma_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.COFAGRIGUS])) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.SEISMITOAD])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.GALVANTULA, SpeciesId.EELEKTROSS])) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.DRAPION, SpeciesId.TOXICROAK])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.KINGAMBIT])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.HYDREIGON], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.gender = Gender.MALE; - }), - ), - [TrainerType.GHETSIS_2]: new TrainerConfig(++t) - .setName("Ghetsis") - .initForEvilTeamLeader("Plasma Boss", [], true) - .setMixedBattleBgm("battle_plasma_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.RUNERIGUS], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - }), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.JELLICENT, SpeciesId.BASCULEGION], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.gender = Gender.MALE; - p.formIndex = 0; - }), - ) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.KINGAMBIT])) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.VOLCARONA, SpeciesId.IRON_MOTH], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ROGUE_BALL; - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.HYDREIGON, SpeciesId.IRON_JUGULIS], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - if (p.species.speciesId === SpeciesId.HYDREIGON) { - p.gender = Gender.MALE; - } else if (p.species.speciesId === SpeciesId.IRON_JUGULIS) { - p.gender = Gender.GENDERLESS; - } - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.KYUREM], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ), - [TrainerType.LYSANDRE]: new TrainerConfig(++t) - .setName("Lysandre") - .initForEvilTeamLeader("Flare Boss", []) - .setMixedBattleBgm("battle_flare_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.MIENSHAO])) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.HONCHKROW, SpeciesId.TALONFLAME])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.PYROAR], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.gender = Gender.MALE; - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.MALAMAR])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.AEGISLASH, SpeciesId.HISUI_GOODRA])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.GYARADOS], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.formIndex = 1; // Mega Gyarados - p.generateName(); - p.gender = Gender.MALE; - }), - ), - [TrainerType.LYSANDRE_2]: new TrainerConfig(++t) - .setName("Lysandre") - .initForEvilTeamLeader("Flare Boss", [], true) - .setMixedBattleBgm("battle_flare_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.PYROAR], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.gender = Gender.MALE; - }), - ) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.MIENSHAO])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.AEGISLASH, SpeciesId.HISUI_GOODRA])) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.VOLCANION], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ROGUE_BALL; - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.GYARADOS], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.formIndex = 1; // Mega Gyarados - p.generateName(); - p.gender = Gender.MALE; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.ZYGARDE], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - p.formIndex = 0; // 50% Forme, Aura Break - }), - ), - [TrainerType.LUSAMINE]: new TrainerConfig(++t) - .setName("Lusamine") - .initForEvilTeamLeader("Aether Boss", []) - .setMixedBattleBgm("battle_aether_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.CLEFABLE], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.gender = Gender.FEMALE; - }), - ) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.LILLIGANT])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.MILOTIC])) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GALAR_SLOWBRO, SpeciesId.GALAR_SLOWKING])) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.BEWEAR, SpeciesId.LOPUNNY])) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.NIHILEGO], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ROGUE_BALL; - }), - ), - [TrainerType.LUSAMINE_2]: new TrainerConfig(++t) - .setName("Lusamine") - .initForEvilTeamLeader("Aether Boss", [], true) - .setMixedBattleBgm("battle_aether_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.CLEFABLE], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.gender = Gender.FEMALE; - }), - ) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.MILOTIC, SpeciesId.LILLIGANT])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.SILVALLY], TrainerSlot.TRAINER, true, p => { - p.formIndex = randSeedInt(18); // Random Silvally Form - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ROGUE_BALL; - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.MULTI_ATTACK)) { - // Check if Multi Attack is in the moveset, if not, replace the first move with Multi Attack. - p.moveset[0] = new PokemonMove(MoveId.MULTI_ATTACK); - } - }), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.PHEROMOSA], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ROGUE_BALL; - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.NIHILEGO], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ROGUE_BALL; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.NECROZMA], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.formIndex = 2; // Dawn Wings - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ), - [TrainerType.GUZMA]: new TrainerConfig(++t) - .setName("Guzma") - .initForEvilTeamLeader("Skull Boss", []) - .setMixedBattleBgm("battle_skull_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.YANMEGA, SpeciesId.LOKIX], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - if (p.species.speciesId === SpeciesId.YANMEGA) { - p.abilityIndex = 1; // Tinted Lens - } else if (p.species.speciesId === SpeciesId.LOKIX) { - p.abilityIndex = 2; // Tinted Lens - } - }), - ) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.HERACROSS])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.SCIZOR, SpeciesId.KLEAVOR], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - if (p.species.speciesId === SpeciesId.SCIZOR) { - p.abilityIndex = 1; // Technician - } else if (p.species.speciesId === SpeciesId.KLEAVOR) { - p.abilityIndex = 2; // Sharpness - } - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GALVANTULA, SpeciesId.VIKAVOLT])) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.PINSIR], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.formIndex = 1; // Mega Pinsir - p.pokeball = PokeballType.ULTRA_BALL; - p.generateName(); - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.GOLISOPOD], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.FIRST_IMPRESSION)) { - // Check if First Impression is in the moveset, if not, replace the third move with First Impression. - p.moveset[2] = new PokemonMove(MoveId.FIRST_IMPRESSION); - p.gender = Gender.MALE; - } - }), - ), - [TrainerType.GUZMA_2]: new TrainerConfig(++t) - .setName("Guzma") - .initForEvilTeamLeader("Skull Boss", [], true) - .setMixedBattleBgm("battle_skull_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.GOLISOPOD], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.FIRST_IMPRESSION)) { - // Check if First Impression is in the moveset, if not, replace the third move with First Impression. - p.moveset[2] = new PokemonMove(MoveId.FIRST_IMPRESSION); - p.abilityIndex = 2; // Anticipation - p.gender = Gender.MALE; - } - }), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.BUZZWOLE], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ROGUE_BALL; - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.CRAWDAUNT, SpeciesId.HISUI_SAMUROTT], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.abilityIndex = 2; // Sharpness Hisuian Samurott, Adaptability Crawdaunt - }), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.XURKITREE], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ROGUE_BALL; - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.GENESECT], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ROGUE_BALL; - p.formIndex = randSeedInt(4, 1); // Shock, Burn, Chill, or Douse Drive - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TECHNO_BLAST)) { - // Check if Techno Blast is in the moveset, if not, replace the third move with Techno Blast. - p.moveset[2] = new PokemonMove(MoveId.TECHNO_BLAST); - } - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.PINSIR], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.formIndex = 1; // Mega Pinsir - p.generateAndPopulateMoveset(); - p.generateName(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ), - [TrainerType.ROSE]: new TrainerConfig(++t) - .setName("Rose") - .initForEvilTeamLeader("Macro Boss", []) - .setMixedBattleBgm("battle_macro_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.ARCHALUDON], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.ESCAVALIER, SpeciesId.FERROTHORN], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.SIRFETCHD, SpeciesId.MR_RIME], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.CORVIKNIGHT], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.KLINKLANG, SpeciesId.PERRSERKER], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.COPPERAJAH], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.formIndex = 1; // G-Max Copperajah - p.generateName(); - p.pokeball = PokeballType.ULTRA_BALL; - p.gender = Gender.FEMALE; - }), - ), - [TrainerType.ROSE_2]: new TrainerConfig(++t) - .setName("Rose") - .initForEvilTeamLeader("Macro Boss", [], true) - .setMixedBattleBgm("battle_macro_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.ARCHALUDON], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.CORVIKNIGHT])) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.DRACOZOLT, SpeciesId.DRACOVISH], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - p.abilityIndex = 1; // Strong Jaw Dracovish, Hustle Dracozolt - }), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.MELMETAL], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.COPPERAJAH], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.formIndex = 1; // G-Max Copperajah - p.generateName(); - p.pokeball = PokeballType.ULTRA_BALL; - p.gender = Gender.FEMALE; - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc( - [SpeciesId.GALAR_ARTICUNO, SpeciesId.GALAR_ZAPDOS, SpeciesId.GALAR_MOLTRES], - TrainerSlot.TRAINER, - true, - p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }, - ), - ), - [TrainerType.PENNY]: new TrainerConfig(++t) - .setName("Cassiopeia") - .initForEvilTeamLeader("Star Boss", []) - .setMixedBattleBgm("battle_star_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.ESPEON])) - .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.UMBREON])) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.LEAFEON, SpeciesId.GLACEON])) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.VAPOREON, SpeciesId.FLAREON, SpeciesId.JOLTEON])) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.SYLVEON], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.abilityIndex = 2; // Pixilate - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.HYPER_VOICE)) { - // Check if Hyper Voice is in the moveset, if not, replace the second move with Hyper Voice. - p.moveset[1] = new PokemonMove(MoveId.HYPER_VOICE); - p.gender = Gender.FEMALE; - } - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.EEVEE], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.formIndex = 2; // G-Max Eevee - p.pokeball = PokeballType.ULTRA_BALL; - p.generateName(); - }), - ) - .setInstantTera(4), // Tera Fairy Sylveon - [TrainerType.PENNY_2]: new TrainerConfig(++t) - .setName("Cassiopeia") - .initForEvilTeamLeader("Star Boss", [], true) - .setMixedBattleBgm("battle_star_boss") - .setVictoryBgm("victory_team_plasma") - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.SYLVEON], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.abilityIndex = 2; // Pixilate - p.generateAndPopulateMoveset(); - if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.HYPER_VOICE)) { - // Check if Hyper Voice is in the moveset, if not, replace the second move with Hyper Voice. - p.moveset[1] = new PokemonMove(MoveId.HYPER_VOICE); - p.gender = Gender.FEMALE; - } - }), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.ROTOM], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.formIndex = randSeedInt(5, 1); // Heat, Wash, Frost, Fan, or Mow - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.ESPEON, SpeciesId.UMBREON], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.abilityIndex = p.species.speciesId === SpeciesId.UMBREON ? 0 : 2; // Synchronize Umbreon, Magic Bounce Espeon - }), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc( - [SpeciesId.WALKING_WAKE, SpeciesId.GOUGING_FIRE, SpeciesId.RAGING_BOLT], - TrainerSlot.TRAINER, - true, - p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ROGUE_BALL; - }, - ), - ) - .setPartyMemberFunc( - 4, - getRandomPartyMemberFunc([SpeciesId.REVAVROOM], TrainerSlot.TRAINER, true, p => { - p.formIndex = randSeedInt(5, 1); // Random Starmobile form - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ROGUE_BALL; - p.setBoss(true, 2); - }), - ) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.EEVEE], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.formIndex = 2; - p.generateName(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setInstantTera(0), // Tera Fairy Sylveon - - [TrainerType.BUCK]: new TrainerConfig(++t) - .setName("Buck") - .initForStatTrainer(true) - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.CLAYDOL], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 3); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.VENUSAUR, SpeciesId.COALOSSAL], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.GREAT_BALL; - if (p.species.speciesId === SpeciesId.VENUSAUR) { - p.formIndex = 2; // Gmax - p.abilityIndex = 2; // Venusaur gets Chlorophyll - } else { - p.formIndex = 1; // Gmax - } - p.generateName(); - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.AGGRON], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.formIndex = 1; // Mega - p.generateName(); - }), - ) - .setPartyMemberFunc( - 3, - getRandomPartyMemberFunc([SpeciesId.TORKOAL], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.abilityIndex = 1; // Drought - }), - ) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.GREAT_TUSK], TrainerSlot.TRAINER, true)) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.HEATRAN], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ), - [TrainerType.CHERYL]: new TrainerConfig(++t) - .setName("Cheryl") - .initForStatTrainer() - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.BLISSEY], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 3); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.SNORLAX, SpeciesId.LAPRAS], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.GREAT_BALL; - p.formIndex = 1; // Gmax - p.generateName(); - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.AUDINO], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.formIndex = 1; // Mega - p.generateName(); - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GOODRA], TrainerSlot.TRAINER, true)) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.IRON_HANDS], TrainerSlot.TRAINER, true)) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.CRESSELIA, SpeciesId.ENAMORUS], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - if (p.species.speciesId === SpeciesId.ENAMORUS) { - p.formIndex = 1; // Therian - p.generateName(); - } - p.pokeball = PokeballType.MASTER_BALL; - }), - ), - [TrainerType.MARLEY]: new TrainerConfig(++t) - .setName("Marley") - .initForStatTrainer() - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.ARCANINE], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 3); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.ULTRA_BALL; - }), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.CINDERACE, SpeciesId.INTELEON], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.GREAT_BALL; - p.formIndex = 1; // Gmax - p.generateName(); - }), - ) - .setPartyMemberFunc( - 2, - getRandomPartyMemberFunc([SpeciesId.AERODACTYL], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.formIndex = 1; // Mega - p.generateName(); - }), - ) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.DRAGAPULT], TrainerSlot.TRAINER, true)) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.IRON_BUNDLE], TrainerSlot.TRAINER, true)) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.REGIELEKI], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ), - [TrainerType.MIRA]: new TrainerConfig(++t) - .setName("Mira") - .initForStatTrainer() - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.ALAKAZAM], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.formIndex = 1; - p.pokeball = PokeballType.ULTRA_BALL; - p.generateName(); - }), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.GENGAR, SpeciesId.HATTERENE], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.GREAT_BALL; - p.formIndex = p.species.speciesId === SpeciesId.GENGAR ? 2 : 1; // Gmax - p.generateName(); - }), - ) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.FLUTTER_MANE], TrainerSlot.TRAINER, true)) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.HYDREIGON], TrainerSlot.TRAINER, true)) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.MAGNEZONE], TrainerSlot.TRAINER, true)) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.LATIOS, SpeciesId.LATIAS], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.MASTER_BALL; - }), - ), - [TrainerType.RILEY]: new TrainerConfig(++t) - .setName("Riley") - .initForStatTrainer(true) - .setPartyMemberFunc( - 0, - getRandomPartyMemberFunc([SpeciesId.LUCARIO], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - p.formIndex = 1; - p.pokeball = PokeballType.ULTRA_BALL; - p.generateName(); - }), - ) - .setPartyMemberFunc( - 1, - getRandomPartyMemberFunc([SpeciesId.RILLABOOM, SpeciesId.CENTISKORCH], TrainerSlot.TRAINER, true, p => { - p.generateAndPopulateMoveset(); - p.pokeball = PokeballType.GREAT_BALL; - p.formIndex = 1; // Gmax - p.generateName(); - }), - ) - .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.TYRANITAR], TrainerSlot.TRAINER, true)) - .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.ROARING_MOON], TrainerSlot.TRAINER, true)) - .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.URSALUNA], TrainerSlot.TRAINER, true)) - .setPartyMemberFunc( - 5, - getRandomPartyMemberFunc([SpeciesId.REGIGIGAS, SpeciesId.LANDORUS], TrainerSlot.TRAINER, true, p => { - p.setBoss(true, 2); - p.generateAndPopulateMoveset(); - if (p.species.speciesId === SpeciesId.LANDORUS) { - p.formIndex = 1; // Therian - p.generateName(); - } - p.pokeball = PokeballType.MASTER_BALL; - }), - ), - [TrainerType.VICTOR]: new TrainerConfig(++t) - .setTitle("The Winstrates") - .setLocalizedName("Victor") - .setMoneyMultiplier(1) // The Winstrate trainers have total money multiplier of 6 - .setPartyTemplates(trainerPartyTemplates.ONE_AVG_ONE_STRONG), - [TrainerType.VICTORIA]: new TrainerConfig(++t) - .setTitle("The Winstrates") - .setLocalizedName("Victoria") - .setMoneyMultiplier(1) - .setPartyTemplates(trainerPartyTemplates.ONE_AVG_ONE_STRONG), - [TrainerType.VIVI]: new TrainerConfig(++t) - .setTitle("The Winstrates") - .setLocalizedName("Vivi") - .setMoneyMultiplier(1) - .setPartyTemplates(trainerPartyTemplates.TWO_AVG_ONE_STRONG), - [TrainerType.VICKY]: new TrainerConfig(++t) - .setTitle("The Winstrates") - .setLocalizedName("Vicky") - .setMoneyMultiplier(1) - .setPartyTemplates(trainerPartyTemplates.ONE_AVG), - [TrainerType.VITO]: new TrainerConfig(++t) - .setTitle("The Winstrates") - .setLocalizedName("Vito") - .setMoneyMultiplier(2) - .setPartyTemplates( - new TrainerPartyCompoundTemplate( - new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE), - new TrainerPartyTemplate(2, PartyMemberStrength.STRONG), - ), - ), - [TrainerType.BUG_TYPE_SUPERFAN]: new TrainerConfig(++t) - .setMoneyMultiplier(2.25) - .setEncounterBgm(TrainerType.ACE_TRAINER) - .setPartyTemplates(new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE)), - [TrainerType.EXPERT_POKEMON_BREEDER]: new TrainerConfig(++t) - .setMoneyMultiplier(3) - .setEncounterBgm(TrainerType.ACE_TRAINER) - .setLocalizedName("Expert Pokemon Breeder") - .setPartyTemplates(new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE)), - [TrainerType.FUTURE_SELF_M]: new TrainerConfig(++t) - .setMoneyMultiplier(0) - .setEncounterBgm("mystery_encounter_weird_dream") - .setBattleBgm("mystery_encounter_weird_dream") - .setMixedBattleBgm("mystery_encounter_weird_dream") - .setVictoryBgm("mystery_encounter_weird_dream") - .setLocalizedName("Future Self M") - .setPartyTemplates(new TrainerPartyTemplate(6, PartyMemberStrength.STRONG)), - [TrainerType.FUTURE_SELF_F]: new TrainerConfig(++t) - .setMoneyMultiplier(0) - .setEncounterBgm("mystery_encounter_weird_dream") - .setBattleBgm("mystery_encounter_weird_dream") - .setMixedBattleBgm("mystery_encounter_weird_dream") - .setVictoryBgm("mystery_encounter_weird_dream") - .setLocalizedName("Future Self F") - .setPartyTemplates(new TrainerPartyTemplate(6, PartyMemberStrength.STRONG)), + ... eliteFourTrainers, + ... championTrainers, + ... rivalTrainer, + ... evilAdminTrainers, + ... mysteryEventTrainers, }; diff --git a/src/data/trainers/trainers-init/champion-trainers.ts b/src/data/trainers/trainers-init/champion-trainers.ts new file mode 100644 index 00000000000..16f9bf9c53b --- /dev/null +++ b/src/data/trainers/trainers-init/champion-trainers.ts @@ -0,0 +1,746 @@ +import { Gender } from "#data/gender"; +import { MoveId } from "#enums/move-id"; +import { PokeballType } from "#enums/pokeball"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { TrainerSlot } from "#enums/trainer-slot"; +import { TrainerType } from "#enums/trainer-type"; +import { PokemonMove } from "#moves/pokemon-move"; +import { TrainerConfig, getRandomPartyMemberFunc, nextTrainerId, setTrainerId } from "#trainers/trainer-config"; +import { TrainerConfigs } from "#types/trainer-funcs"; +import { randSeedIntRange, randSeedItem } from "#utils/common"; +import { t } from "i18next"; +import { isNullOrUndefined } from "util"; + + +export const championTrainers: TrainerConfigs = { + //Kanto Johto Champions + [TrainerType.BLUE]: new TrainerConfig(setTrainerId(TrainerType.BLUE)) + .initForChampion(true) + .setBattleBgm("battle_kanto_champion") + .setMixedBattleBgm("battle_kanto_champion") + .setHasDouble("blue_red_double") + .setDoubleTrainerType(TrainerType.RED) + .setDoubleTitle("champion_double") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.ALAKAZAM])) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc( + [SpeciesId.ARCANINE, SpeciesId.EXEGGUTOR, SpeciesId.GYARADOS], + TrainerSlot.TRAINER, + true, + p => { + p.generateAndPopulateMoveset(); + p.teraType = p.species.type1; + }, + ), + ) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.RHYPERIOR, SpeciesId.ELECTIVIRE])) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.MACHAMP])) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.HO_OH], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + p.abilityIndex = 2; // Regenerator + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.PIDGEOT], TrainerSlot.TRAINER, true, p => { + p.formIndex = 1; // Mega Pidgeot + p.generateAndPopulateMoveset(); + p.generateName(); + p.gender = Gender.MALE; + p.setBoss(true, 2); + }), + ) + .setInstantTera(1), // Tera Fire Arcanine, Tera Grass Exeggutor, Tera Water Gyarados + [TrainerType.RED]: new TrainerConfig(nextTrainerId()) + .initForChampion(true) + .setBattleBgm("battle_johto_champion") + .setMixedBattleBgm("battle_johto_champion") + .setHasDouble("red_blue_double") + .setDoubleTrainerType(TrainerType.BLUE) + .setDoubleTitle("champion_double") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.PIKACHU], TrainerSlot.TRAINER, true, p => { + p.formIndex = 1; // Partner Pikachu + p.gender = Gender.MALE; + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.VOLT_TACKLE)) { + // Check if Volt Tackle is in the moveset, if not, replace the first move with Volt Tackle. + p.moveset[0] = new PokemonMove(MoveId.VOLT_TACKLE); + } + }), + ) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.MEGANIUM, SpeciesId.TYPHLOSION, SpeciesId.FERALIGATR])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.ESPEON, SpeciesId.UMBREON, SpeciesId.SYLVEON])) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.SNORLAX])) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.LUGIA], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + p.abilityIndex = 2; // Multiscale + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc( + [SpeciesId.VENUSAUR, SpeciesId.CHARIZARD, SpeciesId.BLASTOISE], + TrainerSlot.TRAINER, + true, + p => { + p.formIndex = 1; // Mega Venusaur, Mega Charizard X, or Mega Blastoise + p.generateAndPopulateMoveset(); + p.generateName(); + p.gender = Gender.MALE; + p.setBoss(true, 2); + }, + ), + ) + .setInstantTera(0), // Tera Electric Pikachu + [TrainerType.LANCE_CHAMPION]: new TrainerConfig(nextTrainerId()) + .setName("Lance") + .initForChampion(true) + .setBattleBgm("battle_johto_champion") + .setMixedBattleBgm("battle_johto_champion") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.GYARADOS, SpeciesId.KINGDRA])) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.AERODACTYL])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.CHARIZARD])) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc( + [SpeciesId.TYRANITAR, SpeciesId.GARCHOMP, SpeciesId.HYDREIGON], + TrainerSlot.TRAINER, + true, + p => { + p.abilityIndex = 2; // Unnerve Tyranitar, Rough Skin Garchomp, Levitate Hydreigon + p.generateAndPopulateMoveset(); + }, + ), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.SALAMENCE], TrainerSlot.TRAINER, true, p => { + p.formIndex = 1; // Mega Salamence + p.generateAndPopulateMoveset(); + p.generateName(); + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.DRAGONITE], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.abilityIndex = 2; // Multiscale + p.gender = Gender.MALE; + p.setBoss(true, 2); + p.teraType = PokemonType.DRAGON; + }), + ) + .setInstantTera(5), // Tera Dragon Dragonite + + // Hoenn Champion + [TrainerType.STEVEN]: new TrainerConfig(nextTrainerId()) + .initForChampion(true) + .setBattleBgm("battle_hoenn_champion_g5") + .setMixedBattleBgm("battle_hoenn_champion_g6") + .setHasDouble("steven_wallace_double") + .setDoubleTrainerType(TrainerType.WALLACE) + .setDoubleTitle("champion_double") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.GIGALITH], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 1; // Sand Stream + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.SKARMORY, SpeciesId.CLAYDOL])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.AGGRON])) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.GOLURK, SpeciesId.RUNERIGUS], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 0; // Iron Fist Golurk, Wandering Spirit Runerigus + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc( + [SpeciesId.REGIROCK, SpeciesId.REGICE, SpeciesId.REGISTEEL], + TrainerSlot.TRAINER, + true, + p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }, + ), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.METAGROSS], TrainerSlot.TRAINER, true, p => { + p.formIndex = 1; // Mega Metagross + p.generateAndPopulateMoveset(); + p.generateName(); + p.setBoss(true, 2); + }), + ) + .setInstantTera(4), // Tera Rock Regirock / Ice Regice / Steel Registeel + [TrainerType.WALLACE]: new TrainerConfig(nextTrainerId()) + .initForChampion(true) + .setBattleBgm("battle_hoenn_champion_g5") + .setMixedBattleBgm("battle_hoenn_champion_g6") + .setHasDouble("wallace_steven_double") + .setDoubleTrainerType(TrainerType.STEVEN) + .setDoubleTitle("champion_double") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.PELIPPER], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 1; // Drizzle + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.LUDICOLO], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 0; // Swift Swim + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.TENTACRUEL, SpeciesId.WALREIN], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = p.species.speciesId === SpeciesId.TENTACRUEL ? 2 : 0; // Rain Dish Tentacruel, Thick Fat Walrein + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.LATIAS, SpeciesId.LATIOS], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.generateName(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.SWAMPERT], TrainerSlot.TRAINER, true, p => { + p.formIndex = 1; // Mega Swampert + p.generateAndPopulateMoveset(); + p.generateName(); + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.MILOTIC], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.gender = Gender.FEMALE; + p.setBoss(true, 2); + }), + ) + .setInstantTera(5), // Tera Water Milotic + + // Sinnoh Champion + [TrainerType.CYNTHIA]: new TrainerConfig(nextTrainerId()) + .initForChampion(false) + .setBattleBgm("battle_sinnoh_champion") + .setMixedBattleBgm("battle_sinnoh_champion") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.SPIRITOMB])) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.MILOTIC, SpeciesId.ROSERADE, SpeciesId.HISUI_ARCANINE])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.TOGEKISS], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.teraType = p.species.type1; + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.LUCARIO])) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.GIRATINA], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.GARCHOMP], TrainerSlot.TRAINER, true, p => { + p.formIndex = 1; // Mega Garchomp + p.generateAndPopulateMoveset(); + p.generateName(); + p.gender = Gender.FEMALE; + p.setBoss(true, 2); + }), + ) + .setInstantTera(2), // Tera Fairy Togekiss + + // Unova Champions + [TrainerType.ALDER]: new TrainerConfig(nextTrainerId()) + .initForChampion(true) + .setHasDouble("alder_iris_double") + .setDoubleTrainerType(TrainerType.IRIS) + .setDoubleTitle("champion_double") + .setBattleBgm("battle_champion_alder") + .setMixedBattleBgm("battle_champion_alder") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.BOUFFALANT, SpeciesId.BRAVIARY])) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc( + [SpeciesId.HISUI_LILLIGANT, SpeciesId.HISUI_ZOROARK, SpeciesId.BASCULEGION], + TrainerSlot.TRAINER, + true, + p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ROGUE_BALL; + }, + ), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.CHANDELURE, SpeciesId.KROOKODILE, SpeciesId.REUNICLUS, SpeciesId.CONKELDURR]), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.KELDEO], TrainerSlot.TRAINER, true, p => { + p.pokeball = PokeballType.ROGUE_BALL; + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.SECRET_SWORD)) { + // Check if Secret Sword is in the moveset, if not, replace the third move with Secret Sword. + p.moveset[2] = new PokemonMove(MoveId.SECRET_SWORD); + } + p.formIndex = 1; // Resolute Form + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.ZEKROM], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.VOLCARONA], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.gender = Gender.MALE; + p.setBoss(true, 2); + p.teraType = PokemonType.FIRE; + }), + ) + .setInstantTera(5), // Tera Fire Volcarona + [TrainerType.IRIS]: new TrainerConfig(nextTrainerId()) + .initForChampion(false) + .setBattleBgm("battle_champion_iris") + .setMixedBattleBgm("battle_champion_iris") + .setHasDouble("iris_alder_double") + .setDoubleTrainerType(TrainerType.ALDER) + .setDoubleTitle("champion_double") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.DRUDDIGON])) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.ARCHEOPS], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 2; // Emergency Exit + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.LAPRAS], TrainerSlot.TRAINER, true, p => { + p.formIndex = 1; // G-Max Lapras + p.generateAndPopulateMoveset(); + p.generateName(); + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.AGGRON, SpeciesId.HYDREIGON, SpeciesId.ARCHALUDON])) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.RESHIRAM], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.HAXORUS], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 1; // Mold Breaker + p.generateAndPopulateMoveset(); + p.gender = Gender.FEMALE; + p.setBoss(true, 2); + }), + ) + .setInstantTera(5), // Tera Dragon Haxorus + + // Kalos Champion + [TrainerType.DIANTHA]: new TrainerConfig(nextTrainerId()) + .initForChampion(false) + .setMixedBattleBgm("battle_kalos_champion") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.HAWLUCHA])) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.TREVENANT, SpeciesId.GOURGEIST], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 2; // Harvest Trevenant, Insomnia Gourgeist + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.TYRANTRUM, SpeciesId.AURORUS], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.abilityIndex = 2; // Rock Head Tyrantrum, Snow Warning Aurorus + p.teraType = p.species.type2!; + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GOODRA])) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.XERNEAS], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.GARDEVOIR], TrainerSlot.TRAINER, true, p => { + p.formIndex = 1; // Mega Gardevoir + p.generateAndPopulateMoveset(); + p.generateName(); + p.gender = Gender.FEMALE; + p.setBoss(true, 2); + }), + ) + .setInstantTera(2), // Tera Dragon Tyrantrum / Ice Aurorus + + // Alola Champions + [TrainerType.KUKUI]: new TrainerConfig(nextTrainerId()) + .initForChampion(true) + .setMixedBattleBgm("battle_champion_kukui") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.LYCANROC], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.formIndex = 2; // Dusk Lycanroc + }), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.MAGNEZONE, SpeciesId.ALOLA_NINETALES], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.abilityIndex = p.species.speciesId === SpeciesId.MAGNEZONE ? 1 : 2; // Sturdy Magnezone, Snow Warning Ninetales + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc( + [SpeciesId.TORNADUS, SpeciesId.THUNDURUS, SpeciesId.LANDORUS], + TrainerSlot.TRAINER, + true, + p => { + p.formIndex = 1; // Therian Formes + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ROGUE_BALL; + }, + ), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.TAPU_LELE, SpeciesId.TAPU_FINI], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.abilityIndex = 0; // Psychic / Misty Surge + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.SNORLAX], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.formIndex = 1; // G-Max Snorlax + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.INCINEROAR, SpeciesId.HISUI_DECIDUEYE], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.gender = Gender.MALE; + p.teraType = p.species.type2!; + p.setBoss(true, 2); + }), + ) + .setInstantTera(5), // Tera Dark Incineroar / Fighting Hisuian Decidueye + [TrainerType.HAU]: new TrainerConfig(nextTrainerId()) + .initForChampion(true) + .setMixedBattleBgm("battle_alola_champion") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.ALOLA_RAICHU])) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.NOIVERN], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 1; // Infiltrator + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.BLACEPHALON, SpeciesId.STAKATAKA], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ROGUE_BALL; + }), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.TAPU_KOKO, SpeciesId.TAPU_BULU], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.abilityIndex = 0; // Electric / Grassy Surge + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.SOLGALEO], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.DECIDUEYE, SpeciesId.PRIMARINA], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.setBoss(true, 2); + p.gender = p.species.speciesId === SpeciesId.PRIMARINA ? Gender.FEMALE : Gender.MALE; + p.teraType = p.species.speciesId === SpeciesId.PRIMARINA ? PokemonType.WATER : PokemonType.GHOST; + }), + ) + .setInstantTera(5), // Tera Ghost Decidueye, Water Primarina + + // Galar Champions + [TrainerType.LEON]: new TrainerConfig(nextTrainerId()) + .initForChampion(true) + .setMixedBattleBgm("battle_galar_champion") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.AEGISLASH])) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc( + [SpeciesId.RHYPERIOR, SpeciesId.SEISMITOAD, SpeciesId.MR_RIME], + TrainerSlot.TRAINER, + true, + p => { + p.abilityIndex = 1; // Solid Rock Rhyperior, Poison Touch Seismitoad, Screen Cleaner Mr. Rime + p.generateAndPopulateMoveset(); + }, + ), + ) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.DRAGAPULT])) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.RILLABOOM, SpeciesId.CINDERACE, SpeciesId.INTELEON])) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.ZACIAN], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.CHARIZARD], TrainerSlot.TRAINER, true, p => { + p.formIndex = 3; // G-Max Charizard + p.generateAndPopulateMoveset(); + p.generateName(); + p.gender = Gender.MALE; + p.setBoss(true, 2); + }), + ) + .setInstantTera(3), // Tera Grass Rillaboom, Fire Cinderace, Water Inteleon + [TrainerType.MUSTARD]: new TrainerConfig(nextTrainerId()) + .initForChampion(true) + .setMixedBattleBgm("battle_mustard") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.MIENSHAO], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.CORVIKNIGHT], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.GALAR_SLOWBRO, SpeciesId.GALAR_SLOWKING], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.abilityIndex = p.species.speciesId === SpeciesId.GALAR_SLOWBRO ? 0 : 2; // Quick Draw Galar Slowbro, Regenerator Galar Slowking + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.VENUSAUR, SpeciesId.BLASTOISE], TrainerSlot.TRAINER, true, p => { + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.KOMMO_O], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.URSHIFU], TrainerSlot.TRAINER, true, p => { + p.formIndex = randSeedIntRange(2, 3); // Random G-Max Urshifu form + p.generateName(); + p.gender = Gender.MALE; + p.pokeball = PokeballType.ULTRA_BALL; + p.setBoss(true, 2); + if (p.formIndex === 2) { + p.moveset[0] = new PokemonMove(MoveId.WICKED_BLOW); + p.moveset[1] = new PokemonMove(MoveId.BRICK_BREAK); + p.moveset[2] = new PokemonMove(randSeedItem([MoveId.FIRE_PUNCH, MoveId.THUNDER_PUNCH, MoveId.ICE_PUNCH])); + p.moveset[3] = new PokemonMove(MoveId.FOCUS_ENERGY); + } else if (p.formIndex === 3) { + p.moveset[0] = new PokemonMove(MoveId.SURGING_STRIKES); + p.moveset[1] = new PokemonMove(MoveId.BRICK_BREAK); + p.moveset[2] = new PokemonMove(randSeedItem([MoveId.FIRE_PUNCH, MoveId.THUNDER_PUNCH, MoveId.ICE_PUNCH])); + p.moveset[3] = new PokemonMove(MoveId.FOCUS_ENERGY); + } + }), + ) + .setInstantTera(4), // Tera Fighting Kommo-o + + // Paldea Champions + [TrainerType.GEETA]: new TrainerConfig(nextTrainerId()) + .initForChampion(false) + .setMixedBattleBgm("battle_champion_geeta") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.GLIMMORA], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.gender = Gender.MALE; + p.setBoss(true, 2); + }), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.ESPATHRA], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 0; // Opportunist + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.BAXCALIBUR])) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.CHESNAUGHT, SpeciesId.DELPHOX, SpeciesId.GRENINJA])) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.MIRAIDON], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.KINGAMBIT], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { + // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. + p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); + } + p.abilityIndex = 1; // Supreme Overlord + p.teraType = PokemonType.FLYING; + }), + ) + .setInstantTera(5), // Tera Flying Kingambit + [TrainerType.NEMONA]: new TrainerConfig(nextTrainerId()) + .initForChampion(false) + .setMixedBattleBgm("battle_champion_nemona") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.LYCANROC], TrainerSlot.TRAINER, true, p => { + p.formIndex = 0; // Midday form + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.PAWMOT])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.DUDUNSPARCE], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 0; // Serene Grace + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.ARMAROUGE, SpeciesId.CERULEDGE])) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.KORAIDON], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc( + [SpeciesId.MEOWSCARADA, SpeciesId.SKELEDIRGE, SpeciesId.QUAQUAVAL], + TrainerSlot.TRAINER, + true, + p => { + p.generateAndPopulateMoveset(); + p.gender = Gender.MALE; + p.setBoss(true, 2); + p.teraType = p.species.type2!; + }, + ), + ) + .setInstantTera(5), // Tera Dark Meowscarada, Ghost Skeledirge, Fighting Quaquaval + [TrainerType.KIERAN]: new TrainerConfig(nextTrainerId()) + .initForChampion(true) + .setMixedBattleBgm("battle_champion_kieran") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.POLIWRATH, SpeciesId.POLITOED])) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.INCINEROAR, SpeciesId.GRIMMSNARL], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.abilityIndex = p.species.speciesId === SpeciesId.INCINEROAR ? 2 : 0; // Intimidate Incineroar, Prankster Grimmsnarl + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.DRAGONITE], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 2; // Multiscale + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.URSALUNA, SpeciesId.BLOODMOON_URSALUNA], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.TERAPAGOS], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_STARSTORM)) { + // Check if Tera Starstorm is in the moveset, if not, replace the first move with Tera Starstorm. + p.moveset[0] = new PokemonMove(MoveId.TERA_STARSTORM); + } + p.pokeball = PokeballType.MASTER_BALL; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.HYDRAPPLE], TrainerSlot.TRAINER, true, p => { + p.gender = Gender.MALE; + p.setBoss(true, 2); + p.teraType = PokemonType.FIGHTING; + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { + // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. + p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); + } + }), + ) + .setInstantTera(5), // Tera Fighting Hydrapple +} diff --git a/src/data/trainers/trainers-init/double-trainers.ts b/src/data/trainers/trainers-init/double-trainers.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/data/trainers/trainers-init/elite-four-trainers.ts b/src/data/trainers/trainers-init/elite-four-trainers.ts new file mode 100644 index 00000000000..841441b7611 --- /dev/null +++ b/src/data/trainers/trainers-init/elite-four-trainers.ts @@ -0,0 +1,891 @@ +import { signatureSpecies } from "#balance/signature-species"; +import { Gender } from "#data/gender"; +import { MoveId } from "#enums/move-id"; +import { PokemonType } from "#enums/pokemon-type"; +import { SpeciesId } from "#enums/species-id"; +import { TrainerSlot } from "#enums/trainer-slot"; +import { TrainerType } from "#enums/trainer-type"; +import { PokemonMove } from "#moves/pokemon-move"; +import { getRandomPartyMemberFunc, nextTrainerId, setTrainerId, TrainerConfig } from "#trainers/trainer-config"; +import { TrainerConfigs } from "#types/trainer-funcs"; +import { t } from "i18next"; +import { isNullOrUndefined } from "util"; + + +export const eliteFourTrainers: TrainerConfigs = { + // Kanto Elite Four + [TrainerType.LORELEI]: new TrainerConfig(setTrainerId(TrainerType.LORELEI)) + .initForEliteFour(signatureSpecies["LORELEI"], false, PokemonType.ICE, 2) + .setBattleBgm("battle_kanto_gym") + .setMixedBattleBgm("battle_kanto_gym") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.DEWGONG], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 0; // Thick Fat + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.SLOWBRO, SpeciesId.GALAR_SLOWBRO], TrainerSlot.TRAINER, true, p => { + // Tera Ice Slowbro/G-Slowbro + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.ICE_BEAM)) { + // Check if Ice Beam is in the moveset, if not, replace the third move with Ice Beam. + p.moveset[2] = new PokemonMove(MoveId.ICE_BEAM); + } + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.JYNX])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.CLOYSTER, SpeciesId.ALOLA_SANDSLASH])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.LAPRAS], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.BRUNO]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["BRUNO"], true, PokemonType.FIGHTING, 2) + .setBattleBgm("battle_kanto_gym") + .setMixedBattleBgm("battle_kanto_gym") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.HITMONLEE, SpeciesId.HITMONCHAN, SpeciesId.HITMONTOP])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.STEELIX], TrainerSlot.TRAINER, true, p => { + // Tera Fighting Steelix + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.BODY_PRESS)) { + // Check if Body Press is in the moveset, if not, replace the third move with Body Press. + p.moveset[2] = new PokemonMove(MoveId.BODY_PRESS); + } + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.POLIWRATH])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.ANNIHILAPE])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.MACHAMP], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.AGATHA]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["AGATHA"], false, PokemonType.GHOST, 2) + .setBattleBgm("battle_kanto_gym") + .setMixedBattleBgm("battle_kanto_gym") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.MISMAGIUS])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.ARBOK, SpeciesId.WEEZING], TrainerSlot.TRAINER, true, p => { + // Tera Ghost Arbok/Weezing + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { + // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. + p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); + } + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.ALOLA_MAROWAK])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.CURSOLA])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.GENGAR], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.LANCE]: new TrainerConfig(nextTrainerId()) + .setName("Lance") + .initForEliteFour(signatureSpecies["LANCE"], true, PokemonType.DRAGON, 2) + .setBattleBgm("battle_kanto_gym") + .setMixedBattleBgm("battle_kanto_gym") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.KINGDRA])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.GYARADOS, SpeciesId.AERODACTYL], TrainerSlot.TRAINER, true, p => { + // Tera Dragon Gyarados/Aerodactyl + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { + // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. + p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); + } + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.ALOLA_EXEGGUTOR])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.SALAMENCE])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.DRAGONITE], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + // Johto Elite Four + [TrainerType.WILL]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["WILL"], true, PokemonType.PSYCHIC, 2) + .setBattleBgm("battle_johto_gym") + .setMixedBattleBgm("battle_johto_gym") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.JYNX])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.SLOWKING, SpeciesId.GALAR_SLOWKING])) // Tera Psychic Slowking/G-Slowking + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.EXEGGUTOR])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.WYRDEER, SpeciesId.FARIGIRAF])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.XATU], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.KOGA]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["KOGA"], true, PokemonType.POISON, 2) + .setBattleBgm("battle_johto_gym") + .setMixedBattleBgm("battle_johto_gym") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.VENOMOTH], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 1; // Tinted Lens + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.MUK, SpeciesId.WEEZING])) // Tera Poison Muk/Weezing + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.TENTACRUEL])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.SNEASLER, SpeciesId.OVERQWIL])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.CROBAT], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.KAREN]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["KAREN"], false, PokemonType.DARK, 2) + .setBattleBgm("battle_johto_gym") + .setMixedBattleBgm("battle_johto_gym") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.UMBREON])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.GENGAR], TrainerSlot.TRAINER, true, p => { + // Tera Dark Gengar + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.DARK_PULSE)) { + // Check if Dark Pulse is in the moveset, if not, replace the third move with Dark Pulse. + p.moveset[2] = new PokemonMove(MoveId.DARK_PULSE); + } + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.HONCHKROW])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.WEAVILE])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.HOUNDOOM], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + // Hoenn Elite Four + [TrainerType.SIDNEY]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["SIDNEY"], true, PokemonType.DARK, 2) + .setMixedBattleBgm("battle_hoenn_elite") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.MIGHTYENA], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 0; // Intimidate + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.OBSTAGOON])) // Tera Dark Obstagoon + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.SHIFTRY, SpeciesId.CACTURNE])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.SHARPEDO, SpeciesId.CRAWDAUNT])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.ABSOL], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.PHOEBE]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["PHOEBE"], false, PokemonType.GHOST, 2) + .setMixedBattleBgm("battle_hoenn_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.SABLEYE])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.BANETTE])) // Tera Ghost Banette + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.DRIFBLIM, SpeciesId.MISMAGIUS])) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.ORICORIO, SpeciesId.ALOLA_MAROWAK], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.formIndex = p.species.speciesId === SpeciesId.ORICORIO ? 3 : 0; // Oricorio-Sensu + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.DUSKNOIR], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.GLACIA]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["GLACIA"], false, PokemonType.ICE, 2) + .setMixedBattleBgm("battle_hoenn_elite") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.ABOMASNOW], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 0; // Snow Warning + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.GLALIE])) // Tera Ice Glalie + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.FROSLASS])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.ALOLA_NINETALES])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.WALREIN], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.DRAKE]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["DRAKE"], true, PokemonType.DRAGON, 2) + .setMixedBattleBgm("battle_hoenn_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.ALTARIA])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.DHELMISE], TrainerSlot.TRAINER, true, p => { + // Tera Dragon Dhelmise + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { + // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. + p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); + } + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.FLYGON])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.KINGDRA])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.SALAMENCE], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + + // Sinnoh Elite Four + [TrainerType.AARON]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["AARON"], true, PokemonType.BUG, 5) + .setBattleBgm("battle_sinnoh_gym") + .setMixedBattleBgm("battle_sinnoh_gym") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.YANMEGA])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.HERACROSS])) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.VESPIQUEN])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.SCIZOR, SpeciesId.KLEAVOR])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.DRAPION], TrainerSlot.TRAINER, true, p => { + // Tera Bug Drapion + p.setBoss(true, 2); + p.abilityIndex = 1; // Sniper + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.X_SCISSOR)) { + // Check if X-Scissor is in the moveset, if not, replace the third move with X-Scissor. + p.moveset[2] = new PokemonMove(MoveId.X_SCISSOR); + } + }), + ), + [TrainerType.BERTHA]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["BERTHA"], false, PokemonType.GROUND, 2) + .setBattleBgm("battle_sinnoh_gym") + .setMixedBattleBgm("battle_sinnoh_gym") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.WHISCASH])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.HIPPOWDON], TrainerSlot.TRAINER, true, p => { + // Tera Ground Hippowdon + p.abilityIndex = 0; // Sand Stream + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GLISCOR])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.MAMOSWINE, SpeciesId.URSALUNA])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.RHYPERIOR], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.abilityIndex = 1; // Solid Rock + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.FLINT]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["FLINT"], true, PokemonType.FIRE, 2) + .setBattleBgm("battle_sinnoh_gym") + .setMixedBattleBgm("battle_sinnoh_gym") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.RAPIDASH])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.STEELIX, SpeciesId.LOPUNNY], TrainerSlot.TRAINER, true, p => { + // Tera Fire Steelix/Lopunny + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { + // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. + p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); + } + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.INFERNAPE])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.ARCANINE, SpeciesId.HISUI_ARCANINE])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.MAGMORTAR], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.LUCIAN]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["LUCIAN"], true, PokemonType.PSYCHIC, 2) + .setBattleBgm("battle_sinnoh_gym") + .setMixedBattleBgm("battle_sinnoh_gym") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.ESPEON, SpeciesId.ALAKAZAM])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.FARIGIRAF])) // Tera Psychic Farigiraf + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.BRONZONG])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.MR_RIME, SpeciesId.HISUI_BRAVIARY])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.GALLADE], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.abilityIndex = 1; // Sharpness + p.generateAndPopulateMoveset(); + }), + ), + // Unova Elite Four + [TrainerType.SHAUNTAL]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["SHAUNTAL"], false, PokemonType.GHOST, 2) + .setMixedBattleBgm("battle_unova_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.COFAGRIGUS])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.GOLURK])) // Tera Ghost Golurk + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.JELLICENT])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.MISMAGIUS, SpeciesId.FROSLASS])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.CHANDELURE], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.MARSHAL]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["MARSHAL"], true, PokemonType.FIGHTING, 2) + .setMixedBattleBgm("battle_unova_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.THROH, SpeciesId.SAWK])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.MIENSHAO])) // Tera Fighting Mienshao + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.EMBOAR])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.BRELOOM, SpeciesId.TOXICROAK])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.CONKELDURR], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.GRIMSLEY]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["GRIMSLEY"], true, PokemonType.DARK, 2) + .setMixedBattleBgm("battle_unova_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.LIEPARD])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.KROOKODILE])) // Tera Dark Krookodile + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.SCRAFTY])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.ZOROARK, SpeciesId.HISUI_SAMUROTT])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.KINGAMBIT], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.CAITLIN]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["CAITLIN"], false, PokemonType.PSYCHIC, 2) + .setMixedBattleBgm("battle_unova_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.MUSHARNA])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.REUNICLUS])) // Tera Psychic Reuniclus + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.GALLADE], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 1; // Sharpness + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.SIGILYPH, SpeciesId.HISUI_BRAVIARY])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.GOTHITELLE], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + + // Kalos Elite Four + [TrainerType.MALVA]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["MALVA"], false, PokemonType.FIRE, 2) + .setMixedBattleBgm("battle_kalos_elite") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.PYROAR], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.gender = Gender.FEMALE; + }), + ) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.HOUNDOOM])) // Tera Fire Houndoom + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.TORKOAL], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 1; // Drought + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.CHANDELURE, SpeciesId.DELPHOX])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.TALONFLAME], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.SIEBOLD]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["SIEBOLD"], true, PokemonType.WATER, 2) + .setMixedBattleBgm("battle_kalos_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.CLAWITZER])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.GYARADOS])) // Tera Water Gyarados + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.STARMIE])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.BLASTOISE, SpeciesId.DONDOZO])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.BARBARACLE], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.abilityIndex = 1; // Tough Claws + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.WIKSTROM]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["WIKSTROM"], true, PokemonType.STEEL, 2) + .setMixedBattleBgm("battle_kalos_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.KLEFKI])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.CERULEDGE], TrainerSlot.TRAINER, true, p => { + // Tera Steel Ceruledge + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.IRON_HEAD)) { + // Check if Iron Head is in the moveset, if not, replace the third move with Iron Head. + p.moveset[2] = new PokemonMove(MoveId.IRON_HEAD); + } + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.SCIZOR])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.CORVIKNIGHT])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.AEGISLASH], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.DRASNA]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["DRASNA"], false, PokemonType.DRAGON, 2) + .setMixedBattleBgm("battle_kalos_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.DRAGALGE])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.GARCHOMP])) // Tera Dragon Garchomp + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.ALTARIA])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.DRUDDIGON])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.NOIVERN], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + + // Alola Elite Four + [TrainerType.HALA]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["HALA"], true, PokemonType.FIGHTING, 2) + .setMixedBattleBgm("battle_alola_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.HARIYAMA])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.INCINEROAR], TrainerSlot.TRAINER, true, p => { + // Tera Fighting Incineroar + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.CROSS_CHOP)) { + // Check if Cross Chop is in the moveset, if not, replace the third move with Cross Chop. + p.moveset[2] = new PokemonMove(MoveId.CROSS_CHOP); + } + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.BEWEAR])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.POLIWRATH, SpeciesId.ANNIHILAPE])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.CRABOMINABLE], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.MOLAYNE]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["MOLAYNE"], true, PokemonType.STEEL, 2) + .setMixedBattleBgm("battle_alola_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.KLEFKI])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.ALOLA_SANDSLASH])) // Tera Steel A-Sandslash + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.MAGNEZONE])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.METAGROSS, SpeciesId.KINGAMBIT])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.ALOLA_DUGTRIO], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.OLIVIA]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["OLIVIA"], false, PokemonType.ROCK, 2) + .setMixedBattleBgm("battle_alola_elite") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.GIGALITH], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 1; // Sand Stream + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.PROBOPASS])) // Tera Rock Probopass + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.ALOLA_GOLEM])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.RELICANTH, SpeciesId.CARBINK])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.LYCANROC], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.formIndex = 1; + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.ACEROLA]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["ACEROLA"], false, PokemonType.GHOST, 2) + .setMixedBattleBgm("battle_alola_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.DRIFBLIM])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.MIMIKYU])) // Tera Ghost Mimikyu + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.DHELMISE])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.FROSLASS])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.PALOSSAND], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.KAHILI]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["KAHILI"], false, PokemonType.FLYING, 2) + .setMixedBattleBgm("battle_alola_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.HAWLUCHA])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.DECIDUEYE], TrainerSlot.TRAINER, true, p => { + // Tera Flying Decidueye + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.BRAVE_BIRD)) { + // Check if Brave Bird is in the moveset, if not, replace the third move with Brave Bird. + p.moveset[2] = new PokemonMove(MoveId.BRAVE_BIRD); + } + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.BRAVIARY, SpeciesId.MANDIBUZZ])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.ORICORIO])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.TOUCANNON], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + // Galar Elite Four + [TrainerType.MARNIE_ELITE]: new TrainerConfig(nextTrainerId()) + .setName("Marnie") + .initForEliteFour(signatureSpecies["MARNIE_ELITE"], false, PokemonType.DARK, 2) + .setMixedBattleBgm("battle_galar_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.LIEPARD])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.TOXICROAK], TrainerSlot.TRAINER, true, p => { + // Tera Dark Toxicroak + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.SUCKER_PUNCH)) { + // Check if Sucker Punch is in the moveset, if not, replace the third move with Sucker Punch. + p.moveset[2] = new PokemonMove(MoveId.SUCKER_PUNCH); + } + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.SCRAFTY, SpeciesId.PANGORO])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.MORPEKO])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.GRIMMSNARL], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.NESSA_ELITE]: new TrainerConfig(nextTrainerId()) + .setName("Nessa") + .initForEliteFour(signatureSpecies["NESSA_ELITE"], false, PokemonType.WATER, 2) + .setMixedBattleBgm("battle_galar_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.GOLISOPOD])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.EISCUE], TrainerSlot.TRAINER, true, p => { + // Tera Water Eiscue + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.LIQUIDATION)) { + // Check if Liquidation is in the moveset, if not, replace the third move with Liquidation. + p.moveset[2] = new PokemonMove(MoveId.LIQUIDATION); + } + }), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.PELIPPER], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = 1; // Drizzle + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.TOXAPEX])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.DREDNAW], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.BEA_ELITE]: new TrainerConfig(nextTrainerId()) + .setName("Bea") + .initForEliteFour(signatureSpecies["BEA_ELITE"], false, PokemonType.FIGHTING, 2) + .setMixedBattleBgm("battle_galar_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.HAWLUCHA])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.SIRFETCHD])) // Tera Fighting Sirfetch'd + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GRAPPLOCT, SpeciesId.FALINKS])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.HITMONTOP])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.MACHAMP], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.ALLISTER_ELITE]: new TrainerConfig(nextTrainerId()) + .setName("Allister") + .initForEliteFour(signatureSpecies["ALLISTER_ELITE"], true, PokemonType.GHOST, 2) + .setMixedBattleBgm("battle_galar_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.DUSKNOIR])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.RUNERIGUS])) // Tera Ghost Runerigus + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.POLTEAGEIST, SpeciesId.SINISTCHA])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.CURSOLA])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.GENGAR], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.RAIHAN_ELITE]: new TrainerConfig(nextTrainerId()) + .setName("Raihan") + .initForEliteFour(signatureSpecies["RAIHAN_ELITE"], true, PokemonType.DRAGON, 2) + .setMixedBattleBgm("battle_galar_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.FLYGON])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.TORKOAL], TrainerSlot.TRAINER, true, p => { + // Tera Dragon Torkoal + p.abilityIndex = 1; // Drought + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { + // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. + p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); + } + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GOODRA])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.TURTONATOR])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.ARCHALUDON], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + + // Paldea Elite Four + [TrainerType.RIKA]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["RIKA"], false, PokemonType.GROUND, 5) + .setMixedBattleBgm("battle_paldea_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.DUGTRIO])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.DONPHAN])) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.SWAMPERT, SpeciesId.TORTERRA])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.CAMERUPT])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.CLODSIRE], TrainerSlot.TRAINER, true, p => { + // Tera Ground Clodsire + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.POPPY]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["POPPY"], false, PokemonType.STEEL, 5) + .setMixedBattleBgm("battle_paldea_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.COPPERAJAH])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.MAGNEZONE])) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.BRONZONG, SpeciesId.CORVIKNIGHT], TrainerSlot.TRAINER, true, p => { + p.abilityIndex = p.species.speciesId === SpeciesId.BRONZONG ? 0 : 1; // Levitate Bronzong, Unnerve Corviknight + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.STEELIX])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.TINKATON], TrainerSlot.TRAINER, true, p => { + // Tera Steel Tinkaton + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.LARRY_ELITE]: new TrainerConfig(nextTrainerId()) + .setName("Larry") + .initForEliteFour(signatureSpecies["LARRY_ELITE"], true, PokemonType.FLYING, 5) + .setMixedBattleBgm("battle_paldea_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.ALTARIA])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.BOMBIRDIER])) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.TROPIUS])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.STARAPTOR])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.FLAMIGO], TrainerSlot.TRAINER, true, p => { + // Tera Flying Flamigo + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.HASSEL]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["HASSEL"], true, PokemonType.DRAGON, 5) + .setMixedBattleBgm("battle_paldea_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.NOIVERN])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.DRAGALGE])) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.FLAPPLE, SpeciesId.APPLETUN, SpeciesId.HYDRAPPLE])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.HAXORUS])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.BAXCALIBUR], TrainerSlot.TRAINER, true, p => { + // Tera Dragon Baxcalibur + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + + // Blueberry Academy BB League + [TrainerType.CRISPIN]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["CRISPIN"], true, PokemonType.FIRE, 2) + .setMixedBattleBgm("battle_bb_elite") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.ROTOM], TrainerSlot.TRAINER, true, p => { + p.formIndex = 1; // Heat Rotom + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.EXEGGUTOR], TrainerSlot.TRAINER, true, p => { + // Tera Fire Exeggutor + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { + // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. + p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); + } + }), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.TALONFLAME], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.SUNNY_DAY)) { + // Check if Sunny Day is in the moveset, if not, replace the third move with Sunny Day. + p.moveset[2] = new PokemonMove(MoveId.SUNNY_DAY); + } + }), + ) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.MAGMORTAR])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.BLAZIKEN], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.AMARYS]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["AMARYS"], false, PokemonType.STEEL, 2) + .setMixedBattleBgm("battle_bb_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.SKARMORY])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.REUNICLUS], TrainerSlot.TRAINER, true, p => { + // Tera Steel Reuniclus + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.FLASH_CANNON)) { + // Check if Flash Cannon is in the moveset, if not, replace the third move with Flash Cannon. + p.moveset[2] = new PokemonMove(MoveId.FLASH_CANNON); + } + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.EMPOLEON])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.SCIZOR])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.METAGROSS], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), + [TrainerType.LACEY]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["LACEY"], false, PokemonType.FAIRY, 5) + .setMixedBattleBgm("battle_bb_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.WHIMSICOTT])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.PRIMARINA])) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GRANBULL])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.ALCREMIE])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.EXCADRILL], TrainerSlot.TRAINER, true, p => { + // Tera Fairy Excadrill + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TERA_BLAST)) { + // Check if Tera Blast is in the moveset, if not, replace the third move with Tera Blast. + p.moveset[2] = new PokemonMove(MoveId.TERA_BLAST); + } + }), + ), + [TrainerType.DRAYTON]: new TrainerConfig(nextTrainerId()) + .initForEliteFour(signatureSpecies["DRAYTON"], true, PokemonType.DRAGON, 2) + .setMixedBattleBgm("battle_bb_elite") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.DRAGONITE])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.SCEPTILE], TrainerSlot.TRAINER, true, p => { + // Tera Dragon Sceptile + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.DUAL_CHOP)) { + // Check if Dual Chop is in the moveset, if not, replace the third move with Dual Chop. + p.moveset[2] = new PokemonMove(MoveId.DUAL_CHOP); + } + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.HAXORUS])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.KINGDRA, SpeciesId.DRACOVISH])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.ARCHALUDON], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ), +} diff --git a/src/data/trainers/trainers-init/evil-organization-trainers.ts b/src/data/trainers/trainers-init/evil-organization-trainers.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/data/trainers/trainers-init/evil-organizations/evil-admin-trainers.ts b/src/data/trainers/trainers-init/evil-organizations/evil-admin-trainers.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/data/trainers/trainers-init/evil-organizations/evil-grunts-trainers.ts b/src/data/trainers/trainers-init/evil-organizations/evil-grunts-trainers.ts new file mode 100644 index 00000000000..139597f9cb0 --- /dev/null +++ b/src/data/trainers/trainers-init/evil-organizations/evil-grunts-trainers.ts @@ -0,0 +1,2 @@ + + diff --git a/src/data/trainers/trainers-init/evil-organizations/evil-leaders-trainers.ts b/src/data/trainers/trainers-init/evil-organizations/evil-leaders-trainers.ts new file mode 100644 index 00000000000..a02b8e4f909 --- /dev/null +++ b/src/data/trainers/trainers-init/evil-organizations/evil-leaders-trainers.ts @@ -0,0 +1,879 @@ +import { Gender } from "#data/gender"; +import { MoveId } from "#enums/move-id"; +import { PokeballType } from "#enums/pokeball"; +import { SpeciesId } from "#enums/species-id"; +import { TrainerSlot } from "#enums/trainer-slot"; +import { TrainerType } from "#enums/trainer-type"; +import { PokemonMove } from "#moves/pokemon-move"; +import { getRandomPartyMemberFunc, nextTrainerId, setTrainerId, TrainerConfig } from "#trainers/trainer-config"; +import { TrainerConfigs } from "#types/trainer-funcs"; +import { isNullOrUndefined, randSeedInt } from "#utils/common"; + +export const evilAdminTrainers: TrainerConfigs = { + [TrainerType.ROCKET_BOSS_GIOVANNI_1]: new TrainerConfig(setTrainerId(TrainerType.ROCKET_BOSS_GIOVANNI_1)) + .setName("Giovanni") + .initForEvilTeamLeader("Rocket Boss", []) + .setMixedBattleBgm("battle_rocket_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.PERSIAN], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.gender = Gender.MALE; + }), + ) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.DUGTRIO, SpeciesId.ALOLA_DUGTRIO])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.HONCHKROW])) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.NIDOQUEEN, SpeciesId.NIDOKING])) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.KANGASKHAN], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.formIndex = 1; // Mega Kangaskhan + p.generateName(); + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.RHYPERIOR], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.abilityIndex = 1; // Solid Rock + p.setBoss(true, 2); + }), + ), + [TrainerType.ROCKET_BOSS_GIOVANNI_2]: new TrainerConfig(nextTrainerId()) + .setName("Giovanni") + .initForEvilTeamLeader("Rocket Boss", [], true) + .setMixedBattleBgm("battle_rocket_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.RHYPERIOR], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.abilityIndex = 1; // Solid Rock + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.NIDOKING, SpeciesId.NIDOQUEEN], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.abilityIndex = 2; // Sheer Force + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.HONCHKROW], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.SUCKER_PUNCH)) { + // Check if Sucker Punch is in the moveset, if not, replace the third move with Sucker Punch. + p.moveset[2] = new PokemonMove(MoveId.SUCKER_PUNCH); + } + }), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.KANGASKHAN], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.formIndex = 1; // Mega Kangaskhan + p.generateName(); + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc( + [SpeciesId.ARTICUNO, SpeciesId.ZAPDOS, SpeciesId.MOLTRES], + TrainerSlot.TRAINER, + true, + p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.abilityIndex = 2; // Snow Cloak Articuno, Static Zapdos, Flame Body Moltres + p.setBoss(true, 2); + }, + ), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.MEWTWO], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ), + [TrainerType.MAXIE]: new TrainerConfig(nextTrainerId()) + .setName("Maxie") + .initForEvilTeamLeader("Magma Boss", []) + .setMixedBattleBgm("battle_aqua_magma_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.TORKOAL], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.abilityIndex = 1; // Drought + }), + ) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.SOLROCK])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.WEEZING, SpeciesId.GALAR_WEEZING])) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.SCOVILLAIN], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.abilityIndex = 0; // Chlorophyll + }), + ) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.DONPHAN])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.CAMERUPT], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.formIndex = 1; // Mega Camerupt + p.generateName(); + p.gender = Gender.MALE; + }), + ), + [TrainerType.MAXIE_2]: new TrainerConfig(nextTrainerId()) + .setName("Maxie") + .initForEvilTeamLeader("Magma Boss", [], true) + .setMixedBattleBgm("battle_aqua_magma_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.TYPHLOSION, SpeciesId.SOLROCK], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.NINETALES, SpeciesId.TORKOAL], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + if (p.species.speciesId === SpeciesId.NINETALES) { + p.abilityIndex = 2; // Drought + } else if (p.species.speciesId === SpeciesId.TORKOAL) { + p.abilityIndex = 1; // Drought + } + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.SCOVILLAIN], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.abilityIndex = 0; // Chlorophyll + }), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.GREAT_TUSK], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ROGUE_BALL; + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.CAMERUPT], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.formIndex = 1; // Mega Camerupt + p.generateName(); + p.gender = Gender.MALE; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.GROUDON], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ), + [TrainerType.ARCHIE]: new TrainerConfig(nextTrainerId()) + .setName("Archie") + .initForEvilTeamLeader("Aqua Boss", []) + .setMixedBattleBgm("battle_aqua_magma_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.PELIPPER], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.abilityIndex = 1; // Drizzle + }), + ) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.WAILORD])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.MUK, SpeciesId.ALOLA_MUK])) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.LUDICOLO])) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.QWILFISH], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.abilityIndex = 1; // Swift Swim + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.SHARPEDO], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.formIndex = 1; // Mega Sharpedo + p.generateName(); + p.gender = Gender.MALE; + }), + ), + [TrainerType.ARCHIE_2]: new TrainerConfig(nextTrainerId()) + .setName("Archie") + .initForEvilTeamLeader("Aqua Boss", [], true) + .setMixedBattleBgm("battle_aqua_magma_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.LUDICOLO, SpeciesId.EMPOLEON], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.POLITOED, SpeciesId.PELIPPER], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + if (p.species.speciesId === SpeciesId.POLITOED) { + p.abilityIndex = 2; // Drizzle + } else if (p.species.speciesId === SpeciesId.PELIPPER) { + p.abilityIndex = 1; // Drizzle + } + }), + ) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.DHELMISE])) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.OVERQWIL], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.abilityIndex = 1; // Swift Swim + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.SHARPEDO], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.formIndex = 1; // Mega Sharpedo + p.generateName(); + p.gender = Gender.MALE; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.KYOGRE], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ), + [TrainerType.CYRUS]: new TrainerConfig(nextTrainerId()) + .setName("Cyrus") + .initForEvilTeamLeader("Galactic Boss", []) + .setMixedBattleBgm("battle_galactic_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.GYARADOS])) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.CROBAT, SpeciesId.HONCHKROW])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.MAGNEZONE])) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.UXIE, SpeciesId.MESPRIT, SpeciesId.AZELF])) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.HOUNDOOM], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.WEAVILE], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.gender = Gender.MALE; + }), + ), + [TrainerType.CYRUS_2]: new TrainerConfig(nextTrainerId()) + .setName("Cyrus") + .initForEvilTeamLeader("Galactic Boss", [], true) + .setMixedBattleBgm("battle_galactic_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.CROBAT, SpeciesId.HONCHKROW], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.MAGNEZONE])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.UXIE, SpeciesId.MESPRIT, SpeciesId.AZELF], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ROGUE_BALL; + }), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.HOUNDOOM], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.formIndex = 1; // Mega Houndoom + p.generateName(); + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.WEAVILE], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.gender = Gender.MALE; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.DIALGA, SpeciesId.PALKIA], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ), + [TrainerType.GHETSIS]: new TrainerConfig(nextTrainerId()) + .setName("Ghetsis") + .initForEvilTeamLeader("Plasma Boss", []) + .setMixedBattleBgm("battle_plasma_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.COFAGRIGUS])) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.SEISMITOAD])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.GALVANTULA, SpeciesId.EELEKTROSS])) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.DRAPION, SpeciesId.TOXICROAK])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.KINGAMBIT])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.HYDREIGON], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.gender = Gender.MALE; + }), + ), + [TrainerType.GHETSIS_2]: new TrainerConfig(nextTrainerId()) + .setName("Ghetsis") + .initForEvilTeamLeader("Plasma Boss", [], true) + .setMixedBattleBgm("battle_plasma_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.RUNERIGUS], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.JELLICENT, SpeciesId.BASCULEGION], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.gender = Gender.MALE; + p.formIndex = 0; + }), + ) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.KINGAMBIT])) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.VOLCARONA, SpeciesId.IRON_MOTH], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ROGUE_BALL; + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.HYDREIGON, SpeciesId.IRON_JUGULIS], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + if (p.species.speciesId === SpeciesId.HYDREIGON) { + p.gender = Gender.MALE; + } else if (p.species.speciesId === SpeciesId.IRON_JUGULIS) { + p.gender = Gender.GENDERLESS; + } + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.KYUREM], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ), + [TrainerType.LYSANDRE]: new TrainerConfig(nextTrainerId()) + .setName("Lysandre") + .initForEvilTeamLeader("Flare Boss", []) + .setMixedBattleBgm("battle_flare_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.MIENSHAO])) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.HONCHKROW, SpeciesId.TALONFLAME])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.PYROAR], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.gender = Gender.MALE; + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.MALAMAR])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.AEGISLASH, SpeciesId.HISUI_GOODRA])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.GYARADOS], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.formIndex = 1; // Mega Gyarados + p.generateName(); + p.gender = Gender.MALE; + }), + ), + [TrainerType.LYSANDRE_2]: new TrainerConfig(nextTrainerId()) + .setName("Lysandre") + .initForEvilTeamLeader("Flare Boss", [], true) + .setMixedBattleBgm("battle_flare_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.PYROAR], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.gender = Gender.MALE; + }), + ) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.MIENSHAO])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.AEGISLASH, SpeciesId.HISUI_GOODRA])) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.VOLCANION], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ROGUE_BALL; + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.GYARADOS], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.formIndex = 1; // Mega Gyarados + p.generateName(); + p.gender = Gender.MALE; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.ZYGARDE], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + p.formIndex = 0; // 50% Forme, Aura Break + }), + ), + [TrainerType.LUSAMINE]: new TrainerConfig(nextTrainerId()) + .setName("Lusamine") + .initForEvilTeamLeader("Aether Boss", []) + .setMixedBattleBgm("battle_aether_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.CLEFABLE], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.gender = Gender.FEMALE; + }), + ) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.LILLIGANT])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.MILOTIC])) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GALAR_SLOWBRO, SpeciesId.GALAR_SLOWKING])) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.BEWEAR, SpeciesId.LOPUNNY])) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.NIHILEGO], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ROGUE_BALL; + }), + ), + [TrainerType.LUSAMINE_2]: new TrainerConfig(nextTrainerId()) + .setName("Lusamine") + .initForEvilTeamLeader("Aether Boss", [], true) + .setMixedBattleBgm("battle_aether_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.CLEFABLE], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.gender = Gender.FEMALE; + }), + ) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.MILOTIC, SpeciesId.LILLIGANT])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.SILVALLY], TrainerSlot.TRAINER, true, p => { + p.formIndex = randSeedInt(18); // Random Silvally Form + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ROGUE_BALL; + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.MULTI_ATTACK)) { + // Check if Multi Attack is in the moveset, if not, replace the first move with Multi Attack. + p.moveset[0] = new PokemonMove(MoveId.MULTI_ATTACK); + } + }), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.PHEROMOSA], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ROGUE_BALL; + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.NIHILEGO], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ROGUE_BALL; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.NECROZMA], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.formIndex = 2; // Dawn Wings + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ), + [TrainerType.GUZMA]: new TrainerConfig(nextTrainerId()) + .setName("Guzma") + .initForEvilTeamLeader("Skull Boss", []) + .setMixedBattleBgm("battle_skull_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.YANMEGA, SpeciesId.LOKIX], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + if (p.species.speciesId === SpeciesId.YANMEGA) { + p.abilityIndex = 1; // Tinted Lens + } else if (p.species.speciesId === SpeciesId.LOKIX) { + p.abilityIndex = 2; // Tinted Lens + } + }), + ) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.HERACROSS])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.SCIZOR, SpeciesId.KLEAVOR], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + if (p.species.speciesId === SpeciesId.SCIZOR) { + p.abilityIndex = 1; // Technician + } else if (p.species.speciesId === SpeciesId.KLEAVOR) { + p.abilityIndex = 2; // Sharpness + } + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GALVANTULA, SpeciesId.VIKAVOLT])) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.PINSIR], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.formIndex = 1; // Mega Pinsir + p.pokeball = PokeballType.ULTRA_BALL; + p.generateName(); + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.GOLISOPOD], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.FIRST_IMPRESSION)) { + // Check if First Impression is in the moveset, if not, replace the third move with First Impression. + p.moveset[2] = new PokemonMove(MoveId.FIRST_IMPRESSION); + p.gender = Gender.MALE; + } + }), + ), + [TrainerType.GUZMA_2]: new TrainerConfig(nextTrainerId()) + .setName("Guzma") + .initForEvilTeamLeader("Skull Boss", [], true) + .setMixedBattleBgm("battle_skull_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.GOLISOPOD], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.FIRST_IMPRESSION)) { + // Check if First Impression is in the moveset, if not, replace the third move with First Impression. + p.moveset[2] = new PokemonMove(MoveId.FIRST_IMPRESSION); + p.abilityIndex = 2; // Anticipation + p.gender = Gender.MALE; + } + }), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.BUZZWOLE], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ROGUE_BALL; + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.CRAWDAUNT, SpeciesId.HISUI_SAMUROTT], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.abilityIndex = 2; // Sharpness Hisuian Samurott, Adaptability Crawdaunt + }), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.XURKITREE], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ROGUE_BALL; + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.GENESECT], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ROGUE_BALL; + p.formIndex = randSeedInt(4, 1); // Shock, Burn, Chill, or Douse Drive + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.TECHNO_BLAST)) { + // Check if Techno Blast is in the moveset, if not, replace the third move with Techno Blast. + p.moveset[2] = new PokemonMove(MoveId.TECHNO_BLAST); + } + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.PINSIR], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.formIndex = 1; // Mega Pinsir + p.generateAndPopulateMoveset(); + p.generateName(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ), + // Macros + [TrainerType.ROSE]: new TrainerConfig(nextTrainerId()) + .setName("Rose") + .initForEvilTeamLeader("Macro Boss", []) + .setMixedBattleBgm("battle_macro_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.ARCHALUDON], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.ESCAVALIER, SpeciesId.FERROTHORN], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.SIRFETCHD, SpeciesId.MR_RIME], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.CORVIKNIGHT], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.KLINKLANG, SpeciesId.PERRSERKER], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.COPPERAJAH], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.formIndex = 1; // G-Max Copperajah + p.generateName(); + p.pokeball = PokeballType.ULTRA_BALL; + p.gender = Gender.FEMALE; + }), + ), + [TrainerType.ROSE_2]: new TrainerConfig(nextTrainerId()) + .setName("Rose") + .initForEvilTeamLeader("Macro Boss", [], true) + .setMixedBattleBgm("battle_macro_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.ARCHALUDON], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.CORVIKNIGHT])) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.DRACOZOLT, SpeciesId.DRACOVISH], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + p.abilityIndex = 1; // Strong Jaw Dracovish, Hustle Dracozolt + }), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.MELMETAL], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.COPPERAJAH], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.formIndex = 1; // G-Max Copperajah + p.generateName(); + p.pokeball = PokeballType.ULTRA_BALL; + p.gender = Gender.FEMALE; + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc( + [SpeciesId.GALAR_ARTICUNO, SpeciesId.GALAR_ZAPDOS, SpeciesId.GALAR_MOLTRES], + TrainerSlot.TRAINER, + true, + p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }, + ), + ), + + // Star Boss + [TrainerType.PENNY]: new TrainerConfig(nextTrainerId()) + .setName("Cassiopeia") + .initForEvilTeamLeader("Star Boss", []) + .setMixedBattleBgm("battle_star_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc(0, getRandomPartyMemberFunc([SpeciesId.ESPEON])) + .setPartyMemberFunc(1, getRandomPartyMemberFunc([SpeciesId.UMBREON])) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.LEAFEON, SpeciesId.GLACEON])) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.VAPOREON, SpeciesId.FLAREON, SpeciesId.JOLTEON])) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.SYLVEON], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.abilityIndex = 2; // Pixilate + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.HYPER_VOICE)) { + // Check if Hyper Voice is in the moveset, if not, replace the second move with Hyper Voice. + p.moveset[1] = new PokemonMove(MoveId.HYPER_VOICE); + p.gender = Gender.FEMALE; + } + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.EEVEE], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.formIndex = 2; // G-Max Eevee + p.pokeball = PokeballType.ULTRA_BALL; + p.generateName(); + }), + ) + .setInstantTera(4), // Tera Fairy Sylveon + [TrainerType.PENNY_2]: new TrainerConfig(nextTrainerId()) + .setName("Cassiopeia") + .initForEvilTeamLeader("Star Boss", [], true) + .setMixedBattleBgm("battle_star_boss") + .setVictoryBgm("victory_team_plasma") + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.SYLVEON], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.abilityIndex = 2; // Pixilate + p.generateAndPopulateMoveset(); + if (!p.moveset.some(move => !isNullOrUndefined(move) && move.moveId === MoveId.HYPER_VOICE)) { + // Check if Hyper Voice is in the moveset, if not, replace the second move with Hyper Voice. + p.moveset[1] = new PokemonMove(MoveId.HYPER_VOICE); + p.gender = Gender.FEMALE; + } + }), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.ROTOM], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.formIndex = randSeedInt(5, 1); // Heat, Wash, Frost, Fan, or Mow + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.ESPEON, SpeciesId.UMBREON], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.abilityIndex = p.species.speciesId === SpeciesId.UMBREON ? 0 : 2; // Synchronize Umbreon, Magic Bounce Espeon + }), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc( + [SpeciesId.WALKING_WAKE, SpeciesId.GOUGING_FIRE, SpeciesId.RAGING_BOLT], + TrainerSlot.TRAINER, + true, + p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ROGUE_BALL; + }, + ), + ) + .setPartyMemberFunc( + 4, + getRandomPartyMemberFunc([SpeciesId.REVAVROOM], TrainerSlot.TRAINER, true, p => { + p.formIndex = randSeedInt(5, 1); // Random Starmobile form + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ROGUE_BALL; + p.setBoss(true, 2); + }), + ) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.EEVEE], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.formIndex = 2; + p.generateName(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ).setInstantTera(0) +} diff --git a/src/data/trainers/trainers-init/gym-trainers.ts b/src/data/trainers/trainers-init/gym-trainers.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/data/trainers/trainers-init/mystery-event-trainers.ts b/src/data/trainers/trainers-init/mystery-event-trainers.ts new file mode 100644 index 00000000000..d937453918b --- /dev/null +++ b/src/data/trainers/trainers-init/mystery-event-trainers.ts @@ -0,0 +1,275 @@ +import { PartyMemberStrength } from "#enums/party-member-strength"; +import { PokeballType } from "#enums/pokeball"; +import { SpeciesId } from "#enums/species-id"; +import { TrainerSlot } from "#enums/trainer-slot"; +import { TrainerType } from "#enums/trainer-type"; +import { getRandomPartyMemberFunc, nextTrainerId, TrainerConfig } from "#trainers/trainer-config"; +import { TrainerPartyCompoundTemplate, TrainerPartyTemplate, trainerPartyTemplates } from "#trainers/trainer-party-template"; +import { TrainerConfigs } from "#types/trainer-funcs"; + +export const mysteryEventTrainers: TrainerConfigs = { + + // Mystery Event Test Trainer Encounter +[TrainerType.BUCK]: new TrainerConfig(nextTrainerId()) + .setName("Buck") + .initForStatTrainer(true) + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.CLAYDOL], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 3); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.VENUSAUR, SpeciesId.COALOSSAL], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.GREAT_BALL; + if (p.species.speciesId === SpeciesId.VENUSAUR) { + p.formIndex = 2; // Gmax + p.abilityIndex = 2; // Venusaur gets Chlorophyll + } else { + p.formIndex = 1; // Gmax + } + p.generateName(); + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.AGGRON], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.formIndex = 1; // Mega + p.generateName(); + }), + ) + .setPartyMemberFunc( + 3, + getRandomPartyMemberFunc([SpeciesId.TORKOAL], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.abilityIndex = 1; // Drought + }), + ) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.GREAT_TUSK], TrainerSlot.TRAINER, true)) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.HEATRAN], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ), + [TrainerType.CHERYL]: new TrainerConfig(nextTrainerId()) + .setName("Cheryl") + .initForStatTrainer() + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.BLISSEY], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 3); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.SNORLAX, SpeciesId.LAPRAS], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.GREAT_BALL; + p.formIndex = 1; // Gmax + p.generateName(); + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.AUDINO], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.formIndex = 1; // Mega + p.generateName(); + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.GOODRA], TrainerSlot.TRAINER, true)) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.IRON_HANDS], TrainerSlot.TRAINER, true)) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.CRESSELIA, SpeciesId.ENAMORUS], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + if (p.species.speciesId === SpeciesId.ENAMORUS) { + p.formIndex = 1; // Therian + p.generateName(); + } + p.pokeball = PokeballType.MASTER_BALL; + }), + ), + [TrainerType.MARLEY]: new TrainerConfig(nextTrainerId()) + .setName("Marley") + .initForStatTrainer() + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.ARCANINE], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 3); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.ULTRA_BALL; + }), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.CINDERACE, SpeciesId.INTELEON], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.GREAT_BALL; + p.formIndex = 1; // Gmax + p.generateName(); + }), + ) + .setPartyMemberFunc( + 2, + getRandomPartyMemberFunc([SpeciesId.AERODACTYL], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.formIndex = 1; // Mega + p.generateName(); + }), + ) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.DRAGAPULT], TrainerSlot.TRAINER, true)) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.IRON_BUNDLE], TrainerSlot.TRAINER, true)) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.REGIELEKI], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ), + [TrainerType.MIRA]: new TrainerConfig(nextTrainerId()) + .setName("Mira") + .initForStatTrainer() + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.ALAKAZAM], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.formIndex = 1; + p.pokeball = PokeballType.ULTRA_BALL; + p.generateName(); + }), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.GENGAR, SpeciesId.HATTERENE], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.GREAT_BALL; + p.formIndex = p.species.speciesId === SpeciesId.GENGAR ? 2 : 1; // Gmax + p.generateName(); + }), + ) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.FLUTTER_MANE], TrainerSlot.TRAINER, true)) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.HYDREIGON], TrainerSlot.TRAINER, true)) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.MAGNEZONE], TrainerSlot.TRAINER, true)) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.LATIOS, SpeciesId.LATIAS], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + }), + ), + [TrainerType.RILEY]: new TrainerConfig(nextTrainerId()) + .setName("Riley") + .initForStatTrainer(true) + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc([SpeciesId.LUCARIO], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + p.formIndex = 1; + p.pokeball = PokeballType.ULTRA_BALL; + p.generateName(); + }), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc([SpeciesId.RILLABOOM, SpeciesId.CENTISKORCH], TrainerSlot.TRAINER, true, p => { + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.GREAT_BALL; + p.formIndex = 1; // Gmax + p.generateName(); + }), + ) + .setPartyMemberFunc(2, getRandomPartyMemberFunc([SpeciesId.TYRANITAR], TrainerSlot.TRAINER, true)) + .setPartyMemberFunc(3, getRandomPartyMemberFunc([SpeciesId.ROARING_MOON], TrainerSlot.TRAINER, true)) + .setPartyMemberFunc(4, getRandomPartyMemberFunc([SpeciesId.URSALUNA], TrainerSlot.TRAINER, true)) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.REGIGIGAS, SpeciesId.LANDORUS], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + if (p.species.speciesId === SpeciesId.LANDORUS) { + p.formIndex = 1; // Therian + p.generateName(); + } + p.pokeball = PokeballType.MASTER_BALL; + }), + ), + + + // Mystery Event Winstrates + [TrainerType.VICTOR]: new TrainerConfig(nextTrainerId()) + .setTitle("The Winstrates") + .setLocalizedName("Victor") + .setMoneyMultiplier(1) // The Winstrate trainers have total money multiplier of 6 + .setPartyTemplates(trainerPartyTemplates.ONE_AVG_ONE_STRONG), + [TrainerType.VICTORIA]: new TrainerConfig(nextTrainerId()) + .setTitle("The Winstrates") + .setLocalizedName("Victoria") + .setMoneyMultiplier(1) + .setPartyTemplates(trainerPartyTemplates.ONE_AVG_ONE_STRONG), + [TrainerType.VIVI]: new TrainerConfig(nextTrainerId()) + .setTitle("The Winstrates") + .setLocalizedName("Vivi") + .setMoneyMultiplier(1) + .setPartyTemplates(trainerPartyTemplates.TWO_AVG_ONE_STRONG), + [TrainerType.VICKY]: new TrainerConfig(nextTrainerId()) + .setTitle("The Winstrates") + .setLocalizedName("Vicky") + .setMoneyMultiplier(1) + .setPartyTemplates(trainerPartyTemplates.ONE_AVG), + [TrainerType.VITO]: new TrainerConfig(nextTrainerId()) + .setTitle("The Winstrates") + .setLocalizedName("Vito") + .setMoneyMultiplier(2) + .setPartyTemplates( + new TrainerPartyCompoundTemplate( + new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE), + new TrainerPartyTemplate(2, PartyMemberStrength.STRONG), + ), + ), + + // Mystery Event Bug Type Super Fan + [TrainerType.BUG_TYPE_SUPERFAN]: new TrainerConfig(nextTrainerId()) + .setMoneyMultiplier(2.25) + .setEncounterBgm(TrainerType.ACE_TRAINER) + .setPartyTemplates(new TrainerPartyTemplate(2, PartyMemberStrength.AVERAGE)), + // Mystery Event Pokemon Breeder + [TrainerType.EXPERT_POKEMON_BREEDER]: new TrainerConfig(nextTrainerId()) + .setMoneyMultiplier(3) + .setEncounterBgm(TrainerType.ACE_TRAINER) + .setLocalizedName("Expert Pokemon Breeder") + .setPartyTemplates(new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE)), + + // Mystery Event Giratina Event, Weird Dream Event. + [TrainerType.FUTURE_SELF_M]: new TrainerConfig(nextTrainerId()) + .setMoneyMultiplier(0) + .setEncounterBgm("mystery_encounter_weird_dream") + .setBattleBgm("mystery_encounter_weird_dream") + .setMixedBattleBgm("mystery_encounter_weird_dream") + .setVictoryBgm("mystery_encounter_weird_dream") + .setLocalizedName("Future Self M") + .setPartyTemplates(new TrainerPartyTemplate(6, PartyMemberStrength.STRONG)), + [TrainerType.FUTURE_SELF_F]: new TrainerConfig(nextTrainerId()) + .setMoneyMultiplier(0) + .setEncounterBgm("mystery_encounter_weird_dream") + .setBattleBgm("mystery_encounter_weird_dream") + .setMixedBattleBgm("mystery_encounter_weird_dream") + .setVictoryBgm("mystery_encounter_weird_dream") + .setLocalizedName("Future Self F") + .setPartyTemplates(new TrainerPartyTemplate(6, PartyMemberStrength.STRONG)), +} diff --git a/src/data/trainers/trainers-init/random-npcs-trainers.ts b/src/data/trainers/trainers-init/random-npcs-trainers.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/data/trainers/trainers-init/rival-trainer.ts b/src/data/trainers/trainers-init/rival-trainer.ts new file mode 100644 index 00000000000..3b6e35b80f6 --- /dev/null +++ b/src/data/trainers/trainers-init/rival-trainer.ts @@ -0,0 +1,517 @@ +import { timedEventManager } from "#app/global-event-manager"; +import { pokemonEvolutions, pokemonPrevolutions } from "#balance/pokemon-evolutions"; +import { modifierTypes } from "#data/data-lists"; +import { PokemonSpecies } from "#data/pokemon-species"; +import { PokeballType } from "#enums/pokeball"; +import { SpeciesId } from "#enums/species-id"; +import { TrainerSlot } from "#enums/trainer-slot"; +import { TrainerType } from "#enums/trainer-type"; +import { getRandomPartyMemberFunc, nextTrainerId, setTrainerId, TrainerConfig } from "#trainers/trainer-config"; +import { trainerPartyTemplates } from "#trainers/trainer-party-template"; +import { TrainerConfigs } from "#types/trainer-funcs"; + +export const rivalTrainer : TrainerConfigs = { + // Rival floor 8 + [TrainerType.RIVAL]: new TrainerConfig(setTrainerId(TrainerType.RIVAL)) + .setName("Finn") + .setHasGenders("Ivy") + .setHasCharSprite() + .setTitle("Rival") + .setStaticParty() + .setEncounterBgm(TrainerType.RIVAL) + .setBattleBgm("battle_rival") + .setMixedBattleBgm("battle_rival") + .setPartyTemplates(trainerPartyTemplates.RIVAL) + .setModifierRewardFuncs( + () => modifierTypes.SUPER_EXP_CHARM, + () => modifierTypes.EXP_SHARE, + ) + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc( + [ + SpeciesId.BULBASAUR, + SpeciesId.CHARMANDER, + SpeciesId.SQUIRTLE, + SpeciesId.CHIKORITA, + SpeciesId.CYNDAQUIL, + SpeciesId.TOTODILE, + SpeciesId.TREECKO, + SpeciesId.TORCHIC, + SpeciesId.MUDKIP, + SpeciesId.TURTWIG, + SpeciesId.CHIMCHAR, + SpeciesId.PIPLUP, + SpeciesId.SNIVY, + SpeciesId.TEPIG, + SpeciesId.OSHAWOTT, + SpeciesId.CHESPIN, + SpeciesId.FENNEKIN, + SpeciesId.FROAKIE, + SpeciesId.ROWLET, + SpeciesId.LITTEN, + SpeciesId.POPPLIO, + SpeciesId.GROOKEY, + SpeciesId.SCORBUNNY, + SpeciesId.SOBBLE, + SpeciesId.SPRIGATITO, + SpeciesId.FUECOCO, + SpeciesId.QUAXLY, + ], + TrainerSlot.TRAINER, + true, + p => (p.abilityIndex = 0), + ), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc( + [ + SpeciesId.PIDGEY, + SpeciesId.HOOTHOOT, + SpeciesId.TAILLOW, + SpeciesId.STARLY, + SpeciesId.PIDOVE, + SpeciesId.FLETCHLING, + SpeciesId.PIKIPEK, + SpeciesId.ROOKIDEE, + SpeciesId.WATTREL, + ], + TrainerSlot.TRAINER, + true, + ), + ), + // Rival Floor 25 + [TrainerType.RIVAL_2]: new TrainerConfig(nextTrainerId()) + .setName("Finn") + .setHasGenders("Ivy") + .setHasCharSprite() + .setTitle("Rival") + .setStaticParty() + .setMoneyMultiplier(1.25) + .setEncounterBgm(TrainerType.RIVAL) + .setBattleBgm("battle_rival") + .setMixedBattleBgm("battle_rival") + .setPartyTemplates(trainerPartyTemplates.RIVAL_2) + .setModifierRewardFuncs(() => modifierTypes.EXP_SHARE) + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc( + [ + SpeciesId.IVYSAUR, + SpeciesId.CHARMELEON, + SpeciesId.WARTORTLE, + SpeciesId.BAYLEEF, + SpeciesId.QUILAVA, + SpeciesId.CROCONAW, + SpeciesId.GROVYLE, + SpeciesId.COMBUSKEN, + SpeciesId.MARSHTOMP, + SpeciesId.GROTLE, + SpeciesId.MONFERNO, + SpeciesId.PRINPLUP, + SpeciesId.SERVINE, + SpeciesId.PIGNITE, + SpeciesId.DEWOTT, + SpeciesId.QUILLADIN, + SpeciesId.BRAIXEN, + SpeciesId.FROGADIER, + SpeciesId.DARTRIX, + SpeciesId.TORRACAT, + SpeciesId.BRIONNE, + SpeciesId.THWACKEY, + SpeciesId.RABOOT, + SpeciesId.DRIZZILE, + SpeciesId.FLORAGATO, + SpeciesId.CROCALOR, + SpeciesId.QUAXWELL, + ], + TrainerSlot.TRAINER, + true, + p => (p.abilityIndex = 0), + ), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc( + [ + SpeciesId.PIDGEOTTO, + SpeciesId.HOOTHOOT, + SpeciesId.TAILLOW, + SpeciesId.STARAVIA, + SpeciesId.TRANQUILL, + SpeciesId.FLETCHINDER, + SpeciesId.TRUMBEAK, + SpeciesId.CORVISQUIRE, + SpeciesId.WATTREL, + ], + TrainerSlot.TRAINER, + true, + ), + ) + .setPartyMemberFunc( + 2, + getSpeciesFilterRandomPartyMemberFunc( + (species: PokemonSpecies) => + !pokemonEvolutions.hasOwnProperty(species.speciesId) + && !pokemonPrevolutions.hasOwnProperty(species.speciesId) + && species.baseTotal >= 450, + ), + ), + // Rival Floor 55 + [TrainerType.RIVAL_3]: new TrainerConfig(nextTrainerId()) + .setName("Finn") + .setHasGenders("Ivy") + .setHasCharSprite() + .setTitle("Rival") + .setStaticParty() + .setMoneyMultiplier(1.5) + .setEncounterBgm(TrainerType.RIVAL) + .setBattleBgm("battle_rival") + .setMixedBattleBgm("battle_rival") + .setPartyTemplates(trainerPartyTemplates.RIVAL_3) + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc( + [ + SpeciesId.VENUSAUR, + SpeciesId.CHARIZARD, + SpeciesId.BLASTOISE, + SpeciesId.MEGANIUM, + SpeciesId.TYPHLOSION, + SpeciesId.FERALIGATR, + SpeciesId.SCEPTILE, + SpeciesId.BLAZIKEN, + SpeciesId.SWAMPERT, + SpeciesId.TORTERRA, + SpeciesId.INFERNAPE, + SpeciesId.EMPOLEON, + SpeciesId.SERPERIOR, + SpeciesId.EMBOAR, + SpeciesId.SAMUROTT, + SpeciesId.CHESNAUGHT, + SpeciesId.DELPHOX, + SpeciesId.GRENINJA, + SpeciesId.DECIDUEYE, + SpeciesId.INCINEROAR, + SpeciesId.PRIMARINA, + SpeciesId.RILLABOOM, + SpeciesId.CINDERACE, + SpeciesId.INTELEON, + SpeciesId.MEOWSCARADA, + SpeciesId.SKELEDIRGE, + SpeciesId.QUAQUAVAL, + ], + TrainerSlot.TRAINER, + true, + p => (p.abilityIndex = 0), + ), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc( + [ + SpeciesId.PIDGEOT, + SpeciesId.NOCTOWL, + SpeciesId.SWELLOW, + SpeciesId.STARAPTOR, + SpeciesId.UNFEZANT, + SpeciesId.TALONFLAME, + SpeciesId.TOUCANNON, + SpeciesId.CORVIKNIGHT, + SpeciesId.KILOWATTREL, + ], + TrainerSlot.TRAINER, + true, + ), + ) + .setPartyMemberFunc( + 2, + getSpeciesFilterRandomPartyMemberFunc( + (species: PokemonSpecies) => + !pokemonEvolutions.hasOwnProperty(species.speciesId) + && !pokemonPrevolutions.hasOwnProperty(species.speciesId) + && species.baseTotal >= 450, + ), + ) + .setSpeciesFilter(species => species.baseTotal >= 540), + // Rival floor 95 + [TrainerType.RIVAL_4]: new TrainerConfig(nextTrainerId()) + .setName("Finn") + .setHasGenders("Ivy") + .setHasCharSprite() + .setTitle("Rival") + .setBoss() + .setStaticParty() + .setMoneyMultiplier(1.75) + .setEncounterBgm(TrainerType.RIVAL) + .setBattleBgm("battle_rival_2") + .setMixedBattleBgm("battle_rival_2") + .setPartyTemplates(trainerPartyTemplates.RIVAL_4) + .setModifierRewardFuncs(() => modifierTypes.TERA_ORB) + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc( + [ + SpeciesId.VENUSAUR, + SpeciesId.CHARIZARD, + SpeciesId.BLASTOISE, + SpeciesId.MEGANIUM, + SpeciesId.TYPHLOSION, + SpeciesId.FERALIGATR, + SpeciesId.SCEPTILE, + SpeciesId.BLAZIKEN, + SpeciesId.SWAMPERT, + SpeciesId.TORTERRA, + SpeciesId.INFERNAPE, + SpeciesId.EMPOLEON, + SpeciesId.SERPERIOR, + SpeciesId.EMBOAR, + SpeciesId.SAMUROTT, + SpeciesId.CHESNAUGHT, + SpeciesId.DELPHOX, + SpeciesId.GRENINJA, + SpeciesId.DECIDUEYE, + SpeciesId.INCINEROAR, + SpeciesId.PRIMARINA, + SpeciesId.RILLABOOM, + SpeciesId.CINDERACE, + SpeciesId.INTELEON, + SpeciesId.MEOWSCARADA, + SpeciesId.SKELEDIRGE, + SpeciesId.QUAQUAVAL, + ], + TrainerSlot.TRAINER, + true, + p => { + p.abilityIndex = 0; + p.teraType = p.species.type1; + }, + ), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc( + [ + SpeciesId.PIDGEOT, + SpeciesId.NOCTOWL, + SpeciesId.SWELLOW, + SpeciesId.STARAPTOR, + SpeciesId.UNFEZANT, + SpeciesId.TALONFLAME, + SpeciesId.TOUCANNON, + SpeciesId.CORVIKNIGHT, + SpeciesId.KILOWATTREL, + ], + TrainerSlot.TRAINER, + true, + ), + ) + .setPartyMemberFunc( + 2, + getSpeciesFilterRandomPartyMemberFunc( + (species: PokemonSpecies) => + !pokemonEvolutions.hasOwnProperty(species.speciesId) + && !pokemonPrevolutions.hasOwnProperty(species.speciesId) + && species.baseTotal >= 450, + ), + ) + .setSpeciesFilter(species => species.baseTotal >= 540) + .setInstantTera(0), // Tera starter to primary type + // Rival Floor 145 + [TrainerType.RIVAL_5]: new TrainerConfig(nextTrainerId()) + .setName("Finn") + .setHasGenders("Ivy") + .setHasCharSprite() + .setTitle("Rival") + .setBoss() + .setStaticParty() + .setMoneyMultiplier(2.25) + .setEncounterBgm(TrainerType.RIVAL) + .setBattleBgm("battle_rival_3") + .setMixedBattleBgm("battle_rival_3") + .setPartyTemplates(trainerPartyTemplates.RIVAL_5) + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc( + [ + SpeciesId.VENUSAUR, + SpeciesId.CHARIZARD, + SpeciesId.BLASTOISE, + SpeciesId.MEGANIUM, + SpeciesId.TYPHLOSION, + SpeciesId.FERALIGATR, + SpeciesId.SCEPTILE, + SpeciesId.BLAZIKEN, + SpeciesId.SWAMPERT, + SpeciesId.TORTERRA, + SpeciesId.INFERNAPE, + SpeciesId.EMPOLEON, + SpeciesId.SERPERIOR, + SpeciesId.EMBOAR, + SpeciesId.SAMUROTT, + SpeciesId.CHESNAUGHT, + SpeciesId.DELPHOX, + SpeciesId.GRENINJA, + SpeciesId.DECIDUEYE, + SpeciesId.INCINEROAR, + SpeciesId.PRIMARINA, + SpeciesId.RILLABOOM, + SpeciesId.CINDERACE, + SpeciesId.INTELEON, + SpeciesId.MEOWSCARADA, + SpeciesId.SKELEDIRGE, + SpeciesId.QUAQUAVAL, + ], + TrainerSlot.TRAINER, + true, + p => { + p.setBoss(true, 2); + p.abilityIndex = 0; + p.teraType = p.species.type1; + }, + ), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc( + [ + SpeciesId.PIDGEOT, + SpeciesId.NOCTOWL, + SpeciesId.SWELLOW, + SpeciesId.STARAPTOR, + SpeciesId.UNFEZANT, + SpeciesId.TALONFLAME, + SpeciesId.TOUCANNON, + SpeciesId.CORVIKNIGHT, + SpeciesId.KILOWATTREL, + ], + TrainerSlot.TRAINER, + true, + ), + ) + .setPartyMemberFunc( + 2, + getSpeciesFilterRandomPartyMemberFunc( + (species: PokemonSpecies) => + !pokemonEvolutions.hasOwnProperty(species.speciesId) + && !pokemonPrevolutions.hasOwnProperty(species.speciesId) + && species.baseTotal >= 450, + ), + ) + .setSpeciesFilter(species => species.baseTotal >= 540) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.RAYQUAZA], TrainerSlot.TRAINER, true, p => { + p.setBoss(true, 3); + p.pokeball = PokeballType.MASTER_BALL; + p.shiny = timedEventManager.getClassicTrainerShinyChance() === 0; + p.variant = 1; + }), + ) + .setInstantTera(0), // Tera starter to primary type + // Floor 195 + [TrainerType.RIVAL_6]: new TrainerConfig(nextTrainerId()) + .setName("Finn") + .setHasGenders("Ivy") + .setHasCharSprite() + .setTitle("Rival") + .setBoss() + .setStaticParty() + .setMoneyMultiplier(3) + .setEncounterBgm("final") + .setBattleBgm("battle_rival_3") + .setMixedBattleBgm("battle_rival_3") + .setPartyTemplates(trainerPartyTemplates.RIVAL_6) + .setPartyMemberFunc( + 0, + getRandomPartyMemberFunc( + [ + SpeciesId.VENUSAUR, + SpeciesId.CHARIZARD, + SpeciesId.BLASTOISE, + SpeciesId.MEGANIUM, + SpeciesId.TYPHLOSION, + SpeciesId.FERALIGATR, + SpeciesId.SCEPTILE, + SpeciesId.BLAZIKEN, + SpeciesId.SWAMPERT, + SpeciesId.TORTERRA, + SpeciesId.INFERNAPE, + SpeciesId.EMPOLEON, + SpeciesId.SERPERIOR, + SpeciesId.EMBOAR, + SpeciesId.SAMUROTT, + SpeciesId.CHESNAUGHT, + SpeciesId.DELPHOX, + SpeciesId.GRENINJA, + SpeciesId.DECIDUEYE, + SpeciesId.INCINEROAR, + SpeciesId.PRIMARINA, + SpeciesId.RILLABOOM, + SpeciesId.CINDERACE, + SpeciesId.INTELEON, + SpeciesId.MEOWSCARADA, + SpeciesId.SKELEDIRGE, + SpeciesId.QUAQUAVAL, + ], + TrainerSlot.TRAINER, + true, + p => { + p.setBoss(true, 3); + p.abilityIndex = 0; + p.teraType = p.species.type1; + p.generateAndPopulateMoveset(); + }, + ), + ) + .setPartyMemberFunc( + 1, + getRandomPartyMemberFunc( + [ + SpeciesId.PIDGEOT, + SpeciesId.NOCTOWL, + SpeciesId.SWELLOW, + SpeciesId.STARAPTOR, + SpeciesId.UNFEZANT, + SpeciesId.TALONFLAME, + SpeciesId.TOUCANNON, + SpeciesId.CORVIKNIGHT, + SpeciesId.KILOWATTREL, + ], + TrainerSlot.TRAINER, + true, + p => { + p.setBoss(true, 2); + p.generateAndPopulateMoveset(); + }, + ), + ) + .setPartyMemberFunc( + 2, + getSpeciesFilterRandomPartyMemberFunc( + (species: PokemonSpecies) => + !pokemonEvolutions.hasOwnProperty(species.speciesId) + && !pokemonPrevolutions.hasOwnProperty(species.speciesId) + && species.baseTotal >= 450, + ), + ) + .setSpeciesFilter(species => species.baseTotal >= 540) + .setPartyMemberFunc( + 5, + getRandomPartyMemberFunc([SpeciesId.RAYQUAZA], TrainerSlot.TRAINER, true, p => { + p.setBoss(); + p.generateAndPopulateMoveset(); + p.pokeball = PokeballType.MASTER_BALL; + p.shiny = timedEventManager.getClassicTrainerShinyChance() === 0; + p.variant = 1; + p.formIndex = 1; // Mega Rayquaza + p.generateName(); + }), + ) + .setInstantTera(0), // Tera starter to primary type +} +function getSpeciesFilterRandomPartyMemberFunc(arg0: (species: PokemonSpecies) => boolean): import("#types/trainer-funcs").PartyMemberFunc { + throw new Error("Function not implemented."); +} +