mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-22 09:39:15 +01:00
* Move phase types out of phase interceptor * Create isXPhase method and add properties to each phase * Replace instanceof phase with isXPhase * Fix missing union types for phaseName * Update doc comment in phase.ts * Fix incomplete comment in encounter-phase * Make phaseName as public and fix more uses * Move phaseName property declaration before constructor in move anim phase Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Rename isXPhase to is --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import { globalScene } from "#app/global-scene";
|
|
import { UiMode } from "#enums/ui-mode";
|
|
import i18next from "i18next";
|
|
import { ModifierRewardPhase } from "./modifier-reward-phase";
|
|
|
|
export class GameOverModifierRewardPhase extends ModifierRewardPhase {
|
|
public readonly phaseName = "GameOverModifierRewardPhase";
|
|
doReward(): Promise<void> {
|
|
return new Promise<void>(resolve => {
|
|
const newModifier = this.modifierType.newModifier();
|
|
globalScene.addModifier(newModifier);
|
|
// Sound loaded into game as is
|
|
globalScene.playSound("level_up_fanfare");
|
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
|
globalScene.ui.fadeIn(250).then(() => {
|
|
globalScene.ui.showText(
|
|
i18next.t("battle:rewardGain", {
|
|
modifierName: newModifier?.type.name,
|
|
}),
|
|
null,
|
|
() => {
|
|
globalScene.time.delayedCall(1500, () => globalScene.arenaBg.setVisible(true));
|
|
resolve();
|
|
},
|
|
null,
|
|
true,
|
|
1500,
|
|
);
|
|
});
|
|
});
|
|
}
|
|
}
|