【战斗】添加缺失的方法

dev_chengFeng
gaoxin 2021-09-07 19:43:08 +08:00
parent 2fa2fe0a28
commit 2a23609ed6
1 changed files with 18 additions and 1 deletions

View File

@ -8,6 +8,23 @@ local min = math.min
--local BattleEventName = BattleEventName
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)
if v < minValue then
return minValue
@ -208,7 +225,7 @@ function BattleUtil.RemoveNoDeadRole(arr)
for i = 1, #arr do
local role=arr[i]
if BattleLogic.BuffMgr:HasBuff(role,BuffName.NoDead) then
table.removebyvalue(arr,role)
table_removebyvalue(arr,role)
end
end
end