Adjusted canMove failure condition.

This commit is contained in:
frutescens 2024-11-10 12:12:51 -08:00
parent 2530c0941e
commit 56fd2cd7b8

View File

@ -120,13 +120,10 @@ export class MovePhase extends BattlePhase {
console.log(Moves[this.move.moveId]);
// Check if move is unusable (e.g. because it's out of PP due to a mid-turn Spite).
if (!this.canMove(true)) {
if (this.pokemon.isActive(true) && this.move.ppUsed >= this.move.getMovePp()) {
if ((!this.canMove(true) || this.move.ppUsed >= this.move.getMovePp()) && this.pokemon.isActive(true)) {
this.fail();
this.showMoveText();
this.showFailedText();
}
return this.end();
}
@ -378,15 +375,11 @@ export class MovePhase extends BattlePhase {
} else {
this.pokemon.pushMoveHistory({ move: this.move.moveId, targets: this.targets, result: MoveResult.FAIL, virtual: this.move.virtual });
let failedText: string | undefined;
const failureMessage = move.getFailedText(this.pokemon, targets[0], move, new BooleanHolder(false));
if (failureMessage) {
failedText = failureMessage;
}
this.showMoveText();
this.showFailedText(failedText);
this.showFailedText(failureMessage);
}
// Remove the user from its semi-invulnerable state (if applicable)
this.pokemon.lapseTags(BattlerTagLapseType.MOVE_EFFECT);