Update name of base class

This commit is contained in:
Zach Day 2024-09-02 18:35:51 -04:00
parent 2e3434910e
commit 5f3183bc8a
2 changed files with 11 additions and 10 deletions

View File

@ -102,7 +102,7 @@ export interface TerrainBattlerTag {
* match a condition. A disabled move gets cancelled before it is used. Players and enemies should not be allowed * match a condition. A disabled move gets cancelled before it is used. Players and enemies should not be allowed
* to select disabled moves. * to select disabled moves.
*/ */
export abstract class DisablingBattlerTag extends BattlerTag { export abstract class MoveRestrictionBattlerTag extends BattlerTag {
constructor(tagType: BattlerTagType, turnCount: integer, sourceMove?: Moves, sourceId?: integer) { constructor(tagType: BattlerTagType, turnCount: integer, sourceMove?: Moves, sourceId?: integer) {
super(tagType, [ BattlerTagLapseType.PRE_MOVE, BattlerTagLapseType.TURN_END ], turnCount, sourceMove, sourceId); super(tagType, [ BattlerTagLapseType.PRE_MOVE, BattlerTagLapseType.TURN_END ], turnCount, sourceMove, sourceId);
} }
@ -142,7 +142,7 @@ export abstract class DisablingBattlerTag extends BattlerTag {
* Tag representing the "disabling" effect performed by {@linkcode Moves.DISABLE} and {@linkcode Abilities.CURSED_BODY}. * Tag representing the "disabling" effect performed by {@linkcode Moves.DISABLE} and {@linkcode Abilities.CURSED_BODY}.
* When the tag is added, the last used move of the tag holder is set as the disabled move. * When the tag is added, the last used move of the tag holder is set as the disabled move.
*/ */
export class DisabledTag extends DisablingBattlerTag { export class DisabledTag extends MoveRestrictionBattlerTag {
/** The move being disabled. Gets set when {@linkcode onAdd} is called for this tag. */ /** The move being disabled. Gets set when {@linkcode onAdd} is called for this tag. */
public moveId: Moves = Moves.NONE; public moveId: Moves = Moves.NONE;

View File

@ -18,7 +18,7 @@ import { Status, StatusEffect, getRandomStatus } from "../data/status-effect";
import { pokemonEvolutions, pokemonPrevolutions, SpeciesFormEvolution, SpeciesEvolutionCondition, FusionSpeciesFormEvolution } from "../data/pokemon-evolutions"; import { pokemonEvolutions, pokemonPrevolutions, SpeciesFormEvolution, SpeciesEvolutionCondition, FusionSpeciesFormEvolution } from "../data/pokemon-evolutions";
import { reverseCompatibleTms, tmSpecies, tmPoolTiers } from "../data/tms"; import { reverseCompatibleTms, tmSpecies, tmPoolTiers } from "../data/tms";
import { BattleStat } from "../data/battle-stat"; import { BattleStat } from "../data/battle-stat";
import { BattlerTag, BattlerTagLapseType, EncoreTag, GroundedTag, HighestStatBoostTag, TypeImmuneTag, getBattlerTag, SemiInvulnerableTag, TypeBoostTag, DisablingBattlerTag, ExposedTag, DragonCheerTag, CritBoostTag, TrappedTag } from "../data/battler-tags"; import { BattlerTag, BattlerTagLapseType, EncoreTag, GroundedTag, HighestStatBoostTag, TypeImmuneTag, getBattlerTag, SemiInvulnerableTag, TypeBoostTag, MoveRestrictionBattlerTag, ExposedTag, DragonCheerTag, CritBoostTag, TrappedTag } from "../data/battler-tags";
import { WeatherType } from "../data/weather"; import { WeatherType } from "../data/weather";
import { TempBattleStat } from "../data/temp-battle-stat"; import { TempBattleStat } from "../data/temp-battle-stat";
import { ArenaTagSide, NoCritTag, WeakenMoveScreenTag } from "../data/arena-tag"; import { ArenaTagSide, NoCritTag, WeakenMoveScreenTag } from "../data/arena-tag";
@ -2549,20 +2549,21 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} }
/** /**
* Gets whether a move is currently disabled for this Pokemon. * Gets whether the given move move is currently disabled for this Pokemon.
* @see {@linkcode DisablingBattlerTag} * @param moveId {@linkcode Moves} The ID of the move to check
* @see {@linkcode MoveRestrictionBattlerTag}
*/ */
isMoveDisabled(moveId: Moves): boolean { isMoveDisabled(moveId: Moves): boolean {
return this.getDisablingTag(moveId) !== null; return this.getDisablingTag(moveId) !== null;
} }
/** /**
* Gets the {@link DisablingBattlerTag} that is disabling the given move, or null if that move is not disabled. * Gets the {@link MoveRestrictionBattlerTag} that is disabling the given move, or null if that move is not disabled.
*/ */
getDisablingTag(moveId: Moves): DisablingBattlerTag | null { getDisablingTag(moveId: Moves): MoveRestrictionBattlerTag | null {
for (const tag of this.findTags(t => t instanceof DisablingBattlerTag)) { for (const tag of this.findTags(t => t instanceof MoveRestrictionBattlerTag)) {
if ((tag as DisablingBattlerTag).moveIsDisabled(moveId)) { if ((tag as MoveRestrictionBattlerTag).moveIsDisabled(moveId)) {
return tag as DisablingBattlerTag; return tag as MoveRestrictionBattlerTag;
} }
} }
return null; return null;