# TrainerConfig | pokemon-rogue-battle
Documentation for pokemon-rogue-battle

# Class TrainerConfig

- Defined in src/data/trainers/trainer-config.ts:92

##### Index

### Constructors

constructor

### Properties

battleBgm
defeatMessages
doubleDefeatMessages
doubleEncounterBgm
doubleEncounterMessages
doubleOnly
doubleVictoryMessages
encounterBgm
encounterMessages
eventRewardFuncs
femaleDefeatMessages
femaleEncounterBgm
femaleEncounterMessages
femaleVictoryMessages
genAIFuncs
genModifiersFunc
hasCharSprite
hasDouble
hasGenders
hasStaticParty
hasVoucher
isBoss
mixedBattleBgm
modifierRewardFuncs
moneyMultiplier
name
nameDouble
nameFemale
partyMemberFuncs
partyTemplateFunc
partyTemplates
specialtyType
speciesFilter
speciesPools
title
titleDouble
trainerAI
trainerType
trainerTypeDouble
useSameSeedForAllMembers
victoryBgm
victoryMessages

### Methods

clone
getDerivedType
getKey
getSpriteKey
getTitle
hasSpecialtyType
initForChampion
initForEliteFour
initForEvilTeamAdmin
initForEvilTeamLeader
initForGymLeader
initForStatTrainer
loadAssets
setBattleBgm
setBoss
setDoubleMessages
setDoubleOnly
setDoubleTitle
setDoubleTrainerType
setEncounterBgm
setEventModifierRewardFuncs
setGenModifiersFunc
setHasCharSprite
setHasDouble
setHasGenders
setHasVoucher
setInstantTera
setLocalizedName
setMixedBattleBgm
setModifierRewardFuncs
setMoneyMultiplier
setName
setPartyMemberFunc
setPartyTemplateFunc
setPartyTemplates
setRandomTeraModifiers
setSpecialtyType
setSpeciesFilter
setSpeciesPools
setStaticParty
setTitle
setUseSameSeedForAllMembers
setVictoryBgm

## Constructors

### constructor

- new TrainerConfig(
  trainerType: TrainerType ,
  allowLegendaries?: boolean,
  ): TrainerConfig

  #### Parameters

  - trainerType: TrainerType
  - `Optional` allowLegendaries: boolean

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:139

## Properties

### battleBgm

battleBgm: string

- Defined in src/data/trainers/trainer-config.ts:109

### defeatMessages

defeatMessages: string[] = []

- Defined in src/data/trainers/trainer-config.ts:129

### doubleDefeatMessages

doubleDefeatMessages: string[]

- Defined in src/data/trainers/trainer-config.ts:137

### doubleEncounterBgm

doubleEncounterBgm: string

- Defined in src/data/trainers/trainer-config.ts:112

### doubleEncounterMessages

doubleEncounterMessages: string[]

- Defined in src/data/trainers/trainer-config.ts:135

### doubleOnly

doubleOnly: boolean = false

- Defined in src/data/trainers/trainer-config.ts:103

### doubleVictoryMessages

doubleVictoryMessages: string[]

- Defined in src/data/trainers/trainer-config.ts:136

### encounterBgm

encounterBgm: string

- Defined in src/data/trainers/trainer-config.ts:110

### encounterMessages

encounterMessages: string[] = []

- Defined in src/data/trainers/trainer-config.ts:127

### eventRewardFuncs

eventRewardFuncs: ModifierTypeFunc [] = []

- Defined in src/data/trainers/trainer-config.ts:119

### femaleDefeatMessages

femaleDefeatMessages: string[]

- Defined in src/data/trainers/trainer-config.ts:133

### femaleEncounterBgm

femaleEncounterBgm: string

- Defined in src/data/trainers/trainer-config.ts:111

### femaleEncounterMessages

femaleEncounterMessages: string[]

- Defined in src/data/trainers/trainer-config.ts:131

### femaleVictoryMessages

femaleVictoryMessages: string[]

- Defined in src/data/trainers/trainer-config.ts:132

### genAIFuncs

genAIFuncs: GenAIFunc [] = []

- Defined in src/data/trainers/trainer-config.ts:115

### genModifiersFunc

genModifiersFunc: GenModifiersFunc

