From 92f3dee3ab14da733567eb1443c5434a0a73b93f Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Fri, 18 Feb 2022 16:26:33 +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=E8=A2=AB=E5=8A=A8226=20=20423=20=20=20424?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B7=BB=E5=8A=A0=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/Logic/Base/Passivity.lua | 53 ++++++++++++++++--- .../Modules/Battle/Logic/Misc/BattleUtil.lua | 3 ++ 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index a16c72d94b..fd9aaadb7f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -5979,11 +5979,12 @@ local passivityList = { end role.Event:AddEvent(BattleEventName.FinalBeDamage,onFinalBeDamage,nil,nil,role) end, - --攻击时伤害增加(我方每个存活的其他[a]元素武将伤害增加[b]%) - --a[int] b[float] + --攻击时伤害增加(我方每个存活的其他[a]元素武将伤害增加[b]%,是否包含自身[c] + --a[int 10:与自身相同阵营],b[float],c[int 1:包含 ] [266] = function(role,args,id,judge) local ele=args[1] local v1=args[2] + local type=args[3] local passiveBeBeDamage=function(damagingFunc, defRole, damage, skill) if skill and not skill.isTriggerJudge and judge==1 then return @@ -5994,15 +5995,15 @@ local passivityList = { local list = RoleManager.QueryIncludeExile(function(v) return role.camp == v.camp end) local num=0 for _, r in pairs(list) do - if r~=role and r.element==ele and not r:IsDead() then + if (r~=role or (type and type==1) ) and (r.element==ele or (ele==10 and r.element==role.element) )and not r:IsDead() then num=num+1 end end - if damagingFunc then - local dd = BattleUtil.CountValue(damage,v1*num,2)-damage - damagingFunc(-floor(BattleUtil.ErrorCorrection(dd))) - end + if damagingFunc then + local dd = BattleUtil.CountValue(damage,v1*num,2)-damage + damagingFunc(-floor(BattleUtil.ErrorCorrection(dd))) + end end @@ -10870,7 +10871,43 @@ local passivityList = { end role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging,nil,nil,role) end, - + --每回合结束时,自身增加[a]类型[b]效果,持续[c]回合,参数1[d],参数2[e],参数3[f],buff是否可被清除[g] + --a[int],b[int],c[int],d[int/float],e[int/float],f[int/float],g[int 0可被清除 1:不可清除 ] + [423]=function(role,args,id,judge) + local t1=args[1] + local t2=args[2] + local r1=args[3] + local v1=args[4] + local v2=args[5] + local v3=args[6] + local type=args[7] + local onRoundChange=function(round) + if round==0 then + return + end + if t1==BuffName.PropertyChange then + local buff=Buff.Create(role,BuffName.PropertyChange, r1, BattlePropList[t2], v1,v2) + if type and type==1 then + buff.clear=false + else + buff.clear=true + end + role:AddBuff(buff) + end + end + BattleLogic.Event:AddEvent(BattleEventName.BattleRoundEnd, onRoundChange,nil,nil,role) + end, + --造成直接伤害,无视对方[a]%的伤害减免 + -- a[float] + [424]=function(role,args,id,judge) + local v1=args[1] + local addDMGFac=function(func) + if func then + func(v1,CountTypeName.Sub) + end + end + role.Event:AddEvent(BattleEventName.PassiveChangeDefDMGReFac,addDMGFac,nil,nil,role) + end, } return passivityList \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index 015af0a1e6..930e91c37d 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -1032,6 +1032,9 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i defDMGRef=BattleUtil.CountValue(defDMGRef,v1,ct) end atkRole.Event:DispatchEvent(BattleEventName.PassiveChangeDefDMGReFac,changeDefDMGFac) + if defDMGRef<0 then + defDMGRef=0 + end -- 基础伤害增加系数 local addDamageFactor = 1 + atkRole:GetRoleData(RoleDataName.DamageBocusFactor) - defDMGRef