From 87be1121e1bc2b7013ffb60acc344cd86722a50f Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Sat, 10 Oct 2020 18:54:31 +0900 Subject: [PATCH] =?UTF-8?q?=E6=B2=BB=E7=96=97=E6=95=B0=E5=80=BC=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=8F=97=E6=9A=B4=E5=87=BB=E7=B3=BB=E6=95=B0=E5=92=8C?= =?UTF-8?q?=E4=BC=A4=E5=AE=B3=E5=8A=A0=E6=88=90=E5=BD=B1=E5=93=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/Logic/Misc/BattleUtil.lua | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index c9d410f262..4e3b56f172 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -530,11 +530,26 @@ function BattleUtil.CalTreat(castRole, targetRole, value, baseFactor) if targetRole.ctrl_noheal or targetRole:IsDead() then --禁疗和死亡无法加血 return end + -- 是否暴击: 暴击率 = 自身暴击率 - 对方抗暴率 + local bCrit = false + local critRandom = Random.Range01() + local critCondition = castRole:GetRoleData(RoleDataName.Crit) + bCrit = critRandom <= critCondition + bCrit = bCrit or targetRole.isFlagCrit == true -- 必定暴击 + -- 计算暴伤害系数 + local critDamageFactor = 1 + --计算暴击 + if bCrit then + --伤害有个+1.3 不知道干什么用的就给去了 by:wangxhenxing 2020/10/10 18:46 + critDamageFactor = castRole:GetRoleData(RoleDataName.CritDamageFactor) + end + -- 基础伤害增加系数 + local addDamageFactor = 1 + castRole:GetRoleData(RoleDataName.DamageBocusFactor) targetRole.Event:DispatchEvent(BattleEventName.RoleBeHealed, castRole) - BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor) + BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamageFactor,addDamageFactor) end -function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor) +function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamageFactor,addDamageFactor) if targetRole.ctrl_noheal or targetRole:IsDead() then --禁疗和死亡无法加血 return end @@ -551,7 +566,7 @@ function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor) local factor = castRole.isTeam and 1 or castRole:GetRoleData(RoleDataName.TreatFacter) --释放者为team则不计算治疗加成属性 local factor2 = targetRole:GetRoleData(RoleDataName.CureFacter) - local baseTreat = BattleUtil.FP_Mul(value, baseFactor, factor, factor2) + local baseTreat = BattleUtil.FP_Mul(value, baseFactor, factor, factor2,critDamageFactor,addDamageFactor) --加入被动效果 local cl = {}