diff --git a/src/data/abilities/ability.ts b/src/data/abilities/ability.ts index 6d6235b1ec2..7f45f555b1e 100644 --- a/src/data/abilities/ability.ts +++ b/src/data/abilities/ability.ts @@ -11,7 +11,8 @@ import { randSeedFloat, } from "#app/utils/common"; import { getPokemonNameWithAffix } from "#app/messages"; -import { BattlerTagLapseType, GroundedTag } from "#app/data/battler-tags"; +import { GroundedTag } from "#app/data/battler-tags"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import { getNonVolatileStatusEffects, getStatusEffectDescriptor, diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 66b5f7d7cb5..7b445895061 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -42,19 +42,7 @@ import { EFFECTIVE_STATS, getStatKey, Stat, type BattleStat, type EffectiveStat import { StatusEffect } from "#enums/status-effect"; import { WeatherType } from "#enums/weather-type"; import { isNullOrUndefined } from "#app/utils/common"; - -export enum BattlerTagLapseType { - FAINT, - MOVE, - PRE_MOVE, - AFTER_MOVE, - MOVE_EFFECT, - TURN_END, - HIT, - /** Tag lapses AFTER_HIT, applying its effects even if the user faints */ - AFTER_HIT, - CUSTOM, -} +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; export class BattlerTag { public tagType: BattlerTagType; diff --git a/src/enums/battler-tag-lapse-type.ts b/src/enums/battler-tag-lapse-type.ts new file mode 100644 index 00000000000..9569d08f01a --- /dev/null +++ b/src/enums/battler-tag-lapse-type.ts @@ -0,0 +1,13 @@ + +export enum BattlerTagLapseType { + FAINT, + MOVE, + PRE_MOVE, + AFTER_MOVE, + MOVE_EFFECT, + TURN_END, + HIT, + /** Tag lapses AFTER_HIT, applying its effects even if the user faints */ + AFTER_HIT, + CUSTOM +} diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 744514369c2..152658a6751 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -116,7 +116,6 @@ import { import { reverseCompatibleTms, tmSpecies, tmPoolTiers } from "#app/data/balance/tms"; import { BattlerTag, - BattlerTagLapseType, EncoreTag, GroundedTag, HighestStatBoostTag, @@ -135,6 +134,7 @@ import { loadBattlerTag, type GrudgeTag, } from "../data/battler-tags"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import { WeatherType } from "#enums/weather-type"; import { NoCritTag, WeakenMoveScreenTag } from "#app/data/arena-tag"; import { ArenaTagSide } from "#enums/arena-tag-side"; diff --git a/src/phases/faint-phase.ts b/src/phases/faint-phase.ts index 2b9d51ac194..55f5433c390 100644 --- a/src/phases/faint-phase.ts +++ b/src/phases/faint-phase.ts @@ -9,7 +9,7 @@ import { PostKnockOutAbAttr, PostVictoryAbAttr, } from "#app/data/abilities/ability"; -import { BattlerTagLapseType } from "#app/data/battler-tags"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import { battleSpecDialogue } from "#app/data/dialogue"; import { PostVictoryStatStageChangeAttr } from "#app/data/moves/move"; import { allMoves } from "#app/data/data-lists"; diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index 17cf9b7fe85..4c35d4f564a 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -20,13 +20,13 @@ import { ConditionalProtectTag } from "#app/data/arena-tag"; import { ArenaTagSide } from "#enums/arena-tag-side"; import { MoveAnim } from "#app/data/battle-anims"; import { - BattlerTagLapseType, DamageProtectedTag, ProtectedTag, SemiInvulnerableTag, SubstituteTag, TypeBoostTag, } from "#app/data/battler-tags"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import type { MoveAttr } from "#app/data/moves/move"; import { applyFilteredMoveAttrs, diff --git a/src/phases/move-end-phase.ts b/src/phases/move-end-phase.ts index 463bfb390e2..e5f87089fae 100644 --- a/src/phases/move-end-phase.ts +++ b/src/phases/move-end-phase.ts @@ -1,5 +1,5 @@ import { globalScene } from "#app/global-scene"; -import { BattlerTagLapseType } from "#app/data/battler-tags"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import { PokemonPhase } from "./pokemon-phase"; import type { BattlerIndex } from "#enums/battler-index"; import { applyPostSummonAbAttrs, PostSummonRemoveEffectAbAttr } from "#app/data/abilities/ability"; diff --git a/src/phases/move-phase.ts b/src/phases/move-phase.ts index 31380bba913..53218ad9883 100644 --- a/src/phases/move-phase.ts +++ b/src/phases/move-phase.ts @@ -13,7 +13,8 @@ import { } from "#app/data/abilities/ability"; import type { DelayedAttackTag } from "#app/data/arena-tag"; import { CommonAnim } from "#app/data/battle-anims"; -import { BattlerTagLapseType, CenterOfAttentionTag } from "#app/data/battler-tags"; +import { CenterOfAttentionTag } from "#app/data/battler-tags"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import { AddArenaTrapTagAttr, applyMoveAttrs, diff --git a/src/phases/mystery-encounter-phases.ts b/src/phases/mystery-encounter-phases.ts index 1f27db7ff64..9aae796211f 100644 --- a/src/phases/mystery-encounter-phases.ts +++ b/src/phases/mystery-encounter-phases.ts @@ -1,4 +1,4 @@ -import { BattlerTagLapseType } from "#app/data/battler-tags"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import type { OptionPhaseCallback } from "#app/data/mystery-encounters/mystery-encounter-option"; import type MysteryEncounterOption from "#app/data/mystery-encounters/mystery-encounter-option"; import { SeenEncounterData } from "#app/data/mystery-encounters/mystery-encounter-save-data"; diff --git a/src/phases/turn-end-phase.ts b/src/phases/turn-end-phase.ts index 85590d667d6..a539b234a18 100644 --- a/src/phases/turn-end-phase.ts +++ b/src/phases/turn-end-phase.ts @@ -1,5 +1,5 @@ import { applyPostTurnAbAttrs, PostTurnAbAttr } from "#app/data/abilities/ability"; -import { BattlerTagLapseType } from "#app/data/battler-tags"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import { TerrainType } from "#app/data/terrain"; import { WeatherType } from "#app/enums/weather-type"; import { TurnEndEvent } from "#app/events/battle-scene"; diff --git a/test/battlerTags/octolock.test.ts b/test/battlerTags/octolock.test.ts index 63784ed7f1b..d0214f495fc 100644 --- a/test/battlerTags/octolock.test.ts +++ b/test/battlerTags/octolock.test.ts @@ -1,6 +1,7 @@ import { afterEach, beforeAll, describe, expect, it, vi } from "vitest"; import type Pokemon from "#app/field/pokemon"; -import { BattlerTagLapseType, OctolockTag, TrappedTag } from "#app/data/battler-tags"; +import { OctolockTag, TrappedTag } from "#app/data/battler-tags"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase"; import { Stat } from "#enums/stat"; import GameManager from "#test/testUtils/gameManager"; diff --git a/test/battlerTags/substitute.test.ts b/test/battlerTags/substitute.test.ts index b0c9a9e3cff..06aedab19f4 100644 --- a/test/battlerTags/substitute.test.ts +++ b/test/battlerTags/substitute.test.ts @@ -3,7 +3,8 @@ import type { PokemonTurnData, TurnMove } from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon"; import { MoveResult } from "#enums/move-result"; import type BattleScene from "#app/battle-scene"; -import { BattlerTagLapseType, BindTag, SubstituteTag } from "#app/data/battler-tags"; +import { BindTag, SubstituteTag } from "#app/data/battler-tags"; +import { BattlerTagLapseType } from "#enums/battler-tag-lapse-type"; import { MoveId } from "#enums/move-id"; import { PokemonAnimType } from "#app/enums/pokemon-anim-type"; import * as messages from "#app/messages";