feat(hero): 为英雄系统添加天赋加成支持
- 在 HeroAttrsComp 中添加 getTalentValue 静态方法,用于获取指定天赋的加成数值 - 定义 TalentType 枚举,明确各类天赋类型 - 调整部分天赋配置,如亡语强化和召唤强化的数值与消耗 - 在 Hero 实体初始化时,根据英雄阵营应用攻击、生命、暴击等天赋加成 - 在召唤技能触发逻辑中,增加召唤强化天赋的额外触发次数
This commit is contained in:
@@ -4,6 +4,8 @@ import { mLogger } from "../common/Logger";
|
||||
import { Timer } from "db://oops-framework/core/common/timer/Timer";
|
||||
import { FacSet, FightSet } from "../common/config/GameSet";
|
||||
import { FieldSkillSet, FieldSkillType } from "../common/config/SkillSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { TalentConfig } from "../common/config/TalentSet";
|
||||
@ecs.register('HeroAttrs')
|
||||
export class HeroAttrsComp extends ecs.Comp {
|
||||
public debugMode: boolean = false;
|
||||
@@ -298,6 +300,16 @@ export class HeroAttrsComp extends ecs.Comp {
|
||||
});
|
||||
return total;
|
||||
}
|
||||
|
||||
/** 获取指定天赋的加成数值 */
|
||||
public static getTalentValue(talentId: number): number {
|
||||
if (!smc || !smc.collection || !smc.collection.talents) return 0;
|
||||
let level = smc.collection.talents[talentId] || 0;
|
||||
if (level <= 0) return 0;
|
||||
let talentInfo = TalentConfig.talents.find(t => t.id === talentId);
|
||||
if (!talentInfo || !talentInfo.values || level > talentInfo.values.length) return 0;
|
||||
return talentInfo.values[level - 1];
|
||||
}
|
||||
}
|
||||
|
||||
@ecs.register('HeroBuffSystem')
|
||||
|
||||
Reference in New Issue
Block a user