Update phases.ts

This commit is contained in:
Lugiad 2024-05-20 02:25:34 +02:00 committed by GitHub
parent 050ea35508
commit 75d688f610
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3552,23 +3552,20 @@ export class GameOverModifierRewardPhase extends ModifierRewardPhase {
super(scene, modifierTypeFunc); super(scene, modifierTypeFunc);
} }
async doReward(): Promise<void> { doReward(): Promise<void> {
await new Promise<void>(resolve => { return new Promise<void>(resolve => {
const newModifier = this.modifierType.newModifier(); const newModifier = this.modifierType.newModifier();
this.scene.addModifier(newModifier).then(() => { this.scene.addModifier(newModifier).then(() => {
this.scene.playSound('level_up_fanfare'); this.scene.playSound('level_up_fanfare');
this.scene.ui.setMode(Mode.MESSAGE); this.scene.ui.setMode(Mode.MESSAGE);
this.scene.ui.fadeIn(250).then(() => { this.scene.ui.fadeIn(250).then(() => {
const modifierName = newModifier.type.name; this.scene.ui.showText(`You received\n${newModifier.type.name}!`, null, () => {
const message = i18next.t("battle:modifierReceived", { modifierName });
this.scene.ui.showText(message, null, () => {
this.scene.time.delayedCall(1500, () => this.scene.arenaBg.setVisible(true)); this.scene.time.delayedCall(1500, () => this.scene.arenaBg.setVisible(true));
resolve(); resolve();
}, null, true, 1500); }, null, true, 1500);
}); });
}); });
}); })
} }
} }