战斗同步

back_recharge
duhui 2020-12-28 12:20:39 +08:00
parent dffe1b81b9
commit 869b8400f0
1 changed files with 28 additions and 0 deletions

View File

@ -311,6 +311,7 @@ function BuffManager:PassUpdate()
and buff.caster.position == curPos
and buff.roundDuration > 0 -- 不是无限存在的buff
and buff.caster.type~=BattleUnitType.Monster --灵兽的buff在这里处理
and buff.type~=BuffName.NoDead
then
-- 当前轮释放的buff不结算
if buff.startRound ~= BattleLogic.GetCurRound() then
@ -325,6 +326,33 @@ function BuffManager:PassUpdate()
end
end
end
--只更新不灭buff
function BuffManager:PassUpdateNoDead()
local curCamp, curPos = BattleLogic.GetCurTurn()
for i=1, self.buffDic.size do
local buffList = self.buffDic.vList[i]
if buffList.size > 0 then
for index = 1, buffList.size do
local buff = buffList.buffer[index]
if not buff.disperse -- 没过期
and buff.caster.camp == curCamp -- 释放者是当前轮到的人
and buff.caster.position == curPos
and buff.roundDuration > 0 -- 不是无限存在的buff
and buff.caster.type~=BattleUnitType.Monster --灵兽的buff在这里处理
and buff.type==BuffName.NoDead --不灭在这里处理
then
-- 当前轮释放的buff不结算
buff.roundPass = buff.roundPass + 1
if buff.roundPass >= buff.roundDuration then
buff.disperse = true
end
buff.target.Event:DispatchEvent(BattleEventName.BuffRoundChange, buff)
end
end
end
end
end
--计算灵兽buff更新
function BuffManager:PassMonsterUpdate()
local curCamp, curPos = BattleLogic.GetCurTurn()