- Defined in src/data/trainers/trainer-config.ts:114

### hasCharSprite

hasCharSprite: boolean = false

- Defined in src/data/trainers/trainer-config.ts:102

### hasDouble

hasDouble: boolean = false

- Defined in src/data/trainers/trainer-config.ts:101

### hasGenders

hasGenders: boolean = false

- Defined in src/data/trainers/trainer-config.ts:100

### hasStaticParty

hasStaticParty: boolean = false

- Defined in src/data/trainers/trainer-config.ts:106

### hasVoucher

hasVoucher: boolean = false

- Defined in src/data/trainers/trainer-config.ts:124

### isBoss

isBoss: boolean = false

- Defined in src/data/trainers/trainer-config.ts:105

### mixedBattleBgm

mixedBattleBgm: string

- Defined in src/data/trainers/trainer-config.ts:108

### modifierRewardFuncs

modifierRewardFuncs: ModifierTypeFunc [] = []

- Defined in src/data/trainers/trainer-config.ts:116

### moneyMultiplier

moneyMultiplier: number = 1

- Defined in src/data/trainers/trainer-config.ts:104

### name

name: string

- Defined in src/data/trainers/trainer-config.ts:95

### nameDouble

nameDouble: string

- Defined in src/data/trainers/trainer-config.ts:97

### nameFemale

nameFemale: string

- Defined in src/data/trainers/trainer-config.ts:96

### partyMemberFuncs

partyMemberFuncs: PartyMemberFuncs = {}

- Defined in src/data/trainers/trainer-config.ts:120

### partyTemplateFunc

partyTemplateFunc: PartyTemplateFunc

- Defined in src/data/trainers/trainer-config.ts:118

### partyTemplates

partyTemplates: TrainerPartyTemplate []

- Defined in src/data/trainers/trainer-config.ts:117

### specialtyType

specialtyType: PokemonType

- Defined in src/data/trainers/trainer-config.ts:123

### speciesFilter

speciesFilter: PokemonSpeciesFilter

- Defined in src/data/trainers/trainer-config.ts:122

### speciesPools

speciesPools: TrainerTierPools

- Defined in src/data/trainers/trainer-config.ts:121

### title

title: string

- Defined in src/data/trainers/trainer-config.ts:98

### titleDouble

titleDouble: string

- Defined in src/data/trainers/trainer-config.ts:99

### trainerAI

trainerAI: TrainerAI

- Defined in src/data/trainers/trainer-config.ts:125

### trainerType

trainerType: TrainerType

- Defined in src/data/trainers/trainer-config.ts:93

### trainerTypeDouble

trainerTypeDouble: TrainerType

- Defined in src/data/trainers/trainer-config.ts:94

### useSameSeedForAllMembers

useSameSeedForAllMembers: boolean = false

- Defined in src/data/trainers/trainer-config.ts:107

### victoryBgm

victoryBgm: string

- Defined in src/data/trainers/trainer-config.ts:113

### victoryMessages

victoryMessages: string[] = []

- Defined in src/data/trainers/trainer-config.ts:128

## Methods

### clone

- clone(): TrainerConfig

  Creates a shallow copy of a trainer config so that it can be modified without affecting the trainerConfigs source map

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:936

### getDerivedType

- getDerivedType(trainerTypeToDeriveFrom?: null | TrainerType ): TrainerType

  Returns the derived trainer type for a given trainer type.

  #### Parameters

  - trainerTypeToDeriveFrom: null | TrainerType = null

    The trainer type to derive from. (If null, the this.trainerType property will be used.)

  #### Returns TrainerType

  - The derived trainer type.
  - Defined in src/data/trainers/trainer-config.ts:215

### getKey

- getKey(): string

  #### Returns string

  - Defined in src/data/trainers/trainer-config.ts:152

### getSpriteKey

- getSpriteKey(female?: boolean, isDouble?: boolean): string

  #### Parameters

  - `Optional` female: boolean
  - isDouble: boolean = false

  #### Returns string

  - Defined in src/data/trainers/trainer-config.ts:156

### getTitle

