mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-10 18:32:16 +02:00
added some comment
This commit is contained in:
parent
45ff55b528
commit
a3cfcf2bd1
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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()}`);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user