From 2e886d45244ff8493de3ffe9726c8ba3bd170d52 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Tue, 30 Mar 2021 16:34:17 +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=E6=B8=85=E9=99=A4=E7=9B=BE=E6=95=88=E6=9E=9C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=A0=B4=E7=9B=BE=E6=8F=90=E7=A4=BA=E6=96=87=E5=AD=97?= =?UTF-8?q?=EF=BC=8C=E6=B8=85=E9=99=A4=E5=85=8D=E7=96=AB=EF=BC=8C=E6=8C=81?= =?UTF-8?q?=E7=BB=AD=E4=BC=A4=E5=AE=B3=EF=BC=8C=E6=8E=A7=E5=88=B6=E6=95=88?= =?UTF-8?q?=E6=9E=9C=E6=B7=BB=E5=8A=A0=E6=B8=85=E9=99=A4=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=EF=BC=9B=E8=A2=AB=E5=8A=A8278=E4=BF=AE=E6=94=B9=EF=BC=9B?= =?UTF-8?q?=E8=A2=AB=E5=8A=A8=E6=B7=BB=E5=8A=A0=E6=8E=92=E5=BA=8F=EF=BC=9B?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E6=95=88=E6=9E=9C=E7=BB=93=E6=9D=9F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/ManagedResources/~Lua/Common/Language.lua | 2 ++ .../~Lua/Modules/Battle/BattleManager.lua | 6 +++++- .../~Lua/Modules/Battle/Logic/Base/Buff.lua | 7 +++++++ .../~Lua/Modules/Battle/Logic/Base/Passivity.lua | 8 ++++++-- .../~Lua/Modules/Battle/Logic/Buff/Control.lua | 4 ++++ .../~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua | 2 ++ .../~Lua/Modules/Battle/Logic/Role/RoleLogic.lua | 3 ++- 7 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Common/Language.lua b/Assets/ManagedResources/~Lua/Common/Language.lua index e88d44ae92..19eea2f567 100644 --- a/Assets/ManagedResources/~Lua/Common/Language.lua +++ b/Assets/ManagedResources/~Lua/Common/Language.lua @@ -2234,4 +2234,6 @@ [12233] = GetLanguageStrById("核心神将:"), [12234] = GetLanguageStrById("%d次内必得金色及以上魂印"), [12235] = GetLanguageStrById("重连失败,请重新登录"), + [12236] = GetLanguageStrById("破盾"), + [12237] = GetLanguageStrById("清除"), } diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua index 2356484caa..b9f89bec38 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/BattleManager.lua @@ -976,7 +976,11 @@ end function this.GetArtFontConfig(_ArtFontType) if _ArtFontType == BattleArtFontType.Immune then - return {type = 2, content = Language[10203]} + return {type = 2, content = Language[10203]} + elseif _ArtFontType == BattleArtFontType.Shield then + return {type = 2, content = Language[12236]} + elseif _ArtFontType == BattleArtFontType.clear then + return {type = 2, content = Language[12237]} end end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua index 94ef159780..8f430f6334 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Buff.lua @@ -227,6 +227,13 @@ function BuffManager:ClearBuff(target, func) while idx <= list.size do local buff = list.buffer[idx] if buff.target == target and (not func or (func and buff.clear and func(buff))) then + if func and func(buff) then + if buff.type== BuffName.Shield then + buff.target.Event:DispatchEvent(BattleEventName.ShowHintText, BattleArtFontType.Shield) + elseif buff.type== BuffName.DOT or buff.type==BuffName.Control or buff.type==BuffName.Immune then + buff.target.Event:DispatchEvent(BattleEventName.ShowHintText, BattleArtFontType.clear) + end + end buff:OnEnd() buff.target.Event:DispatchEvent(BattleEventName.BuffEnd, buff) putBuff(buff) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index 1f786cf6db..35e4bbfc70 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -5664,7 +5664,11 @@ local passivityList = { if defRole and defRole.camp~=role.camp and skill.owner==role and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) then BattleUtil.RandomAction(pro, function() BattleLogic.BuffMgr:ClearBuff(defRole, function(buff) - return buff.type == BuffName.Immune and (buff.immuneType == 4 or buff.immuneType == 2) + if buff.type == BuffName.Immune and (buff.immuneType == 4 or buff.immuneType == 2) then + buff.target.Event:DispatchEvent(BattleEventName.ShowHintText, BattleArtFontType.clear) + return true + end + return false end) end) end @@ -6081,7 +6085,7 @@ local passivityList = { local v1=args[2] local OnBuffEnd=function(buff) if buff and not buff.target:IsDead() and buff.caster==role and buff.type==BuffName.Shield then - local val = floor(BattleUtil.FP_Mul(v1, role:GetRoleData(BattlePropList[pro]))) + local val = floor(BattleUtil.FP_Mul(v1, buff.target:GetRoleData(BattlePropList[pro]))) BattleUtil.CalTreat(role,buff.target, val) end end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Control.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Control.lua index f8081adf12..91d4d347d5 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Control.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Control.lua @@ -40,6 +40,10 @@ end --效果结束时调用一次 function Control:OnEnd() + --如果还有同类型的控制效果,就返回 + if BattleLogic.BuffMgr:HasBuff(self.target, BuffName.Control, function (buff) return buff~=self and buff.ctrlType == self.ctrlType end) then + return + end if self.ctrlType == 1 then --眩晕 self.target.ctrl_dizzy = false elseif self.ctrlType == 2 then --沉默 diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua index d748317693..ec2e72be0e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleDefine.lua @@ -328,4 +328,6 @@ BattleRoleElementType = { BattleArtFontType = { Immune = 1, -- 免疫文字 + Shield = 2, --破盾文字 + clear = 3, --清除文字 } \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua index e00ddcdb89..9d4d0979c6 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua @@ -84,6 +84,7 @@ function RoleLogic:Init(uid, data, position) self.type = BattleUnitType.Role self.passiveList = {} if data.passivity and #data.passivity > 0 then + table.sort(data.passivity,function(a,b)return a[1] < b[1] end) for i = 1, #data.passivity do local v = data.passivity[i] local passivityId=v[1] @@ -96,7 +97,7 @@ function RoleLogic:Init(uid, data, position) if BattleUtil.Passivity[id] then BattleUtil.Passivity[id](self, args,passivityId,judge) -- 加入被动列表 - table.insert(self.passiveList, {id, args}) + table.insert(self.passiveList, {id, args,passivityId}) end end end