refactor(hero): 将触发技能配置从 HeroInfo 移至 HeroAttrsComp

重构英雄和怪物实体的创建逻辑,将 call、dead、fstart、fend、atking、atked 等触发技能配置从静态 HeroInfo 表复制到 HeroAttrsComp 组件实例中。
修改 SCastSystem、HeroAtkSystem、MissionComp 和 HeroViewComp 中的技能触发逻辑,改为直接读取组件内的配置。
这消除了对全局静态配置的依赖,使技能触发逻辑与实体数据更紧密地绑定,提高了代码的内聚性和可维护性。
This commit is contained in:
walkpan
2026-04-15 22:27:38 +08:00
parent ba3e416ab0
commit e3c6aad172
7 changed files with 53 additions and 28 deletions

View File

@@ -338,10 +338,9 @@ export class SCastSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
/** 检查并触发攻击附加技能 (atking) */
private checkAndTriggerAtkingSkills(heroAttrs: HeroAttrsComp, heroView: HeroViewComp) {
const heroInfo = HeroInfo[heroAttrs.hero_uuid];
if (!heroInfo || !heroInfo.atking || heroInfo.atking.length === 0) return;
if (!heroAttrs.atking || heroAttrs.atking.length === 0) return;
heroInfo.atking.forEach(atkConfig => {
heroAttrs.atking.forEach(atkConfig => {
if (heroAttrs.atk_count > 0 && heroAttrs.atk_count % atkConfig.t_num === 0) {
oops.message.dispatchEvent(GameEvent.TriggerSkill, {
s_uuid: atkConfig.s_uuid,