【战斗】==============技能是否可以释放处 添加目标数量判断,如果没有目标则不能释放

dev_chengFeng
wangzhenxing 2021-09-17 15:20:44 +08:00
parent a793dccf22
commit df1409717d
2 changed files with 9 additions and 9 deletions

View File

@ -327,6 +327,15 @@ end
-- 判断角色是否可以释放技能
function RoleLogic:IsAvailable(skill)
if skill and skill.effectCaster then
--放技能前判断是否有目标,没有就不会放技能,直接执行技能回调 by 王振兴 2021/09/17
--为解决攻击目标只剩被放逐的单位导致我方不放技能扣除怒气
skill.effectCaster:ChooseTarget()
local targets=BattleUtil.LengthOfTable(skill.effectCaster:GetDirectTargetsNoExile())
if targets==0 then
return false
end
end
--角色没有真正死亡 在 被眩晕/沉默的 情况下 任然能释放死亡技能
if (self.ctrl_dizzy or self.ctrl_slient) and self:IsDead() and skill and skill.type==BattleSkillType.DeadSkill then
return true

View File

@ -52,15 +52,6 @@ function Skill:GetOwner()
end
-- 是否可以释放
function Skill:canCastSkill()
if self.effectCaster then
--放技能前判断是否有目标,没有就不会放技能,直接执行技能回调 by 王振兴 2021/03/26
--为解决攻击目标只剩被放逐的单位导致技能播放异常
self.effectCaster:ChooseTarget()
local targets=BattleUtil.LengthOfTable(self:GetDirectTargetsNoExile())
if targets==0 then
return false
end
end
return true
end