- getTitle(trainerSlot?: TrainerSlot , variant: TrainerVariant ): string

  Retrieves the title for the trainer based on the provided trainer slot and variant.

  #### Parameters

  - trainerSlot: TrainerSlot = TrainerSlot.NONE

    The slot to determine which title to use. Defaults to TrainerSlot.NONE.

  - variant: TrainerVariant

    The variant of the trainer to determine the specific title.

  #### Returns string

  - The title of the trainer.
  - Defined in src/data/trainers/trainer-config.ts:837

### hasSpecialtyType

- hasSpecialtyType(): boolean

  Helper function to check if a specialty type is set

  #### Returns boolean

  true if specialtyType is defined and not Type.UNKNOWN

  - Defined in src/data/trainers/trainer-config.ts:929

### initForChampion

- initForChampion(isMale: boolean): TrainerConfig

  Initializes the trainer configuration for a Champion.

  #### Parameters

  - isMale: boolean

    Whether the Champion is Male or Female (for localization of the title).

  #### Returns TrainerConfig

  The updated TrainerConfig instance.

  - Defined in src/data/trainers/trainer-config.ts:787

### initForEliteFour

- initForEliteFour(
  signatureSpecies: (Species | Species [])[],
  isMale: boolean,
  specialtyType?: PokemonType ,
  teraSlot?: number,
  ): TrainerConfig

  Initializes the trainer configuration for an Elite Four member.

  #### Parameters

  - signatureSpecies: (Species | Species [])[]

    The signature species for the Elite Four member.

  - isMale: boolean

    Whether the Elite Four Member is Male or Female (for localization of the title).

  - `Optional` specialtyType: PokemonType

    {PokemonType} The specialty type for the Elite Four member.

  - `Optional` teraSlot: number

    Optional, sets the party member in this slot to Terastallize.

  #### Returns TrainerConfig

  The updated TrainerConfig instance.

  - Defined in src/data/trainers/trainer-config.ts:727

### initForEvilTeamAdmin

- initForEvilTeamAdmin(
  title: string,
  poolName: EvilTeam ,
  signatureSpecies: (Species | Species [])[],
  specialtyType?: PokemonType ,
  ): TrainerConfig

  Initializes the trainer configuration for an evil team admin.

  #### Parameters

  - title: string

    The title of the evil team admin.

  - poolName: EvilTeam

    The evil team the admin belongs to.

  - signatureSpecies: (Species | Species [])[]

    The signature species for the evil team leader.

  - `Optional` specialtyType: PokemonType

    The specialty Type of the admin, if they have one

  #### Returns TrainerConfig

  The updated TrainerConfig instance. *

  - Defined in src/data/trainers/trainer-config.ts:548

### initForEvilTeamLeader

- initForEvilTeamLeader(
  title: string,
  signatureSpecies: (Species | Species [])[],
  rematch?: boolean,
  specialtyType?: PokemonType ,
  ): TrainerConfig

  Initializes the trainer configuration for an evil team leader. Temporarily hardcoding evil leader teams though.

  #### Parameters

  - title: string
  - signatureSpecies: (Species | Species [])[]

    The signature species for the evil team leader.

  - rematch: boolean = false
  - `Optional` specialtyType: PokemonType

    The specialty type for the evil team Leader.

  #### Returns TrainerConfig

  The updated TrainerConfig instance. *

  - Defined in src/data/trainers/trainer-config.ts:619

### initForGymLeader

- initForGymLeader(
  signatureSpecies: (Species | Species [])[],
  isMale: boolean,
  specialtyType: PokemonType ,
  ignoreMinTeraWave?: boolean,
  teraSlot?: number,
  ): TrainerConfig

  Initializes the trainer configuration for a Gym Leader.

  #### Parameters

  - signatureSpecies: (Species | Species [])[]

    The signature species for the Gym Leader. Added to party in reverse order.

  - isMale: boolean

    Whether the Gym Leader is Male or Not (for localization of the title).

  - specialtyType: PokemonType

    The specialty type for the Gym Leader.

  - ignoreMinTeraWave: boolean = false

    Whether the Gym Leader always uses Tera (true), or only Teras after GYM_LEADER_TERA_WAVE (false). Defaults to false.

  - `Optional` teraSlot: number

    Optional, sets the party member in this slot to Terastallize. Wraps based on party size.

  #### Returns TrainerConfig

  The updated TrainerConfig instance. *

  - Defined in src/data/trainers/trainer-config.ts:665

