From 3b24316a1c9ed6c72e03ddbc0cc808cff19d014e Mon Sep 17 00:00:00 2001 From: mengyxu Date: Fri, 16 May 2025 17:10:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BB=E5=87=BB=E6=97=B6=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=BC=A4=E5=AE=B3=E9=9A=8F=E6=9C=BA=E7=B3=BB=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tool/caller/battle.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tool/caller/battle.ts b/src/tool/caller/battle.ts index 309e6e1..b381305 100644 --- a/src/tool/caller/battle.ts +++ b/src/tool/caller/battle.ts @@ -149,7 +149,8 @@ export class BattleRole { const atkPercent = 1 + (attr.atkPercent + extra.atkPercent) / 100; //攻击加成 this.atk = baseAtk * atkPercent; //回合最终攻击力 const dmgPercent = callDmgPercent(attr.dmgPercent, extra.dmgPercent) / 100; //伤害加成 - this.baseDmg = this.atk * (1 + dmgPercent) * (this.skillPercent / 100); //造成伤害 + const factor = Math.random() * 0.1 + 0.95; //伤害随机系数 + this.baseDmg = this.atk * (1 + dmgPercent) * (this.skillPercent / 100) * factor; //造成伤害 const crit = attr.crit + extra.crit - target.attr.critAvoid - target.extraAttr.critAvoid; //最终暴击率 this.crit = Math.random() < crit / 100; if (this.crit) { @@ -161,8 +162,8 @@ export class BattleRole { const dmgReduc = callDmgReduc(target.attr.dmgReduc, target.extraAttr.dmgReduc); //目标伤害减免 const takeDmgPercent = (1 - reducPercent) * (1 - dmgReduc / 100); //目标承受伤害比例 const bloc = target.attr.bloc + target.extraAttr.bloc; //目标格挡值 - this.dmg = Math.ceil(this.baseDmg * takeDmgPercent - bloc); //目标承受伤害 - this.dmg < 1 && (this.dmg = 1); + const dmg = Math.ceil(this.baseDmg * takeDmgPercent - bloc); //目标承受伤害 + this.dmg = dmg < 1 ? 1 : dmg; }; putBuff(buff: Skills.Buff) {