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

@@ -254,8 +254,7 @@ export class HeroAttrsComp extends ecs.Comp {
* @param skillsComp 技能组件
*/
public updateSkillDistanceCache(): void {
const rangeType = this.type as HType.Melee | HType.Mid | HType.Long;
const maxRange = HeroDisVal[rangeType];
const maxRange = this.dis;
let minRange = 0;
this.maxSkillDistance = maxRange;
this.minSkillDistance = minRange;