### initForStatTrainer

- initForStatTrainer(_isMale?: boolean): TrainerConfig

  Initializes the trainer configuration for a Stat Trainer, as part of the Trainer's Test Mystery Encounter.

  #### Parameters

  - _isMale: boolean = false

    Whether the stat trainer is Male or Female (for localization of the title).

  #### Returns TrainerConfig

  The updated TrainerConfig instance.

  - Defined in src/data/trainers/trainer-config.ts:592

### loadAssets

- loadAssets(variant: TrainerVariant ): Promise<void>

  #### Parameters

  - variant: TrainerVariant

  #### Returns Promise<void>

  - Defined in src/data/trainers/trainer-config.ts:873

### setBattleBgm

- setBattleBgm(battleBgm: string): TrainerConfig

  #### Parameters

  - battleBgm: string

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:418

### setBoss

- setBoss(): TrainerConfig

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:398

### setDoubleMessages

- setDoubleMessages(nameDouble: string): void

  Sets the encounter and victory messages for double trainers.

  #### Parameters

  - nameDouble: string

    The name of the pair (e.g. "red_blue_double").

  #### Returns void

  - Defined in src/data/trainers/trainer-config.ts:353

### setDoubleOnly

- setDoubleOnly(): TrainerConfig

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:388

### setDoubleTitle

- setDoubleTitle(titleDouble: string): TrainerConfig

  Sets the title for double trainers

  #### Parameters

  - titleDouble: string

    The key for the title in the i18n file. (e.g., "champion_double").

  #### Returns TrainerConfig

  The updated TrainerConfig instance.

  - Defined in src/data/trainers/trainer-config.ts:368

### setDoubleTrainerType

- setDoubleTrainerType(trainerTypeDouble: TrainerType ): TrainerConfig

  Sets the trainer type for double battles.

  #### Parameters

  - trainerTypeDouble: TrainerType

    The TrainerType of the partner in a double battle.

  #### Returns TrainerConfig

  The updated TrainerConfig instance.

  - Defined in src/data/trainers/trainer-config.ts:343

### setEncounterBgm

- setEncounterBgm(encounterBgm: string | TrainerType ): TrainerConfig

  #### Parameters

  - encounterBgm: string | TrainerType

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:423

### setEventModifierRewardFuncs

- setEventModifierRewardFuncs(wave: number): TrainerConfig

  Sets eventRewardFuncs to the active event rewards for the specified wave

  #### Parameters

  - wave: number

    Associated with getFixedBattleEventRewards

  #### Returns TrainerConfig

  this

  - Defined in src/data/trainers/trainer-config.ts:525

### setGenModifiersFunc

- setGenModifiersFunc(genModifiersFunc: GenModifiersFunc ): TrainerConfig

  #### Parameters

  - genModifiersFunc: GenModifiersFunc

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:467

### setHasCharSprite

- setHasCharSprite(): TrainerConfig

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:383

### setHasDouble

- setHasDouble(
  nameDouble: string,
  doubleEncounterBgm?: string | TrainerType ,
  ): TrainerConfig

  Sets the configuration for trainers with double battles, including the name of the double trainer and the encounter BGM.

  #### Parameters

  - nameDouble: string

    The name of the double trainer (e.g., "Ace Duo" for Trainer Class Doubles or "red_blue_double" for NAMED trainer doubles).

  - `Optional` doubleEncounterBgm: string | TrainerType

    The encounter BGM for the double trainer, which can be a TrainerType or a string.

  #### Returns TrainerConfig

  The updated TrainerConfig instance.

  - Defined in src/data/trainers/trainer-config.ts:326

### setHasGenders

- setHasGenders(
  nameFemale?: string,
  femaleEncounterBgm?: string | TrainerType ,
  ): TrainerConfig

  Sets the configuration for trainers with genders, including the female name and encounter background music (BGM).

  #### Parameters

  - `Optional` nameFemale: string

    The name of the female trainer. If 'Ivy', a localized name will be assigned.

  - `Optional` femaleEncounterBgm: string | TrainerType

    The encounter BGM for the female trainer, which can be a TrainerType or a string.

  #### Returns TrainerConfig

  The updated TrainerConfig instance.

  - Defined in src/data/trainers/trainer-config.ts:288

