bug
parent
bb3fd97b0d
commit
c1a542867a
|
@ -91,17 +91,14 @@ local function chooseTarget(role, chooseId, exceptList)
|
|||
end
|
||||
|
||||
if exceptNum > 0 then
|
||||
local chooseList = {}
|
||||
for i=1, exceptNum do
|
||||
chooseList[i] = exceptList.buffer[i]
|
||||
for j=#arr, i+1, -1 do
|
||||
arr[j] = arr[j-1]
|
||||
end
|
||||
arr[i] = exceptList.buffer[i]
|
||||
end
|
||||
for i=1+exceptNum, num == 0 and #arr or min(#arr, num) do
|
||||
chooseList[i] = arr[i-exceptNum]
|
||||
end
|
||||
return chooseList
|
||||
else
|
||||
return arr
|
||||
end
|
||||
return arr
|
||||
end
|
||||
local effectPool = BattleObjectPool.New(function ()
|
||||
return {0, {}} -- type, {args, ...}
|
||||
|
|
|
@ -253,6 +253,9 @@ function BattleLogic.WaitForTrigger(delayTime, action)
|
|||
item[1] = curFrame + floor(delayTime * BattleLogic.GameFrameRate + 0.5)
|
||||
item[2] = action
|
||||
tbActionList:Add(item)
|
||||
if BattleLogic.IsOpenBattleRecord then
|
||||
BattleLogic.RecordDelayTrigger(delayTime, curFrame + floor(delayTime * BattleLogic.GameFrameRate + 0.5))
|
||||
end
|
||||
end
|
||||
|
||||
function BattleLogic.AddOption(opType, opArg)
|
||||
|
@ -281,6 +284,7 @@ function BattleLogic.CurFrame()
|
|||
return curFrame
|
||||
end
|
||||
|
||||
|
||||
--local list = {}
|
||||
function BattleLogic.Query(func, inCludeDeadRole)
|
||||
--for i=1, #list do
|
||||
|
@ -292,6 +296,7 @@ function BattleLogic.Query(func, inCludeDeadRole)
|
|||
for i=1, objList.size do
|
||||
local v = objList.vList[i]
|
||||
if func(v) and (inCludeDeadRole or not v.isDead) then
|
||||
--if memoize(func, v) and (inCludeDeadRole or not v.isDead) then
|
||||
list[index] = v
|
||||
index = index + 1
|
||||
end
|
||||
|
@ -360,9 +365,7 @@ function BattleLogic.Update()
|
|||
index = 1
|
||||
while index <= tbActionList.size do
|
||||
if tbActionList.buffer[index][1] <= curFrame then
|
||||
if tbActionList.buffer[index][2] then
|
||||
tbActionList.buffer[index][2]()
|
||||
end
|
||||
tbActionList.buffer[index][2]()
|
||||
actionPool:Put(tbActionList.buffer[index])
|
||||
tbActionList:Remove(index)
|
||||
else
|
||||
|
@ -469,6 +472,11 @@ function BattleLogic.RecordEffect(caster, target, type, args, interval)
|
|||
table.insert(record, string.format("frame:%d, caster:%s, target:%s, effectType:%d, args:%s, interval:%d", curFrame, cUid, tUid, type, str, interval))
|
||||
end
|
||||
|
||||
--Record专用
|
||||
function BattleLogic.RecordDelayTrigger(delayFrame, triggerFrame)
|
||||
table.insert(record, string.format("frame:%d, delayFrame:%d, triggerFrame:%d", curFrame, delayFrame, triggerFrame))
|
||||
end
|
||||
|
||||
--Record专用
|
||||
function BattleLogic.GenerateRecordFile()
|
||||
local time = string.format("%d-%d-%d-%d-%d-%d",
|
||||
|
|
Loading…
Reference in New Issue