From 7618fa2b3abf6c391594bbba48d8b27505aeb543 Mon Sep 17 00:00:00 2001 From: "PC-202302260912\\Administrator" <1545929779@qq.com> Date: Wed, 20 Dec 2023 11:44:38 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=88=98=E6=96=97]=3D=3D=3D=3D=3D=3D=3D?= =?UTF-8?q?=E8=A2=AB=E5=8A=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/Logic/Base/Passivity.lua | 45 +++++++++---------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index 9eb8fd0457..84e2cf9208 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -12889,33 +12889,28 @@ local passivityList = { local type=args[1] local r1=args[2] --移除破甲 - local buffBeAdd=function(caster,target,buff) - if caster==role and buff.type==BuffName.PropertyChange and buff.changeType==4 then - --LogError("1111111111111111111111111111111111111111") - -- local phy1=target:GetRoleData(RoleDataName.PhysicalDefence) - -- local mag1=target:GetRoleData(RoleDataName.MagicDefence) - -- BattleLogic.WaitForTrigger(1, function () - -- local phy2=target:GetRoleData(RoleDataName.PhysicalDefence) - -- local mag2=target:GetRoleData(RoleDataName.MagicDefence) - -- local list={} - -- --LogError("phy2==="..phy2.." phy1==="..phy1) - -- if type==1 then - -- table.insert(list,role) - -- else - -- list=RoleManager.RoleManager.Query(function(v) return v.camp == role.camp end) - -- end - -- for i=1,#list do - -- if mag1-mag2>0 then - -- list[i]:AddBuff(Buff.Create(role, BuffName.PropertyChange, r1,RoleDataName.MagicDefence, mag1-mag2, 1)) - -- end - -- if phy1-phy2>0 then - -- list[i]:AddBuff(Buff.Create(role, BuffName.PropertyChange, r1,RoleDataName.PhysicalDefence, phy1-phy2, 1)) - -- end - -- end - -- end) + local buffBeAdd=function(buff) + if buff.caster==role and buff.type==BuffName.PropertyChange and buff.changeType==4 then + local phy1=buff.target:GetRoleData(buff.propertyName) + BattleLogic.WaitForTrigger(1, function () + local phy2=buff.target:GetRoleData(buff.propertyName) + local list={} + if type==1 then + table.insert(list,role) + else + list=RoleManager.Query(function(v) return v.camp == role.camp end) + end + for i=1,#list do + if phy1-phy2>0 then + list[i]:AddBuff(Buff.Create(role, BuffName.PropertyChange, r1,buff.propertyName, phy1-phy2, 1)) + end + end + end) end end - BattleLogic.Event:AddEvent(BattleEventName.RecordBuff, buffBeAdd,nil,nil,role) + role.Event:AddEvent(BattleEventName.BuffCaster, buffBeAdd,nil,nil,role) + + end, } return passivityList \ No newline at end of file