From b1c208cd86f931bdb73c56b371c6d609df079964 Mon Sep 17 00:00:00 2001 From: Dmitriy K Date: Thu, 30 May 2024 12:49:57 -0400 Subject: [PATCH] [Feature] Add status override (#1602) --- src/field/pokemon.ts | 8 ++++++++ src/overrides.ts | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 16be16e508c..55a8091f857 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -2804,6 +2804,10 @@ export class PlayerPokemon extends Pokemon { constructor(scene: BattleScene, species: PokemonSpecies, level: integer, abilityIndex: integer, formIndex: integer, gender: Gender, shiny: boolean, variant: Variant, ivs: integer[], nature: Nature, dataSource: Pokemon | PokemonData) { super(scene, 106, 148, species, level, abilityIndex, formIndex, gender, shiny, variant, ivs, nature, dataSource); + if (Overrides.STATUS_OVERRIDE) { + this.status = new Status(Overrides.STATUS_OVERRIDE); + } + if (Overrides.SHINY_OVERRIDE) { this.shiny = true; this.initShinySparkle(); @@ -3213,6 +3217,10 @@ export class EnemyPokemon extends Pokemon { this.setBoss(); } + if (Overrides.OPP_STATUS_OVERRIDE) { + this.status = new Status(Overrides.OPP_STATUS_OVERRIDE); + } + if (!dataSource) { this.generateAndPopulateMoveset(); diff --git a/src/overrides.ts b/src/overrides.ts index 671e54e19de..a4f94901957 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -13,6 +13,7 @@ import { PokeballCounts } from "./battle-scene"; import { PokeballType } from "./data/pokeball"; import {TimeOfDay} from "#app/data/enums/time-of-day"; import { Gender } from "./data/gender"; +import { StatusEffect } from "./data/status-effect"; /** * Overrides for testing different in game situations @@ -63,6 +64,7 @@ export const STARTING_LEVEL_OVERRIDE: integer = 0; export const STARTER_SPECIES_OVERRIDE: Species | integer = 0; export const ABILITY_OVERRIDE: Abilities = Abilities.NONE; export const PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE; +export const STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE; export const GENDER_OVERRIDE: Gender = null; export const MOVESET_OVERRIDE: Array = []; export const SHINY_OVERRIDE: boolean = false; @@ -76,6 +78,7 @@ export const OPP_SPECIES_OVERRIDE: Species | integer = 0; export const OPP_LEVEL_OVERRIDE: number = 0; export const OPP_ABILITY_OVERRIDE: Abilities = Abilities.NONE; export const OPP_PASSIVE_ABILITY_OVERRIDE = Abilities.NONE; +export const OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE; export const OPP_GENDER_OVERRIDE: Gender = null; export const OPP_MOVESET_OVERRIDE: Array = []; export const OPP_SHINY_OVERRIDE: boolean = false;