From ee2c61c4b81cd8440d5336e76d482664c0eca687 Mon Sep 17 00:00:00 2001 From: hayuna Date: Wed, 29 May 2024 21:17:36 +0200 Subject: [PATCH] [Feature] Add possibility to override foe level (#1561) * Add possibility to override foe level * Override foe level * Update code styling * Replace null with 0 as init value * Replace null with 0 as init value * Update order of constants --- src/battle-scene.ts | 4 ++++ src/overrides.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 9a2f22d5c90..05a6e699c48 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -670,6 +670,10 @@ export default class BattleScene extends SceneBase { species = getPokemonSpecies(Overrides.OPP_SPECIES_OVERRIDE); } const pokemon = new EnemyPokemon(this, species, level, trainerSlot, boss, dataSource); + if (Overrides.OPP_LEVEL_OVERRIDE !== 0) { + pokemon.level = Overrides.OPP_LEVEL_OVERRIDE; + } + if (Overrides.OPP_GENDER_OVERRIDE !== null) { pokemon.gender = Overrides.OPP_GENDER_OVERRIDE; } diff --git a/src/overrides.ts b/src/overrides.ts index 27f264879f0..671e54e19de 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -73,6 +73,7 @@ export const VARIANT_OVERRIDE: Variant = 0; */ 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_GENDER_OVERRIDE: Gender = null;