【战斗】修复人物技能会在零售技能释放完成之前加入对列,导致技能释放失败的问题。

dev_chengFeng
gaoxin 2020-11-02 21:49:06 +08:00
parent 9779a99414
commit cb10b3ff1d
2 changed files with 36 additions and 11 deletions

View File

@ -228,17 +228,28 @@ function BattleLogic.TurnRound(debugTurn)
BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoundChange, CurRound)
-- 开始
BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoundStart, CurRound)
--轮数变化后延时0.2秒用于初始化监听回合数被动的初始化
BattleLogic.WaitForTrigger(0.2,function()
-- 进入新轮
BattleLogic.CheckBattleLogic()
-- 检测一次灵兽技能
SkillManager.CheckMonsterSkill(function()
--轮数变化后延时0.2秒用于初始化监听回合数被动的初始化
BattleLogic.WaitForTrigger(0.2,function()
-- 进入新轮
BattleLogic.CheckBattleLogic()
end)
end)
else
-- 切换阵营
CurCamp = (CurCamp + 1) % 2
BattleLogic.CheckBattleLogic()
-- 检测一次灵兽技能
SkillManager.CheckMonsterSkill(function()
--轮数变化后延时0.2秒用于初始化监听回合数被动的初始化
BattleLogic.WaitForTrigger(0.2,function()
-- 切换阵营
CurCamp = (CurCamp + 1) % 2
BattleLogic.CheckBattleLogic()
end)
end)
end
end
--检测战斗逻辑
@ -310,8 +321,8 @@ function BattleLogic.CheckBattleLogic()
BattleLogic.BuffMgr:TurnUpdate(3) -- 计算持续伤害(流血)
BattleLogic.BuffMgr:TurnUpdate(4) -- 计算其他buff
BattleLogic.BuffMgr:PassUpdate() -- 计算buff轮数
SkillRole.Event:DispatchEvent(BattleEventName.RoleTurnEnd, SkillRole) -- 行动结束
BattleLogic.Event:DispatchEvent(BattleEventName.RoleTurnEnd, SkillRole) -- 开始行动
SkillRole.Event:DispatchEvent(BattleEventName.RoleTurnEnd, SkillRole) -- 行动结束
BattleLogic.Event:DispatchEvent(BattleEventName.RoleTurnEnd, SkillRole) -- 开始行动
BattleLogic.TurnRoundNextFrame()
end)
end

View File

@ -74,6 +74,10 @@ function this.CheckTurnRound()
if this.MonsterSkillList and #this.MonsterSkillList > 0 then
return
end
-- 检测一次灵兽技能
this.CheckMonsterSkill(this.MonsterCheckFunc)
--
if this.DeadSkillList and #this.DeadSkillList > 0 then
return
end
@ -89,6 +93,17 @@ function this.CheckTurnRound()
end
end
-- 检测是否需要等待灵兽技能
function this.CheckMonsterSkill(func)
this.MonsterCheckFunc = func
if not this.MonsterSkillList or #this.MonsterSkillList == 0 then
if this.MonsterCheckFunc then
this.MonsterCheckFunc()
end
this.MonsterCheckFunc = nil
end
end
--
function this.Update()
-- 如果正在引导战斗
@ -169,7 +184,6 @@ function this.Clear()
for _, skill in ipairs(this.SkillList) do
skill:Dispose()
skillPool:Put(skill)
end
this.MonsterSkillList = {}
this.DeadSkillList = {}