diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 56b1636ae76..8935ab07bf7 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -101,6 +101,11 @@ export default class BattleScene extends SceneBase { public experimentalSprites: boolean = false; public moveAnimations: boolean = true; public expGainsSpeed: integer = 0; + //expParty can be: + // 0 - default - the normal exp gain display, nothing changed + // 1 - Only level up - we display the level up in the small frame instead of a message + // 2 - Skip - no level up frame nor message + // 1 & 2 still are compatible with stats display, level up, new move, ... public expParty: integer = 0; public hpBarSpeed: integer = 0; public fusionPaletteSwaps: boolean = true; diff --git a/src/phases.ts b/src/phases.ts index 3a2a6975520..cebd44a7667 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -3673,12 +3673,14 @@ export class ShowPartyExpBarPhase extends PlayerPartyMemberPokemonPhase { this.scene.unshiftPhase(new HidePartyExpBarPhase(this.scene)); pokemon.updateInfo(); - if (this.scene.expParty === 2) { + if (this.scene.expParty === 2) { // 2 - Skip - no level up frame nor message this.end(); - } else if (this.scene.expParty === 1) { - if (newLevel > lastLevel) { + } else if (this.scene.expParty === 1) { // 1 - Only level up - we display the level up in the small frame instead of a message + if (newLevel > lastLevel) { // this means if we level up + // instead of displaying the exp gain in the small frame, we display the new level + // we use the same method for the normal and the only up, by giving a parameter saying to display the exp or the level this.scene.partyExpBar.showPokemonExp(pokemon, exp.value, this.scene.expParty === 1, newLevel).then(() => { - setTimeout(() => this.end(), 200 / Math.pow(2, this.scene.expGainsSpeed)); + setTimeout(() => this.end(), 500 / Math.pow(2, this.scene.expGainsSpeed)); }); } else { this.end(); @@ -3730,12 +3732,13 @@ export class LevelUpPhase extends PlayerPartyMemberPokemonPhase { const prevStats = pokemon.stats.slice(0); pokemon.calculateStats(); pokemon.updateInfo(); - if (this.scene.expParty === 0) { + if (this.scene.expParty === 0) { // 0 - default - the normal exp gain display, nothing changed 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) { + } else if (this.scene.expParty === 2) { // 2 - Skip - no level up frame nor message this.end(); - } else { + } else { // 1 - Only level up - we display the level up in the small frame instead of a message + // we still want to display the stats if activated this.scene.ui.getMessageHandler().promptLevelUpStats(this.partyMemberIndex, prevStats, false).then(() => this.end()); } if (this.level <= 100) { diff --git a/src/ui/party-exp-bar.ts b/src/ui/party-exp-bar.ts index 1ac12574792..df28b898f03 100644 --- a/src/ui/party-exp-bar.ts +++ b/src/ui/party-exp-bar.ts @@ -39,13 +39,15 @@ export default class PartyExpBar extends Phaser.GameObjects.Container { this.add(this.pokemonIcon); + // if we want to only display the level in the small frame if (showOnlyLevelUp) { - if (newLevel > 200) { + if (newLevel > 200) { // if the level is greater than 200, we only display Lv. UP this.expText.setText('Lv. UP'); - } else { + } else { // otherwise we display Lv. Up and the new level this.expText.setText(`Lv. UP : ${newLevel.toString()}`); } } else { + // if we want to display the exp this.expText.setText(`+${expValue.toString()}`); }