feat(技能): 新增驻场技能系统并集成到游戏机制中
- 在英雄配置中增加驻场技能字段,支持八种全局加成类型 - 实现驻场技能数值计算,影响召唤/死亡/战斗开始结束技能触发次数 - 集成驻场技能到金币收益系统,提升每回合和卖出英雄的金币获取 - 为战斗结束治疗添加驻场技能加成,增强队伍恢复效果
This commit is contained in:
@@ -38,6 +38,7 @@ import { HeroAttrsComp } from "../hero/HeroAttrsComp";
|
||||
import { FacSet, FightSet, BoxSet } from "../common/config/GameSet";
|
||||
import { oneCom } from "../skill/oncend";
|
||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { FieldSkillSet, FieldSkillType } from "../common/config/SkillSet";
|
||||
const { ccclass } = _decorator;
|
||||
|
||||
/**
|
||||
@@ -252,6 +253,26 @@ export class MissionHeroCompComp extends CCComp {
|
||||
return heroes;
|
||||
}
|
||||
|
||||
/** 获取指定驻场技能类型的总加成值(只计算存活的英雄) */
|
||||
public getFieldSkillTotalValue(type: FieldSkillType): number {
|
||||
let total = 0;
|
||||
const heroes = this.getAllHeroes();
|
||||
for (const hero of heroes) {
|
||||
const model = hero.get(HeroAttrsComp);
|
||||
if (!model || model.is_dead) continue;
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从存活英雄中挑选可参与本次合成的英雄组。
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user