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

@@ -1,8 +1,9 @@
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { HeroDisVal, HSkillInfo, HType } from "../common/config/heroSet";
import { HeroDisVal, HeroInfo, HSkillInfo, HType } from "../common/config/heroSet";
import { mLogger } from "../common/Logger";
import { Timer } from "db://oops-framework/core/common/timer/Timer";
import { FightSet } from "../common/config/GameSet";
import { FacSet, FightSet } from "../common/config/GameSet";
import { FieldSkillSet, FieldSkillType } from "../common/config/SkillSet";
@ecs.register('HeroAttrs')
export class HeroAttrsComp extends ecs.Comp {
public debugMode: boolean = false;
@@ -279,8 +280,24 @@ export class HeroAttrsComp extends ecs.Comp {
this.dirty_shield = false;
}
/** 获取指定驻场技能类型的总加成值(只计算存活的英雄) */
public static getFieldSkillTotalValue(type: FieldSkillType): number {
let total = 0;
ecs.query(ecs.allOf(HeroAttrsComp)).forEach((entity: ecs.Entity) => {
const model = entity.get(HeroAttrsComp);
if (!model || model.is_dead || model.fac !== FacSet.HERO) return;
const heroConfig = HeroInfo[model.hero_uuid];
if (heroConfig && heroConfig.field) {
for (const skillUuid of heroConfig.field) {
const skillConfig = FieldSkillSet[skillUuid];
if (skillConfig && skillConfig.type === type) {
total += skillConfig.value;
}
}
}
});
return total;
}
}
@ecs.register('HeroBuffSystem')