mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-17 13:52:18 +02:00
Update phases.ts
This commit is contained in:
parent
3671fe4c2f
commit
8595a50cd1
@ -1250,8 +1250,12 @@ export class SummonPhase extends PartyMemberPokemonPhase {
|
|||||||
});
|
});
|
||||||
this.scene.time.delayedCall(750, () => this.summon());
|
this.scene.time.delayedCall(750, () => this.summon());
|
||||||
} else {
|
} else {
|
||||||
|
const trainerName = this.scene.currentBattle.trainer.getName(!(this.fieldIndex % 2) ? TrainerSlot.TRAINER : TrainerSlot.TRAINER_PARTNER);
|
||||||
|
const pokemonName = this.getPokemon().name;
|
||||||
|
const message = i18next.t("battle:trainerSendOut", { trainerName, pokemonName });
|
||||||
|
|
||||||
this.scene.pbTrayEnemy.hide();
|
this.scene.pbTrayEnemy.hide();
|
||||||
this.scene.ui.showText(`${this.scene.currentBattle.trainer.getName(!(this.fieldIndex % 2) ? TrainerSlot.TRAINER : TrainerSlot.TRAINER_PARTNER)} sent out\n${this.getPokemon().name}!`, null, () => this.summon());
|
this.scene.ui.showText(message, null, () => this.summon());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3509,7 +3513,11 @@ export class MoneyRewardPhase extends BattlePhase {
|
|||||||
|
|
||||||
this.scene.addMoney(moneyAmount.value);
|
this.scene.addMoney(moneyAmount.value);
|
||||||
|
|
||||||
this.scene.ui.showText(`You got ₽${moneyAmount.value.toLocaleString('en-US')}\nfor winning!`, null, () => this.end(), null, true);
|
const userLocale = navigator.language || 'en-US';
|
||||||
|
const formattedMoneyAmount = moneyAmount.value.toLocaleString(userLocale);
|
||||||
|
const message = i18next.t("battle:moneyWon", { moneyAmount: formattedMoneyAmount });
|
||||||
|
|
||||||
|
this.scene.ui.showText(message, null, () => this.end(), null, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3544,20 +3552,23 @@ export class GameOverModifierRewardPhase extends ModifierRewardPhase {
|
|||||||
super(scene, modifierTypeFunc);
|
super(scene, modifierTypeFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
doReward(): Promise<void> {
|
async doReward(): Promise<void> {
|
||||||
return new Promise<void>(resolve => {
|
await 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(() => {
|
||||||
this.scene.ui.showText(`You received\n${newModifier.type.name}!`, null, () => {
|
const modifierName = newModifier.type.name;
|
||||||
|
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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4415,7 +4426,7 @@ export class AttemptCapturePhase extends PokemonPhase {
|
|||||||
Promise.all([ pokemon.hideInfo(), this.scene.gameData.setPokemonCaught(pokemon) ]).then(() => {
|
Promise.all([ pokemon.hideInfo(), this.scene.gameData.setPokemonCaught(pokemon) ]).then(() => {
|
||||||
if (this.scene.getParty().length === 6) {
|
if (this.scene.getParty().length === 6) {
|
||||||
const promptRelease = () => {
|
const promptRelease = () => {
|
||||||
this.scene.ui.showText(`Your party is full.\nRelease a Pokémon to make room for ${pokemon.name}?`, null, () => {
|
this.scene.ui.showText(i18next.t("battle:partyFull", { pokemonName: pokemon.name }), null, () => {
|
||||||
this.scene.ui.setMode(Mode.CONFIRM, () => {
|
this.scene.ui.setMode(Mode.CONFIRM, () => {
|
||||||
this.scene.ui.setMode(Mode.PARTY, PartyUiMode.RELEASE, this.fieldIndex, (slotIndex: integer, _option: PartyOption) => {
|
this.scene.ui.setMode(Mode.PARTY, PartyUiMode.RELEASE, this.fieldIndex, (slotIndex: integer, _option: PartyOption) => {
|
||||||
this.scene.ui.setMode(Mode.MESSAGE).then(() => {
|
this.scene.ui.setMode(Mode.MESSAGE).then(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user