diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/BattleEvent.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/BattleEvent.lua index 96b9e372ff..464636a8c6 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/BattleEvent.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/BattleEvent.lua @@ -66,6 +66,15 @@ function BattleEvent:DispatchEvent(sEventName, ...) if v.once then self:RemoveEvent(sEventName, v) end + if v.role~=nil then + BattleLogManager.Log( + "send event", + "event id==", tostring(sEventName), + "camp", tostring(v.role.camp), + "pos", tostring(v.role.position) + ) + end + end end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua index c079ff66b8..47112c3197 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua @@ -183,6 +183,14 @@ function BuffManager:AddBuff(target, buff) buff.caster.Event:DispatchEvent(BattleEventName.BuffCaster, buff) buff.caster.Event:DispatchEvent(BattleEventName.BuffCaster2, buff) buff.target.Event:DispatchEvent(BattleEventName.BuffBeAdd, buff) + BattleLogManager.Log( + "Role add Buff", + "buff.type", tostring(buff.type), + "target.camp==", tostring(target.camp), + "target.position", tostring(target.position), + "caster.camp==", tostring(buff.caster.camp), + "caster.position", tostring(buff.caster.position) + ) -- 用于记录统计 BattleLogic.Event:DispatchEvent(BattleEventName.RecordBuff, buff.caster, buff.target, buff) end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index 0341f266ce..ce2d0a289a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -229,6 +229,21 @@ function BattleUtil.RemoveNoDeadRole(arr) end end end + +--按怒气排序 +function BattleUtil.SortByPos(arr, sort) + BattleUtil.Sort(arr, function(a, b) + local r1 = a.Rage + local r2 = b.Rage + if sort == 1 then + return a.position>b.position + else + return a.position0 then + BattleUtil.SortByPos(RealDeadList,1) for i = 1, #RealDeadList do if RealDeadList[i].camp==type then return RealDeadList[i]