From a1f7304d4cb408d4ff0d31f8c206539489252237 Mon Sep 17 00:00:00 2001 From: Lylian Date: Mon, 31 Mar 2025 16:13:20 +0200 Subject: [PATCH] nit --- src/data/ability.ts | 6 ++++-- src/field/pokemon.ts | 27 ++++++++++++++++----------- src/overrides.ts | 2 +- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index dd6d522ac5b..b89c6d28459 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -5265,8 +5265,10 @@ export class IllusionPostBattleAbAttr extends PostBattleAbAttr { * @returns {boolean} - Whether the illusion was applied. */ override applyPostBattle(pokemon: Pokemon, passive: boolean, simulated:boolean, args: any[]): void { - pokemon.breakIllusion(); - pokemon.battleData.illusion.available = true; + const illusion = pokemon.breakIllusion(); + if (illusion) { + pokemon.battleData.illusion.available = true; + } } } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 25bd3d84ec7..658a1d1627d 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -733,8 +733,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { this.loadAssets(false, true).then(() => this.playAnim()); this.updateInfo(); } else { - let availables: Species[] = []; - let randomIllusion: PokemonSpecies = globalScene.arena.randomSpecies(globalScene.currentBattle.waveIndex, this.level); + const availables: Species[] = []; + const randomIllusion: PokemonSpecies = globalScene.arena.randomSpecies(globalScene.currentBattle.waveIndex, this.level); /* if (this.isBoss()) { availables = [ Species.ENTEI, Species.RAIKOU, Species.SUICUNE ]; @@ -758,16 +758,15 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } breakIllusion(): boolean { - console.log("breakIllusion"); if (!this.battleData?.illusion.active) { return false; } - this.name = this.battleData?.illusion.basePokemon!.name; - this.nickname = this.battleData?.illusion.basePokemon!.nickname; - this.shiny = this.battleData?.illusion.basePokemon!.shiny; - this.variant = this.battleData?.illusion.basePokemon!.variant; - this.fusionVariant = this.battleData?.illusion.basePokemon!.fusionVariant; - this.fusionShiny = this.battleData?.illusion.basePokemon!.fusionShiny; + this.name = this.battleData?.illusion.basePokemon?.name ?? this.name; + this.nickname = this.battleData?.illusion.basePokemon?.nickname ?? this.nickname; + this.shiny = this.battleData?.illusion.basePokemon?.shiny ?? this.shiny; + this.variant = this.battleData?.illusion.basePokemon?.variant ?? this.variant; + this.fusionVariant = this.battleData?.illusion.basePokemon?.fusionVariant ?? this.fusionVariant; + this.fusionShiny = this.battleData?.illusion.basePokemon?.fusionShiny ?? this.fusionShiny; this.battleData.illusion = { active: false, available: false, basePokemon: this }; if (this.isOnField()) { globalScene.playSound("PRSFX- Transform"); @@ -5835,6 +5834,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } resetBattleData(): void { + console.log("RESET BATTLE DATA") const illusionActive: boolean = this.battleData?.illusion.active; this.breakIllusion(); this.battleData = new PokemonBattleData(); @@ -7829,7 +7829,7 @@ interface Illusion { * The formIndex of the illusion * @type {integer} */ - formIndex?: integer; + formIndex?: number; /** * The gender of the illusion * @type {Gender} @@ -7848,12 +7848,17 @@ interface Illusion { * The fusionFormIndex of the illusion * @type {integer} */ - fusionFormIndex?: integer; + fusionFormIndex?: number; /** * The fusionGender of the illusion if it's a fusion * @type {Gender} */ fusionGender?: Gender; + /** + * The level of the illusion + * @type {integer} + */ + level?: number } export interface TurnMove { diff --git a/src/overrides.ts b/src/overrides.ts index 3a9a54e740b..14461583d0a 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -121,7 +121,7 @@ class DefaultOverrides { readonly STARTER_FORM_OVERRIDES: Partial> = {}; /** default 5 or 20 for Daily */ - readonly STARTING_LEVEL_OVERRIDE: number = 0; + readonly STARTING_LEVEL_OVERRIDE: number = 30; /** * SPECIES OVERRIDE * will only apply to the first starter in your party or each enemy pokemon