From d92e67a8662517778cfcd6090444db04accff259 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Sat, 5 Dec 2020 15:14:02 +0900 Subject: [PATCH] =?UTF-8?q?[=E6=88=98=E6=96=97]=20=20=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=81=B5=E5=85=BD=E7=BB=99=E8=8B=B1=E9=9B=84=E9=99=84=E5=8A=A0?= =?UTF-8?q?=E7=9A=84buff=E7=9A=84=E5=88=B7=E6=96=B0=E6=9C=BA=E5=88=B6?= =?UTF-8?q?=EF=BC=8C=E6=94=B9=E4=B8=BA=E5=A4=A7=E5=9B=9E=E5=90=88=E5=88=B7?= =?UTF-8?q?=E6=96=B0=EF=BC=8C=E5=A6=82=E6=9E=9C=E7=81=B5=E5=85=BD=E6=98=AF?= =?UTF-8?q?=E5=9C=A8=E5=9B=9E=E5=90=88=E5=90=8E=E9=87=8A=E6=94=BE=EF=BC=8C?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=9A=84=E6=8C=81=E7=BB=AD=E5=9B=9E=E5=90=88?= =?UTF-8?q?=E6=95=B0+1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/Logic/Base/Buff.lua | 30 +++++++++++++++++-- .../~Lua/Modules/Battle/Logic/BattleLogic.lua | 2 ++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua index 4aa54c1f9f..bc008234ac 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua @@ -310,6 +310,34 @@ function BuffManager:PassUpdate() and buff.caster.camp == curCamp -- 释放者是当前轮到的人 and buff.caster.position == curPos and buff.roundDuration > 0 -- 不是无限存在的buff + and buff.caster.type~=BattleUnitType.Monster --灵兽的buff在这里处理 + then + -- 当前轮释放的buff不结算 + if buff.startRound ~= BattleLogic.GetCurRound() then + 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 +end +--计算灵兽buff更新 +function BuffManager:PassMonsterUpdate() + 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在这里处理 then -- 当前轮释放的buff不结算 if buff.startRound ~= BattleLogic.GetCurRound() then @@ -324,8 +352,6 @@ function BuffManager:PassUpdate() end end end - - -- 每一个人的轮次都刷新 function BuffManager:TurnUpdate(sort) local curCamp, curPos = BattleLogic.GetCurTurn() diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua index d509664b38..53b90786d4 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua @@ -224,6 +224,8 @@ function BattleLogic.TurnRound(debugTurn) ) -- 轮数变化 BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoundChange, CurRound) + --刷新灵兽buff,回合开始前刷新,如果灵兽技能是在回合后释放,持续1回合,配置的回合数要+1 2020/12/05 by:王振兴 + BattleLogic.BuffMgr:PassMonsterUpdate() -- 开始 BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoundStart, CurRound)