refactor: 移除技能配置中的固定距离字段,改用动态计算

技能配置中不再硬编码 `dis` 距离字段,而是通过 `casterAttrs.getCachedMaxSkillDistance()` 动态获取英雄的最大技能距离。这提高了灵活性,使技能距离可以基于英雄属性动态变化。
This commit is contained in:
panw
2026-03-12 16:05:12 +08:00
parent 9d86be80c7
commit 876b3f9a30
2 changed files with 12 additions and 13 deletions

View File

@@ -125,7 +125,7 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
}
private findTargets(caster: HeroViewComp, casterAttrs: HeroAttrsComp, config: SkillConfig): HeroViewComp[] {
const range = Number(config.dis ?? GameConst.Battle.DEFAULT_SEARCH_RANGE);
const range = casterAttrs.getCachedMaxSkillDistance() || GameConst.Battle.DEFAULT_SEARCH_RANGE;
const isEnemy = config.TGroup === TGroup.Enemy;
const isSelf = config.TGroup === TGroup.Self;
const isTeam = config.TGroup === TGroup.Team || config.TGroup === TGroup.Ally;