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) {