mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-20 15:22:19 +02:00
add: ExpGainsSpeed enum
This commit is contained in:
parent
c346653127
commit
836e4d54dc
@ -86,6 +86,7 @@ import { TitlePhase } from "./phases/title-phase";
|
||||
import { ToggleDoublePositionPhase } from "./phases/toggle-double-position-phase";
|
||||
import { TurnInitPhase } from "./phases/turn-init-phase";
|
||||
import { ShopCursorTarget } from "./enums/shop-cursor-target";
|
||||
import { ExpGainsSpeed } from "./enums/exp-gains-speed";
|
||||
|
||||
export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1";
|
||||
|
||||
@ -161,7 +162,7 @@ export default class BattleScene extends SceneBase {
|
||||
public experimentalSprites: boolean = false;
|
||||
public musicPreference: integer = 0;
|
||||
public moveAnimations: boolean = true;
|
||||
public expGainsSpeed: integer = 0;
|
||||
public expGainsSpeed: ExpGainsSpeed = ExpGainsSpeed.DEFAULT;
|
||||
public skipSeenDialogues: boolean = false;
|
||||
/**
|
||||
* Determines if the egg hatching animation should be skipped
|
||||
|
22
src/enums/exp-gains-speed.ts
Normal file
22
src/enums/exp-gains-speed.ts
Normal file
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Defines the speed of gaining experience.
|
||||
*
|
||||
* @remarks
|
||||
* The `expGainSpeed` can have several modes:
|
||||
* - `0` - Default: The normal speed.
|
||||
* - `1` - Fast: Fast speed.
|
||||
* - `2` - Faster: Faster speed.
|
||||
* - `3` - Skip: Skip gaining exp animation.
|
||||
*
|
||||
* @default 0 - Uses the default normal speed.
|
||||
*/
|
||||
export enum ExpGainsSpeed {
|
||||
/** The normal speed. */
|
||||
DEFAULT,
|
||||
/** Fast speed. */
|
||||
FAST,
|
||||
/** Faster speed. */
|
||||
FASTER,
|
||||
/** Skip gaining exp animation. */
|
||||
SKIP
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
import BattleScene from "#app/battle-scene";
|
||||
import { ExpGainsSpeed } from "#app/enums/exp-gains-speed";
|
||||
import { ExpNotification } from "#app/enums/exp-notification";
|
||||
import { ExpBoosterModifier } from "#app/modifier/modifier";
|
||||
import * as Utils from "#app/utils";
|
||||
@ -44,7 +45,7 @@ export class ShowPartyExpBarPhase extends PlayerPartyMemberPokemonPhase {
|
||||
} else {
|
||||
this.end();
|
||||
}
|
||||
} else if (this.scene.expGainsSpeed < 3) {
|
||||
} else if (this.scene.expGainsSpeed < ExpGainsSpeed.SKIP) {
|
||||
this.scene.partyExpBar.showPokemonExp(pokemon, exp.value, false, newLevel).then(() => {
|
||||
setTimeout(() => this.end(), 500 / Math.pow(2, this.scene.expGainsSpeed));
|
||||
});
|
||||
|
@ -49,6 +49,7 @@ import { OverridesHelper } from "./helpers/overridesHelper";
|
||||
import { SettingsHelper } from "./helpers/settingsHelper";
|
||||
import { ReloadHelper } from "./helpers/reloadHelper";
|
||||
import { CheckSwitchPhase } from "#app/phases/check-switch-phase";
|
||||
import { ExpGainsSpeed } from "#app/enums/exp-gains-speed";
|
||||
|
||||
/**
|
||||
* Class to manage the game state and transitions between phases.
|
||||
@ -140,7 +141,7 @@ export default class GameManager {
|
||||
this.scene.gameSpeed = 5;
|
||||
this.scene.moveAnimations = false;
|
||||
this.scene.showLevelUpStats = false;
|
||||
this.scene.expGainsSpeed = 3;
|
||||
this.scene.expGainsSpeed = ExpGainsSpeed.SKIP;
|
||||
this.scene.expParty = ExpNotification.SKIP;
|
||||
this.scene.hpBarSpeed = 3;
|
||||
this.scene.enableTutorials = false;
|
||||
|
Loading…
Reference in New Issue
Block a user