mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-11-23 03:28:18 +01:00
* Extract Mode enum out of UI and into its own file Reduces circular imports from 909 to 773 * Move around utility files Reduces cyclical dependencies from 773 to 765 * Remove starterColors and bypassLogin from battle-scene Reduces cyclical dependencies from 765 to 623 * Fix test runner error * Update import for bypassLogin in test * Update mocks for utils in tests * Fix broken tests * Update selectWithTera override * Update path for utils in ab-attr.ts * Update path for utils in ability-class.ts * Fix utils import path in healer.test.ts
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import { globalScene } from "#app/global-scene";
|
|
import type PokemonSpecies from "#app/data/pokemon-species";
|
|
import type { ModifierTypeFunc } from "#app/modifier/modifier-type";
|
|
import { UiMode } from "#enums/ui-mode";
|
|
import i18next from "i18next";
|
|
import { ModifierRewardPhase } from "./modifier-reward-phase";
|
|
|
|
export class RibbonModifierRewardPhase extends ModifierRewardPhase {
|
|
private species: PokemonSpecies;
|
|
|
|
constructor(modifierTypeFunc: ModifierTypeFunc, species: PokemonSpecies) {
|
|
super(modifierTypeFunc);
|
|
|
|
this.species = species;
|
|
}
|
|
|
|
doReward(): Promise<void> {
|
|
return new Promise<void>(resolve => {
|
|
const newModifier = this.modifierType.newModifier();
|
|
globalScene.addModifier(newModifier);
|
|
globalScene.playSound("level_up_fanfare");
|
|
globalScene.ui.setMode(UiMode.MESSAGE);
|
|
globalScene.ui.showText(
|
|
i18next.t("battle:beatModeFirstTime", {
|
|
speciesName: this.species.name,
|
|
gameMode: globalScene.gameMode.getName(),
|
|
newModifier: newModifier?.type.name,
|
|
}),
|
|
null,
|
|
() => {
|
|
resolve();
|
|
},
|
|
null,
|
|
true,
|
|
1500,
|
|
);
|
|
});
|
|
}
|
|
}
|