fix(hero): 修复技能添加和天赋叠加逻辑

修复英雄技能添加时错误的参数传递,将HSSet.max改为HSSet.skill
完善天赋叠加逻辑,当天赋已存在时叠加效果数值而非直接返回
This commit is contained in:
walkpan
2026-01-16 20:21:13 +08:00
parent b577350003
commit fc6d2ad8c6
2 changed files with 7 additions and 2 deletions

View File

@@ -58,7 +58,7 @@ export class HeroSkillsComp extends ecs.Comp {
const s_uuid = args as number;
console.log(`[HeroSkills] 收到技能选择事件,添加技能 ID: ${s_uuid}`);
this.addSkill(s_uuid,HSSet.max);
this.addSkill(s_uuid, HSSet.skill);
}
// ==================== 辅助方法 ====================

View File

@@ -109,7 +109,12 @@ export class TalComp extends ecs.Comp {
addTal(uuid: number,v_add:number = 0,c_add:number = 0,t_add:number = 0) {
// 检查天赋是否已存在
if (this.Tals[uuid]) {
console.error(`[TalComp]天赋已存在,天赋ID:${uuid}`);
console.log(`[TalComp]天赋已存在,执行叠加逻辑 ID:${uuid}`);
const tConf = talConf[uuid];
if (tConf) {
// 叠加效果数值
this.Tals[uuid].value_add += tConf.value;
}
return;
}