diff --git a/assets/script/game/hero/MoveComp.ts b/assets/script/game/hero/MoveComp.ts index 6d8e7ffa..869a30ad 100644 --- a/assets/script/game/hero/MoveComp.ts +++ b/assets/script/game/hero/MoveComp.ts @@ -3,7 +3,7 @@ import { HeroViewComp } from "./HeroViewComp"; import { HeroAttrsComp } from "./HeroAttrsComp"; import { smc } from "../common/SingletonModuleComp"; import { FacSet } from "../common/config/GameSet"; -import { HeroDisVal, HType, resolveFormationTargetX } from "../common/config/heroSet"; +import { HeroDisVal, HType } from "../common/config/heroSet"; import { BoxCollider2D, Node } from "cc"; @ecs.register('MoveComp') @@ -49,6 +49,8 @@ interface MoveFacConfig { export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate { /** 近战判定射程(来自 heroSet) */ private readonly meleeAttackRange = HeroDisVal[HType.Melee]; + private readonly heroFrontAnchorX = -30; + private readonly monFrontAnchorX = 30; /** 常规同阵营横向最小间距 */ private readonly allySpacingX = 60; /** 纵向判定为同排的最大 Y 差 */ @@ -239,7 +241,7 @@ export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate return a.eid - b.eid; }); const slotIndex = Math.max(0, laneAllies.findIndex(entity => entity === self)); - const frontAnchorX = resolveFormationTargetX(model.fac, HType.Melee); + const frontAnchorX = model.fac === FacSet.MON ? this.monFrontAnchorX : this.heroFrontAnchorX; const targetX = frontAnchorX - forwardDir * slotIndex * this.allySpacingX; return Math.max(moveMinX, Math.min(moveMaxX, targetX)); }