From 8357b60486e92af57b50e2bc449b9b9c020d1751 Mon Sep 17 00:00:00 2001 From: AJ Fontaine Date: Mon, 28 Apr 2025 15:02:06 -0400 Subject: [PATCH] Trainer config interface --- src/data/trainers/trainer-config.ts | 53 +++++++++++++++++++++++++++++ src/data/trainers/typedefs.ts | 6 +++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/src/data/trainers/trainer-config.ts b/src/data/trainers/trainer-config.ts index a2e62e6761b..0df769e7283 100644 --- a/src/data/trainers/trainer-config.ts +++ b/src/data/trainers/trainer-config.ts @@ -48,8 +48,28 @@ import type { TrainerTierPools, TrainerConfigs, PartyMemberFuncs, + TrainerPartyConfigs, } from "./typedefs"; +export interface TrainerPartyMemberConfig { + species: Species | Species[], + formIndex?: number, + abilityIndex?: number, + ability?: Abilities, // Using this will try to get the ability index on its own, useful for 2 mons sharing an ability + moves?: Moves[], // Up to 4 moves to set on the mon before move generation + teraType?: PokemonType, + instantTera?: boolean, + isBoss?: boolean, + bossBars?: number, + ball?: PokeballType, + vitamins?: number[] // Quantity of vitamins for each stat +} + +export type TrainerPartySetSlot = [ + slot: number, + config: TrainerPartyMemberConfig | TrainerPartyMemberConfig[] +] + /** Minimum BST for Pokemon generated onto the Elite Four's teams */ const ELITE_FOUR_MINIMUM_BST = 460; @@ -1039,6 +1059,39 @@ function getSpeciesFilterRandomPartyMemberFunc( }; } +export const trainerPartyConfigs: TrainerPartyConfigs = { + [TrainerType.LORELEI]: [ + [ 0, { + species: Species.DEWGONG, + ability: Abilities.THICK_FAT, + }], + [ 2, { + species: [Species.SLOWBRO, Species.GALAR_SLOWBRO ], + teraType: PokemonType.ICE, + instantTera: true, + moves: [Moves.ICE_BEAM], + }], + [ 3, {species: Species.JYNX}], + [ 4, {species: [Species.CLOYSTER, Species.ALOLA_SANDSLASH]}], + [ 5, {species: Species.LAPRAS, isBoss: true, bossBars: 2}] + ], + [TrainerType.LANCE]: [ + [ 0, {species: Species.KINGDRA}], + [ 2, [{ + species: Species.GYARADOS, + moves: [Moves.OUTRAGE] + }, + { + species: Species.AERODACTYL, + moves: [Moves.DRAGON_CLAW] + }] + ], + [ 3, {species: Species.ALOLA_EXEGGUTOR}], + [ 4, {species: Species.SALAMENCE}], + [ 5, {species: Species.DRAGONITE, isBoss: true, bossBars: 2}] + ] +} + export const trainerConfigs: TrainerConfigs = { [TrainerType.UNKNOWN]: new TrainerConfig(0).setHasGenders(), [TrainerType.ACE_TRAINER]: new TrainerConfig(++t) diff --git a/src/data/trainers/typedefs.ts b/src/data/trainers/typedefs.ts index c6d286e961e..8e916130384 100644 --- a/src/data/trainers/typedefs.ts +++ b/src/data/trainers/typedefs.ts @@ -2,7 +2,7 @@ import type { EnemyPokemon } from "#app/field/pokemon"; import type { PersistentModifier } from "#app/modifier/modifier"; import type { PartyMemberStrength } from "#enums/party-member-strength"; import type { Species } from "#enums/species"; -import type { TrainerConfig } from "./trainer-config"; +import type { TrainerConfig, TrainerPartySetSlot } from "./trainer-config"; import type { TrainerPartyTemplate } from "./TrainerPartyTemplate"; export type PartyTemplateFunc = () => TrainerPartyTemplate; @@ -20,3 +20,7 @@ export interface TrainerConfigs { export interface PartyMemberFuncs { [key: number]: PartyMemberFunc; } + +export interface TrainerPartyConfigs { + [key: number]: TrainerPartySetSlot[]; +}