From fc6d2ad8c6459161e71fdeb88ba1649cc82836aa Mon Sep 17 00:00:00 2001 From: walkpan Date: Fri, 16 Jan 2026 20:21:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(hero):=20=E4=BF=AE=E5=A4=8D=E6=8A=80?= =?UTF-8?q?=E8=83=BD=E6=B7=BB=E5=8A=A0=E5=92=8C=E5=A4=A9=E8=B5=8B=E5=8F=A0?= =?UTF-8?q?=E5=8A=A0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复英雄技能添加时错误的参数传递,将HSSet.max改为HSSet.skill 完善天赋叠加逻辑,当天赋已存在时叠加效果数值而非直接返回 --- assets/script/game/hero/HeroSkills.ts | 2 +- assets/script/game/hero/TalComp.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/assets/script/game/hero/HeroSkills.ts b/assets/script/game/hero/HeroSkills.ts index 0b40ef75..b254b196 100644 --- a/assets/script/game/hero/HeroSkills.ts +++ b/assets/script/game/hero/HeroSkills.ts @@ -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); } // ==================== 辅助方法 ==================== diff --git a/assets/script/game/hero/TalComp.ts b/assets/script/game/hero/TalComp.ts index 92d27b80..b2937160 100644 --- a/assets/script/game/hero/TalComp.ts +++ b/assets/script/game/hero/TalComp.ts @@ -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; }