Add option to hide exp gains after a battle

pull/178/head
Hans Sorongon 2024-04-18 12:24:47 +08:00 committed by Samuel H
parent 34a7d435b9
commit 0948295a98
3 changed files with 19 additions and 7 deletions

View File

@ -120,6 +120,7 @@ export default class BattleScene extends SceneBase {
public gameSpeed: integer = 1;
public damageNumbersMode: integer = 0;
public showLevelUpStats: boolean = true;
public showExpGains: boolean = true;
public enableTutorials: boolean = import.meta.env.VITE_BYPASS_TUTORIAL === "1";
public enableRetries: boolean = false;
public uiTheme: UiTheme = UiTheme.DEFAULT;

View File

@ -3543,12 +3543,17 @@ export class ShowPartyExpBarPhase extends PlayerPartyMemberPokemonPhase {
this.scene.unshiftPhase(new HidePartyExpBarPhase(this.scene));
pokemon.updateInfo();
this.scene.partyExpBar.showPokemonExp(pokemon, exp.value).then(() => {
if (newLevel > lastLevel)
this.end();
else
setTimeout(() => this.end(), 500);
});
if (this.scene.showExpGains) {
this.scene.partyExpBar.showPokemonExp(pokemon, exp.value).then(() => {
if (newLevel > lastLevel)
this.end();
else
setTimeout(() => this.end(), 500);
});
} else {
this.end();
}
}
}

View File

@ -16,6 +16,7 @@ export enum Setting {
Sprite_Set = "SPRITE_SET",
Move_Animations = "MOVE_ANIMATIONS",
Show_Stats_on_Level_Up = "SHOW_LEVEL_UP_STATS",
Show_EXP_Gains = "SHOW_EXP_GAINS",
HP_Bar_Speed = "HP_BAR_SPEED",
Fusion_Palette_Swaps = "FUSION_PALETTE_SWAPS",
Player_Gender = "PLAYER_GENDER",
@ -45,6 +46,7 @@ export const settingOptions: SettingOptions = {
[Setting.Sprite_Set]: [ 'Consistent', 'Prioritize Animation' ],
[Setting.Move_Animations]: [ 'Off', 'On' ],
[Setting.Show_Stats_on_Level_Up]: [ 'Off', 'On' ],
[Setting.Show_EXP_Gains]: [ 'Off', 'On' ],
[Setting.HP_Bar_Speed]: [ 'Normal', 'Fast', 'Faster', 'Instant' ],
[Setting.Fusion_Palette_Swaps]: [ 'Off', 'On' ],
[Setting.Player_Gender]: [ 'Boy', 'Girl' ],
@ -66,6 +68,7 @@ export const settingDefaults: SettingDefaults = {
[Setting.Sprite_Set]: 0,
[Setting.Move_Animations]: 1,
[Setting.Show_Stats_on_Level_Up]: 1,
[Setting.Show_EXP_Gains]: 1,
[Setting.HP_Bar_Speed]: 0,
[Setting.Fusion_Palette_Swaps]: 1,
[Setting.Player_Gender]: 0,
@ -119,6 +122,9 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer)
case Setting.Show_Stats_on_Level_Up:
scene.showLevelUpStats = settingOptions[setting][value] === 'On';
break;
case Setting.Show_EXP_Gains:
scene.showExpGains = settingOptions[setting][value] === 'On';
break;
case Setting.HP_Bar_Speed:
scene.hpBarSpeed = value;
break;
@ -148,4 +154,4 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer)
}
return true;
}
}