From e83b649e3427249da5e94c4db57cd8f89d07ed98 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Thu, 24 Feb 2022 15:57:12 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=88=98=E6=96=97=E3=80=91=3D=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=E6=96=B0=E5=A2=9E425=20=20426=E8=A2=AB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/Logic/Base/Passivity.lua | 51 +++++++++++++++++++ .../Modules/Battle/Logic/Misc/BattleUtil.lua | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index e86134c6e2..fdd1d5089f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -10908,6 +10908,57 @@ local passivityList = { end role.Event:AddEvent(BattleEventName.PassiveChangeDefDMGReFac,addDMGFac,nil,nil,role) end, + -- 攻击时若目标[a]类型[b]效果,则当次攻击自身暴击[c]改变[d]% + -- a[int],b[int],c[改变类型],d[float] + [425] = function(role, args,id,judge) + local dot = args[1] + local pro = args[2] + local ct = args[3] + local f1 = args[4] + + + local function onRoleDamageBefore(critFunc,atkRole,defRole,skill) + if atkRole~=role then + return + end + if not skill then + return + end + if skill and not skill.isTriggerJudge and judge==1 then + return + end + local isHave=false + if dot==BuffName.DOT then + if BattleLogic.BuffMgr:HasBuff(defRole, BuffName.DOT, function(buff) return buff.damageType == pro end,role,pro) then + isHave=true + end + end + if isHave then + critFunc(f1,ct,false) + end + end + BattleLogic.Event:AddEvent(BattleEventName.TemporaryChangeCrit, onRoleDamageBefore,nil,nil,role) + end, + --改变[a]目标[b]生命回复量[c]% + --a[int],b[int 1:敌方],c[float] + [426]=function(role, args,id,judge) + local ct=args[1] + local type=args[2] + local pro=args[3] + + local function onPassiveTreatFactor(func,target,skill) + local isTrigger=false + if type==1 and target.camp~=role.camp then + isTrigger=true + end + if isTrigger then + func(pro,ct) + end + end + + BattleLogic.Event:AddEvent(BattleEventName.PassiveTreatingFactor,onPassiveTreatFactor,nil,nil,role) + end, + } return passivityList \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index 930e91c37d..daea8ddf9f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -1242,7 +1242,7 @@ function BattleUtil.ApplyTreat(castRole, targetRole, value, baseFactor,critDamag end castRole.Event:DispatchEvent(BattleEventName.PassiveTreatingFactor, treatFactorFunc, targetRole,skill) targetRole.Event:DispatchEvent(BattleEventName.PassiveBeTreatedFactor, treatFactorFunc, castRole) - + BattleLogic.Event:DispatchEvent(BattleEventName.PassiveTreatingFactor,treatFactorFunc,targetRole,skill) local factor = castRole.isTeam and 1 or castRole:GetRoleData(RoleDataName.TreatFacter) --释放者为team则不计算治疗加成属性 if factor==0 then factor=1