From b48547b1f15e32c6695159222634d34d761c21bc Mon Sep 17 00:00:00 2001 From: panw Date: Fri, 6 Feb 2026 15:55:47 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=88=98=E6=96=97=E7=B3=BB=E7=BB=9F):=20?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BC=A4=E5=AE=B3=E8=AE=A1=E7=AE=97=E5=85=AC?= =?UTF-8?q?=E5=BC=8F=E5=B9=B6=E7=AE=80=E5=8C=96=E5=B1=9E=E6=80=A7=E5=8D=A1?= =?UTF-8?q?=E7=89=8C=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在伤害计算中,将防御属性从百分比减免改为固定值减免,确保至少造成1点伤害 - 移除天赋免伤对防御属性的影响,使防御计算更清晰 - 简化一阶属性卡牌配置,移除不常用的特殊属性卡牌 --- assets/script/game/common/config/AttrSet.ts | 22 +++++++-------------- assets/script/game/hero/HeroAtkSystem.ts | 5 +++-- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/assets/script/game/common/config/AttrSet.ts b/assets/script/game/common/config/AttrSet.ts index f9ae2eda..808dff9f 100644 --- a/assets/script/game/common/config/AttrSet.ts +++ b/assets/script/game/common/config/AttrSet.ts @@ -11,20 +11,12 @@ import { Attrs } from "./HeroAttrs"; } export const AttrCards: Record = { //*一阶 */ - 2001:{uuid:2001, icon:"1020", attr: Attrs.AP, value: 20, desc: "攻击力 +20%", isSpecial: false,name: "强化攻击" }, - 2002:{uuid:2002, icon:"1020", attr: Attrs.HP_MAX, value: 20, desc: "生命上限 +20%", isSpecial: false,name: "强化生命" }, - 2003:{uuid:2003, icon:"1020", attr: Attrs.DEF, value: 20, desc: "防御力 +20%", isSpecial: false,name: "强化防御" }, - 2004:{uuid:2004, icon:"1020", attr: Attrs.AS, value: 5, desc: "攻击速度 +5%", isSpecial: false,name: "强化攻速" }, - 2005:{uuid:2005, icon:"1020", attr: Attrs.LIFESTEAL, value: 10, desc: "吸血比例 +2%", isSpecial: true,name: "强化吸血" }, - 2006:{uuid:2006, icon:"1020", attr: Attrs.CRITICAL, value: 5, desc: "暴击率 +2%", isSpecial: true,name: "强化暴击" }, - 2007:{uuid:2007, icon:"1020", attr: Attrs.CRITICAL_DMG, value: 10, desc: "暴击伤害 +10%", isSpecial: true,name: "强化爆伤" }, - 2008:{uuid:2008, icon:"1020", attr: Attrs.STUN_CHANCE, value: 5, desc: "眩晕概率 +2%", isSpecial: true,name: "强化眩晕" }, - 2009:{uuid:2009, icon:"1020", attr: Attrs.FREEZE_CHANCE, value: 5, desc: "冰冻概率 +2%", isSpecial: true,name: "强化冰冻" }, - 2010:{uuid:2010, icon:"1020", attr: Attrs.BURN_CHANCE, value: 5, desc: "燃烧概率 +2%", isSpecial: true,name: "强化燃烧" }, - 2011:{uuid:2011, icon:"1020", attr: Attrs.BACK_CHANCE, value: 5, desc: "击退概率 +2%", isSpecial: true,name: "强化击退" }, - 2012:{uuid:2012, icon:"1020", attr: Attrs.SLOW_CHANCE, value: 5, desc: "减速概率 +2%", isSpecial: true,name: "强化减速" }, - 2013:{uuid:2013, icon:"1020", attr: Attrs.DODGE, value: 5, desc: "闪避率 +5%", isSpecial: true,name: "强化闪避" }, - 2014:{uuid:2014, icon:"1020", attr: Attrs.HP_REGEN, value: 20, desc: "回血 +20%", isSpecial: true,name: "强化回血" }, + 2001:{uuid:2001, icon:"1020", attr: Attrs.AP, value: 20, desc: "攻击力 +20%", isSpecial: false,name: "攻击" }, + 2002:{uuid:2002, icon:"1020", attr: Attrs.HP_MAX, value: 20, desc: "生命上限 +20%", isSpecial: false,name: "生命" }, + 2003:{uuid:2003, icon:"1020", attr: Attrs.DEF, value: 20, desc: "防御力 +20%", isSpecial: false,name: "防御" }, + 2004:{uuid:2004, icon:"1020", attr: Attrs.AS, value: 5, desc: "攻击速度 +5%", isSpecial: false,name: "攻速" }, + 2005:{uuid:2007, icon:"1020", attr: Attrs.CRITICAL_DMG, value: 10, desc: "暴击伤害 +10%", isSpecial: true,name: "爆伤" }, + 2006:{uuid:2013, icon:"1020", attr: Attrs.DODGE, value: 5, desc: "闪避率 +5%", isSpecial: true,name: "闪避" }, } @@ -55,7 +47,7 @@ export const PotionCards: Record = { export const CanSelectAttrs: Record = { // 1阶属性 - 1: [2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014], + 1: [2001, 2002, 2003, 2004, 2005, 2006], }; export const CanSelectPotions: Record = { diff --git a/assets/script/game/hero/HeroAtkSystem.ts b/assets/script/game/hero/HeroAtkSystem.ts index ab17cdea..6371eb18 100644 --- a/assets/script/game/hero/HeroAtkSystem.ts +++ b/assets/script/game/hero/HeroAtkSystem.ts @@ -156,6 +156,7 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd const isCrit = this.checkChance(damageEvent.Attrs[Attrs.CRITICAL]-TAttrsComp.Attrs[Attrs.CRITICAL_RES]); // 计算基础伤害 let damage = this.dmgCount(damageEvent,TAttrsComp); + mLogger.log(this.debugMode, 'HeroAtkSystem', " dmgCount",damage) if (isCrit) { // 暴击伤害计算 @@ -331,7 +332,7 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd // 易伤 let DMG_INVUL = TAttrs[Attrs.DMG_INVUL]||0 // 免伤 属性免伤+天赋免伤 - let DMG_RED = (TAttrs[Attrs.DEF]||0) + TAttrsComp.useCountValTal(Attrs.DEF); + let DMG_RED = TAttrsComp.useCountValTal(Attrs.DEF); // 4. 确保伤害值非负 let total = Math.max(0, apBase); @@ -341,7 +342,7 @@ export class HeroAtkSystem extends ecs.ComblockSystem implements ecs.ISystemUpd let damageRatio = 1 + (DMG_INVUL - DMG_RED) / 100; damageRatio = Math.max(0, damageRatio); // 确保伤害系数不为负(即最多减免至0伤害) - total = Math.floor(total * damageRatio); + total = Math.max(1,Math.floor(total * damageRatio-TAttrs[Attrs.DEF])); if (this.debugMode) mLogger.log(this.debugMode, 'HeroAtkSystem', ` 最终伤害: ${total} (Base: ${apBase}, Def: ${DMG_RED}%, Invul: ${DMG_INVUL}%, Ratio: ${damageRatio})`); return total;