mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-23 00:32:28 +02:00
Apply suggestions from Kev's review
This commit is contained in:
parent
61ee7c0717
commit
5a096a7994
@ -3335,7 +3335,7 @@ export class CutHpStatStageBoostAttr extends StatStageChangeAttr {
|
||||
|
||||
override apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
user.damageAndUpdate(Utils.toDmgValue(user.getMaxHp() / this.cutRatio), HitResult.OTHER, false, true);
|
||||
user.updateInfo(); // TODO: This is a Promise and might cause desync issues
|
||||
user.updateInfo();
|
||||
const ret = super.apply(user, target, move, args);
|
||||
if (this.messageCallback) {
|
||||
this.messageCallback(user);
|
||||
@ -3452,7 +3452,7 @@ export class ResetStatsAttr extends MoveEffectAttr {
|
||||
for (const s of BATTLE_STATS) {
|
||||
pokemon.setStatStage(s, 0);
|
||||
}
|
||||
pokemon.updateInfo(); // TODO: This is still a Promise and might cause desync issues
|
||||
pokemon.updateInfo();
|
||||
}
|
||||
}
|
||||
|
||||
@ -3526,7 +3526,7 @@ export class HpSplitAttr extends MoveEffectAttr {
|
||||
globalScene.damageNumberHandler.add(p, damage);
|
||||
}
|
||||
}
|
||||
p.updateInfo(); // TODO: This is still a Promise
|
||||
p.updateInfo();
|
||||
});
|
||||
|
||||
return true;
|
||||
@ -6016,7 +6016,7 @@ export class RevivalBlessingAttr extends MoveEffectAttr {
|
||||
*/
|
||||
override apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
// If user is player, checks if the user has fainted pokemon
|
||||
if (user instanceof PlayerPokemon && globalScene.getPlayerParty().findIndex((p) => p.isFainted()) > -1) {
|
||||
if (user instanceof PlayerPokemon) {
|
||||
globalScene.unshiftPhase(new RevivalBlessingPhase(user));
|
||||
return true;
|
||||
} else if (user instanceof EnemyPokemon && user.hasTrainer() && globalScene.getEnemyParty().findIndex((p) => p.isFainted() && !p.isBoss()) > -1) {
|
||||
|
@ -12,16 +12,22 @@ export class GameOverModifierRewardPhase extends ModifierRewardPhase {
|
||||
doReward(): Promise<void> {
|
||||
return new Promise<void>(resolve => {
|
||||
const newModifier = this.modifierType.newModifier();
|
||||
globalScene.addModifier(newModifier).then(() => {
|
||||
// Sound loaded into game as is
|
||||
globalScene.playSound("level_up_fanfare");
|
||||
globalScene.ui.setMode(Mode.MESSAGE);
|
||||
globalScene.ui.fadeIn(250).then(() => {
|
||||
globalScene.ui.showText(i18next.t("battle:rewardGain", { modifierName: newModifier?.type.name }), null, () => {
|
||||
globalScene.addModifier(newModifier);
|
||||
// Sound loaded into game as is
|
||||
globalScene.playSound("level_up_fanfare");
|
||||
globalScene.ui.setMode(Mode.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);
|
||||
});
|
||||
},
|
||||
null,
|
||||
true,
|
||||
1500,
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user