mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-02-06 08:07:42 +00:00
- remove any `.js` extension imports - remove unncessary dynamic imports of `modifier.ts` file. The file was being imported statically & dynamically. Made it pure static - increase vite chunk-size warning limit Co-authored-by: Mumble <171087428+frutescens@users.noreply.github.com>
29 lines
955 B
TypeScript
29 lines
955 B
TypeScript
import BattleScene from "#app/battle-scene";
|
|
import { Phase } from "#app/phase";
|
|
import { Unlockables, getUnlockableName } from "#app/system/unlockables";
|
|
import { Mode } from "#app/ui/ui";
|
|
import i18next from "i18next";
|
|
|
|
export class UnlockPhase extends Phase {
|
|
private unlockable: Unlockables;
|
|
|
|
constructor(scene: BattleScene, unlockable: Unlockables) {
|
|
super(scene);
|
|
|
|
this.unlockable = unlockable;
|
|
}
|
|
|
|
start(): void {
|
|
this.scene.time.delayedCall(2000, () => {
|
|
this.scene.gameData.unlocks[this.unlockable] = true;
|
|
// Sound loaded into game as is
|
|
this.scene.playSound("level_up_fanfare");
|
|
this.scene.ui.setMode(Mode.MESSAGE);
|
|
this.scene.ui.showText(i18next.t("battle:unlockedSomething", { unlockedThing: getUnlockableName(this.unlockable) }), null, () => {
|
|
this.scene.time.delayedCall(1500, () => this.scene.arenaBg.setVisible(true));
|
|
this.end();
|
|
}, null, true, 1500);
|
|
});
|
|
}
|
|
}
|