【战斗】==============链接符显示修改,链接符放逐修改,灵兽无目标修改
parent
19d7914e78
commit
9101433578
|
@ -17,14 +17,17 @@ function Curse:ShareDamageTrigger(damagingFunc, atkRole, defRole, damage, skill,
|
||||||
if not BattleLogic.BuffMgr:HasBuff(defRole, BuffName.Curse, function(buff) return buff.curseType == CurseTypeName.ShareDamage end) then
|
if not BattleLogic.BuffMgr:HasBuff(defRole, BuffName.Curse, function(buff) return buff.curseType == CurseTypeName.ShareDamage end) then
|
||||||
-- 计算拥有此印记人的数量
|
-- 计算拥有此印记人的数量
|
||||||
local sdList = RoleManager.Query(function(role)
|
local sdList = RoleManager.Query(function(role)
|
||||||
return role.camp == self.target.camp and BattleLogic.BuffMgr:HasBuff(role, BuffName.Curse, function(buff) return buff.curseType == CurseTypeName.ShareDamage end)
|
return role.camp == self.target.camp and BattleLogic.BuffMgr:HasBuff(role, BuffName.Curse, function(buff) return buff.curseType == CurseTypeName.ShareDamage end)
|
||||||
end)
|
end)
|
||||||
if sdList and #sdList ~= 0 then
|
if sdList and #sdList ~= 0 then
|
||||||
-- 计算收到的伤害
|
-- 计算收到的伤害
|
||||||
local f1 = self.args[1] --平分伤害的百分比
|
local f1 = self.args[1] --平分伤害的百分比
|
||||||
local sd = math.floor(BattleUtil.ErrorCorrection(damage * f1 / #sdList))
|
local sd = math.floor(BattleUtil.ErrorCorrection(damage * f1 / #sdList))
|
||||||
if sd ~= 0 then
|
if sd ~= 0 then
|
||||||
BattleUtil.FinalDamage(nil, atkRole, self.target, sd)
|
if not self.target.isExile then
|
||||||
|
BattleUtil.FinalDamage(nil, atkRole, self.target, sd)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -63,6 +63,15 @@ function MSkill:Cast(func)
|
||||||
|
|
||||||
-- 技能效果生效
|
-- 技能效果生效
|
||||||
if self.effectCaster then
|
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()
|
self.effectCaster:Cast()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -119,7 +128,10 @@ end
|
||||||
function MSkill:GetMaxTargetNum()
|
function MSkill:GetMaxTargetNum()
|
||||||
return self.effectCaster:GetMaxTargetNum()
|
return self.effectCaster:GetMaxTargetNum()
|
||||||
end
|
end
|
||||||
|
-- 获取直接目标,不包含放逐的目标,可能为空
|
||||||
|
function MSkill:GetDirectTargetsNoExile()
|
||||||
|
return self.effectCaster:GetDirectTargetsNoExile()
|
||||||
|
end
|
||||||
-- 判断是否命中
|
-- 判断是否命中
|
||||||
function MSkill:CheckTargetIsHit(role)
|
function MSkill:CheckTargetIsHit(role)
|
||||||
return self.effectCaster:CheckTargetIsHit(role)
|
return self.effectCaster:CheckTargetIsHit(role)
|
||||||
|
|
|
@ -69,6 +69,7 @@ function Skill:Cast(func)
|
||||||
self.effectCaster:ChooseTarget()
|
self.effectCaster:ChooseTarget()
|
||||||
local targets=LengthOfTable(self:GetDirectTargetsNoExile())
|
local targets=LengthOfTable(self:GetDirectTargetsNoExile())
|
||||||
if targets==0 and self.castDoneFunc then
|
if targets==0 and self.castDoneFunc then
|
||||||
|
self.isRage=false
|
||||||
self.castDoneFunc()
|
self.castDoneFunc()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -116,7 +117,7 @@ function Skill:GetDirectTargetsNoMiss()
|
||||||
return self.effectCaster:GetDirectTargetsNoMiss()
|
return self.effectCaster:GetDirectTargetsNoMiss()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 获取直接目标,不包含miss的目标,可能为空
|
-- 获取直接目标,不包含放逐的目标,可能为空
|
||||||
function Skill:GetDirectTargetsNoExile()
|
function Skill:GetDirectTargetsNoExile()
|
||||||
return self.effectCaster:GetDirectTargetsNoExile()
|
return self.effectCaster:GetDirectTargetsNoExile()
|
||||||
end
|
end
|
||||||
|
|
|
@ -237,6 +237,7 @@ function BuffCtrl:RemoveBuffIcon(buff)
|
||||||
if not self.BuffIconList then
|
if not self.BuffIconList then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
LogRed(buff.id.." type "..tostring(buff.type))
|
||||||
-- if self.BuffIconList[buff.id] then
|
-- if self.BuffIconList[buff.id] then
|
||||||
-- local count=self.BuffIconList[buff.id].count
|
-- local count=self.BuffIconList[buff.id].count
|
||||||
-- if count==1 then
|
-- if count==1 then
|
||||||
|
@ -306,8 +307,11 @@ function BuffCtrl:RemoveBuffIcon(buff)
|
||||||
self.BuffIconList[key]:SetCount(floor-1)
|
self.BuffIconList[key]:SetCount(floor-1)
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
|
end
|
||||||
elseif buffType == BuffName.Curse then
|
elseif buffType == BuffName.Curse then
|
||||||
|
LogError("floor "..floor)
|
||||||
if self.BuffIconList[key].curseType==buff.curseType then
|
if self.BuffIconList[key].curseType==buff.curseType then
|
||||||
|
|
||||||
if floor==1 then
|
if floor==1 then
|
||||||
self.BuffIconList[key]:Dispose()
|
self.BuffIconList[key]:Dispose()
|
||||||
self.BuffIconList[key] = nil
|
self.BuffIconList[key] = nil
|
||||||
|
@ -317,7 +321,6 @@ function BuffCtrl:RemoveBuffIcon(buff)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue