战斗逻辑

back_recharge
lvxinran 2019-10-31 14:49:13 +08:00
parent b6747e3746
commit 521edb1bfe
2 changed files with 14 additions and 5 deletions

View File

@ -142,7 +142,7 @@ function Skill:Cast()
if not self.isTeamSkill then
local type = BattleLogic.Type
local isPVEMonster = self.owner.camp == 1 and (type == 1 or type == 2 or type == 4 or type == 5)
local isPVEMonster = self.owner.camp == 1 and (type == 1 or type == 2 or type == 4 or type == 5 or type == 8)
local time = 0
if isPVEMonster then
if self.owner.superSkill == self then

View File

@ -12,7 +12,7 @@ local curFrame
local playerSkillUsable
local enemySkillUsable
BattleLogic.Type = 0 --1 故事副本 2 地图探索 3 竞技场 4 秘境boss 5 解锁秘境 6 公会战 7 血战
BattleLogic.Type = 0 --1 故事副本 2 地图探索 3 竞技场 4 秘境boss 5 解锁秘境 6 公会战 7 血战 8 兽潮
BattleLogic.IsEnd = false
BattleLogic.Result = -1
BattleLogic.Event = BattleEvent.New()
@ -28,7 +28,7 @@ local record
local optionRecord
--是否开启战斗日志
BattleLogic.IsOpenBattleRecord = false
BattleLogic.IsOpenBattleRecord = true
--逻辑帧频
BattleLogic.GameFrameRate = 30
BattleLogic.GameDeltaTime = 1 / BattleLogic.GameFrameRate
@ -450,10 +450,19 @@ function BattleLogic.GetAggro(role)
end
return target
end
--获取对位相邻站位的人 chooseType 1 我方 2 敌方(若对位的敌人死亡,则选取相邻最近的作为目标)
--获取对位相邻站位的人 chooseType 1 我方 2 敌方(对位的敌人受到嘲讽的影响,若对位的敌人死亡,则选取相邻最近的作为目标)
function BattleLogic.GetNeighbor(role, chooseType)
local posList = {}
local target = chooseType == 1 and role or BattleLogic.GetAggro(role)
local target
if chooseType == 1 then
target = role
else
if role.lockTarget and not role.lockTarget.isDead then
target = role.lockTarget
else
target = BattleLogic.GetAggro(role)
end
end
if target then
local list = BattleLogic.Query(function (r) return r.camp == target.camp end)
for i=1, #list do