mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-21 15:52:18 +02:00
Merge 5bb02d3ea0
into e73dbe9861
This commit is contained in:
commit
ba1f51a0e2
@ -69,8 +69,9 @@ import {
|
|||||||
PostBattleInitAbAttr,
|
PostBattleInitAbAttr,
|
||||||
PostItemLostAbAttr,
|
PostItemLostAbAttr,
|
||||||
} from "#app/data/ability";
|
} from "#app/data/ability";
|
||||||
import type { FixedBattleConfig } from "#app/battle";
|
import type { FixedBattleConfig } from "./data/balance/fixed-battle-configs";
|
||||||
import Battle, { BattleType } from "#app/battle";
|
import Battle from "#app/battle";
|
||||||
|
import { BattleType } from "#enums/battle-spec";
|
||||||
import type { GameMode } from "#app/game-mode";
|
import type { GameMode } from "#app/game-mode";
|
||||||
import { GameModes, getGameMode } from "#app/game-mode";
|
import { GameModes, getGameMode } from "#app/game-mode";
|
||||||
import FieldSpritePipeline from "#app/pipelines/field-sprite";
|
import FieldSpritePipeline from "#app/pipelines/field-sprite";
|
||||||
|
200
src/battle.ts
200
src/battle.ts
@ -1,57 +1,24 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { Command } from "./ui/command-ui-handler";
|
import type { Command } from "./ui/command-ui-handler";
|
||||||
import * as Utils from "./utils";
|
import * as Utils from "./utils";
|
||||||
import Trainer, { TrainerVariant } from "./field/trainer";
|
import type Trainer from "./field/trainer";
|
||||||
import type { GameMode } from "./game-mode";
|
import type { GameMode } from "./game-mode";
|
||||||
import { MoneyMultiplierModifier, PokemonHeldItemModifier } from "./modifier/modifier";
|
import { MoneyMultiplierModifier, PokemonHeldItemModifier } from "./modifier/modifier";
|
||||||
import type { PokeballType } from "#enums/pokeball";
|
import type { PokeballType } from "#enums/pokeball";
|
||||||
import { trainerConfigs } from "#app/data/trainer-config";
|
|
||||||
import { SpeciesFormKey } from "#enums/species-form-key";
|
import { SpeciesFormKey } from "#enums/species-form-key";
|
||||||
import type { EnemyPokemon, PlayerPokemon, TurnMove } from "#app/field/pokemon";
|
import type { EnemyPokemon, PlayerPokemon, TurnMove } from "#app/field/pokemon";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import { ArenaTagType } from "#enums/arena-tag-type";
|
import { ArenaTagType } from "#enums/arena-tag-type";
|
||||||
import { BattleSpec } from "#enums/battle-spec";
|
import { BattleSpec, BattleType } from "#enums/battle-spec";
|
||||||
import type { Moves } from "#enums/moves";
|
import type { Moves } from "#enums/moves";
|
||||||
import { PlayerGender } from "#enums/player-gender";
|
|
||||||
import { MusicPreference } from "#app/system/settings/settings";
|
import { MusicPreference } from "#app/system/settings/settings";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import { TrainerType } from "#enums/trainer-type";
|
|
||||||
import i18next from "#app/plugins/i18n";
|
import i18next from "#app/plugins/i18n";
|
||||||
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
||||||
import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
|
||||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
|
||||||
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
|
import type { FixedBattleConfig } from "./data/balance/fixed-battle-configs";
|
||||||
export enum ClassicFixedBossWaves {
|
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||||
TOWN_YOUNGSTER = 5,
|
|
||||||
RIVAL_1 = 8,
|
|
||||||
RIVAL_2 = 25,
|
|
||||||
EVIL_GRUNT_1 = 35,
|
|
||||||
RIVAL_3 = 55,
|
|
||||||
EVIL_GRUNT_2 = 62,
|
|
||||||
EVIL_GRUNT_3 = 64,
|
|
||||||
EVIL_ADMIN_1 = 66,
|
|
||||||
RIVAL_4 = 95,
|
|
||||||
EVIL_GRUNT_4 = 112,
|
|
||||||
EVIL_ADMIN_2 = 114,
|
|
||||||
EVIL_BOSS_1 = 115,
|
|
||||||
RIVAL_5 = 145,
|
|
||||||
EVIL_BOSS_2 = 165,
|
|
||||||
ELITE_FOUR_1 = 182,
|
|
||||||
ELITE_FOUR_2 = 184,
|
|
||||||
ELITE_FOUR_3 = 186,
|
|
||||||
ELITE_FOUR_4 = 188,
|
|
||||||
CHAMPION = 190,
|
|
||||||
RIVAL_6 = 195,
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum BattleType {
|
|
||||||
WILD,
|
|
||||||
TRAINER,
|
|
||||||
CLEAR,
|
|
||||||
MYSTERY_ENCOUNTER
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum BattlerIndex {
|
export enum BattlerIndex {
|
||||||
ATTACKER = -1,
|
ATTACKER = -1,
|
||||||
@ -62,12 +29,12 @@ export enum BattlerIndex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface TurnCommand {
|
export interface TurnCommand {
|
||||||
command: Command;
|
command: Command;
|
||||||
cursor?: number;
|
cursor?: number;
|
||||||
move?: TurnMove;
|
move?: TurnMove;
|
||||||
targets?: BattlerIndex[];
|
targets?: BattlerIndex[];
|
||||||
skip?: boolean;
|
skip?: boolean;
|
||||||
args?: any[];
|
args?: any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FaintLogEntry {
|
export interface FaintLogEntry {
|
||||||
@ -252,7 +219,7 @@ export default class Battle {
|
|||||||
} else {
|
} else {
|
||||||
return this.trainer?.getMixedBattleBgm() ?? null;
|
return this.trainer?.getMixedBattleBgm() ?? null;
|
||||||
}
|
}
|
||||||
} else if (this.gameMode.isClassic && this.waveIndex > 195 && this.battleSpec !== BattleSpec.FINAL_BOSS) {
|
} else if (this.gameMode.isClassic && this.waveIndex > ClassicFixedBossWaves.RIVAL_6 && this.battleSpec !== BattleSpec.FINAL_BOSS) {
|
||||||
return "end_summit";
|
return "end_summit";
|
||||||
}
|
}
|
||||||
const wildOpponents = globalScene.getEnemyParty();
|
const wildOpponents = globalScene.getEnemyParty();
|
||||||
@ -421,7 +388,7 @@ export default class Battle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (globalScene.gameMode.isClassic && this.waveIndex <= 4) {
|
if (globalScene.gameMode.isClassic && this.waveIndex < ClassicFixedBossWaves.TOWN_YOUNGSTER) {
|
||||||
return "battle_wild";
|
return "battle_wild";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -473,146 +440,3 @@ export class FixedBattle extends Battle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetTrainerFunc = () => Trainer;
|
|
||||||
type GetEnemyPartyFunc = () => EnemyPokemon[];
|
|
||||||
|
|
||||||
export class FixedBattleConfig {
|
|
||||||
public battleType: BattleType;
|
|
||||||
public double: boolean;
|
|
||||||
public getTrainer: GetTrainerFunc;
|
|
||||||
public getEnemyParty: GetEnemyPartyFunc;
|
|
||||||
public seedOffsetWaveIndex: number;
|
|
||||||
public customModifierRewardSettings?: CustomModifierSettings;
|
|
||||||
|
|
||||||
setBattleType(battleType: BattleType): FixedBattleConfig {
|
|
||||||
this.battleType = battleType;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
setDouble(double: boolean): FixedBattleConfig {
|
|
||||||
this.double = double;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
setGetTrainerFunc(getTrainerFunc: GetTrainerFunc): FixedBattleConfig {
|
|
||||||
this.getTrainer = getTrainerFunc;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
setGetEnemyPartyFunc(getEnemyPartyFunc: GetEnemyPartyFunc): FixedBattleConfig {
|
|
||||||
this.getEnemyParty = getEnemyPartyFunc;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
setSeedOffsetWave(seedOffsetWaveIndex: number): FixedBattleConfig {
|
|
||||||
this.seedOffsetWaveIndex = seedOffsetWaveIndex;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
setCustomModifierRewards(customModifierRewardSettings: CustomModifierSettings) {
|
|
||||||
this.customModifierRewardSettings = customModifierRewardSettings;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper function to generate a random trainer for evil team trainers and the elite 4/champion
|
|
||||||
* @param trainerPool The TrainerType or list of TrainerTypes that can possibly be generated
|
|
||||||
* @param randomGender whether or not to randomly (50%) generate a female trainer (for use with evil team grunts)
|
|
||||||
* @param seedOffset the seed offset to use for the random generation of the trainer
|
|
||||||
* @returns the generated trainer
|
|
||||||
*/
|
|
||||||
export function getRandomTrainerFunc(trainerPool: (TrainerType | TrainerType[])[], randomGender: boolean = false, seedOffset: number = 0): GetTrainerFunc {
|
|
||||||
return () => {
|
|
||||||
const rand = Utils.randSeedInt(trainerPool.length);
|
|
||||||
const trainerTypes: TrainerType[] = [];
|
|
||||||
|
|
||||||
globalScene.executeWithSeedOffset(() => {
|
|
||||||
for (const trainerPoolEntry of trainerPool) {
|
|
||||||
const trainerType = Array.isArray(trainerPoolEntry)
|
|
||||||
? Utils.randSeedItem(trainerPoolEntry)
|
|
||||||
: trainerPoolEntry;
|
|
||||||
trainerTypes.push(trainerType);
|
|
||||||
}
|
|
||||||
}, seedOffset);
|
|
||||||
|
|
||||||
let trainerGender = TrainerVariant.DEFAULT;
|
|
||||||
if (randomGender) {
|
|
||||||
trainerGender = (Utils.randInt(2) === 0) ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 1/3 chance for evil team grunts to be double battles */
|
|
||||||
const evilTeamGrunts = [ 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 ];
|
|
||||||
const isEvilTeamGrunt = evilTeamGrunts.includes(trainerTypes[rand]);
|
|
||||||
|
|
||||||
if (trainerConfigs[trainerTypes[rand]].hasDouble && isEvilTeamGrunt) {
|
|
||||||
return new Trainer(trainerTypes[rand], (Utils.randInt(3) === 0) ? TrainerVariant.DOUBLE : trainerGender);
|
|
||||||
}
|
|
||||||
|
|
||||||
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, Utils.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 })
|
|
||||||
};
|
|
||||||
|
@ -23,7 +23,7 @@ import { Command } from "../ui/command-ui-handler";
|
|||||||
import { BerryModifierType } from "#app/modifier/modifier-type";
|
import { BerryModifierType } from "#app/modifier/modifier-type";
|
||||||
import { getPokeballName } from "./pokeball";
|
import { getPokeballName } from "./pokeball";
|
||||||
import type { BattlerIndex } from "#app/battle";
|
import type { BattlerIndex } from "#app/battle";
|
||||||
import { BattleType } from "#app/battle";
|
import { BattleType } from "#enums/battle-spec";
|
||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { ArenaTagType } from "#enums/arena-tag-type";
|
import { ArenaTagType } from "#enums/arena-tag-type";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
|
150
src/data/balance/fixed-battle-configs.ts
Normal file
150
src/data/balance/fixed-battle-configs.ts
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
import { BattleType } from "#enums/battle-spec";
|
||||||
|
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||||
|
import Trainer, { TrainerVariant } from "#app/field/trainer";
|
||||||
|
import { globalScene } from "#app/global-scene";
|
||||||
|
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||||
|
import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
||||||
|
import * as Utils from "#app/utils";
|
||||||
|
import { PlayerGender } from "#enums/player-gender";
|
||||||
|
import { TrainerType } from "#enums/trainer-type";
|
||||||
|
import type { EnemyPokemon } from "#app/field/pokemon";
|
||||||
|
|
||||||
|
export class FixedBattleConfig {
|
||||||
|
public battleType: BattleType;
|
||||||
|
public double: boolean;
|
||||||
|
public getTrainer: GetTrainerFunc;
|
||||||
|
public getEnemyParty: GetEnemyPartyFunc;
|
||||||
|
public seedOffsetWaveIndex: number;
|
||||||
|
public customModifierRewardSettings?: CustomModifierSettings;
|
||||||
|
|
||||||
|
setBattleType(battleType: BattleType): FixedBattleConfig {
|
||||||
|
this.battleType = battleType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
setDouble(double: boolean): FixedBattleConfig {
|
||||||
|
this.double = double;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
setGetTrainerFunc(getTrainerFunc: GetTrainerFunc): FixedBattleConfig {
|
||||||
|
this.getTrainer = getTrainerFunc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
setGetEnemyPartyFunc(getEnemyPartyFunc: GetEnemyPartyFunc): FixedBattleConfig {
|
||||||
|
this.getEnemyParty = getEnemyPartyFunc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
setSeedOffsetWave(seedOffsetWaveIndex: number): FixedBattleConfig {
|
||||||
|
this.seedOffsetWaveIndex = seedOffsetWaveIndex;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
setCustomModifierRewards(customModifierRewardSettings: CustomModifierSettings) {
|
||||||
|
this.customModifierRewardSettings = customModifierRewardSettings;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetTrainerFunc = () => Trainer;
|
||||||
|
type GetEnemyPartyFunc = () => EnemyPokemon[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper function to generate a random trainer for evil team trainers and the elite 4/champion
|
||||||
|
* @param trainerPool The TrainerType or list of TrainerTypes that can possibly be generated
|
||||||
|
* @param randomGender whether or not to randomly (50%) generate a female trainer (for use with evil team grunts)
|
||||||
|
* @param seedOffset the seed offset to use for the random generation of the trainer
|
||||||
|
* @returns the generated trainer
|
||||||
|
*/
|
||||||
|
export function getRandomTrainerFunc(trainerPool: (TrainerType | TrainerType[])[], randomGender: boolean = false, seedOffset: number = 0): GetTrainerFunc {
|
||||||
|
return () => {
|
||||||
|
const rand = Utils.randSeedInt(trainerPool.length);
|
||||||
|
const trainerTypes: TrainerType[] = [];
|
||||||
|
|
||||||
|
globalScene.executeWithSeedOffset(() => {
|
||||||
|
for (const trainerPoolEntry of trainerPool) {
|
||||||
|
const trainerType = Array.isArray(trainerPoolEntry)
|
||||||
|
? Utils.randSeedItem(trainerPoolEntry)
|
||||||
|
: trainerPoolEntry;
|
||||||
|
trainerTypes.push(trainerType);
|
||||||
|
}
|
||||||
|
}, seedOffset);
|
||||||
|
|
||||||
|
let trainerGender = TrainerVariant.DEFAULT;
|
||||||
|
if (randomGender) {
|
||||||
|
trainerGender = (Utils.randInt(2) === 0) ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 1/3 chance for evil team grunts to be double battles */
|
||||||
|
if ([ 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 ].includes(trainerTypes[rand])) {
|
||||||
|
return new Trainer(trainerTypes[rand], (Utils.randInt(3) === 0) ? TrainerVariant.DOUBLE : trainerGender);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Trainer(trainerTypes[rand], trainerGender);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FixedBattleConfigs {
|
||||||
|
[key: number]: FixedBattleConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Youngster/Lass on 5
|
||||||
|
* Rival on 8, 25, 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, Utils.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 })
|
||||||
|
};
|
@ -7,8 +7,10 @@ import { getPokemonSpecies, getPokemonSpeciesForm } from "#app/data/pokemon-spec
|
|||||||
import { speciesStarterCosts } from "#app/data/balance/starters";
|
import { speciesStarterCosts } from "#app/data/balance/starters";
|
||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import { PokemonMove } from "#app/field/pokemon";
|
import { PokemonMove } from "#app/field/pokemon";
|
||||||
import type { FixedBattleConfig } from "#app/battle";
|
import type { FixedBattleConfig } from "./balance/fixed-battle-configs";
|
||||||
import { ClassicFixedBossWaves, BattleType, getRandomTrainerFunc } from "#app/battle";
|
import { BattleType } from "#enums/battle-spec";
|
||||||
|
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||||
|
import { getRandomTrainerFunc } from "./balance/fixed-battle-configs";
|
||||||
import Trainer, { TrainerVariant } from "#app/field/trainer";
|
import Trainer, { TrainerVariant } from "#app/field/trainer";
|
||||||
import type { GameMode } from "#app/game-mode";
|
import type { GameMode } from "#app/game-mode";
|
||||||
import { Type } from "#enums/type";
|
import { Type } from "#enums/type";
|
||||||
|
@ -79,7 +79,7 @@ import {
|
|||||||
PreserveBerryModifier,
|
PreserveBerryModifier,
|
||||||
} from "../modifier/modifier";
|
} from "../modifier/modifier";
|
||||||
import type { BattlerIndex } from "../battle";
|
import type { BattlerIndex } from "../battle";
|
||||||
import { BattleType } from "../battle";
|
import { BattleType } from "#enums/battle-spec";
|
||||||
import { TerrainType } from "./terrain";
|
import { TerrainType } from "./terrain";
|
||||||
import { ModifierPoolType } from "#app/modifier/modifier-type";
|
import { ModifierPoolType } from "#app/modifier/modifier-type";
|
||||||
import { Command } from "../ui/command-ui-handler";
|
import { Command } from "../ui/command-ui-handler";
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import type Battle from "#app/battle";
|
import type Battle from "#app/battle";
|
||||||
import { BattlerIndex, BattleType } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
|
import { BattleType } from "#enums/battle-spec";
|
||||||
import { biomeLinks, BiomePoolTier } from "#app/data/balance/biomes";
|
import { biomeLinks, BiomePoolTier } from "#app/data/balance/biomes";
|
||||||
import type MysteryEncounterOption from "#app/data/mystery-encounters/mystery-encounter-option";
|
import type MysteryEncounterOption from "#app/data/mystery-encounters/mystery-encounter-option";
|
||||||
import { AVERAGE_ENCOUNTERS_PER_RUN_TARGET, WEIGHT_INCREMENT_ON_SPAWN_MISS } from "#app/data/mystery-encounters/mystery-encounters";
|
import { AVERAGE_ENCOUNTERS_PER_RUN_TARGET, WEIGHT_INCREMENT_ON_SPAWN_MISS } from "#app/data/mystery-encounters/mystery-encounters";
|
||||||
|
@ -22,6 +22,7 @@ import { PartyMemberStrength } from "#enums/party-member-strength";
|
|||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import { TrainerType } from "#enums/trainer-type";
|
import { TrainerType } from "#enums/trainer-type";
|
||||||
import { Gender } from "#app/data/gender";
|
import { Gender } from "#app/data/gender";
|
||||||
|
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||||
|
|
||||||
/** Minimum BST for Pokemon generated onto the Elite Four's teams */
|
/** Minimum BST for Pokemon generated onto the Elite Four's teams */
|
||||||
const ELITE_FOUR_MINIMUM_BST = 460;
|
const ELITE_FOUR_MINIMUM_BST = 460;
|
||||||
@ -1218,21 +1219,25 @@ interface TrainerConfigs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The function to get variable strength grunts
|
* The function to get the appropriate strength template for grunts and admins.
|
||||||
|
* Each successive evil team battle has higher strength template.
|
||||||
|
* The exception is Grunt 4 and Admin 2, who share the GYM_LEADER_5 template.
|
||||||
|
* The Leader's strength template is defined separately.
|
||||||
|
* @see {@linkcode initForEvilTeamLeader}
|
||||||
* @returns the correct TrainerPartyTemplate
|
* @returns the correct TrainerPartyTemplate
|
||||||
*/
|
*/
|
||||||
function getEvilGruntPartyTemplate(): TrainerPartyTemplate {
|
function getEvilGruntPartyTemplate(): TrainerPartyTemplate {
|
||||||
const waveIndex = globalScene.currentBattle?.waveIndex;
|
switch (globalScene.currentBattle?.waveIndex) {
|
||||||
if (waveIndex < 40) {
|
case ClassicFixedBossWaves.EVIL_GRUNT_1:
|
||||||
return trainerPartyTemplates.TWO_AVG;
|
return trainerPartyTemplates.TWO_AVG;
|
||||||
} else if (waveIndex < 63) {
|
case ClassicFixedBossWaves.EVIL_GRUNT_2:
|
||||||
return trainerPartyTemplates.THREE_AVG;
|
return trainerPartyTemplates.THREE_AVG;
|
||||||
} else if (waveIndex < 65) {
|
case ClassicFixedBossWaves.EVIL_GRUNT_3:
|
||||||
return trainerPartyTemplates.TWO_AVG_ONE_STRONG;
|
return trainerPartyTemplates.TWO_AVG_ONE_STRONG;
|
||||||
} else if (waveIndex < 112) {
|
case ClassicFixedBossWaves.EVIL_ADMIN_1:
|
||||||
return trainerPartyTemplates.GYM_LEADER_4; // 3avg 1 strong 1 stronger
|
return trainerPartyTemplates.GYM_LEADER_4; // 3 avg 1 strong 1 stronger
|
||||||
} else {
|
default:
|
||||||
return trainerPartyTemplates.GYM_LEADER_5; // 3 avg 2 strong 1 stronger
|
return trainerPartyTemplates.GYM_LEADER_5; // 3 avg 2 strong 1 stronger
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,3 +2,10 @@ export enum BattleSpec {
|
|||||||
DEFAULT,
|
DEFAULT,
|
||||||
FINAL_BOSS
|
FINAL_BOSS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum BattleType {
|
||||||
|
WILD,
|
||||||
|
TRAINER,
|
||||||
|
CLEAR,
|
||||||
|
MYSTERY_ENCOUNTER
|
||||||
|
}
|
||||||
|
23
src/enums/fixed-boss-waves.ts
Normal file
23
src/enums/fixed-boss-waves.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
export enum ClassicFixedBossWaves {
|
||||||
|
TOWN_YOUNGSTER = 5,
|
||||||
|
RIVAL_1 = 8,
|
||||||
|
RIVAL_2 = 25,
|
||||||
|
EVIL_GRUNT_1 = 35,
|
||||||
|
RIVAL_3 = 55,
|
||||||
|
EVIL_GRUNT_2 = 62,
|
||||||
|
EVIL_GRUNT_3 = 64,
|
||||||
|
EVIL_ADMIN_1 = 66,
|
||||||
|
RIVAL_4 = 95,
|
||||||
|
EVIL_GRUNT_4 = 112,
|
||||||
|
EVIL_ADMIN_2 = 114,
|
||||||
|
EVIL_BOSS_1 = 115,
|
||||||
|
RIVAL_5 = 145,
|
||||||
|
EVIL_BOSS_2 = 165,
|
||||||
|
ELITE_FOUR_1 = 182,
|
||||||
|
ELITE_FOUR_2 = 184,
|
||||||
|
ELITE_FOUR_3 = 186,
|
||||||
|
ELITE_FOUR_4 = 188,
|
||||||
|
CHAMPION = 190,
|
||||||
|
RIVAL_6 = 195,
|
||||||
|
ETERNATUS = 200
|
||||||
|
}
|
@ -1,6 +1,8 @@
|
|||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import type { FixedBattleConfigs } from "./battle";
|
import type { FixedBattleConfigs } from "./data/balance/fixed-battle-configs";
|
||||||
import { classicFixedBattles, FixedBattleConfig } from "./battle";
|
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||||
|
import { FixedBattleConfig } from "./data/balance/fixed-battle-configs";
|
||||||
|
import { classicFixedBattles } from "./data/balance/fixed-battle-configs";
|
||||||
import type { Challenge } from "./data/challenge";
|
import type { Challenge } from "./data/challenge";
|
||||||
import { allChallenges, applyChallenges, ChallengeType, copyChallenge } from "./data/challenge";
|
import { allChallenges, applyChallenges, ChallengeType, copyChallenge } from "./data/challenge";
|
||||||
import type PokemonSpecies from "./data/pokemon-species";
|
import type PokemonSpecies from "./data/pokemon-species";
|
||||||
@ -215,7 +217,7 @@ export class GameMode implements GameModeConfig {
|
|||||||
switch (modeId) {
|
switch (modeId) {
|
||||||
case GameModes.CLASSIC:
|
case GameModes.CLASSIC:
|
||||||
case GameModes.CHALLENGE:
|
case GameModes.CHALLENGE:
|
||||||
return waveIndex === 200;
|
return waveIndex === ClassicFixedBossWaves.ETERNATUS;
|
||||||
case GameModes.ENDLESS:
|
case GameModes.ENDLESS:
|
||||||
case GameModes.SPLICED_ENDLESS:
|
case GameModes.SPLICED_ENDLESS:
|
||||||
return !(waveIndex % 250);
|
return !(waveIndex % 250);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { TurnCommand } from "#app/battle";
|
import type { TurnCommand } from "#app/battle";
|
||||||
import { BattleType } from "#app/battle";
|
import { BattleType } from "#enums/battle-spec";
|
||||||
import type { EncoreTag } from "#app/data/battler-tags";
|
import type { EncoreTag } from "#app/data/battler-tags";
|
||||||
import { TrappedTag } from "#app/data/battler-tags";
|
import { TrappedTag } from "#app/data/battler-tags";
|
||||||
import type { MoveTargetSet } from "#app/data/move";
|
import type { MoveTargetSet } from "#app/data/move";
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
import { BattlerIndex, BattleType } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
|
import { BattleType } from "#enums/battle-spec";
|
||||||
|
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { PLAYER_PARTY_MAX_SIZE } from "#app/constants";
|
import { PLAYER_PARTY_MAX_SIZE } from "#app/constants";
|
||||||
import { applyAbAttrs, SyncEncounterNatureAbAttr } from "#app/data/ability";
|
import { applyAbAttrs, SyncEncounterNatureAbAttr } from "#app/data/ability";
|
||||||
@ -59,7 +61,7 @@ export class EncounterPhase extends BattlePhase {
|
|||||||
globalScene.eventTarget.dispatchEvent(new EncounterPhaseEvent());
|
globalScene.eventTarget.dispatchEvent(new EncounterPhaseEvent());
|
||||||
|
|
||||||
// Failsafe if players somehow skip floor 200 in classic mode
|
// Failsafe if players somehow skip floor 200 in classic mode
|
||||||
if (globalScene.gameMode.isClassic && globalScene.currentBattle.waveIndex > 200) {
|
if (globalScene.gameMode.isClassic && globalScene.currentBattle.waveIndex > ClassicFixedBossWaves.ETERNATUS) {
|
||||||
globalScene.unshiftPhase(new GameOverPhase());
|
globalScene.unshiftPhase(new GameOverPhase());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import type { BattlerIndex } from "#app/battle";
|
import type { BattlerIndex } from "#app/battle";
|
||||||
import { BattleType } from "#app/battle";
|
import { BattleType } from "#enums/battle-spec";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { applyPostFaintAbAttrs, applyPostKnockOutAbAttrs, applyPostVictoryAbAttrs, PostFaintAbAttr, PostKnockOutAbAttr, PostVictoryAbAttr } from "#app/data/ability";
|
import { applyPostFaintAbAttrs, applyPostKnockOutAbAttrs, applyPostVictoryAbAttrs, PostFaintAbAttr, PostKnockOutAbAttr, PostVictoryAbAttr } from "#app/data/ability";
|
||||||
import type { DestinyBondTag, GrudgeTag } from "#app/data/battler-tags";
|
import type { DestinyBondTag, GrudgeTag } from "#app/data/battler-tags";
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { clientSessionId } from "#app/account";
|
import { clientSessionId } from "#app/account";
|
||||||
import { BattleType } from "#app/battle";
|
import { BattleType } from "#enums/battle-spec";
|
||||||
|
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions";
|
import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions";
|
||||||
import { getCharVariantFromDialogue } from "#app/data/dialogue";
|
import { getCharVariantFromDialogue } from "#app/data/dialogue";
|
||||||
@ -46,7 +47,7 @@ export class GameOverPhase extends BattlePhase {
|
|||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
// Failsafe if players somehow skip floor 200 in classic mode
|
// Failsafe if players somehow skip floor 200 in classic mode
|
||||||
if (globalScene.gameMode.isClassic && globalScene.currentBattle.waveIndex > 200) {
|
if (globalScene.gameMode.isClassic && globalScene.currentBattle.waveIndex > ClassicFixedBossWaves.ETERNATUS) {
|
||||||
this.isVictory = true;
|
this.isVictory = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { BattleType } from "#app/battle";
|
import { BattleType } from "#enums/battle-spec";
|
||||||
import { getPokeballAtlasKey, getPokeballTintColor } from "#app/data/pokeball";
|
import { getPokeballAtlasKey, getPokeballTintColor } from "#app/data/pokeball";
|
||||||
import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms";
|
import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms";
|
||||||
import { TrainerSlot } from "#app/data/trainer-config";
|
import { TrainerSlot } from "#app/data/trainer-config";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { loggedInUser } from "#app/account";
|
import { loggedInUser } from "#app/account";
|
||||||
import { BattleType } from "#app/battle";
|
import { BattleType } from "#enums/battle-spec";
|
||||||
import { fetchDailyRunSeed, getDailyRunStarters } from "#app/data/daily-run";
|
import { fetchDailyRunSeed, getDailyRunStarters } from "#app/data/daily-run";
|
||||||
import { Gender } from "#app/data/gender";
|
import { Gender } from "#app/data/gender";
|
||||||
import { getBiomeKey } from "#app/field/arena";
|
import { getBiomeKey } from "#app/field/arena";
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import type { BattlerIndex } from "#app/battle";
|
import type { BattlerIndex } from "#app/battle";
|
||||||
import { BattleType, ClassicFixedBossWaves } from "#app/battle";
|
import { BattleType } from "#enums/battle-spec";
|
||||||
|
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||||
import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
import { BattleEndPhase } from "./battle-end-phase";
|
import { BattleEndPhase } from "./battle-end-phase";
|
||||||
|
@ -15,7 +15,7 @@ import PersistentModifierData from "#app/system/modifier-data";
|
|||||||
import ArenaData from "#app/system/arena-data";
|
import ArenaData from "#app/system/arena-data";
|
||||||
import { Unlockables } from "#app/system/unlockables";
|
import { Unlockables } from "#app/system/unlockables";
|
||||||
import { GameModes, getGameMode } from "#app/game-mode";
|
import { GameModes, getGameMode } from "#app/game-mode";
|
||||||
import { BattleType } from "#app/battle";
|
import { BattleType } from "#enums/battle-spec";
|
||||||
import TrainerData from "#app/system/trainer-data";
|
import TrainerData from "#app/system/trainer-data";
|
||||||
import { trainerConfigs } from "#app/data/trainer-config";
|
import { trainerConfigs } from "#app/data/trainer-config";
|
||||||
import { resetSettings, setSetting, SettingKeys } from "#app/system/settings/settings";
|
import { resetSettings, setSetting, SettingKeys } from "#app/system/settings/settings";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { BattleType } from "../battle";
|
import { BattleType } from "#enums/battle-spec";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import type { Gender } from "../data/gender";
|
import type { Gender } from "../data/gender";
|
||||||
import type { Nature } from "#enums/nature";
|
import type { Nature } from "#enums/nature";
|
||||||
|
@ -14,7 +14,7 @@ import type { PokemonMove } from "#app/field/pokemon";
|
|||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import type { CommandPhase } from "#app/phases/command-phase";
|
import type { CommandPhase } from "#app/phases/command-phase";
|
||||||
import MoveInfoOverlay from "./move-info-overlay";
|
import MoveInfoOverlay from "./move-info-overlay";
|
||||||
import { BattleType } from "#app/battle";
|
import { BattleType } from "#enums/battle-spec";
|
||||||
|
|
||||||
export default class FightUiHandler extends UiHandler implements InfoToggle {
|
export default class FightUiHandler extends UiHandler implements InfoToggle {
|
||||||
public static readonly MOVES_CONTAINER_NAME = "moves";
|
public static readonly MOVES_CONTAINER_NAME = "moves";
|
||||||
|
@ -8,7 +8,7 @@ import type PokemonData from "../system/pokemon-data";
|
|||||||
import MessageUiHandler from "./message-ui-handler";
|
import MessageUiHandler from "./message-ui-handler";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { Button } from "../enums/buttons";
|
import { Button } from "../enums/buttons";
|
||||||
import { BattleType } from "../battle";
|
import { BattleType } from "#enums/battle-spec";
|
||||||
import type { RunEntry } from "../system/game-data";
|
import type { RunEntry } from "../system/game-data";
|
||||||
import { PlayerGender } from "#enums/player-gender";
|
import { PlayerGender } from "#enums/player-gender";
|
||||||
import { TrainerVariant } from "../field/trainer";
|
import { TrainerVariant } from "../field/trainer";
|
||||||
|
@ -9,7 +9,7 @@ import * as Utils from "../utils";
|
|||||||
import type PokemonData from "../system/pokemon-data";
|
import type PokemonData from "../system/pokemon-data";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { Button } from "../enums/buttons";
|
import { Button } from "../enums/buttons";
|
||||||
import { BattleType } from "../battle";
|
import { BattleType } from "#enums/battle-spec";
|
||||||
import { TrainerVariant } from "../field/trainer";
|
import { TrainerVariant } from "../field/trainer";
|
||||||
import { Challenges } from "#enums/challenges";
|
import { Challenges } from "#enums/challenges";
|
||||||
import { getLuckString, getLuckTextTint } from "../modifier/modifier-type";
|
import { getLuckString, getLuckTextTint } from "../modifier/modifier-type";
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import Battle, { BattleType } from "#app/battle";
|
import Battle from "#app/battle";
|
||||||
|
import { BattleType } from "#enums/battle-spec";
|
||||||
import type BattleScene from "#app/battle-scene";
|
import type BattleScene from "#app/battle-scene";
|
||||||
import { getDailyRunStarters } from "#app/data/daily-run";
|
import { getDailyRunStarters } from "#app/data/daily-run";
|
||||||
import { Gender } from "#app/data/gender";
|
import { Gender } from "#app/data/gender";
|
||||||
|
Loading…
Reference in New Issue
Block a user