Simplify DisablingBattlerTag lapse

This commit is contained in:
Zach Day 2024-08-09 20:42:51 -04:00
parent daf063be19
commit 3fe58ac5db

View File

@ -110,22 +110,17 @@ export abstract class DisablingBattlerTag extends BattlerTag {
const phase = pokemon.scene.getCurrentPhase() as MovePhase; const phase = pokemon.scene.getCurrentPhase() as MovePhase;
const move = phase.move; const move = phase.move;
if (!this.moveIsDisabled(move.moveId)) { if (this.moveIsDisabled(move.moveId)) {
return true;
}
pokemon.scene.queueMessage(this.interruptedText(pokemon, move.moveId)); pokemon.scene.queueMessage(this.interruptedText(pokemon, move.moveId));
phase.fail(); phase.fail();
} else if (lapseType === BattlerTagLapseType.TURN_END) {
// On turn end, subtract from lifetime and remove this tag if 0
if (!super.lapse(pokemon, lapseType)) {
return false;
}
} }
return true; return true;
} }
return super.lapse(pokemon, lapseType);
}
/** /**
* The text to display when a move's execution is prevented as a result of the disable. * The text to display when a move's execution is prevented as a result of the disable.
* Because disabling effects also prevent selection of the move, this situation can only arise if a * Because disabling effects also prevent selection of the move, this situation can only arise if a