mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-07 07:59:26 +02:00
[Dev] Move Fixed Battle Configs to own file (#6054)
This commit is contained in:
parent
e05d85977e
commit
583b3758c0
@ -2,8 +2,8 @@ import type { PartyMemberStrength } from "#enums/party-member-strength";
|
||||
import type { SpeciesId } from "#enums/species-id";
|
||||
import type { EnemyPokemon } from "#field/pokemon";
|
||||
import type { PersistentModifier } from "#modifiers/modifier";
|
||||
import type { TrainerPartyTemplate } from "#trainers/TrainerPartyTemplate";
|
||||
import type { TrainerConfig } from "#trainers/trainer-config";
|
||||
import type { TrainerPartyTemplate } from "#trainers/trainer-party-template";
|
||||
|
||||
export type PartyTemplateFunc = () => TrainerPartyTemplate;
|
||||
export type PartyMemberFunc = (level: number, strength: PartyMemberStrength) => EnemyPokemon;
|
||||
|
369
src/battle.ts
369
src/battle.ts
@ -5,12 +5,9 @@ import { BattleSpec } from "#enums/battle-spec";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { BattlerIndex } from "#enums/battler-index";
|
||||
import type { Command } from "#enums/command";
|
||||
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||
import { ModifierTier } from "#enums/modifier-tier";
|
||||
import type { MoveId } from "#enums/move-id";
|
||||
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
||||
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
import { PlayerGender } from "#enums/player-gender";
|
||||
import type { PokeballType } from "#enums/pokeball";
|
||||
import { SpeciesFormKey } from "#enums/species-form-key";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
@ -577,369 +574,3 @@ export function getRandomTrainerFunc(
|
||||
return new Trainer(trainerTypes[rand], trainerGender);
|
||||
};
|
||||
}
|
||||
|
||||
export interface FixedBattleConfigs {
|
||||
[key: number]: FixedBattleConfig;
|
||||
}
|
||||
/**
|
||||
* Youngster/Lass on 5
|
||||
* Rival on 8, 55, 95, 145, 195
|
||||
* Evil team grunts on 35, 62, 64, and 112
|
||||
* Evil team admin on 66 and 114
|
||||
* Evil leader on 115, 165
|
||||
* E4 on 182, 184, 186, 188
|
||||
* Champion on 190
|
||||
*/
|
||||
export const classicFixedBattles: FixedBattleConfigs = {
|
||||
[ClassicFixedBossWaves.TOWN_YOUNGSTER]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
() => new Trainer(TrainerType.YOUNGSTER, randSeedInt(2) ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT),
|
||||
),
|
||||
[ClassicFixedBossWaves.RIVAL_1]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
() =>
|
||||
new Trainer(
|
||||
TrainerType.RIVAL,
|
||||
globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT,
|
||||
),
|
||||
),
|
||||
[ClassicFixedBossWaves.RIVAL_2]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
() =>
|
||||
new Trainer(
|
||||
TrainerType.RIVAL_2,
|
||||
globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT,
|
||||
),
|
||||
)
|
||||
.setCustomModifierRewards({
|
||||
guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.GREAT, ModifierTier.GREAT],
|
||||
allowLuckUpgrades: false,
|
||||
}),
|
||||
[ClassicFixedBossWaves.EVIL_GRUNT_1]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc(
|
||||
[
|
||||
TrainerType.ROCKET_GRUNT,
|
||||
TrainerType.MAGMA_GRUNT,
|
||||
TrainerType.AQUA_GRUNT,
|
||||
TrainerType.GALACTIC_GRUNT,
|
||||
TrainerType.PLASMA_GRUNT,
|
||||
TrainerType.FLARE_GRUNT,
|
||||
TrainerType.AETHER_GRUNT,
|
||||
TrainerType.SKULL_GRUNT,
|
||||
TrainerType.MACRO_GRUNT,
|
||||
TrainerType.STAR_GRUNT,
|
||||
],
|
||||
true,
|
||||
),
|
||||
),
|
||||
[ClassicFixedBossWaves.RIVAL_3]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
() =>
|
||||
new Trainer(
|
||||
TrainerType.RIVAL_3,
|
||||
globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT,
|
||||
),
|
||||
)
|
||||
.setCustomModifierRewards({
|
||||
guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.GREAT, ModifierTier.GREAT],
|
||||
allowLuckUpgrades: false,
|
||||
}),
|
||||
[ClassicFixedBossWaves.EVIL_GRUNT_2]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc(
|
||||
[
|
||||
TrainerType.ROCKET_GRUNT,
|
||||
TrainerType.MAGMA_GRUNT,
|
||||
TrainerType.AQUA_GRUNT,
|
||||
TrainerType.GALACTIC_GRUNT,
|
||||
TrainerType.PLASMA_GRUNT,
|
||||
TrainerType.FLARE_GRUNT,
|
||||
TrainerType.AETHER_GRUNT,
|
||||
TrainerType.SKULL_GRUNT,
|
||||
TrainerType.MACRO_GRUNT,
|
||||
TrainerType.STAR_GRUNT,
|
||||
],
|
||||
true,
|
||||
),
|
||||
),
|
||||
[ClassicFixedBossWaves.EVIL_GRUNT_3]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc(
|
||||
[
|
||||
TrainerType.ROCKET_GRUNT,
|
||||
TrainerType.MAGMA_GRUNT,
|
||||
TrainerType.AQUA_GRUNT,
|
||||
TrainerType.GALACTIC_GRUNT,
|
||||
TrainerType.PLASMA_GRUNT,
|
||||
TrainerType.FLARE_GRUNT,
|
||||
TrainerType.AETHER_GRUNT,
|
||||
TrainerType.SKULL_GRUNT,
|
||||
TrainerType.MACRO_GRUNT,
|
||||
TrainerType.STAR_GRUNT,
|
||||
],
|
||||
true,
|
||||
),
|
||||
),
|
||||
[ClassicFixedBossWaves.EVIL_ADMIN_1]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc(
|
||||
[
|
||||
[TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL],
|
||||
[TrainerType.TABITHA, TrainerType.COURTNEY],
|
||||
[TrainerType.MATT, TrainerType.SHELLY],
|
||||
[TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN],
|
||||
[TrainerType.ZINZOLIN, TrainerType.COLRESS],
|
||||
[TrainerType.XEROSIC, TrainerType.BRYONY],
|
||||
TrainerType.FABA,
|
||||
TrainerType.PLUMERIA,
|
||||
TrainerType.OLEANA,
|
||||
[TrainerType.GIACOMO, TrainerType.MELA, TrainerType.ATTICUS, TrainerType.ORTEGA, TrainerType.ERI],
|
||||
],
|
||||
true,
|
||||
),
|
||||
),
|
||||
[ClassicFixedBossWaves.RIVAL_4]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
() =>
|
||||
new Trainer(
|
||||
TrainerType.RIVAL_4,
|
||||
globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT,
|
||||
),
|
||||
)
|
||||
.setCustomModifierRewards({
|
||||
guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA],
|
||||
allowLuckUpgrades: false,
|
||||
}),
|
||||
[ClassicFixedBossWaves.EVIL_GRUNT_4]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc(
|
||||
[
|
||||
TrainerType.ROCKET_GRUNT,
|
||||
TrainerType.MAGMA_GRUNT,
|
||||
TrainerType.AQUA_GRUNT,
|
||||
TrainerType.GALACTIC_GRUNT,
|
||||
TrainerType.PLASMA_GRUNT,
|
||||
TrainerType.FLARE_GRUNT,
|
||||
TrainerType.AETHER_GRUNT,
|
||||
TrainerType.SKULL_GRUNT,
|
||||
TrainerType.MACRO_GRUNT,
|
||||
TrainerType.STAR_GRUNT,
|
||||
],
|
||||
true,
|
||||
),
|
||||
),
|
||||
[ClassicFixedBossWaves.EVIL_ADMIN_2]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc(
|
||||
[
|
||||
[TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL],
|
||||
[TrainerType.TABITHA, TrainerType.COURTNEY],
|
||||
[TrainerType.MATT, TrainerType.SHELLY],
|
||||
[TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN],
|
||||
[TrainerType.ZINZOLIN, TrainerType.COLRESS],
|
||||
[TrainerType.XEROSIC, TrainerType.BRYONY],
|
||||
TrainerType.FABA,
|
||||
TrainerType.PLUMERIA,
|
||||
TrainerType.OLEANA,
|
||||
[TrainerType.GIACOMO, TrainerType.MELA, TrainerType.ATTICUS, TrainerType.ORTEGA, TrainerType.ERI],
|
||||
],
|
||||
true,
|
||||
1,
|
||||
),
|
||||
),
|
||||
[ClassicFixedBossWaves.EVIL_BOSS_1]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc([
|
||||
TrainerType.ROCKET_BOSS_GIOVANNI_1,
|
||||
TrainerType.MAXIE,
|
||||
TrainerType.ARCHIE,
|
||||
TrainerType.CYRUS,
|
||||
TrainerType.GHETSIS,
|
||||
TrainerType.LYSANDRE,
|
||||
TrainerType.LUSAMINE,
|
||||
TrainerType.GUZMA,
|
||||
TrainerType.ROSE,
|
||||
TrainerType.PENNY,
|
||||
]),
|
||||
)
|
||||
.setCustomModifierRewards({
|
||||
guaranteedModifierTiers: [
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ULTRA,
|
||||
ModifierTier.ULTRA,
|
||||
ModifierTier.ULTRA,
|
||||
],
|
||||
allowLuckUpgrades: false,
|
||||
}),
|
||||
[ClassicFixedBossWaves.RIVAL_5]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
() =>
|
||||
new Trainer(
|
||||
TrainerType.RIVAL_5,
|
||||
globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT,
|
||||
),
|
||||
)
|
||||
.setCustomModifierRewards({
|
||||
guaranteedModifierTiers: [
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ULTRA,
|
||||
ModifierTier.ULTRA,
|
||||
],
|
||||
allowLuckUpgrades: false,
|
||||
}),
|
||||
[ClassicFixedBossWaves.EVIL_BOSS_2]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc([
|
||||
TrainerType.ROCKET_BOSS_GIOVANNI_2,
|
||||
TrainerType.MAXIE_2,
|
||||
TrainerType.ARCHIE_2,
|
||||
TrainerType.CYRUS_2,
|
||||
TrainerType.GHETSIS_2,
|
||||
TrainerType.LYSANDRE_2,
|
||||
TrainerType.LUSAMINE_2,
|
||||
TrainerType.GUZMA_2,
|
||||
TrainerType.ROSE_2,
|
||||
TrainerType.PENNY_2,
|
||||
]),
|
||||
)
|
||||
.setCustomModifierRewards({
|
||||
guaranteedModifierTiers: [
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ULTRA,
|
||||
ModifierTier.ULTRA,
|
||||
ModifierTier.ULTRA,
|
||||
ModifierTier.ULTRA,
|
||||
],
|
||||
allowLuckUpgrades: false,
|
||||
}),
|
||||
[ClassicFixedBossWaves.ELITE_FOUR_1]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc([
|
||||
TrainerType.LORELEI,
|
||||
TrainerType.WILL,
|
||||
TrainerType.SIDNEY,
|
||||
TrainerType.AARON,
|
||||
TrainerType.SHAUNTAL,
|
||||
TrainerType.MALVA,
|
||||
[TrainerType.HALA, TrainerType.MOLAYNE],
|
||||
TrainerType.MARNIE_ELITE,
|
||||
TrainerType.RIKA,
|
||||
TrainerType.CRISPIN,
|
||||
]),
|
||||
),
|
||||
[ClassicFixedBossWaves.ELITE_FOUR_2]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.ELITE_FOUR_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc([
|
||||
TrainerType.BRUNO,
|
||||
TrainerType.KOGA,
|
||||
TrainerType.PHOEBE,
|
||||
TrainerType.BERTHA,
|
||||
TrainerType.MARSHAL,
|
||||
TrainerType.SIEBOLD,
|
||||
TrainerType.OLIVIA,
|
||||
TrainerType.NESSA_ELITE,
|
||||
TrainerType.POPPY,
|
||||
TrainerType.AMARYS,
|
||||
]),
|
||||
),
|
||||
[ClassicFixedBossWaves.ELITE_FOUR_3]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.ELITE_FOUR_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc([
|
||||
TrainerType.AGATHA,
|
||||
TrainerType.BRUNO,
|
||||
TrainerType.GLACIA,
|
||||
TrainerType.FLINT,
|
||||
TrainerType.GRIMSLEY,
|
||||
TrainerType.WIKSTROM,
|
||||
TrainerType.ACEROLA,
|
||||
[TrainerType.BEA_ELITE, TrainerType.ALLISTER_ELITE],
|
||||
TrainerType.LARRY_ELITE,
|
||||
TrainerType.LACEY,
|
||||
]),
|
||||
),
|
||||
[ClassicFixedBossWaves.ELITE_FOUR_4]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.ELITE_FOUR_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc([
|
||||
TrainerType.LANCE,
|
||||
TrainerType.KAREN,
|
||||
TrainerType.DRAKE,
|
||||
TrainerType.LUCIAN,
|
||||
TrainerType.CAITLIN,
|
||||
TrainerType.DRASNA,
|
||||
TrainerType.KAHILI,
|
||||
TrainerType.RAIHAN_ELITE,
|
||||
TrainerType.HASSEL,
|
||||
TrainerType.DRAYTON,
|
||||
]),
|
||||
),
|
||||
[ClassicFixedBossWaves.CHAMPION]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.ELITE_FOUR_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc([
|
||||
TrainerType.BLUE,
|
||||
[TrainerType.RED, TrainerType.LANCE_CHAMPION],
|
||||
[TrainerType.STEVEN, TrainerType.WALLACE],
|
||||
TrainerType.CYNTHIA,
|
||||
[TrainerType.ALDER, TrainerType.IRIS],
|
||||
TrainerType.DIANTHA,
|
||||
[TrainerType.KUKUI, TrainerType.HAU],
|
||||
[TrainerType.LEON, TrainerType.MUSTARD],
|
||||
[TrainerType.GEETA, TrainerType.NEMONA],
|
||||
TrainerType.KIERAN,
|
||||
]),
|
||||
),
|
||||
[ClassicFixedBossWaves.RIVAL_6]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
() =>
|
||||
new Trainer(
|
||||
TrainerType.RIVAL_6,
|
||||
globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT,
|
||||
),
|
||||
)
|
||||
.setCustomModifierRewards({
|
||||
guaranteedModifierTiers: [
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ULTRA,
|
||||
ModifierTier.ULTRA,
|
||||
ModifierTier.GREAT,
|
||||
ModifierTier.GREAT,
|
||||
],
|
||||
allowLuckUpgrades: false,
|
||||
}),
|
||||
};
|
||||
|
@ -44,8 +44,8 @@ import {
|
||||
HeldItemRequirement,
|
||||
TypeRequirement,
|
||||
} from "#mystery-encounters/mystery-encounter-requirements";
|
||||
import { TrainerPartyCompoundTemplate, TrainerPartyTemplate } from "#trainers/TrainerPartyTemplate";
|
||||
import { getRandomPartyMemberFunc, trainerConfigs } from "#trainers/trainer-config";
|
||||
import { TrainerPartyCompoundTemplate, TrainerPartyTemplate } from "#trainers/trainer-party-template";
|
||||
import type { OptionSelectItem } from "#ui/abstact-option-select-ui-handler";
|
||||
import { MoveInfoOverlay } from "#ui/move-info-overlay";
|
||||
import { isNullOrUndefined, randSeedInt, randSeedShuffle } from "#utils/common";
|
||||
|
@ -43,8 +43,8 @@ import {
|
||||
import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter";
|
||||
import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter";
|
||||
import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encounter-option";
|
||||
import { TrainerPartyCompoundTemplate, TrainerPartyTemplate } from "#trainers/TrainerPartyTemplate";
|
||||
import { trainerConfigs } from "#trainers/trainer-config";
|
||||
import { TrainerPartyCompoundTemplate, TrainerPartyTemplate } from "#trainers/trainer-party-template";
|
||||
import type { OptionSelectConfig } from "#ui/abstact-option-select-ui-handler";
|
||||
import { randSeedInt, randSeedShuffle } from "#utils/common";
|
||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||
|
@ -9,12 +9,12 @@ import type { EnemyPartyConfig } from "#mystery-encounters/encounter-phase-utils
|
||||
import { initBattleWithEnemyConfig, setEncounterRewards } from "#mystery-encounters/encounter-phase-utils";
|
||||
import type { MysteryEncounter } from "#mystery-encounters/mystery-encounter";
|
||||
import { MysteryEncounterBuilder } from "#mystery-encounters/mystery-encounter";
|
||||
import { trainerConfigs } from "#trainers/trainer-config";
|
||||
import {
|
||||
TrainerPartyCompoundTemplate,
|
||||
TrainerPartyTemplate,
|
||||
trainerPartyTemplates,
|
||||
} from "#trainers/TrainerPartyTemplate";
|
||||
import { trainerConfigs } from "#trainers/trainer-config";
|
||||
} from "#trainers/trainer-party-template";
|
||||
import { randSeedInt } from "#utils/common";
|
||||
|
||||
/** the i18n namespace for the encounter */
|
||||
|
@ -36,8 +36,8 @@ import { MysteryEncounterOptionBuilder } from "#mystery-encounters/mystery-encou
|
||||
import i18next from "#plugins/i18n";
|
||||
import { achvs } from "#system/achv";
|
||||
import { PokemonData } from "#system/pokemon-data";
|
||||
import { TrainerPartyTemplate } from "#trainers/TrainerPartyTemplate";
|
||||
import { trainerConfigs } from "#trainers/trainer-config";
|
||||
import { TrainerPartyTemplate } from "#trainers/trainer-party-template";
|
||||
import type { HeldModifierConfig } from "#types/held-modifier-config";
|
||||
import { isNullOrUndefined, NumberHolder, randSeedInt, randSeedShuffle } from "#utils/common";
|
||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||
|
376
src/data/trainers/fixed-battle-configs.ts
Normal file
376
src/data/trainers/fixed-battle-configs.ts
Normal file
@ -0,0 +1,376 @@
|
||||
import { FixedBattleConfig, getRandomTrainerFunc } from "#app/battle";
|
||||
import { Trainer } from "#app/field/trainer";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { randSeedInt } from "#app/utils/common";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||
import { ModifierTier } from "#enums/modifier-tier";
|
||||
import { PlayerGender } from "#enums/player-gender";
|
||||
import { TrainerType } from "#enums/trainer-type";
|
||||
import { TrainerVariant } from "#enums/trainer-variant";
|
||||
|
||||
export interface FixedBattleConfigs {
|
||||
[key: number]: FixedBattleConfig;
|
||||
}
|
||||
/**
|
||||
* Youngster/Lass on 5
|
||||
* Rival on 8, 55, 95, 145, 195
|
||||
* Evil team grunts on 35, 62, 64, and 112
|
||||
* Evil team admin on 66 and 114
|
||||
* Evil leader on 115, 165
|
||||
* E4 on 182, 184, 186, 188
|
||||
* Champion on 190
|
||||
*/
|
||||
export const classicFixedBattles: FixedBattleConfigs = {
|
||||
[ClassicFixedBossWaves.TOWN_YOUNGSTER]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
() => new Trainer(TrainerType.YOUNGSTER, randSeedInt(2) ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT),
|
||||
),
|
||||
[ClassicFixedBossWaves.RIVAL_1]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
() =>
|
||||
new Trainer(
|
||||
TrainerType.RIVAL,
|
||||
globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT,
|
||||
),
|
||||
),
|
||||
[ClassicFixedBossWaves.RIVAL_2]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
() =>
|
||||
new Trainer(
|
||||
TrainerType.RIVAL_2,
|
||||
globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT,
|
||||
),
|
||||
)
|
||||
.setCustomModifierRewards({
|
||||
guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.GREAT, ModifierTier.GREAT],
|
||||
allowLuckUpgrades: false,
|
||||
}),
|
||||
[ClassicFixedBossWaves.EVIL_GRUNT_1]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc(
|
||||
[
|
||||
TrainerType.ROCKET_GRUNT,
|
||||
TrainerType.MAGMA_GRUNT,
|
||||
TrainerType.AQUA_GRUNT,
|
||||
TrainerType.GALACTIC_GRUNT,
|
||||
TrainerType.PLASMA_GRUNT,
|
||||
TrainerType.FLARE_GRUNT,
|
||||
TrainerType.AETHER_GRUNT,
|
||||
TrainerType.SKULL_GRUNT,
|
||||
TrainerType.MACRO_GRUNT,
|
||||
TrainerType.STAR_GRUNT,
|
||||
],
|
||||
true,
|
||||
),
|
||||
),
|
||||
[ClassicFixedBossWaves.RIVAL_3]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
() =>
|
||||
new Trainer(
|
||||
TrainerType.RIVAL_3,
|
||||
globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT,
|
||||
),
|
||||
)
|
||||
.setCustomModifierRewards({
|
||||
guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.GREAT, ModifierTier.GREAT],
|
||||
allowLuckUpgrades: false,
|
||||
}),
|
||||
[ClassicFixedBossWaves.EVIL_GRUNT_2]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc(
|
||||
[
|
||||
TrainerType.ROCKET_GRUNT,
|
||||
TrainerType.MAGMA_GRUNT,
|
||||
TrainerType.AQUA_GRUNT,
|
||||
TrainerType.GALACTIC_GRUNT,
|
||||
TrainerType.PLASMA_GRUNT,
|
||||
TrainerType.FLARE_GRUNT,
|
||||
TrainerType.AETHER_GRUNT,
|
||||
TrainerType.SKULL_GRUNT,
|
||||
TrainerType.MACRO_GRUNT,
|
||||
TrainerType.STAR_GRUNT,
|
||||
],
|
||||
true,
|
||||
),
|
||||
),
|
||||
[ClassicFixedBossWaves.EVIL_GRUNT_3]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc(
|
||||
[
|
||||
TrainerType.ROCKET_GRUNT,
|
||||
TrainerType.MAGMA_GRUNT,
|
||||
TrainerType.AQUA_GRUNT,
|
||||
TrainerType.GALACTIC_GRUNT,
|
||||
TrainerType.PLASMA_GRUNT,
|
||||
TrainerType.FLARE_GRUNT,
|
||||
TrainerType.AETHER_GRUNT,
|
||||
TrainerType.SKULL_GRUNT,
|
||||
TrainerType.MACRO_GRUNT,
|
||||
TrainerType.STAR_GRUNT,
|
||||
],
|
||||
true,
|
||||
),
|
||||
),
|
||||
[ClassicFixedBossWaves.EVIL_ADMIN_1]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc(
|
||||
[
|
||||
[TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL],
|
||||
[TrainerType.TABITHA, TrainerType.COURTNEY],
|
||||
[TrainerType.MATT, TrainerType.SHELLY],
|
||||
[TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN],
|
||||
[TrainerType.ZINZOLIN, TrainerType.COLRESS],
|
||||
[TrainerType.XEROSIC, TrainerType.BRYONY],
|
||||
TrainerType.FABA,
|
||||
TrainerType.PLUMERIA,
|
||||
TrainerType.OLEANA,
|
||||
[TrainerType.GIACOMO, TrainerType.MELA, TrainerType.ATTICUS, TrainerType.ORTEGA, TrainerType.ERI],
|
||||
],
|
||||
true,
|
||||
),
|
||||
),
|
||||
[ClassicFixedBossWaves.RIVAL_4]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
() =>
|
||||
new Trainer(
|
||||
TrainerType.RIVAL_4,
|
||||
globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT,
|
||||
),
|
||||
)
|
||||
.setCustomModifierRewards({
|
||||
guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA],
|
||||
allowLuckUpgrades: false,
|
||||
}),
|
||||
[ClassicFixedBossWaves.EVIL_GRUNT_4]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc(
|
||||
[
|
||||
TrainerType.ROCKET_GRUNT,
|
||||
TrainerType.MAGMA_GRUNT,
|
||||
TrainerType.AQUA_GRUNT,
|
||||
TrainerType.GALACTIC_GRUNT,
|
||||
TrainerType.PLASMA_GRUNT,
|
||||
TrainerType.FLARE_GRUNT,
|
||||
TrainerType.AETHER_GRUNT,
|
||||
TrainerType.SKULL_GRUNT,
|
||||
TrainerType.MACRO_GRUNT,
|
||||
TrainerType.STAR_GRUNT,
|
||||
],
|
||||
true,
|
||||
),
|
||||
),
|
||||
[ClassicFixedBossWaves.EVIL_ADMIN_2]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc(
|
||||
[
|
||||
[TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL],
|
||||
[TrainerType.TABITHA, TrainerType.COURTNEY],
|
||||
[TrainerType.MATT, TrainerType.SHELLY],
|
||||
[TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN],
|
||||
[TrainerType.ZINZOLIN, TrainerType.COLRESS],
|
||||
[TrainerType.XEROSIC, TrainerType.BRYONY],
|
||||
TrainerType.FABA,
|
||||
TrainerType.PLUMERIA,
|
||||
TrainerType.OLEANA,
|
||||
[TrainerType.GIACOMO, TrainerType.MELA, TrainerType.ATTICUS, TrainerType.ORTEGA, TrainerType.ERI],
|
||||
],
|
||||
true,
|
||||
1,
|
||||
),
|
||||
),
|
||||
[ClassicFixedBossWaves.EVIL_BOSS_1]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc([
|
||||
TrainerType.ROCKET_BOSS_GIOVANNI_1,
|
||||
TrainerType.MAXIE,
|
||||
TrainerType.ARCHIE,
|
||||
TrainerType.CYRUS,
|
||||
TrainerType.GHETSIS,
|
||||
TrainerType.LYSANDRE,
|
||||
TrainerType.LUSAMINE,
|
||||
TrainerType.GUZMA,
|
||||
TrainerType.ROSE,
|
||||
TrainerType.PENNY,
|
||||
]),
|
||||
)
|
||||
.setCustomModifierRewards({
|
||||
guaranteedModifierTiers: [
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ULTRA,
|
||||
ModifierTier.ULTRA,
|
||||
ModifierTier.ULTRA,
|
||||
],
|
||||
allowLuckUpgrades: false,
|
||||
}),
|
||||
[ClassicFixedBossWaves.RIVAL_5]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
() =>
|
||||
new Trainer(
|
||||
TrainerType.RIVAL_5,
|
||||
globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT,
|
||||
),
|
||||
)
|
||||
.setCustomModifierRewards({
|
||||
guaranteedModifierTiers: [
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ULTRA,
|
||||
ModifierTier.ULTRA,
|
||||
],
|
||||
allowLuckUpgrades: false,
|
||||
}),
|
||||
[ClassicFixedBossWaves.EVIL_BOSS_2]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.EVIL_GRUNT_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc([
|
||||
TrainerType.ROCKET_BOSS_GIOVANNI_2,
|
||||
TrainerType.MAXIE_2,
|
||||
TrainerType.ARCHIE_2,
|
||||
TrainerType.CYRUS_2,
|
||||
TrainerType.GHETSIS_2,
|
||||
TrainerType.LYSANDRE_2,
|
||||
TrainerType.LUSAMINE_2,
|
||||
TrainerType.GUZMA_2,
|
||||
TrainerType.ROSE_2,
|
||||
TrainerType.PENNY_2,
|
||||
]),
|
||||
)
|
||||
.setCustomModifierRewards({
|
||||
guaranteedModifierTiers: [
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ULTRA,
|
||||
ModifierTier.ULTRA,
|
||||
ModifierTier.ULTRA,
|
||||
ModifierTier.ULTRA,
|
||||
],
|
||||
allowLuckUpgrades: false,
|
||||
}),
|
||||
[ClassicFixedBossWaves.ELITE_FOUR_1]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc([
|
||||
TrainerType.LORELEI,
|
||||
TrainerType.WILL,
|
||||
TrainerType.SIDNEY,
|
||||
TrainerType.AARON,
|
||||
TrainerType.SHAUNTAL,
|
||||
TrainerType.MALVA,
|
||||
[TrainerType.HALA, TrainerType.MOLAYNE],
|
||||
TrainerType.MARNIE_ELITE,
|
||||
TrainerType.RIKA,
|
||||
TrainerType.CRISPIN,
|
||||
]),
|
||||
),
|
||||
[ClassicFixedBossWaves.ELITE_FOUR_2]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.ELITE_FOUR_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc([
|
||||
TrainerType.BRUNO,
|
||||
TrainerType.KOGA,
|
||||
TrainerType.PHOEBE,
|
||||
TrainerType.BERTHA,
|
||||
TrainerType.MARSHAL,
|
||||
TrainerType.SIEBOLD,
|
||||
TrainerType.OLIVIA,
|
||||
TrainerType.NESSA_ELITE,
|
||||
TrainerType.POPPY,
|
||||
TrainerType.AMARYS,
|
||||
]),
|
||||
),
|
||||
[ClassicFixedBossWaves.ELITE_FOUR_3]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.ELITE_FOUR_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc([
|
||||
TrainerType.AGATHA,
|
||||
TrainerType.BRUNO,
|
||||
TrainerType.GLACIA,
|
||||
TrainerType.FLINT,
|
||||
TrainerType.GRIMSLEY,
|
||||
TrainerType.WIKSTROM,
|
||||
TrainerType.ACEROLA,
|
||||
[TrainerType.BEA_ELITE, TrainerType.ALLISTER_ELITE],
|
||||
TrainerType.LARRY_ELITE,
|
||||
TrainerType.LACEY,
|
||||
]),
|
||||
),
|
||||
[ClassicFixedBossWaves.ELITE_FOUR_4]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.ELITE_FOUR_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc([
|
||||
TrainerType.LANCE,
|
||||
TrainerType.KAREN,
|
||||
TrainerType.DRAKE,
|
||||
TrainerType.LUCIAN,
|
||||
TrainerType.CAITLIN,
|
||||
TrainerType.DRASNA,
|
||||
TrainerType.KAHILI,
|
||||
TrainerType.RAIHAN_ELITE,
|
||||
TrainerType.HASSEL,
|
||||
TrainerType.DRAYTON,
|
||||
]),
|
||||
),
|
||||
[ClassicFixedBossWaves.CHAMPION]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setSeedOffsetWave(ClassicFixedBossWaves.ELITE_FOUR_1)
|
||||
.setGetTrainerFunc(
|
||||
getRandomTrainerFunc([
|
||||
TrainerType.BLUE,
|
||||
[TrainerType.RED, TrainerType.LANCE_CHAMPION],
|
||||
[TrainerType.STEVEN, TrainerType.WALLACE],
|
||||
TrainerType.CYNTHIA,
|
||||
[TrainerType.ALDER, TrainerType.IRIS],
|
||||
TrainerType.DIANTHA,
|
||||
[TrainerType.KUKUI, TrainerType.HAU],
|
||||
[TrainerType.LEON, TrainerType.MUSTARD],
|
||||
[TrainerType.GEETA, TrainerType.NEMONA],
|
||||
TrainerType.KIERAN,
|
||||
]),
|
||||
),
|
||||
[ClassicFixedBossWaves.RIVAL_6]: new FixedBattleConfig()
|
||||
.setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(
|
||||
() =>
|
||||
new Trainer(
|
||||
TrainerType.RIVAL_6,
|
||||
globalScene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT,
|
||||
),
|
||||
)
|
||||
.setCustomModifierRewards({
|
||||
guaranteedModifierTiers: [
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ROGUE,
|
||||
ModifierTier.ULTRA,
|
||||
ModifierTier.ULTRA,
|
||||
ModifierTier.GREAT,
|
||||
ModifierTier.GREAT,
|
||||
],
|
||||
allowLuckUpgrades: false,
|
||||
}),
|
||||
};
|
@ -30,7 +30,7 @@ import {
|
||||
TrainerPartyCompoundTemplate,
|
||||
TrainerPartyTemplate,
|
||||
trainerPartyTemplates,
|
||||
} from "#trainers/TrainerPartyTemplate";
|
||||
} from "#trainers/trainer-party-template";
|
||||
import type { ModifierTypeFunc } from "#types/modifier-types";
|
||||
import type {
|
||||
GenAIFunc,
|
||||
|
@ -14,10 +14,13 @@ import { TrainerVariant } from "#enums/trainer-variant";
|
||||
import type { EnemyPokemon } from "#field/pokemon";
|
||||
import type { PersistentModifier } from "#modifiers/modifier";
|
||||
import { getIsInitialized, initI18n } from "#plugins/i18n";
|
||||
import type { TrainerPartyTemplate } from "#trainers/TrainerPartyTemplate";
|
||||
import { TrainerPartyCompoundTemplate, trainerPartyTemplates } from "#trainers/TrainerPartyTemplate";
|
||||
import type { TrainerConfig } from "#trainers/trainer-config";
|
||||
import { trainerConfigs } from "#trainers/trainer-config";
|
||||
import {
|
||||
TrainerPartyCompoundTemplate,
|
||||
type TrainerPartyTemplate,
|
||||
trainerPartyTemplates,
|
||||
} from "#trainers/trainer-party-template";
|
||||
import { randSeedInt, randSeedItem, randSeedWeightedItem } from "#utils/common";
|
||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||
import i18next from "i18next";
|
||||
|
@ -1,5 +1,4 @@
|
||||
import type { FixedBattleConfigs } from "#app/battle";
|
||||
import { classicFixedBattles, FixedBattleConfig } from "#app/battle";
|
||||
import { FixedBattleConfig } from "#app/battle";
|
||||
import { CHALLENGE_MODE_MYSTERY_ENCOUNTER_WAVES, CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import Overrides from "#app/overrides";
|
||||
@ -14,6 +13,7 @@ import { Challenges } from "#enums/challenges";
|
||||
import { GameModes } from "#enums/game-modes";
|
||||
import { SpeciesId } from "#enums/species-id";
|
||||
import type { Arena } from "#field/arena";
|
||||
import { classicFixedBattles, type FixedBattleConfigs } from "#trainers/fixed-battle-configs";
|
||||
import { isNullOrUndefined, randSeedInt, randSeedItem } from "#utils/common";
|
||||
import i18next from "i18next";
|
||||
|
||||
|
@ -20,8 +20,8 @@ import {
|
||||
} from "#test/mystery-encounter/encounter-test-utils";
|
||||
import { GameManager } from "#test/testUtils/gameManager";
|
||||
import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils";
|
||||
import { TrainerPartyCompoundTemplate, TrainerPartyTemplate } from "#trainers/TrainerPartyTemplate";
|
||||
import { TrainerConfig } from "#trainers/trainer-config";
|
||||
import { TrainerPartyCompoundTemplate, TrainerPartyTemplate } from "#trainers/trainer-party-template";
|
||||
import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user