Merge branch 'master_develop' of http://60.1.1.230/gaoxin/JL_Client into master_develop

dev_chengFeng
jiaoyangna 2020-08-26 14:51:15 +08:00
commit 8d41c89eee
4 changed files with 32 additions and 3 deletions

View File

@ -0,0 +1 @@
{"buglyId":"261348dcd3", "channel":"MHT", "resUrl":"http://jl.tyu89.wang/mht_test/", "packageVersion":"0.1", "subChannel":"20000", "version":"0.1.2", "serverUrl":"http://139.9.223.139:8080/"}

View File

@ -0,0 +1 @@
{"buglyId":"261348dcd3", "channel":"MHT", "resUrl":"http://jl.tyu89.wang/mht_test/", "packageVersion":"0.1", "subChannel":"10000", "version":"0.1.2", "serverUrl":"http://139.9.223.139:8080/"}

View File

@ -209,7 +209,12 @@ function BattleUtil.ChooseTarget(role, chooseId)
elseif chooseWeight == 7 then -- 对位及其相邻目标
arr = RoleManager.GetNeighbor(role, chooseType)
elseif chooseWeight == 8 then -- 对位
arr = RoleManager.GetArrAggroList(role, arr)
LogError("选择对位")
if num==1 then
arr=RoleManager.GetAggroHero(role,arr)
else
arr = RoleManager.GetArrAggroList(role, arr)
end
-- elseif chooseWeight == 9 then -- 展位距离
-- BattleUtil.Sort(arr, function(a, b)
-- local r1 = math.abs(role.position - a.position) * 10 + a.position
@ -217,7 +222,7 @@ function BattleUtil.ChooseTarget(role, chooseId)
-- if sort == 1 then return r1 > r2 else return r1 < r2 end
-- end)
end
LogError(#arr)
local finalArr = {}
if num == 0 then
finalArr = arr
@ -349,7 +354,8 @@ end
--检测是否有是金翅大鹏有不灭效果
function BattleUtil.CheckIsNoDead(target)
if target then
return target:IsAssignHeroAndHeroStar(10086,10)==false and BattleLogic.BuffMgr:HasBuff(target,BuffName.NoDead)==false
LogError(target.star)
return BattleLogic.BuffMgr:HasBuff(target,BuffName.NoDead)==false and target:IsAssignHeroAndHeroStar(10086,10)==false
end
return false
end

View File

@ -253,6 +253,27 @@ function this.GetArrAggroList(role, arr)
end)
return targetList
end
--对位规则: 1敌方相同对位 2若死亡或不存在选取相邻阵位最近且阵位索引最小的
function this.GetAggroHero(role,arr)
-- 计算开始位置
if not arr then
return
end
local startPos = role.position
local targetList={}
startPos = startPos > 3 and startPos - 3 or startPos
for _, v in ipairs(arr) do
local pos= v.position>3 and v.position -3 or v.position
if pos==startPos then
table.insert(targetList,v)
end
end
if #targetList==0 then
table.insert(targetList,arr[1])
end
return targetList
end
--获取对位相邻站位的人 chooseType 1 我方 2 敌方(对位的敌人受到嘲讽的影响,若对位的敌人死亡,则选取相邻最近的作为目标)
function this.GetNeighbor(role, chooseType)
local posList = {}