diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua index 6461adf37f..889fc7dc13 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Effect.lua @@ -1976,15 +1976,16 @@ local effectList = { caster.Event:DispatchEvent(BattleEventName.RoleViewBullet, skill, target) BattleLogic.WaitForTrigger(interval, function () local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType) - local arr = RoleManager.Query(function (r) return r.camp == caster.camp end) + local arr = RoleManager.NoOrder(function (r) return r.camp == caster.camp end,false,true) BattleUtil.SortByHpFactor(arr, 1) - -- 检测技能伤害治疗加成 - f2 = BattleUtil.CheckSkillDamageHeal(f2, caster, arr[1]) + -- 检测技能伤害治疗加成 -- 治疗血量最低队友实际伤害的f2% --之前是finaldag 改成 damage for i = 1, LengthOfTable(arr) do if i<=num then + f2 = BattleUtil.CheckSkillDamageHeal(f2, caster, arr[i]) BattleUtil.ApplyTreat(caster, arr[i], floor(damage*f2)) + end end end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index e148dc2f3b..1ab69d3d54 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -5638,7 +5638,7 @@ local passivityList = { -- 释放技能后 local onSkillEnd = function(skill) if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra then - local list= RoleManager.Query(function(v) return v.camp == role.camp and v.element==ele end) + local list= RoleManager.NoOrder(function(v) return v.camp == role.camp and v.element==ele end,true) if not list or LengthOfTable(list)==0 then return end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleManager.lua index f775b9c2e3..f0b78310d7 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleManager.lua @@ -154,7 +154,38 @@ function RoleManager.Query(func, inCludeDeadRole) end) return list end - +-- 查找角色(不包含死亡和拥有不灭的) 2020/11/28 王振兴 +function RoleManager.QueryNoDead(func) + local list = {} + local index = 1 + if func then + for pos, v in pairs(PosList) do + if func(v) and not v:IsRealDead() and v.deadFilter then + list[index] = v + index = index + 1 + end + end + end + table.sort(list, function(a, b) + return a.position < b.position + end) + return list +end +-- 查找角色(无排序,无死亡单位,无不灭) 2020/11/28 王振兴 +function RoleManager.NoOrder(func) + local list = {} + local index = 1 + if func then + for pos, v in pairs(PosList) do + if func(v) and not v:IsRealDead() and v.deadFilter then + list[index] = v + index = index + 1 + end + end + end + BattleUtil.RandomList(list) + return list +end --对位规则: 1敌方相同对位 2若死亡或不存在,选取相邻阵位最近且阵位索引最小的 function this.GetAggro(role)