refactor: 移除技能配置中的固定距离字段,改用动态计算
技能配置中不再硬编码 `dis` 距离字段,而是通过 `casterAttrs.getCachedMaxSkillDistance()` 动态获取英雄的最大技能距离。这提高了灵活性,使技能距离可以基于英雄属性动态变化。
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user