Remove circular import between battle-anims.ts and battler-tags.ts

This commit is contained in:
NightKev 2025-06-14 10:31:06 -07:00
parent f3a07ced5c
commit 431521ed70

View File

@ -1,12 +1,18 @@
import { globalScene } from "#app/global-scene";
import { allMoves } from "./data-lists";
import { allMoves } from "#app/data/data-lists";
import { MoveFlags } from "#enums/MoveFlags";
import type Pokemon from "../field/pokemon";
import { type nil, getFrameMs, getEnumKeys, getEnumValues, animationFileName, coerceArray } from "../utils/common";
import type Pokemon from "#app/field/pokemon";
import {
type nil,
getFrameMs,
getEnumKeys,
getEnumValues,
animationFileName,
coerceArray,
isNullOrUndefined,
} from "#app/utils/common";
import type { BattlerIndex } from "#enums/battler-index";
import { MoveId } from "#enums/move-id";
import { SubstituteTag } from "./battler-tags";
import { isNullOrUndefined } from "../utils/common";
import Phaser from "phaser";
import { EncounterAnim } from "#enums/encounter-anims";
import { AnimBlendType, AnimFrameTarget, AnimFocus, ChargeAnim, CommonAnim } from "#enums/move-anims-common";
@ -845,7 +851,7 @@ export abstract class BattleAnim {
return;
}
const targetSubstitute = !!onSubstitute && user !== target ? target.getTag(SubstituteTag) : null;
const targetSubstitute = !!onSubstitute && user !== target ? target.getTag(BattlerTagType.SUBSTITUTE) : null;
const userSprite = user.getSprite();
const targetSprite = targetSubstitute?.sprite ?? target.getSprite();