[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
This commit is contained in:
hayuna 2024-05-29 21:17:36 +02:00 committed by GitHub
parent 55423dd39d
commit ee2c61c4b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;