mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-17 12:59:25 +02:00
fixed double phase start bug fr
This commit is contained in:
parent
a691c43d33
commit
2a611da07a
@ -93,18 +93,25 @@ export class PokemonHealPhase extends CommonAnimPhase {
|
||||
// Only play animation if not skipped and target is not at full HP
|
||||
if (!this.skipAnim && !this.getPokemon().isFullHp()) {
|
||||
super.start();
|
||||
} else {
|
||||
this.end();
|
||||
}
|
||||
}
|
||||
|
||||
this.heal();
|
||||
// This is required as `commonAnimPhase` calls `this.end` once the animation finishes
|
||||
// TODO: This is a really shitty process and i hate it
|
||||
override end() {
|
||||
this.heal().then(() => {
|
||||
super.end();
|
||||
});
|
||||
}
|
||||
|
||||
private heal() {
|
||||
private async heal() {
|
||||
const pokemon = this.getPokemon();
|
||||
|
||||
// Prevent healing off-field pokemon unless via revives
|
||||
// TODO: Revival effects shouldn't use this phase
|
||||
if (!this.revive && !pokemon.isActive(true)) {
|
||||
super.end();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -112,7 +119,6 @@ export class PokemonHealPhase extends CommonAnimPhase {
|
||||
const healBlock = pokemon.getTag(BattlerTagType.HEAL_BLOCK);
|
||||
if (healBlock && this.hpHealed > 0) {
|
||||
globalScene.phaseManager.queueMessage(healBlock.onActivation(pokemon));
|
||||
super.end();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -137,7 +143,7 @@ export class PokemonHealPhase extends CommonAnimPhase {
|
||||
if (this.message) {
|
||||
globalScene.phaseManager.queueMessage(this.message);
|
||||
}
|
||||
pokemon.updateInfo().then(() => super.end());
|
||||
await pokemon.updateInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user