### setHasVoucher

- setHasVoucher(hasVoucher: boolean): void

  Sets if a boss trainer will have a voucher or not.

  #### Parameters

  - hasVoucher: boolean

    If the boss trainer will have a voucher.

  #### Returns void

  - Defined in src/data/trainers/trainer-config.ts:191

### setInstantTera

- setInstantTera(index: number): TrainerConfig

  Sets a specific pokemon to instantly Tera

  #### Parameters

  - index: number

    The index within the team to have instant Tera.

  #### Returns TrainerConfig

  this

  - Defined in src/data/trainers/trainer-config.ts:504

### setLocalizedName

- setLocalizedName(name: string): TrainerConfig

  Sets a localized name for the trainer. This should only be used for trainers that dont use a "initFor" function and are considered "named" trainers

  #### Parameters

  - name: string

    The name of the trainer.

  #### Returns TrainerConfig

  The updated TrainerConfig instance.

  - Defined in src/data/trainers/trainer-config.ts:822

### setMixedBattleBgm

- setMixedBattleBgm(mixedBattleBgm: string): TrainerConfig

  #### Parameters

  - mixedBattleBgm: string

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:413

### setModifierRewardFuncs

- setModifierRewardFuncs(
  ...modifierTypeFuncs: (() => ModifierTypeFunc)[],
  ): TrainerConfig

  #### Parameters

  - ...modifierTypeFuncs: (() => ModifierTypeFunc)[]

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:530

### setMoneyMultiplier

- setMoneyMultiplier(moneyMultiplier: number): TrainerConfig

  #### Parameters

  - moneyMultiplier: number

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:393

### setName

- setName(name: string): TrainerConfig

  #### Parameters

  - name: string

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:169

### setPartyMemberFunc

- setPartyMemberFunc(
  slotIndex: number,
  partyMemberFunc: PartyMemberFunc ,
  ): TrainerConfig

  #### Parameters

  - slotIndex: number
  - partyMemberFunc: PartyMemberFunc

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:444

### setPartyTemplateFunc

- setPartyTemplateFunc(partyTemplateFunc: PartyTemplateFunc ): TrainerConfig

  #### Parameters

  - partyTemplateFunc: PartyTemplateFunc

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:439

### setPartyTemplates

- setPartyTemplates(...partyTemplates: TrainerPartyTemplate []): TrainerConfig

  #### Parameters

  - ...partyTemplates: TrainerPartyTemplate []

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:434

### setRandomTeraModifiers

- setRandomTeraModifiers(count: () => number, slot?: number): TrainerConfig

  Sets random pokemon from the trainer's team to instant tera. Also sets Tera type to specialty type and checks for Shedinja as appropriate.

  #### Parameters

  - count: () => number

    A callback (yucky) to see how many teras should be used

  - `Optional` slot: number

    Optional, a specified slot that should be terastallized. Wraps to match party size (-1 will get the last slot and so on).

  #### Returns TrainerConfig

  this

  - Defined in src/data/trainers/trainer-config.ts:478

### setSpecialtyType

- setSpecialtyType(specialtyType: PokemonType ): TrainerConfig

  #### Parameters

  - specialtyType: PokemonType

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:462

### setSpeciesFilter

- setSpeciesFilter(
  speciesFilter: PokemonSpeciesFilter ,
  allowLegendaries?: boolean,
  ): TrainerConfig

  #### Parameters

  - speciesFilter: PokemonSpeciesFilter
  - `Optional` allowLegendaries: boolean

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:456

### setSpeciesPools

- setSpeciesPools(speciesPools: Species [] | TrainerTierPools ): TrainerConfig

  #### Parameters

  - speciesPools: Species [] | TrainerTierPools

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:449

### setStaticParty

- setStaticParty(): TrainerConfig

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:403

### setTitle

- setTitle(title: string): TrainerConfig

  #### Parameters

  - title: string

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:195

### setUseSameSeedForAllMembers

- setUseSameSeedForAllMembers(): TrainerConfig

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:408

### setVictoryBgm

- setVictoryBgm(victoryBgm: string): TrainerConfig

  #### Parameters

  - victoryBgm: string

  #### Returns TrainerConfig

  - Defined in src/data/trainers/trainer-config.ts:429