【战斗】修复lenthoftable方法在后端战斗中无法调用导致报错

dev_chengFeng
gaoxin 2020-11-30 19:43:37 +08:00
parent b0f9e59672
commit 4dbbbc7929
2 changed files with 8 additions and 9 deletions

View File

@ -1981,11 +1981,10 @@ local effectList = {
-- 检测技能伤害治疗加成 -- 检测技能伤害治疗加成
-- 治疗血量最低队友实际伤害的f2% -- 治疗血量最低队友实际伤害的f2%
--之前是finaldag 改成 damage --之前是finaldag 改成 damage
for i = 1, LengthOfTable(arr) do for i = 1, #arr do
if i<=num then if i<=num then
f2 = BattleUtil.CheckSkillDamageHeal(f2, caster, arr[i]) f2 = BattleUtil.CheckSkillDamageHeal(f2, caster, arr[i])
BattleUtil.ApplyTreat(caster, arr[i], floor(damage*f2)) BattleUtil.ApplyTreat(caster, arr[i], floor(damage*f2))
end end
end end
end end

View File

@ -5616,7 +5616,7 @@ local passivityList = {
elseif camp==1 then elseif camp==1 then
list= RoleManager.Query(function(v) return v.camp ~= role.camp and v.element==ele end) list= RoleManager.Query(function(v) return v.camp ~= role.camp and v.element==ele end)
end end
if not list or LengthOfTable(list)==0 then if not list or #list == 0 then
return return
end end
list = BattleUtil.SortByProp(list, BattlePropList[pro],0) list = BattleUtil.SortByProp(list, BattlePropList[pro],0)
@ -5638,11 +5638,11 @@ local passivityList = {
local onSkillEnd = function(skill) local onSkillEnd = function(skill)
if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra then if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra then
local list= RoleManager.NoOrder(function(v) return v.camp == role.camp and v.element==ele end,true) 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 if not list or #list ==0 then
return return
end end
list =BattleUtil.SortByHpFactor(list,1) list =BattleUtil.SortByHpFactor(list,1)
for i = 1,LengthOfTable(list) do for i = 1, #list do
if i<=num then if i<=num then
if not list[i]:IsDead() then if not list[i]:IsDead() then
local buff=Buff.Create(role, BuffName.Immune,round,1) local buff=Buff.Create(role, BuffName.Immune,round,1)
@ -5699,11 +5699,11 @@ local passivityList = {
if skill and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) then if skill and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) then
BattleUtil.RandomAction(p1, function () BattleUtil.RandomAction(p1, function ()
local list= RoleManager.Query(function(v) return v.camp == role.camp and v.element==ele and not v:IsDead() end) local list= RoleManager.Query(function(v) return v.camp == role.camp and v.element==ele and not v:IsDead() end)
if not list or LengthOfTable(list)==0 then if not list or #list ==0 then
return return
end end
list =BattleUtil.SortByProp(list,BattlePropList[p2],0) list =BattleUtil.SortByProp(list,BattlePropList[p2],0)
for i = 1,LengthOfTable(list) do for i = 1, #list do
if i<=num then if i<=num then
local buff=Buff.Create(role, BuffName.PropertyChange,r1,BattlePropList[p3],v1,ct ) local buff=Buff.Create(role, BuffName.PropertyChange,r1,BattlePropList[p3],v1,ct )
list[i]:AddBuff(buff) list[i]:AddBuff(buff)
@ -5763,7 +5763,7 @@ local passivityList = {
elseif camp==1 then elseif camp==1 then
list= RoleManager.Query(function(v) return v.camp ~= role.camp and v.element==ele end) list= RoleManager.Query(function(v) return v.camp ~= role.camp and v.element==ele end)
end end
if not list or LengthOfTable(list)==0 then if not list or #list ==0 then
return return
end end
for key, value in pairs(list) do for key, value in pairs(list) do
@ -5790,7 +5790,7 @@ local passivityList = {
elseif camp==1 then elseif camp==1 then
list= RoleManager.Query(function(v) return v.camp ~= role.camp and v.element==ele end) list= RoleManager.Query(function(v) return v.camp ~= role.camp and v.element==ele end)
end end
if not list or LengthOfTable(list)==0 then if not list or #list ==0 then
return return
end end
list=BattleUtil.SortByRage(list,0) list=BattleUtil.SortByRage(list,0)