fix(战斗系统): 调整伤害计算公式并简化属性卡牌配置
- 在伤害计算中,将防御属性从百分比减免改为固定值减免,确保至少造成1点伤害 - 移除天赋免伤对防御属性的影响,使防御计算更清晰 - 简化一阶属性卡牌配置,移除不常用的特殊属性卡牌
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user