Recharge checked earlier, Move Tags not checked if move cancelled

Recharge is now checked at the start of doMove to determine if other Tags need to be checked or if the pokemon is recharging.  If the move is already cancelled, Move lapse tags are no longer checked (To account for Sleep/Paralyze happening before hand, so confusion would never trigger)
This commit is contained in:
Stophles 2024-04-05 19:14:02 -05:00 committed by GitHub
parent 5b2925cf85
commit 4c2dc8651f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2023,12 +2023,13 @@ export class MovePhase extends BattlePhase {
});
const doMove = () => {
if (!this.followUp && this.canMove()) {
this.pokemon.lapseTags(BattlerTagLapseType.MOVE);
if (this.cancelled) {
this.pokemon.pushMoveHistory({ move: Moves.NONE, result: MoveResult.FAIL });
return this.end();
}
this.pokemon.lapseTags(BattlerTagLapseType.PRE_MOVE);
if (!this.followUp && this.canMove() && !this.cancelled) {
this.pokemon.lapseTags(BattlerTagLapseType.MOVE);
}
if (this.cancelled) {
this.pokemon.pushMoveHistory({ move: Moves.NONE, result: MoveResult.FAIL });
return this.end();
}
const moveQueue = this.pokemon.getMoveQueue();
@ -4242,4 +4243,4 @@ export class TestMessagePhase extends MessagePhase {
constructor(scene: BattleScene, message: string) {
super(scene, message, null, true);
}
}
}