mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-10-24 14:05:50 +02: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>
27 lines
730 B
TypeScript
27 lines
730 B
TypeScript
import { globalScene } from "#app/global-scene";
|
|
import { UiMode } from "#enums/ui-mode";
|
|
import i18next from "i18next";
|
|
import { FieldPhase } from "./field-phase";
|
|
|
|
export class LevelCapPhase extends FieldPhase {
|
|
public readonly phaseName = "LevelCapPhase";
|
|
start(): void {
|
|
super.start();
|
|
|
|
globalScene.ui.setMode(UiMode.MESSAGE).then(() => {
|
|
// Sound loaded into game as is
|
|
globalScene.playSound("level_up_fanfare");
|
|
globalScene.ui.showText(
|
|
i18next.t("battle:levelCapUp", {
|
|
levelCap: globalScene.getMaxExpLevel(),
|
|
}),
|
|
null,
|
|
() => this.end(),
|
|
null,
|
|
true,
|
|
);
|
|
this.executeForAll(pokemon => pokemon.updateInfo(true));
|
|
});
|
|
}
|
|
}
|