mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-03-13 05:15:17 +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
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import BattleScene from "#app/battle-scene";
|
|
import { ModifierTypeFunc } from "#app/modifier/modifier-type";
|
|
import { Mode } from "#app/ui/ui";
|
|
import i18next from "i18next";
|
|
import { ModifierRewardPhase } from "./modifier-reward-phase";
|
|
|
|
export class GameOverModifierRewardPhase extends ModifierRewardPhase {
|
|
constructor(scene: BattleScene, modifierTypeFunc: ModifierTypeFunc) {
|
|
super(scene, modifierTypeFunc);
|
|
}
|
|
|
|
doReward(): Promise<void> {
|
|
return new Promise<void>(resolve => {
|
|
const newModifier = this.modifierType.newModifier();
|
|
this.scene.addModifier(newModifier).then(() => {
|
|
// Sound loaded into game as is
|
|
this.scene.playSound("level_up_fanfare");
|
|
this.scene.ui.setMode(Mode.MESSAGE);
|
|
this.scene.ui.fadeIn(250).then(() => {
|
|
this.scene.ui.showText(i18next.t("battle:rewardGain", { modifierName: newModifier?.type.name }), null, () => {
|
|
this.scene.time.delayedCall(1500, () => this.scene.arenaBg.setVisible(true));
|
|
resolve();
|
|
}, null, true, 1500);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
}
|