fix(战斗): 调整射手技能和近战走位逻辑

- 将射手英雄的技能从[6005,6006]改为[6005,6008]
- 调整技能6005、6006的hit_count从2和3统一为1,提高技能6008的hit_count从1到6
- 优化近战单位的走位逻辑,增加攻击准备锁定和通过阈值判断,调整盟友重叠间距和位移释放距离
This commit is contained in:
panw
2026-03-18 09:57:21 +08:00
parent 941fb50ce2
commit eb4e544363
3 changed files with 14 additions and 6 deletions

View File

@@ -38,8 +38,10 @@ interface MoveFacConfig {
export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate {
private readonly meleeAttackRange = 52;
private readonly allySpacingX = 40;
private readonly allyOverlapSpacingX = 8;
private readonly displacementReleaseX = 24;
private readonly allyOverlapSpacingX = 14;
private readonly displacementReleaseX = 10;
private readonly attackReadyLockX = 10;
private readonly attackPassThresholdX = 60;
private readonly minSpacingY = 30;
private readonly renderSortInterval = 0.05;
private renderSortElapsed = 0;
@@ -327,12 +329,18 @@ export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
selfPriority: number
): number {
if (!selfAttrs || !selfMove || !allyMove) return this.allySpacingX;
if ((selfAttrs.type as HType) !== HType.Melee) return this.allySpacingX;
if (allyPriority !== selfPriority) return this.allySpacingX;
const selfTargetX = selfMove.targetX;
const allyTargetX = allyMove.targetX;
const selfHasTarget = Math.abs(selfTargetX) > 0.01;
const allyHasTarget = Math.abs(allyTargetX) > 0.01;
if (!selfHasTarget || !allyHasTarget) return this.allySpacingX;
const selfDistToAttack = Math.abs(selfTargetX - currentX);
const canAttackNow = selfAttrs.enemy_in_cast_range || selfDistToAttack <= this.attackReadyLockX;
if (canAttackNow) return this.allySpacingX;
const targetTooFar = selfDistToAttack >= this.attackPassThresholdX;
if (!targetTooFar) return this.allySpacingX;
const allyDisplaced = Math.abs(allyX - allyTargetX) >= this.displacementReleaseX;
const selfNeedAdvance = direction > 0 ? selfTargetX > currentX + 2 : selfTargetX < currentX - 2;
if (allyDisplaced && selfNeedAdvance) return this.allyOverlapSpacingX;