From 91014335786bb27654889c6baf0e68c0bc5fdc9e Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Sat, 27 Mar 2021 12:37:50 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=88=98=E6=96=97=E3=80=91=3D=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=E9=93=BE=E6=8E=A5=E7=AC=A6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BF=AE=E6=94=B9=EF=BC=8C=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E7=AC=A6=E6=94=BE=E9=80=90=E4=BF=AE=E6=94=B9=EF=BC=8C=E7=81=B5?= =?UTF-8?q?=E5=85=BD=E6=97=A0=E7=9B=AE=E6=A0=87=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/Logic/Buff/Curse.lua | 7 +++++-- .../Battle/Logic/Monster/MonsterSkill/MSkill.lua | 14 +++++++++++++- .../~Lua/Modules/Battle/Logic/Role/Skill.lua | 3 ++- .../~Lua/Modules/Battle/View/Unit/BuffCtrl.lua | 5 ++++- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Curse.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Curse.lua index 9e1c42cc0f..328de235e6 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Curse.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Curse.lua @@ -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 -- 计算拥有此印记人的数量 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) if sdList and #sdList ~= 0 then -- 计算收到的伤害 local f1 = self.args[1] --平分伤害的百分比 local sd = math.floor(BattleUtil.ErrorCorrection(damage * f1 / #sdList)) 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 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/MonsterSkill/MSkill.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/MonsterSkill/MSkill.lua index 59d60513a9..7a3d1d1a00 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/MonsterSkill/MSkill.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Monster/MonsterSkill/MSkill.lua @@ -63,6 +63,15 @@ function MSkill: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 @@ -119,7 +128,10 @@ end function MSkill:GetMaxTargetNum() return self.effectCaster:GetMaxTargetNum() end - +-- 获取直接目标,不包含放逐的目标,可能为空 +function MSkill:GetDirectTargetsNoExile() + return self.effectCaster:GetDirectTargetsNoExile() +end -- 判断是否命中 function MSkill:CheckTargetIsHit(role) return self.effectCaster:CheckTargetIsHit(role) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/Skill.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/Skill.lua index b2689b83d6..92533efb58 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/Skill.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/Skill.lua @@ -69,6 +69,7 @@ function Skill:Cast(func) self.effectCaster:ChooseTarget() local targets=LengthOfTable(self:GetDirectTargetsNoExile()) if targets==0 and self.castDoneFunc then + self.isRage=false self.castDoneFunc() return end @@ -116,7 +117,7 @@ function Skill:GetDirectTargetsNoMiss() return self.effectCaster:GetDirectTargetsNoMiss() end --- 获取直接目标,不包含miss的目标,可能为空 +-- 获取直接目标,不包含放逐的目标,可能为空 function Skill:GetDirectTargetsNoExile() return self.effectCaster:GetDirectTargetsNoExile() end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua index b4343eec14..0382fe0a9e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/View/Unit/BuffCtrl.lua @@ -237,6 +237,7 @@ function BuffCtrl:RemoveBuffIcon(buff) if not self.BuffIconList then return end + LogRed(buff.id.." type "..tostring(buff.type)) -- if self.BuffIconList[buff.id] then -- local count=self.BuffIconList[buff.id].count -- if count==1 then @@ -306,8 +307,11 @@ function BuffCtrl:RemoveBuffIcon(buff) self.BuffIconList[key]:SetCount(floor-1) end return + end elseif buffType == BuffName.Curse then + LogError("floor "..floor) if self.BuffIconList[key].curseType==buff.curseType then + if floor==1 then self.BuffIconList[key]:Dispose() self.BuffIconList[key] = nil @@ -317,7 +321,6 @@ function BuffCtrl:RemoveBuffIcon(buff) return end end - end end end end