fix: 统一英雄攻击距离并移除冗余最小距离逻辑

将不同英雄类型的攻击距离统一调整为720,简化距离计算逻辑。
移除HeroAttrsComp中根据英雄类型动态计算最小攻击距离的代码,因为所有英雄的最小攻击距离现在均为0。
同时更新MoveSystem中的攻击范围判断逻辑,将远程英雄的最大攻击范围从360调整为720以保持一致性。
This commit is contained in:
walkpan
2026-05-01 21:40:33 +08:00
parent 38ea7b6d57
commit e8df6e6e9c
3 changed files with 4 additions and 9 deletions

View File

@@ -69,9 +69,9 @@ export const FormationPointX = {
} as const;
export const HeroDisVal: Record<HType.Melee | HType.Mid | HType.Long, number> = {
[HType.Melee]: 200,
[HType.Mid]: 400,
[HType.Long]: 660,
[HType.Melee]: 720,
[HType.Mid]: 720,
[HType.Long]: 720,
}
export const resolveFormationTargetX = (fac: FacSet, type: HType): number => {

View File

@@ -200,11 +200,6 @@ export class HeroAttrsComp extends ecs.Comp {
const rangeType = this.type as HType.Melee | HType.Mid | HType.Long;
const maxRange = HeroDisVal[rangeType];
let minRange = 0;
if (rangeType === HType.Mid) {
minRange = HeroDisVal[HType.Melee];
} else if (rangeType === HType.Long) {
minRange = HeroDisVal[HType.Mid];
}
this.maxSkillDistance = maxRange;
this.minSkillDistance = minRange;
}

View File

@@ -173,7 +173,7 @@ export class MoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
const [, maxRange] = this.resolveCombatRange(model, 360, 720);
return dist <= maxRange;
}
const [, maxRange] = this.resolveCombatRange(model, 120, 360);
const [, maxRange] = this.resolveCombatRange(model, 120, 720);
return dist <= maxRange;
}