mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-26 08:46:55 +00:00
Allow for null user in end of move effect phase
This commit is contained in:
parent
5441ecbd73
commit
b29ee1be5e
@ -1739,12 +1739,14 @@ export class MoveEffectPhase extends PokemonPhase {
|
||||
|
||||
end() {
|
||||
const user = this.getUserPokemon();
|
||||
if (--user.turnData.hitsLeft >= 1 && this.getTarget()?.isActive())
|
||||
this.scene.unshiftPhase(this.getNewHitPhase());
|
||||
else {
|
||||
if (user.turnData.hitCount - Math.max(user.turnData.hitsLeft, 0) > 1)
|
||||
this.scene.queueMessage(`Hit ${user.turnData.hitCount} time(s)!`);
|
||||
this.scene.applyModifiers(HitHealModifier, this.player, user);
|
||||
if (user) {
|
||||
if (--user.turnData.hitsLeft >= 1 && this.getTarget()?.isActive())
|
||||
this.scene.unshiftPhase(this.getNewHitPhase());
|
||||
else {
|
||||
if (user.turnData.hitCount - Math.max(user.turnData.hitsLeft, 0) > 1)
|
||||
this.scene.queueMessage(`Hit ${user.turnData.hitCount} time(s)!`);
|
||||
this.scene.applyModifiers(HitHealModifier, this.player, user);
|
||||
}
|
||||
}
|
||||
|
||||
super.end();
|
||||
|
Loading…
Reference in New Issue
Block a user