refactor(hero): 将触发技能配置从 HeroInfo 移至 HeroAttrsComp
重构英雄和怪物实体的创建逻辑,将 call、dead、fstart、fend、atking、atked 等触发技能配置从静态 HeroInfo 表复制到 HeroAttrsComp 组件实例中。 修改 SCastSystem、HeroAtkSystem、MissionComp 和 HeroViewComp 中的技能触发逻辑,改为直接读取组件内的配置。 这消除了对全局静态配置的依赖,使技能触发逻辑与实体数据更紧密地绑定,提高了代码的内聚性和可维护性。
This commit is contained in:
@@ -166,6 +166,15 @@ export class Monster extends ecs.Entity {
|
||||
model.speed = hero.speed;
|
||||
model.type = hero.type;
|
||||
model.fac = FacSet.MON;
|
||||
|
||||
// 复制触发技能配置
|
||||
model.call = hero.call;
|
||||
model.dead = hero.dead;
|
||||
model.fstart = hero.fstart;
|
||||
model.fend = hero.fend;
|
||||
model.atking = hero.atking;
|
||||
model.atked = hero.atked;
|
||||
|
||||
// 标记是否 Boss,非 Boss 默认记作杂兵
|
||||
model.is_boss =is_boss
|
||||
if(!model.is_boss){
|
||||
@@ -219,8 +228,8 @@ export class Monster extends ecs.Entity {
|
||||
}
|
||||
|
||||
// 落地后触发 call 技能
|
||||
if (hero.call && hero.call.length > 0) {
|
||||
hero.call.forEach((uuid: number) => {
|
||||
if (model.call && model.call.length > 0) {
|
||||
model.call.forEach((uuid: number) => {
|
||||
oops.message.dispatchEvent(GameEvent.TriggerSkill, {
|
||||
s_uuid: uuid,
|
||||
heroAttrs: model,
|
||||
|
||||
Reference in New Issue
Block a user