Disabling Moves

This commit is contained in:
frutescens 2024-09-20 12:42:29 -07:00
parent 43e1b3db85
commit daa24b1dbf

View File

@ -2181,9 +2181,9 @@ export class ExposedTag extends BattlerTag {
/**
* Describes the behavior of a Heal Block Tag.
*/
export class HealBlockTag extends BattlerTag {
export class HealBlockTag extends MoveRestrictionBattlerTag {
constructor() {
super(BattlerTagType.HEAL_BLOCK, BattlerTagLapseType.TURN_END, 5, Moves.HEAL_BLOCK);
super(BattlerTagType.HEAL_BLOCK, 5, Moves.HEAL_BLOCK);
}
override onAdd(pokemon: Pokemon): void {
@ -2198,6 +2198,28 @@ export class HealBlockTag extends BattlerTag {
return i18next.t("battle:battlerTagsHealBlock", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon) });
}
override isMoveRestricted(move: Moves): boolean {
if (move.hasFlag(MoveFlags.TRIAGE_MOVE) && move.category() === MoveCategory.STATUS) {
return true;
}
return false;
}
override selectionDeniedText(pokemon: Pokemon, move: Moves): string {
return i18next.t("battle:moveDisabled", { moveName: allMoves[move].name });
}
override isMoveRestricted(move: Moves): boolean {
if (move.hasFlag(MoveFlags.TRIAGE_MOVE) && move.category() === MoveCategory.STATUS) {
return true;
}
return false;
}
override selectionDeniedText(pokemon: Pokemon, move: Moves): string {
return i18next.t("battle:moveDisabled", { moveName: allMoves[move].name });
}
override onRemove(pokemon: Pokemon): void {
super.onRemove(pokemon);