added back stats changes support when setting is on but ignored when on skip

This commit is contained in:
Greenlamp 2024-05-05 14:44:55 +02:00
parent af385fedf6
commit 19cd424e48

View File

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