diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 6da5c9482bc..2a920864850 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -844,14 +844,13 @@ export default class BattleScene extends SceneBase { if (Overrides.OPP_SPECIES_OVERRIDE) { 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; + level = Overrides.OPP_LEVEL_OVERRIDE; } - if (Overrides.OPP_GENDER_OVERRIDE !== null) { - pokemon.gender = Overrides.OPP_GENDER_OVERRIDE; - } + const pokemon = new EnemyPokemon(this, species, level, trainerSlot, boss, dataSource); + overrideModifiers(this, false); overrideHeldItems(this, pokemon, false); if (boss && !dataSource) { diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index a8dfb9d6c48..8a3a6b280cb 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -3758,6 +3758,18 @@ export class EnemyPokemon extends Pokemon { this.status = new Status(Overrides.OPP_STATUS_OVERRIDE); } + if (Overrides.OPP_GENDER_OVERRIDE) { + this.gender = Overrides.OPP_GENDER_OVERRIDE; + } + + const speciesId = this.species.speciesId; + + if (speciesId in Overrides.OPP_FORM_OVERRIDES + && Overrides.OPP_FORM_OVERRIDES[speciesId] + && this.species.forms[Overrides.OPP_FORM_OVERRIDES[speciesId]]) { + this.formIndex = Overrides.OPP_FORM_OVERRIDES[speciesId] ?? 0; + } + if (!dataSource) { this.generateAndPopulateMoveset(); diff --git a/src/overrides.ts b/src/overrides.ts index 8b3d628e05e..32ff116f41d 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -46,14 +46,14 @@ class DefaultOverrides { readonly SEED_OVERRIDE: string = ""; readonly WEATHER_OVERRIDE: WeatherType = WeatherType.NONE; readonly BATTLE_TYPE_OVERRIDE: "double" | "single" | null = null; - readonly STARTING_WAVE_OVERRIDE: integer = 0; + readonly STARTING_WAVE_OVERRIDE: number = 0; readonly STARTING_BIOME_OVERRIDE: Biome = Biome.TOWN; readonly ARENA_TINT_OVERRIDE: TimeOfDay | null = null; /** Multiplies XP gained by this value including 0. Set to null to ignore the override */ readonly XP_MULTIPLIER_OVERRIDE: number | null = null; readonly NEVER_CRIT_OVERRIDE: boolean = false; /** default 1000 */ - readonly STARTING_MONEY_OVERRIDE: integer = 0; + readonly STARTING_MONEY_OVERRIDE: number = 0; /** Sets all shop item prices to 0 */ readonly WAIVE_SHOP_FEES_OVERRIDE: boolean = false; /** Sets reroll price to 0 */ @@ -86,14 +86,14 @@ class DefaultOverrides { readonly STARTER_FORM_OVERRIDES: Partial> = {}; /** default 5 or 20 for Daily */ - readonly STARTING_LEVEL_OVERRIDE: integer = 0; + readonly STARTING_LEVEL_OVERRIDE: number = 0; /** * SPECIES OVERRIDE * will only apply to the first starter in your party or each enemy pokemon * default is 0 to not override * @example SPECIES_OVERRIDE = Species.Bulbasaur; */ - readonly STARTER_SPECIES_OVERRIDE: Species | integer = 0; + readonly STARTER_SPECIES_OVERRIDE: Species | number = 0; readonly ABILITY_OVERRIDE: Abilities = Abilities.NONE; readonly PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE; readonly STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE; @@ -105,7 +105,7 @@ class DefaultOverrides { // -------------------------- // OPPONENT / ENEMY OVERRIDES // -------------------------- - readonly OPP_SPECIES_OVERRIDE: Species | integer = 0; + readonly OPP_SPECIES_OVERRIDE: Species | number = 0; readonly OPP_LEVEL_OVERRIDE: number = 0; readonly OPP_ABILITY_OVERRIDE: Abilities = Abilities.NONE; readonly OPP_PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE; @@ -114,7 +114,8 @@ class DefaultOverrides { readonly OPP_MOVESET_OVERRIDE: Array = []; readonly OPP_SHINY_OVERRIDE: boolean = false; readonly OPP_VARIANT_OVERRIDE: Variant = 0; - readonly OPP_IVS_OVERRIDE: integer | integer[] = []; + readonly OPP_IVS_OVERRIDE: number | number[] = []; + readonly OPP_FORM_OVERRIDES: Partial> = {}; // ------------- // EGG OVERRIDES