refactor(hero&monster): 统一使用dis字段获取攻击距离

移除HeroDisVal映射表,改为直接从实体组件读取配置的dis属性作为攻击距离,同时补全所有英雄和怪物配置中的dis字段
This commit is contained in:
walkpan
2026-05-18 09:29:22 +08:00
parent 39316cf266
commit 3e84566f94
7 changed files with 43 additions and 45 deletions

View File

@@ -670,12 +670,11 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
return frontEnemy.node.position.clone();
}
/** 计算英雄最大施法距离(优先缓存,其次按职业类型 */
/** 计算英雄最大施法距离(优先缓存,其次按英雄配置的基础距离 */
private resolveMaxCastRange(heroAttrs: HeroAttrsComp, type: HType): number {
const cached = heroAttrs.getCachedMaxSkillDistance();
if (cached > 0) return cached;
const rangeType = type as HType.Melee | HType.Mid | HType.Long;
return HeroDisVal[rangeType];
return heroAttrs.dis;
}
/** 生成沿目标方向的施法目标坐标 */