【战斗】添加缺失的方法
parent
2fa2fe0a28
commit
2a23609ed6
|
@ -8,6 +8,23 @@ local min = math.min
|
||||||
--local BattleEventName = BattleEventName
|
--local BattleEventName = BattleEventName
|
||||||
BattleUtil.Passivity = require("Modules/Battle/Logic/Base/Passivity")
|
BattleUtil.Passivity = require("Modules/Battle/Logic/Base/Passivity")
|
||||||
|
|
||||||
|
local function table_removebyvalue(array, value, removeall)
|
||||||
|
local c, i, max = 0, 1, #array
|
||||||
|
while i <= max do
|
||||||
|
if array[i] == value then
|
||||||
|
table.remove(array, i)
|
||||||
|
c = c + 1
|
||||||
|
i = i - 1
|
||||||
|
max = max - 1
|
||||||
|
if not removeall then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
return c
|
||||||
|
end
|
||||||
|
|
||||||
local function clamp(v, minValue, maxValue)
|
local function clamp(v, minValue, maxValue)
|
||||||
if v < minValue then
|
if v < minValue then
|
||||||
return minValue
|
return minValue
|
||||||
|
@ -208,7 +225,7 @@ function BattleUtil.RemoveNoDeadRole(arr)
|
||||||
for i = 1, #arr do
|
for i = 1, #arr do
|
||||||
local role=arr[i]
|
local role=arr[i]
|
||||||
if BattleLogic.BuffMgr:HasBuff(role,BuffName.NoDead) then
|
if BattleLogic.BuffMgr:HasBuff(role,BuffName.NoDead) then
|
||||||
table.removebyvalue(arr,role)
|
table_removebyvalue(arr,role)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue