feat(技能): 新增驻场技能系统并集成到游戏机制中

- 在英雄配置中增加驻场技能字段,支持八种全局加成类型
- 实现驻场技能数值计算,影响召唤/死亡/战斗开始结束技能触发次数
- 集成驻场技能到金币收益系统,提升每回合和卖出英雄的金币获取
- 为战斗结束治疗添加驻场技能加成,增强队伍恢复效果
This commit is contained in:
walkpan
2026-04-22 23:14:07 +08:00
parent 8df4d5169a
commit 100a520df1
8 changed files with 138 additions and 28 deletions

View File

@@ -10,6 +10,7 @@ import { smc } from "../common/SingletonModuleComp";
import { HeroInfo } from "../common/config/heroSet";
import { oops } from "db://oops-framework/core/Oops";
import { GameEvent } from "../common/config/GameEvent";
import { FieldSkillType } from "../common/config/SkillSet";
import { mLogger } from "../common/Logger";
@@ -276,14 +277,19 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd
if (TAttrsComp.dead && TAttrsComp.dead.length > 0) {
const view = entity.get(HeroViewComp);
if (view) {
TAttrsComp.dead.forEach((uuid: number) => {
oops.message.dispatchEvent(GameEvent.TriggerSkill, {
s_uuid: uuid,
heroAttrs: TAttrsComp,
heroView: view,
triggerType: 'dead'
let triggerCount = 1 + HeroAttrsComp.getFieldSkillTotalValue(FieldSkillType.DeadCount);
triggerCount = Math.max(1, Math.floor(triggerCount));
for (let i = 0; i < triggerCount; i++) {
TAttrsComp.dead.forEach((uuid: number) => {
oops.message.dispatchEvent(GameEvent.TriggerSkill, {
s_uuid: uuid,
heroAttrs: TAttrsComp,
heroView: view,
triggerType: 'dead'
});
});
});
}
}
}