feat(技能): 支持英雄技能的多重触发
修改 Hero、Monster 和 HeroAtkSystem 中的技能触发逻辑,将 call、dead 等技能字段从单个 uuid 改为 uuid 数组,支持同时触发多个技能。同时更新 heroSet.ts 中的类型定义和英雄配置以匹配此变更。
This commit is contained in:
@@ -144,12 +144,14 @@ export class Hero extends ecs.Entity {
|
||||
hv.as.idle();
|
||||
|
||||
// 触发 call 技能
|
||||
if (hero.call) {
|
||||
oops.message.dispatchEvent(GameEvent.TriggerSkill, {
|
||||
s_uuid: hero.call,
|
||||
heroAttrs: model,
|
||||
heroView: hv,
|
||||
triggerType: 'call'
|
||||
if (hero.call && hero.call.length > 0) {
|
||||
hero.call.forEach(uuid => {
|
||||
oops.message.dispatchEvent(GameEvent.TriggerSkill, {
|
||||
s_uuid: uuid,
|
||||
heroAttrs: model,
|
||||
heroView: hv,
|
||||
triggerType: 'call'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -255,14 +255,16 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd
|
||||
|
||||
// 触发死亡技能
|
||||
const heroInfo = HeroInfo[TAttrsComp.hero_uuid];
|
||||
if (heroInfo && heroInfo.dead) {
|
||||
if (heroInfo && heroInfo.dead && heroInfo.dead.length > 0) {
|
||||
const view = entity.get(HeroViewComp);
|
||||
if (view) {
|
||||
oops.message.dispatchEvent(GameEvent.TriggerSkill, {
|
||||
s_uuid: heroInfo.dead,
|
||||
heroAttrs: TAttrsComp,
|
||||
heroView: view,
|
||||
triggerType: 'dead'
|
||||
heroInfo.dead.forEach((uuid: number) => {
|
||||
oops.message.dispatchEvent(GameEvent.TriggerSkill, {
|
||||
s_uuid: uuid,
|
||||
heroAttrs: TAttrsComp,
|
||||
heroView: view,
|
||||
triggerType: 'dead'
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,12 +198,14 @@ export class Monster extends ecs.Entity {
|
||||
move.moving = false;
|
||||
|
||||
// 触发 call 技能
|
||||
if (hero.call) {
|
||||
oops.message.dispatchEvent(GameEvent.TriggerSkill, {
|
||||
s_uuid: hero.call,
|
||||
heroAttrs: model,
|
||||
heroView: view,
|
||||
triggerType: 'call'
|
||||
if (hero.call && hero.call.length > 0) {
|
||||
hero.call.forEach((uuid: number) => {
|
||||
oops.message.dispatchEvent(GameEvent.TriggerSkill, {
|
||||
s_uuid: uuid,
|
||||
heroAttrs: model,
|
||||
heroView: view,
|
||||
triggerType: 'call'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user