From 699f7fc6b8d4bd804f25e9301462367e2dec1450 Mon Sep 17 00:00:00 2001 From: panFD Date: Sat, 5 Sep 2026 18:14:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(hero&buff):=20=E6=96=B0=E5=A2=9E=E5=8F=8D?= =?UTF-8?q?=E4=BC=A4=E7=B1=BBbuff=E4=B8=8E=E6=8A=80=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=B8=A6=E4=BF=AE=E9=A5=B0=E7=9A=84=E5=8F=8D?= =?UTF-8?q?=E4=BC=A4=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增两个反伤相关的buff配置:固定反伤7027和比例反伤7028 2. 新增两个支援技能:荆棘护盾和荆棘比例增益 3. 为HeroAttrsComp新增获取最终反伤属性的方法,支持限时修饰词计算 4. 重构英雄反伤伤害计算逻辑,使用新的属性获取方法 --- assets/script/game/common/config/BuffSet.ts | 16 ++++++++++++++++ assets/script/game/common/config/SkillSet.ts | 10 ++++++++++ assets/script/game/hero/HeroAtkSystem.ts | 2 +- assets/script/game/hero/HeroAttrsComp.ts | 12 ++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/assets/script/game/common/config/BuffSet.ts b/assets/script/game/common/config/BuffSet.ts index b7e5c313..609b4400 100644 --- a/assets/script/game/common/config/BuffSet.ts +++ b/assets/script/game/common/config/BuffSet.ts @@ -262,4 +262,20 @@ export const BuffList: Record = { modifiers: [{ attr: Attrs.paralyze_power, op: ModOp.PercentAdd, value: 30 }], info: "麻痹对技能 CD 的减速量额外提升 30%,持续 5 秒", }, + + // ==================== 反伤系 ==================== + // 荆棘(固定值反伤,可叠加) + 7027: { + id: 7027, name: "荆棘", icon: "Stat_Defense", + category: BuffCategory.Buff, duration: 5, max_stack: 5, + modifiers: [{ attr: Attrs.thorns_dmg, op: ModOp.Flat, value: 10 }], + info: "受到攻击时反弹 10 点固定伤害,可叠加,持续 5 秒", + }, + // 荆棘比例(百分比反伤,可叠加) + 7028: { + id: 7028, name: "荆棘比例", icon: "Stat_Defense", + category: BuffCategory.Buff, duration: 5, max_stack: 3, + modifiers: [{ attr: Attrs.thorns_rate, op: ModOp.PercentAdd, value: 10 }], + info: "受到攻击时反弹 10% 所受伤害,可叠加,持续 5 秒", + }, }; diff --git a/assets/script/game/common/config/SkillSet.ts b/assets/script/game/common/config/SkillSet.ts index 5b789db8..e136daa1 100644 --- a/assets/script/game/common/config/SkillSet.ts +++ b/assets/script/game/common/config/SkillSet.ts @@ -515,6 +515,16 @@ export const SkillSet: Record = { uuid: 6513, name: "防御爆发", sp_name: "buff_wind", icon: "Stat_Defense", TGroup: TGroup.Team, readyAnm: "up_blue", endAnm: "", act: "atk", DTType: DTType.single, kind: SkillKind.Support, ap: 0, hit_count: 3, hitcd: 0.2, speed: 720, with: 0, ready: 0.2, EAnm: 0, DAnm: "", IType: IType.support, RType: RType.fixed, EType: EType.animationEnd, buff_type: Attrs.defense, timed_buff_id: 7024, info: "全体友方防御提升100点, 持续5秒", + }, + 6514: { + uuid: 6514, name: "荆棘护盾", sp_name: "buff_wind", icon: "Stat_Defense", TGroup: TGroup.Team, readyAnm: "up_blue", endAnm: "", act: "atk", + DTType: DTType.single, kind: SkillKind.Support, ap: 0, hit_count: 3, hitcd: 0.2, speed: 720, with: 0, ready: 0.2, EAnm: 0, DAnm: "", IType: IType.support, + RType: RType.fixed, EType: EType.animationEnd, buff_type: Attrs.thorns_dmg, timed_buff_id: 7027, info: "全体友方获得10点固定反伤, 持续5秒", + }, + 6515: { + uuid: 6515, name: "荆棘比例", sp_name: "buff_wind", icon: "Stat_Defense", TGroup: TGroup.Team, readyAnm: "up_blue", endAnm: "", act: "atk", + DTType: DTType.single, kind: SkillKind.Support, ap: 0, hit_count: 3, hitcd: 0.2, speed: 720, with: 0, ready: 0.2, EAnm: 0, DAnm: "", IType: IType.support, + RType: RType.fixed, EType: EType.animationEnd, buff_type: Attrs.thorns_rate, timed_buff_id: 7028, info: "全体友方获得10%比例反伤, 持续5秒", } }; diff --git a/assets/script/game/hero/HeroAtkSystem.ts b/assets/script/game/hero/HeroAtkSystem.ts index e87d558e..cb9a4895 100644 --- a/assets/script/game/hero/HeroAtkSystem.ts +++ b/assets/script/game/hero/HeroAtkSystem.ts @@ -196,7 +196,7 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpda // 反伤值 = 实际受到伤害 * thorns_rate / 100 + thorns_dmg(固定值+比例混合) // DoT 不触发反伤(持续伤害类效果通常不触发荆棘) if (!isDot && damage > 0) { - const thornsDmg = Math.floor(damage * TAttrsComp.thorns_rate / 100) + TAttrsComp.thorns_dmg; + const thornsDmg = Math.floor(damage * TAttrsComp.getFinalThornsRate() / 100) + TAttrsComp.getFinalThornsDmg(); if (thornsDmg > 0) { this.applyThornsDamage(casterEid, thornsDmg); } diff --git a/assets/script/game/hero/HeroAttrsComp.ts b/assets/script/game/hero/HeroAttrsComp.ts index 08c5d2df..739c3e97 100644 --- a/assets/script/game/hero/HeroAttrsComp.ts +++ b/assets/script/game/hero/HeroAttrsComp.ts @@ -542,6 +542,18 @@ export class HeroAttrsComp extends ecs.Comp { return Math.max(0, this.defense + mods.flatSum + mods.pctSum); } + /** 最终反伤固定值 = 基础 + 限时修饰(加法模型) */ + public getFinalThornsDmg(): number { + const mods = this.aggregateTimedMods(Attrs.thorns_dmg); + return Math.max(0, this.thorns_dmg + mods.flatSum + mods.pctSum); + } + + /** 最终反伤比例 = 基础 + 限时修饰(加法模型,百分点) */ + public getFinalThornsRate(): number { + const mods = this.aggregateTimedMods(Attrs.thorns_rate); + return Math.max(0, this.thorns_rate + mods.flatSum + mods.pctSum); + } + /** * 按除法递减模型计算防御减伤后的伤害 * 减伤率 = defense / (defense + DEFENSE_K),防御收益递减且永不达到 100%