【战斗】=======解决放逐目标有不灭不会被选中;解决只剩放逐目标攻击动画异常问题

dev_chengFeng
wangzhenxing 2021-03-26 16:50:49 +08:00
parent fb475c1b8e
commit 19d7914e78
3 changed files with 28 additions and 1 deletions

View File

@ -174,6 +174,19 @@ function EffectCaster:GetDirectTargetsNoMiss()
return list
end
-- 获取直接目标和没有被放逐的目标不包含miss的目标可能为空
function EffectCaster:GetDirectTargetsNoExile()
local list = {}
for _, role in ipairs(self.effectTargets[1]) do
if not role.isExile then
table.insert(list, role)
end
end
return list
end
-- 获取技能目标最大人数
function EffectCaster:GetMaxTargetNum()
local mainEffect = self.effectList[1]

View File

@ -380,7 +380,7 @@ function BattleUtil.ChooseTarget(role, chooseId)
local team = RoleManager.Query(function (r) return r.camp ~= role.camp end)
if list then
for key, value in pairs(team) do
if not value:IsDead() and not BattleUtil.ChecklistIsContainValue(role.exileTargets,value) then
if not value:IsRealDead() and not BattleUtil.ChecklistIsContainValue(role.exileTargets,value) then
--return arr[i]
table.insert(tempArr,value)
end

View File

@ -64,6 +64,15 @@ function Skill:Cast(func)
-- 技能效果生效
if self.effectCaster then
--放技能前判断是否有目标,没有就不会放技能,直接执行技能回调 by 王振兴 2021/03/26
--为解决攻击目标只剩被放逐的单位导致技能播放异常
self.effectCaster:ChooseTarget()
local targets=LengthOfTable(self:GetDirectTargetsNoExile())
if targets==0 and self.castDoneFunc then
self.castDoneFunc()
return
end
--end
self.effectCaster:Cast()
end
@ -106,6 +115,11 @@ end
function Skill:GetDirectTargetsNoMiss()
return self.effectCaster:GetDirectTargetsNoMiss()
end
-- 获取直接目标不包含miss的目标可能为空
function Skill:GetDirectTargetsNoExile()
return self.effectCaster:GetDirectTargetsNoExile()
end
-- 获取技能目标最大人数
function Skill:GetMaxTargetNum()
return self.effectCaster:GetMaxTargetNum()