【战斗】===================== 灵兽释放技能逻辑修改, rolemanager 添加获取role接口

dev_chengFeng
wangzhenxing 2021-03-25 15:54:12 +08:00
parent 776353406d
commit f5a85c4d2e
2 changed files with 46 additions and 9 deletions

View File

@ -103,16 +103,35 @@ local _ConditionConfig = {
end
return false
end,
[7] = function(skill, condition) --7检测是否有可以放逐的目标
local list=skill.owner.exileTargets
if list then
local roleList = RoleManager.Query(function(role)
return role.camp ~= skill.owner.camp and not BattleUtil.ChecklistIsContainValue(list,role)
end)
if roleList and #roleList>0 then
return true
[7] = function(skill, condition) --7敌方上场神将数量 且概率(万分比)(检测放逐)
local conId = condition[1]
local comType = condition[2]
local comValue = condition[3]
local rand = condition[4]
local roleList = RoleManager.QueryIncludeExile(function(role)
return role.camp ~= skill.owner.camp
end)
--判断场上敌方数量是否足够
local isEnough=BattleUtil.CompareValue(#roleList, comValue, comType)
if isEnough then
local ishave=false
--是否有没被放逐的目标
local list=skill.owner.exileTargets
for key, value in pairs(roleList) do
if not BattleUtil.ChecklistIsContainValue(list,value) then
ishave=true
break
end
end
end
if ishave then
local r = Random.Range01()
-- 判断概率
if isEnough then
return rand/10000>r
end
end
return false
end
return false
end,
}

View File

@ -157,6 +157,24 @@ function RoleManager.Query(func, inCludeDeadRole)
end)
return list
end
-- 查找角包括放逐目标
function RoleManager.QueryIncludeExile(func, inCludeDeadRole)
local list = {}
local index = 1
if func then
for pos, v in pairs(PosList) do
if func(v) and (inCludeDeadRole or not v:IsRealDead()) then
list[index] = v
index = index + 1
end
end
end
table.sort(list, function(a, b)
return a.position < b.position
end)
return list
end
-- 查找角色(不包含死亡和拥有不灭的) 2020/11/28 王振兴
function RoleManager.QueryNoDead(func)
local list = {}