feat(战斗): 优化自动施法目标选择逻辑

- 在 HeroAttrsComp 中新增 combat_target_eid 和 enemy_in_cast_range 字段,用于跟踪当前战斗目标
- 修改 MoveSystem 在移动时同步更新战斗目标状态,并清理无效目标
- 重构 SCastSystem 的自动施法逻辑,优先使用已锁定的战斗目标而非重新搜索
- 调整技能 6005 和 6006 的 hit_count 参数,分别改为 2 和 3 次打击
- 为友方技能施法添加事件派发机制,通知其他系统技能释放
This commit is contained in:
walkpan
2026-03-16 20:30:28 +08:00
parent ae3231156d
commit f63f5c6656
4 changed files with 75 additions and 64 deletions

View File

@@ -122,6 +122,8 @@ export class HeroAttrsComp extends ecs.Comp {
skill_id:number=0; //技能攻击技能id
can_atk=false
can_skill=false
combat_target_eid: number = -1;
enemy_in_cast_range: boolean = false;
start(){
}
// ==================== BUFF 系统初始化 ====================
@@ -548,6 +550,8 @@ export class HeroAttrsComp extends ecs.Comp {
this.skill_id = 0;
this.can_atk=false
this.can_skill=false
this.combat_target_eid = -1;
this.enemy_in_cast_range = false;
// 重置脏标签
this.dirty_hp = false;
this.dirty_shield = false;