Separate tag lapsing out of the status resolution function

This commit is contained in:
NightKev 2024-09-06 00:37:42 -07:00
parent 841f032e45
commit 9f2a785fdd
1 changed files with 8 additions and 1 deletions

View File

@ -96,6 +96,8 @@ export class MovePhase extends BattlePhase {
this.resolvePreMoveStatusEffects();
this.lapsePreMoveAndMoveTags();
this.resolveFinalPreMoveCancellationChecks();
if (this.cancelled || this.failed) {
@ -160,8 +162,13 @@ export class MovePhase extends BattlePhase {
this.pokemon.updateInfo();
}
}
}
// Lapse tags that triggered before a move is used, regardless of whether or not it failed.
/**
* Lapse `PRE_MOVE` tags that trigger before a move is used, regardless of whether or not it failed.
* Also lapse `MOVE` tags if the move should be successful.
*/
lapsePreMoveAndMoveTags() {
this.pokemon.lapseTags(BattlerTagLapseType.PRE_MOVE);
// TODO: does this intentionally happen before the no targets/Moves.NONE on queue cancellation case is checked?