同步战斗逻辑

back_recharge
lvxinran 2019-07-15 19:25:22 +08:00
parent 89affcf6c1
commit 91d33e56ed
4 changed files with 15 additions and 5 deletions

View File

@ -19,7 +19,7 @@ local propertyList = {
RoleDataName.CritDamageFactor,
RoleDataName.TreatFacter,
RoleDataName.MaxHp,
RoleDataName.Hp,
RoleDataName.MaxHp,
RoleDataName.CureFacter,
RoleDataName.Tenacity,
}

View File

@ -207,7 +207,7 @@ local passivityList = {
end)
end
end
role.Event:AddEvent(BattleEventName.OnRoleBeDamagedBefore, OnRoleBeDamagedBefore)
role.Event:AddEvent(BattleEventName.RoleBeDamagedBefore, OnRoleBeDamagedBefore)
end,
--受击时,有[a]的概率抵消[b]*[c]的攻击。

View File

@ -32,6 +32,7 @@ function Skill:Init(role, effectData)
self.sp = 0
self.spPass = 0
self.isTeamSkill = false
self.isManual = false
for i=2, #effectData do
local v = effectData[i]
@ -167,6 +168,7 @@ function Skill:Cast()
end
BattleLogic.SetSkillUsable(self.owner.camp, false)
self.isManual = false
BattleLogic.WaitForTrigger(duration, function()
BattleLogic.SetSkillUsable(self.owner.camp, true)
if not self.isTeamSkill then
@ -178,7 +180,8 @@ function Skill:Cast()
end
--表现层调用
function Skill:CanManualCast()
return self.owner:CanCastSkill() and self.owner.camp == 0 and not self.owner.Auto and self.sp >= self.spPass
return not self.isManual and self.owner.enable and not self.owner.ctrl_slient and
self.owner.camp == 0 and not self.owner.Auto and self.sp >= self.spPass
end
--表现层调用
function Skill:ManualCast()
@ -192,6 +195,7 @@ function Skill:ManualCast()
else
BattleLogic.AddOption(3, self.owner.uid)
end
self.isManual = true
end
end

View File

@ -25,6 +25,7 @@ BattleLogic.Result = -1
BattleLogic.Event = BattleEvent.New()
BattleLogic.BuffMgr = BuffManager.New()
local skillManualQueue = BattleQueue.New()
local playerTeamDummyRole = {camp = 0, Event = BattleLogic.Event, isTeam = true, curSkill = nil}
local enemyTeamDummyRole = {camp = 1, Event = BattleLogic.Event, isTeam = true, curSkill = nil}
local playerTeamSkillList = {}
@ -76,6 +77,7 @@ function BattleLogic.Init(maxTime, data, optionData)
BattleLogic.TotalOrder = #data.enemyData
BattleLogic.Clear()
skillManualQueue:Clear()
curUid = 0
curBuffId = 0
@ -289,12 +291,12 @@ function BattleLogic.ExecuteOption(option)
elseif opType == 2 then --释放skill
local role = objList.kvList[opArg]
if role and role.skill then
role.skill:Cast()
skillManualQueue:Enqueue(role.skill)
end
elseif opType == 3 then --释放superSkill
local role = objList.kvList[opArg]
if role and role.superSkill then
role.superSkill:Cast()
skillManualQueue:Enqueue(role.superSkill)
end
elseif opType == 4 then --释放teamSkill
local teamSkill = playerTeamSkillList[playerTeamSkillIndex]
@ -399,6 +401,10 @@ function BattleLogic.Update()
end
end
if playerSkillUsable and skillManualQueue.size > 0 then --手动操作的技能进入队列,等待释放
skillManualQueue:Dequeue():Cast()
end
local index = 1
while index <= tbActionList.size do
local action = tbActionList.buffer[index]