From 19cd424e485bea150fd5cbfea472098f85c170cf Mon Sep 17 00:00:00 2001 From: Greenlamp Date: Sun, 5 May 2024 14:44:55 +0200 Subject: [PATCH] added back stats changes support when setting is on but ignored when on skip --- src/phases.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/phases.ts b/src/phases.ts index a7e5f3a77de..8468510f973 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -3647,8 +3647,8 @@ export class ShowPartyExpBarPhase extends PlayerPartyMemberPokemonPhase { pokemon.addExp(exp.value); newLevel = pokemon.level; const isLevelUp = newLevel > lastLevel; - if (this.scene.expParty === 0 && isLevelUp) { - this.scene.unshiftPhase(new LevelUpPhase(this.scene, this.partyMemberIndex, lastLevel)); + if (isLevelUp) { + this.scene.unshiftPhase(new LevelUpPhase(this.scene, this.partyMemberIndex, lastLevel, newLevel)); } this.scene.unshiftPhase(new HidePartyExpBarPhase(this.scene)); pokemon.updateInfo(); @@ -3695,6 +3695,7 @@ export class LevelUpPhase extends PlayerPartyMemberPokemonPhase { this.lastLevel = lastLevel; this.level = level; + this.scene = scene; } start() { @@ -3709,8 +3710,14 @@ export class LevelUpPhase extends PlayerPartyMemberPokemonPhase { const prevStats = pokemon.stats.slice(0); pokemon.calculateStats(); pokemon.updateInfo(); - this.scene.playSound('level_up_fanfare'); - this.scene.ui.showText(i18next.t('battle:levelUp', { pokemonName: this.getPokemon().name, level: this.level }), null, () => this.scene.ui.getMessageHandler().promptLevelUpStats(this.partyMemberIndex, prevStats, false).then(() => this.end()), null, true); + if (this.scene.expParty === 0) { + this.scene.playSound('level_up_fanfare'); + this.scene.ui.showText(i18next.t('battle:levelUp', { pokemonName: this.getPokemon().name, level: this.level }), null, () => this.scene.ui.getMessageHandler().promptLevelUpStats(this.partyMemberIndex, prevStats, false).then(() => this.end()), null, true); + } else if (this.scene.expParty === 2) { + this.end(); + } else { + this.scene.ui.getMessageHandler().promptLevelUpStats(this.partyMemberIndex, prevStats, false).then(() => this.end()); + } if (this.level <= 100) { const levelMoves = this.getPokemon().getLevelMoves(this.lastLevel + 1); for (let lm of levelMoves)