Remove DisabledTag lapse

This commit is contained in:
Zach Day 2024-08-09 20:40:29 -04:00
parent 777511cb4c
commit daf063be19

View File

@ -98,7 +98,7 @@ export interface TerrainBattlerTag {
* to select disabled moves.
*/
export abstract class DisablingBattlerTag extends BattlerTag {
public abstract moveIsDisabled(move: Moves): boolean;
abstract moveIsDisabled(move: Moves): boolean;
constructor(tagType: BattlerTagType, turnCount: integer, sourceMove?: Moves, sourceId?: integer) {
super(tagType, [ BattlerTagLapseType.PRE_MOVE, BattlerTagLapseType.TURN_END ], turnCount, sourceMove, sourceId);
@ -150,19 +150,6 @@ export class DisabledTag extends DisablingBattlerTag {
super(BattlerTagType.DISABLED, 4, Moves.DISABLE, sourceId);
}
override lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
if (!super.lapse(pokemon, lapseType)) {
return false;
}
if (this.moveId === 0) {
console.warn(`attempt to disable move ID 0 on ${pokemon}`);
return false;
}
return true;
}
/**
* Ensures that move history exists and has a valid move. If so, sets the {@link moveId} and shows a message.
* Otherwise, something has gone wrong, so the move ID will not get assigned and this tag will get removed next turn.