战斗逻辑

back_recharge
lvxinran 2019-10-30 15:59:45 +08:00
parent e5d58a9f32
commit 46d1d8b00c
1 changed files with 11 additions and 2 deletions

View File

@ -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