From 44a0b80b843b797c97c77c58c433516ceacd9b46 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Thu, 4 Feb 2021 14:24:56 +0900 Subject: [PATCH 1/6] =?UTF-8?q?=E3=80=90=E6=88=98=E6=96=97=E3=80=91=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=E4=B8=8D=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E7=89=B9=E6=80=A7=E7=9B=B8=E5=85=B3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Battle/Logic/Base/EffectCaster.lua | 2 +- .../Modules/Battle/Logic/Base/Passivity.lua | 864 ++++++++++++++---- .../Modules/Battle/Logic/Misc/BattleUtil.lua | 12 +- .../Modules/Battle/Logic/Role/RoleLogic.lua | 2 +- 4 files changed, 695 insertions(+), 185 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/EffectCaster.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/EffectCaster.lua index b110a82823..9569e7b85e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/EffectCaster.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/EffectCaster.lua @@ -99,7 +99,7 @@ function EffectCaster:ChooseTarget() local function _PassiveTarget(targets) self.effectTargets[i] = targets end - self.skill.owner.Event:DispatchEvent(BattleEventName.SkillTargetCheck, _PassiveTarget) + self.skill.owner.Event:DispatchEvent(BattleEventName.SkillTargetCheck, _PassiveTarget,self.skill) end end end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index e3c68f8bc8..4404162e43 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -380,7 +380,7 @@ local passivityList = { --发动技能后,[a]的概率将[b]*[c]算作[d]计算,持续[e]秒。 --a[float],b[属性],c[float],d[属性],e[int] - [16] = function(role, args) + [16] = function(role, args,id,judge) local f1 = args[1] local pro1 = args[2] local f2 = args[3] @@ -388,6 +388,9 @@ local passivityList = { local f3 = args[5] local OnSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end BattleUtil.RandomAction(f1, function () role:AddPropertyTransfer(BattlePropList[pro1], f2, BattlePropList[pro2], 2, f3) end) @@ -397,13 +400,16 @@ local passivityList = { --发动技能后,[d]改变仇恨目标[a]属性[b],持续[c]秒 --a[属性],b[int],c[int],d[改变类型] - [17] = function(role, args) + [17] = function(role, args,id,judge) local pro1 = args[1] local f1 = args[2] local f2 = args[3] local ct = args[4] local OnSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local arr = BattleUtil.ChooseTarget(role, 40000) if arr[1] then arr[1]:AddBuff(Buff.Create(role, BuffName.PropertyChange, f2, BattlePropList[pro1], f1, ct)) @@ -414,13 +420,16 @@ local passivityList = { --发动技能后,[d]改变己方全体[a]属性[b],持续[c]秒 --a[属性],b[int],c[int],d[改变类型] - [18] = function(role, args) + [18] = function(role, args,id,judge) local pro1 = args[1] local f1 = args[2] local f2 = args[3] local ct = args[4] local OnSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local arr = BattleUtil.ChooseTarget(role, 10000) for i=1, #arr do arr[i]:AddBuff(Buff.Create(role, BuffName.PropertyChange, f2, BattlePropList[pro1], f1, ct)) @@ -519,11 +528,14 @@ local passivityList = { --死亡时,立即回复己方全体[a]*[b]的血量。 --a[属性],b[float] - [23] = function(role, args) + [23] = function(role, args,id,judge) local pro = args[1] local f1 = args[2] - local OnDead = function(atkRole) + local OnDead = function(atkRole,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local arr = BattleUtil.ChooseTarget(role, 10000) for i=1, #arr do local val = floor(BattleUtil.FP_Mul(f1, role:GetRoleData(BattlePropList[pro]))) @@ -572,14 +584,17 @@ local passivityList = { --造成的伤害暴击后,[a]施加攻击*[c]的[d]持续伤害,持续[e]秒。 --a[float],c[float],d[伤害类型],e[int] - [26] = function(role, args) + [26] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] local dt = args[3] local f3 = args[4] local triggerUid = {} - local OnRoleCrit = function(defRole) + local OnRoleCrit = function(defRole, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if triggerUid[defRole.uid] then --加入限定避免循环触发 return end @@ -596,12 +611,15 @@ local passivityList = { --造成的伤害暴击后,[a]的概率回复自身[b]*[c]的血量 --a[float],b[属性],c[float] - [27] = function(role, args) + [27] = function(role, args,id,judge) local f1 = args[1] local pro = args[2] local f2 = args[3] - local OnRoleCrit = function(defRole) + local OnRoleCrit = function(defRole, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end BattleUtil.RandomAction(f1, function () local val = floor(BattleUtil.FP_Mul(f2, role:GetRoleData(BattlePropList[pro]))) BattleUtil.CalTreat(role, role, val) @@ -612,11 +630,14 @@ local passivityList = { --对血量高于[a]的敌人伤害提高[b]。 --a[float],b[float] - [28] = function(role, args) + [28] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] - local OnPassiveDamaging = function(damagingFunc, defRole, damage) + local OnPassiveDamaging = function(damagingFunc, defRole, damage,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if BattleUtil.GetHPPencent(defRole) > f1 then damagingFunc(-floor(f2 * damage)) end @@ -626,11 +647,14 @@ local passivityList = { --对血量低于[a]的敌人伤害提高[b]。 --a[float],b[float] - [29] = function(role, args) + [29] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] - local OnPassiveDamaging = function(damagingFunc, defRole, damage) + local OnPassiveDamaging = function(damagingFunc, defRole, damage,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if BattleUtil.GetHPPencent(defRole) < f1 then damagingFunc(-floor(f2 * damage)) end @@ -640,13 +664,16 @@ local passivityList = { --发动技能后,[d]改变敌方全体[a]属性[b],持续[c]秒 --a[属性],b[float],c[int],d[改变类型] - [30] = function(role, args) + [30] = function(role, args,id,judge) local pro = args[1] local f1 = args[2] local f2 = args[3] local ct = args[4] local OnSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local arr = BattleUtil.ChooseTarget(role, 20000) for i=1, #arr do arr[i]:AddBuff(Buff.Create(role, BuffName.PropertyChange, f2, BattlePropList[pro], f1, ct)) @@ -657,11 +684,14 @@ local passivityList = { --发动技能后,有[a]的概率眩晕敌方其中1人,持续[b]秒。 --a[float],b[int] - [31] = function(role, args) + [31] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] local OnSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local arr = BattleUtil.ChooseTarget(role, 20001) if arr[1] then BattleUtil.RandomControl(f1, 1, role, arr[1], f2) @@ -699,10 +729,13 @@ local passivityList = { --造成伤害时,额外增加[a]点伤害。 --a[int] - [34] = function(role, args) + [34] = function(role, args,id,judge) local f1 = args[1] - local OnPassiveDamaging = function(damagingFunc) + local OnPassiveDamaging = function(damagingFunc,defRole, damage, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end damagingFunc(-f1) end role.Event:AddEvent(BattleEventName.PassiveDamiaging, OnPassiveDamaging) @@ -808,10 +841,13 @@ local passivityList = { --造成伤害时,将伤害的[a]%转化为自身生命 --a[float] - [41] = function(role, args) + [41] = function(role, args,id,judge) local f1 = args[1] - local OnDamage = function(defRole, damage, bCrit, finalDmg) + local OnDamage = function(defRole, damage, bCrit, finalDmg, damageType, dotType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end BattleUtil.CalTreat(role, role, floor(f1 * finalDmg)) end role.Event:AddEvent(BattleEventName.RoleDamage, OnDamage) @@ -819,11 +855,14 @@ local passivityList = { --造成暴击伤害时,有[a]的概率造成[b]的暴击伤害。 --a[float],b[float] - [42] = function(role, args) + [42] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] - local OnPassiveCriting = function(crit) + local OnPassiveCriting = function(crit,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end BattleUtil.RandomAction(f1, function () crit(f2) end) @@ -833,13 +872,16 @@ local passivityList = { --发动技能后,[d]改变仇恨目标[a]属性[b],持续整场战斗,属性最多可改变[c] --a[属性],b[float],c[float],d[改变类型] - [43] = function(role, args) + [43] = function(role, args,id,judge) local pro = args[1] local f1 = args[2] local i1 = args[3] local ct = args[4] local OnSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local arr = BattleUtil.ChooseTarget(role, 40000) if arr[1] then local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, ct) @@ -853,7 +895,7 @@ local passivityList = { --发动技能后,[a]的概率[e]改变自身[b]属性[c],持续[d]秒。 --a[float],b[属性],c[float],d[int],e[改变类型] - [44] = function(role, args) + [44] = function(role, args,id,judge) local f1 = args[1] local pro = args[2] local f2 = args[3] @@ -861,6 +903,9 @@ local passivityList = { local ct = args[5] local OnSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end BattleUtil.RandomAction(f1, function () role:AddBuff(Buff.Create(role, BuffName.PropertyChange, f3, BattlePropList[pro], f2, ct)) end) @@ -945,7 +990,7 @@ local passivityList = { --发动技能后,[a]概率[e]改变敌方全体[b]属性[c],持续[d]秒 --a[float],b[属性],c[float],d[int],e[改变类型] - [49] = function(role, args) + [49] = function(role, args,id,judge) local f1 = args[1] local pro = args[2] local f2 = args[3] @@ -953,6 +998,9 @@ local passivityList = { local ct = args[5] local OnSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end BattleUtil.RandomAction(f1, function () local arr = BattleUtil.ChooseTarget(role, 20000) for i=1, #arr do @@ -1049,12 +1097,15 @@ local passivityList = { end, --造成伤害时,有[a]的概率立即造成攻击[b]%的伤害。 --a[float],b[float] - [55] = function(role, args) + [55] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] local lastTrigger = 0 - local OnDamage = function(defRole, damage, bCrit, finalDmg) + local OnDamage = function(defRole, damage, bCrit, finalDmg,aaa,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end lastTrigger = lastTrigger + 1 if lastTrigger > 1 then --加入限定避免循环触发 return @@ -1069,11 +1120,14 @@ local passivityList = { end, --造成暴击时,额外造成目标最大生命值[a]%的伤害。(目标最大生命值伤害总上限为施法者2.5倍攻击) --a[float] - [56] = function(role, args) + [56] = function(role, args,id,judge) local f1 = args[1] local lastTrigger = 0 - local OnRoleCrit = function(defRole) + local OnRoleCrit = function(defRole, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end lastTrigger = lastTrigger + 1 if lastTrigger > 1 then --加入限定避免循环触发 return @@ -1087,13 +1141,16 @@ local passivityList = { end, --发动技能时,若技能目标与自身发动的上一个技能目标相同,则增加[a]%的伤害,最多叠加[b]层。 --a[float],b[int] - [57] = function(role, args) + [57] = function(role, args,id,judge) local f1 = args[1] local i2 = args[2] local damageDic = {} local lastDamageDic = {} local OnSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end for k in pairs(damageDic) do if lastDamageDic[k] then damageDic[k] = damageDic[k] + 1 @@ -1117,7 +1174,7 @@ local passivityList = { end, --发动技能后,每个敌方角色有[a]概率获得[b],每秒造成[c]%的[d]伤害,持续[e]秒。 --a[float],b[持续伤害类型],c[float],d[伤害类型],e[int] - [58] = function(role, args) + [58] = function(role, args,id,judge) local f1 = args[1] local d1 = args[2] local f2 = args[3] @@ -1125,6 +1182,9 @@ local passivityList = { local f3 = args[5] local OnSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local arr = BattleUtil.ChooseTarget(role, 20000) for i=1, #arr do BattleUtil.RandomAction(f1, function ()-- @@ -1214,13 +1274,16 @@ local passivityList = { end, --发动技能后,有[a]的概率为自身及相邻加持[b][c]%的护盾,持续[d]秒。 --a[float],b[属性],c[float],d[int] - [62] = function(role, args) + [62] = function(role, args,id,judge) local f1 = args[1] local pro = args[2] local f2 = args[3] local f3 = args[4] local OnSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end BattleUtil.RandomAction(f1, function () local list = RoleManager.GetNeighbor(role, 1) for i=1, #list do @@ -1333,13 +1396,16 @@ local passivityList = { end, --造成暴击时,额外造成目标最大生命值[a]%的伤害。造成伤害时,有[a]的概率立即造成攻击[b]%的伤害,该伤害造成的暴击伤害不会触发额外最大生命值伤害。(效果55+效果56)(目标最大生命值伤害总上限为施法者5倍攻击) --a[float],b[float],c[float] - [69] = function(role, args) + [69] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] local f3 = args[3] local lastTrigger = 0 - local OnDamage = function(defRole, damage, bCrit, finalDmg) + local OnDamage = function(defRole, damage, bCrit, finalDmg,damageType,dotType,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end lastTrigger = lastTrigger + 1 if lastTrigger > 1 then --加入限定避免循环触发 return @@ -1360,12 +1426,15 @@ local passivityList = { end, --击杀每个敌人会永久增加[a]%的[b],持续[c]秒。(0表示永久)(不可驱散) --a[float],b[属性],c[int] - [70] = function(role, args) + [70] = function(role, args,id,judge) local f1 = args[1] local pro = args[2] local f2 = args[3] - local OnKill = function(defRole) + local OnKill = function(defRole,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local buff = Buff.Create(role, BuffName.PropertyChange, f2, BattlePropList[pro], f1, 2) buff.cover = true buff.clear = false @@ -1398,11 +1467,14 @@ local passivityList = { end, --造成的伤害暴击时,有[a]概率在计算伤害时额外计算[b]的暴击伤害。 --a[float],b[float] - [72] = function(role, args) + [72] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] - local OnPassiveCriting = function(crit) + local OnPassiveCriting = function(crit,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end BattleUtil.RandomAction(f1, function () crit(role:GetRoleData(RoleDataName.CritDamageFactor)+f2) end) @@ -1411,7 +1483,7 @@ local passivityList = { end, --释放技能时,自己损失[a]%当前生命值,为此次技能增加等量伤害。 --a[float] - [73] = function(role, args) + [73] = function(role, args,id,judge) local f1 = args[1] local hp=0 @@ -1420,6 +1492,9 @@ local passivityList = { end local OnSkillCast, OnSkillCastEnd OnSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end hp = floor(BattleUtil.FP_Mul(role:GetRoleData(RoleDataName.Hp), f1)) role.data:SubValue(RoleDataName.Hp, hp) @@ -1583,21 +1658,30 @@ local passivityList = { local f1 = args[1] local ct = args[2] local passivityDamaging = function(func, caster, damage,skill, dotType, bCrit) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --处理伏虎觉醒十星附加的额外技能,额外技能不触发这个特性 2020/11/17 wangzhenxing if skill and skill.type== BattleSkillType.Extra and skill.owner.roleId==10015 and judge==1 then return - end + end if func and skill and (skill.type == BattleSkillType.Special or skill.type == BattleSkillType.Extra) then local dd = BattleUtil.CountValue(damage, f1, ct) - damage func(-floor(BattleUtil.ErrorCorrection(dd))) end end local OnSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra then role.Event:AddEvent(BattleEventName.PassiveDamaging, passivityDamaging) end end local OnSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra then role.Event:RemoveEvent(BattleEventName.PassiveDamaging, passivityDamaging) end @@ -1608,7 +1692,7 @@ local passivityList = { -- (直接伤害(目前没有明确定义直接伤害))直接伤害击杀目标自身增加[a]点怒气 -- a[int] - [92] = function(role, args) + [92] = function(role, args,id,judge) local i1 = args[1] local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) @@ -1616,6 +1700,9 @@ local passivityList = { -- buff.cover = true -- 可以叠加 -- buff.clear = false -- 不可驱散 -- role:AddBuff(buff) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and not skill.isAdd and defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then BattleUtil.CalRage(role, role, i1, CountTypeName.Add) end @@ -1625,17 +1712,23 @@ local passivityList = { -- 技能治疗量增加[a] -- a[float] - [93] = function(role, args) + [93] = function(role, args,id,judge) local f1 = args[1] local passiveTreating = function(func, caster) if func then func(f1, CountTypeName.AddPencent) end end local OnSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:AddEvent(BattleEventName.PassiveTreating, passiveTreating) end end local OnSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:RemoveEvent(BattleEventName.PassiveTreating, passiveTreating) end @@ -1670,7 +1763,7 @@ local passivityList = { -- 普攻伤害增加[a]%[b]改变 -- a[float]b[改变类型] - [96] = function(role, args) + [96] = function(role, args,id,judge) local f1 = args[1] local ct = args[2] local passivityDamaging = function(func, caster, damage) @@ -1680,11 +1773,17 @@ local passivityList = { end end local OnSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Normal then role.Event:AddEvent(BattleEventName.PassiveDamaging, passivityDamaging) end end local OnSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Normal then role.Event:RemoveEvent(BattleEventName.PassiveDamaging, passivityDamaging) end @@ -1696,12 +1795,15 @@ local passivityList = { -- 释放技能有[a]%对全体造成[c]%[d]伤害 -- a[float]b[int]c[float]d[伤害类型] - [97] = function(role, args) + [97] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] local dt = args[3] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and skill.type == BattleSkillType.Special then BattleUtil.RandomAction(f1, function() BattleLogic.WaitForTrigger(0.1, function() @@ -1734,7 +1836,7 @@ local passivityList = { -- 技能直接伤害的[a]%治疗友方生命最少队友。 -- a[float] - [99] = function(role, args) + [99] = function(role, args,id,judge) local f1 = args[1] local allDamage = 0 @@ -1745,12 +1847,18 @@ local passivityList = { end end local function onSkillCast(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then allDamage = 0 role.Event:AddEvent(BattleEventName.RoleHit, OnHit) end end local function onSkillCastEnd(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:RemoveEvent(BattleEventName.RoleHit, OnHit) local arr = RoleManager.Query(function (r) return r.camp == role.camp and r.deadFilter end) @@ -1786,7 +1894,7 @@ local passivityList = { -- 释放技能技能[a]概率[b]改变[c]% -- a[控制状态]b[改变类型]c[float] - [101] = function(role, args) + [101] = function(role, args,id,judge) local ctl = args[1] local ct = args[2] local f1 = args[3] @@ -1797,11 +1905,17 @@ local passivityList = { end end local onSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:AddEvent(BattleEventName.PassiveRandomControl, onSkillControl) end end local onSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:RemoveEvent(BattleEventName.PassiveRandomControl, onSkillControl) end @@ -1813,10 +1927,13 @@ local passivityList = { -- 释放技能后追加[a]次普攻 -- a[int] - [102] = function(role, args) + [102] = function(role, args,id,judge) local i1 = args[1] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then for i = 1, i1 do role:AddSkill(BattleSkillType.Normal, false, true, nil) @@ -1828,12 +1945,15 @@ local passivityList = { -- 直接伤害每次击杀目标增加[a]%的[b]可叠加持续至战斗结束[c]改变 -- a[float]b[属性]c[改变类型] - [103] = function(role, args) + [103] = function(role, args,id,judge) local f1 = args[1] local pro = args[2] local ct = args[3] -- 释放技能后 - local onRoleHit = function(defRole) + local onRoleHit = function(defRole,damge,bcrit,finalDamage,damagetype,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, ct) -- buff.cover = true @@ -1847,10 +1967,13 @@ local passivityList = { -- 释放技能后给除自己外己方生命最少的武将附加无敌盾持续[b]回合(只剩自己则不加) --b[属性] - [104] = function(role, args) + [104] = function(role, args,id,judge) local i1 = args[1] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then local list = RoleManager.Query(function(v) return v.camp == role.camp end) BattleUtil.SortByHpFactor(list, 1) @@ -1873,10 +1996,13 @@ local passivityList = { -- 释放技能后增加友方全体[a]点怒气 -- a[int] - [105] = function(role, args) + [105] = function(role, args,id,judge) local i1 = args[1] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then local list = RoleManager.Query(function(v) return v.camp == role.camp end) for i = 1, #list do @@ -1912,10 +2038,13 @@ local passivityList = { -- 释放技能后自身回[a]点怒气 -- a[int] - [107] = function(role, args) + [107] = function(role, args,id,judge) local i1 = args[1] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then BattleUtil.CalRage(role, role, i1, CountTypeName.Add) end @@ -1969,10 +2098,13 @@ local passivityList = { -- 释放技能后降低目标[a]点怒气 -- a[int] - [110] = function(role, args) + [110] = function(role, args,id,judge) local i1 = args[1] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then local list = skill:GetDirectTargetsNoMiss() if list then @@ -2009,6 +2141,9 @@ local passivityList = { role.Event:RemoveEvent(BattleEventName.RoleDamageAfter, onRoleDamageAfter) end local function onRoleDamageBefore(target, factorFunc, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --处理伏虎觉醒十星附加的额外技能,额外技能不触发这个特性 2020/11/17 wangzhenxing if skill and skill.type== BattleSkillType.Extra and skill.owner.roleId==10015 and judge==1 then return @@ -2024,9 +2159,12 @@ local passivityList = { -- 追加的普攻[a]%概率暴击 -- a[float] - [113] = function(role, args) + [113] = function(role, args,id,judge) local f1 = args[1] local function onSkillCast(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Normal and skill.isAdd then role.data:AddValue(RoleDataName.Crit, f1) end @@ -2034,6 +2172,9 @@ local passivityList = { role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast) local function onSkillCastEnd(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Normal and skill.isAdd then role.data:SubValue(RoleDataName.Crit, f1) end @@ -2043,10 +2184,13 @@ local passivityList = { -- 直接伤害击杀目标后追加[a]次普攻 -- a[int] - [114] = function(role, args) + [114] = function(role, args,id,judge) local i1 = args[1] -- 释放技能后 - local onRoleHit = function(target) + local onRoleHit = function(target,damage,bcrit,finalDmg,damageType,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then for i = 1, i1 do role:AddSkill(BattleSkillType.Normal, false, true, nil) @@ -2091,10 +2235,13 @@ local passivityList = { -- 直接伤害击杀目标回复自身[a]%的[b] -- a[float] - [116] = function(role, args) + [116] = function(role, args,id,judge) local f1 = args[1] -- 释放技能后 - local onRoleHit = function(target) + local onRoleHit = function(target,damage,bCrit,finalDmg,damageType,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then local treat = floor(BattleUtil.FP_Mul(role:GetRoleData(RoleDataName.MaxHp), f1)) BattleUtil.CalTreat(role, role, treat) @@ -2105,7 +2252,7 @@ local passivityList = { -- 技能目标每[a]改变[b]个,技能伤害增加[c]%,[d]改变 -- a[改变类型]b[int]c[float]d[改变类型] - [117] = function(role, args) + [117] = function(role, args,id,judge) local ct = args[1] -- 对方阵营中死亡数量(目前没有用到) local i1 = args[2] local f1 = args[3] @@ -2115,6 +2262,9 @@ local passivityList = { -- 每次释放技能时提前计算额外加成的伤害 local extra = 0 local onSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end extra = 0 if skill and skill.type == BattleSkillType.Special then -- local roleList =RoleManager.Query(function (r) return r.camp ~= role.camp end) @@ -2134,6 +2284,9 @@ local passivityList = { -- 如果是技能的伤害则判断加成 local onPassiveDamaging = function(func, target, damage, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and skill.type == BattleSkillType.Special then local dd = BattleUtil.CountValue(damage, extra, ct2) - damage if func then func(-floor(BattleUtil.ErrorCorrection(dd))) end @@ -2146,11 +2299,14 @@ local passivityList = { -- 每次释放技能,技能伤害增加[a]%,无限叠加释放普攻时清除加成,[b]改变 -- a[float]b[改变类型] - [118] = function(role, args) + [118] = function(role, args,id,judge) local f1 = args[1] local ct = args[2] local af = 0 local onSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Normal and not skill.isAdd then af = 0 elseif skill.type == BattleSkillType.Special then @@ -2161,6 +2317,9 @@ local passivityList = { -- 如果是技能的伤害则判断加成 local onPassiveDamaging = function(func, target, damage, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and (skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra) then local dd = BattleUtil.CountValue(damage, af, ct) - damage if func then func(-floor(BattleUtil.ErrorCorrection(dd))) end @@ -2170,13 +2329,16 @@ local passivityList = { end, -- 普攻后[a]改变自身[b]%的[c]持续[d]回合可叠加 -- a[改变类型]b[float]c[属性]d[int] - [119] = function(role, args) + [119] = function(role, args,id,judge) local ct = args[1] local f1 = args[2] local pro = args[3] local i1 = args[4] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Normal then local buff = Buff.Create(role, BuffName.PropertyChange, i1, BattlePropList[pro], f1, ct) --属性buff覆盖存在问题,暂时不覆盖 @@ -2206,10 +2368,13 @@ local passivityList = { -- 普攻后回复[a]点怒气 -- a[int] - [121] = function(role, args) + [121] = function(role, args,id,judge) local i1 = args[1] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Normal then BattleUtil.CalRage(role, role, i1, CountTypeName.Add) end @@ -2220,11 +2385,14 @@ local passivityList = { -- 释放技能后给己方前排武将附加减伤盾持续时间[a]改变[b]回合 -- a[改变类型]b[int] - [122] = function(role, args) + [122] = function(role, args,id,judge) local ct = args[1] local i1 = args[2] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then local list = RoleManager.Query(function(v) return v.camp == role.camp and v.position <= 3 end) for _, role in ipairs(list) do @@ -2242,11 +2410,14 @@ local passivityList = { -- 释放技能后给己方前排附加减伤盾效果[a]改变[b]% -- a[改变类型]b[float] - [123] = function(role, args) + [123] = function(role, args,id,judge) local ct = args[1] local f1 = args[2] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then local list = RoleManager.Query(function(v) return v.camp == role.camp and v.position <= 3 end) for _, role in ipairs(list) do @@ -2263,10 +2434,13 @@ local passivityList = { -- 释放技能后回复己方后排[a]点怒气 -- a[int] - [124] = function(role, args) + [124] = function(role, args,id,judge) local i1 = args[1] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then local list = RoleManager.Query(function(v) return v.position > 3 and v.camp==role.camp end) for _, r in ipairs(list) do @@ -2279,10 +2453,13 @@ local passivityList = { -- 直接伤害击杀目标下回合攻击[a]%暴击(TODO:目前为增加[a]%) -- a[float] - [125] = function(role, args) + [125] = function(role, args,id,judge) local f1 = args[1] -- 释放技能后 - local onRoleHit = function(target) + local onRoleHit = function(target,damage,bCrit,finalDmg,damageType,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then local buff = Buff.Create(role, BuffName.PropertyChange, 1, RoleDataName.Crit, f1, CountTypeName.Add) role:AddBuff(buff) @@ -2324,10 +2501,13 @@ local passivityList = { -- 普攻后降低目标[b]点怒气 -- a[int] - [128] = function(role, args) + [128] = function(role, args,id,judge) local i1 = args[1] -- 普攻后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Normal then local list = skill:GetDirectTargetsNoMiss() if list then @@ -2394,7 +2574,7 @@ local passivityList = { -- 敌方每[a]改变[b]人自身伤害就[d]改变[e]% (敌方每死亡i1个则自身属性改变) -- a[改变类型]b[int]d[改变类型]e[float] - [131] = function(role, args) + [131] = function(role, args,id,judge) local ct1 = args[1] local i1 = args[2] local ct2 = args[3] @@ -2417,6 +2597,9 @@ local passivityList = { BattleLogic.Event:AddEvent(BattleEventName.BattleRoleDead, OnDead) local passivityDamaging = function(func, caster, damage, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill then if func then local dd = BattleUtil.CountValue(damage, extra, ct2) - damage @@ -2429,7 +2612,7 @@ local passivityList = { -- 直接伤害每次击杀目标增加自身伤害[a]%,[b]改变,可叠加持续至战斗结束 -- a[float]b[改变类型] - [132] = function(role, args) + [132] = function(role, args,id,judge) local f1 = args[1] local ct = args[2] @@ -2438,6 +2621,9 @@ local passivityList = { -- 击杀数量累加 local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then killNum = killNum + 1 end @@ -2447,6 +2633,9 @@ local passivityList = { -- 释放技能时计算额外伤害 local OnSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill then extra = f1 * killNum end @@ -2456,6 +2645,9 @@ local passivityList = { -- 造成伤害时判断额外伤害 local passivityDamaging = function(func, caster, damage, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill then if func then local dd = BattleUtil.CountValue(damage, extra, ct) - damage @@ -2471,7 +2663,7 @@ local passivityList = { -- 攻击时若目标[a]则当次攻击自身[b],[c]改变[d]% -- a[持续伤害状态]b[属性]c[改变类型]d[float} - [133] = function(role, args) + [133] = function(role, args,id,judge) local dot = args[1] local pro = args[2] local ct = args[3] @@ -2479,12 +2671,18 @@ local passivityList = { local index, tran - local OnRoleDamageBefore = function(target) + local OnRoleDamageBefore = function(target,factorFunc,damageType,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function(buff) return buff.damageType == dot end) then index, tran = role:AddPropertyTransfer(BattlePropList[pro], f1, BattlePropList[pro], ct) end end - local OnRoleDamageAfter = function() + local OnRoleDamageAfter = function(defRole,damageFunc,fixDamage,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if index and tran then role:RemovePropertyTransfer(index, tran) end @@ -2496,7 +2694,7 @@ local passivityList = { -- 释放技能技能[a]概率[b]改变[c]% -- a[持续伤害状态]b[改变类型]c[float] - [134] = function(role, args) + [134] = function(role, args,id,judge) local dot = args[1] local ct = args[2] local f1 = args[3] @@ -2507,12 +2705,18 @@ local passivityList = { end end local onSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:AddEvent(BattleEventName.PassiveRandomDot, onSkillControl) end end -- 技能后后 local onSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:RemoveEvent(BattleEventName.PassiveRandomDot, onSkillControl) end @@ -2523,13 +2727,16 @@ local passivityList = { -- 普攻有[a]%概率使目标[b]持续[c]回合(每回合造成攻击者20%攻击力的伤害) -- a[float]b[持续伤害状态]c[int] - [135] = function(role, args) + [135] = function(role, args,id,judge) local f1 = args[1] local dot = args[2] local i1 = args[3] -- 普攻后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Normal then local list = skill:GetDirectTargetsNoMiss() if list then @@ -2568,12 +2775,15 @@ local passivityList = { -- 释放技能后给目标附加治疗效果每回合回复[a]的[b]%点生命持续[c]回合 -- a[属性]b[float]c[int] - [137] = function(role, args) + [137] = function(role, args,id,judge) local pro = args[1] local f1 = args[2] local i1 = args[3] -- 技能后后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then local list = skill:GetDirectTargets() if list then @@ -2591,7 +2801,7 @@ local passivityList = { -- 释放普攻后给目标附加治疗效果每回合回复[a]的[b]%点生命持续[c]回合(额外加目标[d][e]%生命 ,d e不填不会添加) -- a[属性]b[float]c[int] d[int] e[float] - [138] = function(role, args) + [138] = function(role, args,id,judge) local pro = args[1] local f1 = args[2] local i1 = args[3] @@ -2599,6 +2809,9 @@ local passivityList = { local f2 = args[5] -- 技能后后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Normal then local list = skill:GetDirectTargetsNoMiss() if list then @@ -2620,18 +2833,24 @@ local passivityList = { -- TODO -- 释放技能后给目标附加治疗效果[a]改变[b]% -- a[改变类型]b[float] - [139] = function(role, args) + [139] = function(role, args,id,judge) local dt = args[1] local f1 = args[2] local tFactor = function(factorFunc) factorFunc(f1, dt) end role.Event:AddEvent(BattleEventName.SkillCast, function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:AddEvent(BattleEventName.PassiveTreatingFactor, tFactor) end end) role.Event:AddEvent(BattleEventName.SkillCastEnd, function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:RemoveEvent(BattleEventName.PassiveTreatingFactor, tFactor) end @@ -2680,7 +2899,7 @@ local passivityList = { -- 释放技能时如目标处于[a]状态则伤害的[b]%转化为生命治疗自己 -- a[持续伤害状态]b[float] - [142] = function(role, args) + [142] = function(role, args,id,judge) local dot = args[1] local f1 = args[2] local onHit = function(target, damage, bCrit, finalDmg,damageType,skill) @@ -2694,12 +2913,18 @@ local passivityList = { end end local onSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:AddEvent(BattleEventName.RoleHit, onHit) end end -- 技能后后 local onSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:RemoveEvent(BattleEventName.RoleHit, onHit) end @@ -2711,7 +2936,7 @@ local passivityList = { -- 释放技能时如目标处于[a]状态则[b]的概率[c]改变[d]% -- a[持续伤害状态]b[控制状态]c[改变类型]d[float] - [143] = function(role, args) + [143] = function(role, args,id,judge) local dot = args[1] local ctrl = args[2] local ct = args[3] @@ -2725,12 +2950,18 @@ local passivityList = { end end local onSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:AddEvent(BattleEventName.PassiveRandomControl, onSkillControl) end end -- 技能后后 local onSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:RemoveEvent(BattleEventName.PassiveRandomControl, onSkillControl) end @@ -2756,7 +2987,7 @@ local passivityList = { -- 技能对[a]目标[b]额外提升[c]%(当次),[d]改变 -- a[持续伤害状态]b[属性]c[float]d[改变类型] - [145] = function(role, args) + [145] = function(role, args,id,judge) local dot = args[1] local pro = args[2] local f1 = args[3] @@ -2764,12 +2995,18 @@ local passivityList = { local index, tran local OnRoleDamageBefore = function(target, factorFunc, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and skill.type == BattleSkillType.Special and BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function(buff) return buff.damageType == dot end) then index, tran = role:AddPropertyTransfer(BattlePropList[pro], f1, BattlePropList[pro], ct) end end - local OnRoleDamageAfter = function() + local OnRoleDamageAfter = function(defRole,damageFunc,fixDamage,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if index and tran then role:RemovePropertyTransfer(index, tran) end @@ -2780,7 +3017,7 @@ local passivityList = { -- 普攻对[a]目标伤害额外增加[b]%(当次),[c]改变 -- a[持续伤害状态]b[float]c[改变类型] - [146] = function(role, args) + [146] = function(role, args,id,judge) local dot = args[1] local f1 = args[2] local ct = args[3] @@ -2794,11 +3031,17 @@ local passivityList = { end end local onSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Normal then role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging) end end local onSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Normal then role.Event:RemoveEvent(BattleEventName.PassiveDamaging, onPassiveDamaging) end @@ -2832,10 +3075,13 @@ local passivityList = { end, -- 直接伤害击杀[a]目标回复[b]%的最大生命 -- a[持续伤害状态]b[float] - [148] = function(role, args) + [148] = function(role, args,id,judge) local dot = args[1] local f1 = args[2] - local function onHit(target) + local function onHit(target,damage,bCrit,finalDmg,damageType,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then local maxHp = role:GetRoleData(RoleDataName.MaxHp) local value = floor(BattleUtil.ErrorCorrection(maxHp* f1)) @@ -2843,7 +3089,10 @@ local passivityList = { end role.Event:RemoveEvent(BattleEventName.RoleHit, onHit) end - local onDamaging = function(func, target) + local onDamaging = function(func, target,damage,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function(buff) return buff.damageType == dot end) then role.Event:AddEvent(BattleEventName.RoleHit, onHit) end @@ -2854,7 +3103,7 @@ local passivityList = { -- 技能攻击的目标如本回合直接攻击过自己则对其造成伤害增加[a]%(如目标[b]则伤害增加[c]%)[d]改变 -- a[float]b[持续伤害状态]c[float]d[改变类型] - [149] = function(role, args) + [149] = function(role, args,id,judge) local f1 = args[1] local dot = args[2] local f2 = args[3] @@ -2875,6 +3124,9 @@ local passivityList = { -- 被动技能加伤害 local onDamaging = function(func, target, damage, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if attor[target.position] and skill and skill.type == BattleSkillType.Special and func then local df = f1 if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function(buff) return buff.damageType == dot end) then @@ -2890,7 +3142,7 @@ local passivityList = { -- 技能对[a]目标当次伤害提升[b]%,[c]改变 -- a[持续伤害状态]b[flaot]c[改变类型] - [150] = function(role, args) + [150] = function(role, args,id,judge) local dot = args[1] local f1 = args[2] local ct = args[3] @@ -2904,11 +3156,17 @@ local passivityList = { end end local onSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging) end end local onSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:RemoveEvent(BattleEventName.PassiveDamaging, onPassiveDamaging) end @@ -2920,12 +3178,15 @@ local passivityList = { -- 释放普通攻击如目标[a],且血量低于[b]%则有[c]%概率秒杀 -- a[持续伤害状态]b[float]c[float] - [151] = function(role, args) + [151] = function(role, args,id,judge) local dot = args[1] local f1 = args[2] local f2 = args[3] -- - local onRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) + local onRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and skill.type == BattleSkillType.Normal and not defRole:IsDead() then if BattleLogic.BuffMgr:HasBuff(defRole, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end) then local isBoss=BattleUtil.CheckIsBoss(defRole) @@ -2949,13 +3210,16 @@ local passivityList = { -- 释放技能有[a]%概率附加[b]效果持续[c]回合 -- a[float]b[控制状态]c[int] - [152] = function(role, args) + [152] = function(role, args,id,judge) local f1 = args[1] local ctrl = args[2] local i1 = args[3] -- 技能后后 local onSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then local targets = skill:GetDirectTargetsNoMiss() if targets then @@ -2974,12 +3238,14 @@ local passivityList = { local i1 = args[1] local p1 = args[2] local v1 = args[3] - local onHit = function(target, damage, bCrit, finalDmg,damageType, skill,isDirect) - --不是真实伤害 + local onHit = function(target, damage, bCrit, finalDmg,damageType, skill,isDirect) + --不是真实伤害 if not skill and not isDirect then return end - + if skill and not skill.isTriggerJudge and judge==1 then + return + end --白骨精追加普攻不触发特性 if skill and judge==1 and skill.type== BattleSkillType.Normal and skill.isAdd and skill.owner.roleId==10091 then return @@ -3071,9 +3337,12 @@ local passivityList = { -- 释放技能后回复当前本方阵容最靠前武将[a]点怒气 -- a[int] - [158] = function(role, args) + [158] = function(role, args,id,judge) local i1 = args[1] local onSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then local list = RoleManager.Query(function(v) return v.camp == role.camp end) table.sort(list, function(a, b) @@ -3135,11 +3404,14 @@ local passivityList = { -- 攻击目标时目标身上每有1种异常状态(包括麻痹、眩晕、沉默、灼烧、中毒)都会使对其造成的直接伤害提高,异常状态数量乘以[a]%。 -- a[float] - [161] = function(role, args) + [161] = function(role, args,id,judge) local f1 = args[1] --之前为根据异常效果的数量改为根据异常效果的类型 by:王振兴 - local function onPassiveDamaging(damagingFunc, target, damage) + local function onPassiveDamaging(damagingFunc, target, damage,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --local list = BattleLogic.BuffMgr:GetBuff(target, function(buff) --return buff.type == BuffName.DOT or buff.type == BuffName.Control --end) @@ -3238,7 +3510,7 @@ local passivityList = { -- 战斗中生命每减少[a]%,自身伤害就[b]改变[c]%,减少为[d]改变 -- a[float]b[改变类型]c[float]d[改变类型] - [165] = function(role, args) + [165] = function(role, args,id,judge) local f1 = args[1] local ct = args[2] local f2 = args[3] @@ -3246,6 +3518,9 @@ local passivityList = { -- 释放技能后 local onPassiveDamaging = function(damagingFunc, defRole, damage, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local levelDamage = floor(role:GetRoleData(RoleDataName.MaxHp)*f1) local lostDamage = role:GetRoleData(RoleDataName.MaxHp) - role:GetRoleData(RoleDataName.Hp) local level = floor(lostDamage/levelDamage) @@ -3259,7 +3534,7 @@ local passivityList = { -- 普通攻击时如目标处于[a]状态则伤害的[b]%转化为生命治疗自己 -- a[持续伤害状态]b[float] - [166] = function(role, args) + [166] = function(role, args,id,judge) local dot = args[1] local f1 = args[2] local onHit = function(target, damage, bCrit, finalDmg) @@ -3269,12 +3544,18 @@ local passivityList = { end end local onSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Normal then role.Event:AddEvent(BattleEventName.RoleHit, onHit) end end -- 技能后后 local onSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Normal then role.Event:RemoveEvent(BattleEventName.RoleHit, onHit) end @@ -3285,11 +3566,14 @@ local passivityList = { -- 如果目标数量大于[a]个,增加自身[b]点怒气 -- a[int]b[int] - [167] = function(role, args) + [167] = function(role, args,id,judge) local i1 = args[1] local i2 = args[2] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local targets = skill:GetDirectTargets() if targets and #targets > i1 then BattleUtil.CalRage(role, role, i2, 1) @@ -3300,10 +3584,13 @@ local passivityList = { -- 释放技能后给当前血量最少的2名队友附加无敌吸血盾持续[a]回合 -- a[int] - [168] = function(role, args) + [168] = function(role, args,id,judge) local i1 = args[1] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then local list = RoleManager.Query(function(v) return v.camp == role.camp end) --生命最少改成生命百分比最少 2020/09/29 by:王振兴 @@ -3340,11 +3627,14 @@ local passivityList = { -- 击杀目标后对敌方血量百分比最低两名角色造成[a]%[b]伤害 -- a[float]b[伤害类型] - [170] = function(role, args) + [170] = function(role, args,id,judge) local f1 = args[1] local dt = args[2] -- 直接伤害后 local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and not skill.isAdd and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then local list = RoleManager.Query(function(v) return v.camp ~= role.camp end) BattleUtil.SortByHpFactor(list, 1) @@ -3362,13 +3652,16 @@ local passivityList = { -- 攻击目标越少[a]对每个目标提升概率越高,提升概率为[b]%除以被击者的总数,提升为[c]改变 -- a[控制状态]b[float]c[改变类型] - [172] = function(role, args) + [172] = function(role, args,id,judge) local ctrl = args[1] local f1 = args[2] local ct = args[3] local af = 0 local onSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local maxNum = skill:GetMaxTargetNum() if maxNum and maxNum > 0 then af = BattleUtil.ErrorCorrection(f1/maxNum) @@ -3409,7 +3702,7 @@ local passivityList = { -- 释放技能时,对己方生命最少武将治疗效果额外提升[a],[b]改变 -- a[float]b[改变类型] - [175] = function(role, args) + [175] = function(role, args,id,judge) local f1 = args[1] local ct = args[2] @@ -3422,11 +3715,17 @@ local passivityList = { end local function onSkillCast(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:AddEvent(BattleEventName.PassiveTreatingFactor, onPassiveTreatingFactor) end end local function onSkillCastEnd(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then role.Event:RemoveEvent(BattleEventName.PassiveTreatingFactor, onPassiveTreatingFactor) end @@ -3461,7 +3760,7 @@ local passivityList = { -- 技能治疗效果提升[a]%, 同时为每个技能目标附加减伤盾,减伤效果[b]%,持续[c]回合 -- a[float]b[float]c[int] - [177] = function(role, args) + [177] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] local i1 = args[3] @@ -3471,11 +3770,17 @@ local passivityList = { end local function onSkillCast(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.DeadSkill then role.Event:AddEvent(BattleEventName.PassiveTreatingFactor, onPassiveTreatingFactor) end end local function onSkillCastEnd(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.DeadSkill then role.Event:RemoveEvent(BattleEventName.PassiveTreatingFactor, onPassiveTreatingFactor) -- 对每个目标附加减伤盾 @@ -3492,13 +3797,16 @@ local passivityList = { -- 攻击目标越少[a]对每个目标提升概率越高,提升率等于[b]%除以被攻击者的总数,[c]改变 -- a[持续伤害状态]b[float]c[改变类型] - [178] = function(role, args) + [178] = function(role, args,id,judge) local dot = args[1] local f1 = args[2] local ct = args[3] local af = 0 local onSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local maxNum = skill:GetMaxTargetNum() if maxNum and maxNum > 0 then af = BattleUtil.ErrorCorrection(f1/maxNum) @@ -3516,11 +3824,14 @@ local passivityList = { -- 对别人造成的中毒伤害的[a]%用于治疗自己 -- a[float] - [179] = function(role, args) + [179] = function(role, args,id,judge) local f1 = args[1] local dot = DotType.Poison local onRoleDamage = function(defRole, damage, bCrit, finalDmg, damageType, dotType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if dotType == dot then BattleUtil.ApplyTreat(role, role, floor(BattleUtil.ErrorCorrection(finalDmg * f1))) end @@ -3547,10 +3858,13 @@ local passivityList = { -- 攻击单体目标时额外降低目标[a]点怒气 -- a[int] - [181] = function(role, args) + [181] = function(role, args,id,judge) local i1 = args[1] local function onSkillCastEnd(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end -- 对每个目标附加减伤盾 local targets = skill:GetDirectTargetsNoMiss() if targets and #targets == 1 then @@ -3563,13 +3877,16 @@ local passivityList = { -- 攻击目标越少[a]对每个目标的伤害越高,伤害提升量等于[b]%除以由于自身攻击受到该效果的敌人的总数,[c]改变 -- a[持续伤害状态]b[float]c[改变类型] - [182] = function(role, args) + [182] = function(role, args,id,judge) local dot = args[1] local f1 = args[2] local ct = args[3] local af = 0 local onSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local maxNum = skill:GetMaxTargetNum() if maxNum and maxNum > 0 then af = BattleUtil.ErrorCorrection(f1/maxNum) @@ -3613,10 +3930,13 @@ local passivityList = { end, -- 直接伤害击杀目标对仇恨目标造成[a]%物理伤害 -- a[float] - [185] = function(role, args) + [185] = function(role, args,id,judge) local f1 = args[1] - local onRoleHit = function(target) + local onRoleHit = function(target,damage,bCrit,finalDmg,damageType,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then local target = RoleManager.GetAliveAggro(role) BattleUtil.CalDamage(nil, role, target, 1, f1) @@ -3649,10 +3969,13 @@ local passivityList = { -- 攻击纵排目标时额外降低目标[a]点怒气 -- a[int] - [186] = function(role, args) + [186] = function(role, args,id,judge) local i1 = args[1] local onSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local effectGroup = skill.effectCaster.effectList[1] local chooseId = effectGroup.chooseId local chooseLimit = floor(chooseId / 10000) % 10 @@ -3670,9 +3993,12 @@ local passivityList = { -- 普攻[a]%概率暴击 -- a[float] - [187] = function(role, args) + [187] = function(role, args,id,judge) local f1 = args[1] local function onSkillCast(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Normal then role.data:AddValue(RoleDataName.Crit, f1) end @@ -3680,6 +4006,9 @@ local passivityList = { role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast) local function onSkillCastEnd(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Normal then role.data:SubValue(RoleDataName.Crit, f1) end @@ -3771,10 +4100,13 @@ local passivityList = { -- 所有攻击优先攻击敌方[a]最少的单位 -- a[属性] - [190] = function(role, args) + [190] = function(role, args,id,judge) local pro = args[1] - local function onSkillTargetCheck(func) + local function onSkillTargetCheck(func,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local list = RoleManager.Query(function(r) return r.camp == (role.camp + 1) % 2 end) @@ -3788,10 +4120,13 @@ local passivityList = { -- 技能直接伤害[a]%转化为生命治疗自己 -- a[float] - [191] = function(role, args) + [191] = function(role, args,id,judge) local f1 = args[1] local onHit = function(target, damage, bCrit, finalDmg, dtype, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and skill.type == BattleSkillType.Special then -- 检测技能伤害治疗加成 local f = BattleUtil.CheckSkillDamageHeal(f1, role, target) @@ -3859,10 +4194,13 @@ local passivityList = { -- 攻击有概率清除敌方武将无敌盾和无敌吸血盾,攻击目标越少,清除概率越高,对每个受击者清除概率等于[a]%除以受击者的总数 -- a[float] - [194] = function(role, args) + [194] = function(role, args,id,judge) local f1 = args[1] local OnRoleDamageBefore = function(defRole, factorFunc, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill then -- 计算概率 local cf = f1 @@ -3936,7 +4274,10 @@ local passivityList = { [196] = function(role, args,id,judge) local f1 = args[1] local type = args[2] - local onDamageBeShare = function(func,skill) + local onDamageBeShare = function(func,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --普攻不会被降低分摊 2020/11/17 wangzhenxing lihaiyang if type==1 and skill and skill.type~=BattleSkillType.Normal then return @@ -3955,9 +4296,12 @@ local passivityList = { -- 技能直接击杀敌方目标时有[a]%概率获得目标剩余所有怒气(输出武将佩戴) -- a[float] - [197] = function(role, args) + [197] = function(role, args,id,judge) local f1 = args[1] local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and (skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra) and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then BattleUtil.RandomAction(f1, function() BattleUtil.CalRage(role, role, target.Rage, CountTypeName.Add) @@ -4079,7 +4423,7 @@ local passivityList = { -- 秒杀概率增加[a]%直接伤害击杀的[b]目标有[c]%概率无法复活触发秒杀的目标[d]%无法复活,秒杀概率[e]改变 -- a[float]b[持续伤害状态]c[float]d[float]e[改变类型] - [202] = function(role, args) + [202] = function(role, args,id,judge) local f1 = args[1] local dot = args[2] local f2 = args[3] @@ -4093,7 +4437,10 @@ local passivityList = { role.Event:AddEvent(BattleEventName.PassiveSeckill, onPassiveSeckill) -- 直接伤害概率无法复活 - local function onRoleHit(target) + local function onRoleHit(target,damage,bCrit,finalDmg,damageType,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if target:IsDead() then if not BattleLogic.BuffMgr:HasBuff(role, BuffName.DOT, function (buff) return buff.damageType == dot or dot == 0 end) then BattleUtil.RandomAction(f2, function() @@ -4156,10 +4503,13 @@ local passivityList = { -- 伤害增加[a]%,[b]改变 -- a[float]b[改变类型] - [205] = function(role, args) + [205] = function(role, args,id,judge) local f1 = args[1] local ct = args[2] local passivityDamaging = function(func, caster, damage, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and func then local dd = BattleUtil.CountValue(damage, f1, ct) - damage func(-floor(BattleUtil.ErrorCorrection(dd))) @@ -4170,12 +4520,15 @@ local passivityList = { --技能治疗系数[a]改变[b]% ,技能目标改变[c] [d]名(作用于主动技能效果103) --a[改变类型]b[float] c[改变类型] d[int] - [206] = function(role, args) + [206] = function(role, args,id,judge) local ct = args[1] local f1 = args[2] local ct2 = args[3] local f2 = args[4] local onSkillEffectBefore = function(skill, e, func) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then if e.type == 103 then -- 当前只对技能效果103生效 local factor = BattleUtil.ErrorCorrection(BattleUtil.CountValue(e.args[3], f1, ct)) @@ -4192,13 +4545,16 @@ local passivityList = { -- 释放技能有[a]%几率对敌方后排造成[b]%[c]伤害 -- a[float]b[float]c[伤害类型] - [207] = function(role, args) + [207] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] local dt = args[3] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then BattleUtil.RandomAction(f1, function() BattleLogic.WaitForTrigger(0.1, function() @@ -4331,7 +4687,7 @@ local passivityList = { -- 同阵营只会有一个生效 -- 第[a]回合中,敌人受到的任何伤害会对其他敌人造成该伤害[b]%的伤害 -- a[float],b[float] - [214] = function(role, args) + [214] = function(role, args,id,judge) if PassiveManager.passiveCountList[role.camp][214] and PassiveManager.passiveCountList[role.camp][214] > 0 then return end @@ -4341,6 +4697,9 @@ local passivityList = { local f1 = args[2] local function OnDamage(func, atkRole, defRole, damage, skill, dotType, bCrit, damageType) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if defRole.camp ~= role.camp then if skill or dotType then local list = RoleManager.Query(function(r) return r.camp == defRole.camp and r ~= defRole end) @@ -4479,7 +4838,7 @@ local passivityList = { -- 敌方首次释放技能时,自身获得[a]*[b]的护盾,持续[c]回合 -- a[属性],b[float],c[int] - [219] = function(role, args) + [219] = function(role, args,id,judge) local pro = args[1] local f1 = args[2] local i1 = args[3] @@ -4521,14 +4880,17 @@ local passivityList = { -- 我方武将造成伤害时,[a]概率降低目标[b]%的[c]。若同时拥有效果222,则降低的属性加给伤害者。 -- a[float],b[float],c[属性] - [221] = function(role, args) + [221] = function(role, args,id,judge) local rand = args[1] local f1 = args[2] local pro = args[3] role:AddBuff(Buff.Create(role, BuffName.Brand, 0, "YUAN")) -- 鸳 -- - local function _OnRoleHit(target) + local function _OnRoleHit(target,damage,bCrit,finalDmg,damageType,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end BattleUtil.RandomAction(rand, function() local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, CountTypeName.Sub) buff.cover = true @@ -4552,14 +4914,17 @@ local passivityList = { -- 我方武将造成伤害时,[a]概率降低目标[b]%的[c]。若同时拥有效果221,则降低的属性加给伤害者。 -- a[float],b[float],c[属性] - [222] = function(role, args) + [222] = function(role, args,id,judge) local rand = args[1] local f1 = args[2] local pro = args[3] role:AddBuff(Buff.Create(role, BuffName.Brand, 0, "YANG")) -- 鸯 -- - local function _OnRoleHit(target) + local function _OnRoleHit(target,damage,bCrit,finalDmg,damageType,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end BattleUtil.RandomAction(rand, function() local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, CountTypeName.Sub) buff.cover = true @@ -4586,13 +4951,16 @@ local passivityList = { -- 普攻时,[a]概率附加[b]效果,每回合造成攻击[c]%的伤害,持续[d]秒。 -- a[float],b[持续伤害效果],c[float],d[int] - [223] = function(role, args) + [223] = function(role, args,di,judge) local rand = args[1] local dot = args[2] local f1 = args[3] local i1 = args[3] local function _OnRoleHit(target, damage, _, finalDmg, _, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end -- BattleUtil.RandomDot(rand, dot, role, target, i1, 1, ) if skill and skill.type == BattleSkillType.Normal then BattleUtil.RandomAction(rand, function() @@ -4605,11 +4973,14 @@ local passivityList = { -- 我方武将造成伤害时,[a]概率附加攻击[b]%的真伤。 -- a[float],b[float] - [224] = function(role, args) + [224] = function(role, args,id,judge) local rand = args[1] local f1 = args[2] - local function _OnRoleHit(target) + local function _OnRoleHit(target,damage,bCrit,finalDmg,damageType,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end BattleUtil.RandomAction(rand, function() -- local dd = floor(BattleUtil.ErrorCorrection(role:GetRoleData(RoleDataName.Attack)*f1)) BattleUtil.CalDamage(nil, role, target, 1, f1, 1) @@ -4635,10 +5006,13 @@ local passivityList = { -- 斩杀生命低于[a]的敌人 -- a[float] - [226] = function(role, args) + [226] = function(role, args,id,judge) local f1 = args[1] -- local onRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local isBoss=BattleUtil.CheckIsBoss(defRole) if isBoss then return @@ -4659,12 +5033,15 @@ local passivityList = { -- 杀敌回复自身[a]*[b]的血量 -- a[属性],b[float] - [227] = function(role, args) + [227] = function(role, args,id,judge) local pro = args[1] local f1 = args[2] -- 杀敌回血 local onRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and defRole:IsDead() then -- 回血 local dd = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[pro])*f1)) @@ -4676,10 +5053,13 @@ local passivityList = { -- 敌人生命越高,造成的伤害越高,最高[a]% -- a[float] - [228] = function(role, args) + [228] = function(role, args,id,judge) local f1 = args[1] - local OnPassiveDamaging = function(damagingFunc, target, damage) + local OnPassiveDamaging = function(damagingFunc, target, damage,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end damagingFunc(-floor(BattleUtil.FP_Mul(f1, damage, BattleUtil.GetHPPencent(target)))) end role.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging) @@ -4687,10 +5067,13 @@ local passivityList = { -- 自己血量越低,造成伤害越高,最多[a]% -- a[float] - [229] = function(role, args) + [229] = function(role, args,id,judge) local f1 = args[1] - local OnPassiveDamaging = function(damagingFunc, target, damage) + local OnPassiveDamaging = function(damagingFunc, target, damage,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end damagingFunc(-floor(BattleUtil.FP_Mul(f1, damage, 1 - BattleUtil.GetHPPencent(role)))) end role.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging) @@ -4916,12 +5299,15 @@ local passivityList = { end, -- 释放技能有[a]%概率释放[b]技能。 -- a[float]b[int] - [242] = function(role, args) + [242] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] local f3=args[3] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and skill.type == BattleSkillType.Special then BattleUtil.RandomAction(f1, function() role:InsertExtraSkill(f2,f3) @@ -4932,10 +5318,13 @@ local passivityList = { end, -- 直接伤害击杀目标释放[a]技能。 -- a[float] - [243] = function(role, args) + [243] = function(role, args,id,judge) local f1 = args[1] local f2=args[2] - local onRoleHit = function(target) + local onRoleHit = function(target,damage,bCrit,finalDmg,damageType,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) and not role:IsDead() then -- local target = RoleManager.GetAliveAggro(role) --BattleUtil.CalDamage(nil, role, target, 1, f1) @@ -4953,9 +5342,12 @@ local passivityList = { end, -- (直接伤害(目前没有明确定义直接伤害))直接伤害击杀目标自身增加[a]点怒气 重写92被动效果 每次释放技能只触发一次 -- a[int] - [245] = function(role, args,id) + [245] = function(role, args,id,judge) local i1 = args[1] local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -4982,6 +5374,9 @@ local passivityList = { --不是真实伤害 if not skill and not isDirect then return + end + if skill and not skill.isTriggerJudge and judge==1 then + return end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then @@ -5006,10 +5401,13 @@ local passivityList = { end, -- 直接伤害击杀目标后追加[a]次普攻 重写114 一次技能只触发一次被动 -- a[int] - [247] = function(role, args,id) + [247] = function(role, args,id,judge) local i1 = args[1] -- 释放技能后 local onRoleHit = function(target,damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -5029,10 +5427,13 @@ local passivityList = { -- 直接伤害击杀目标回复自身[a]%的[b] 重写116 一次技能只触发一次被动 -- a[float] - [248] = function(role, args,id) + [248] = function(role, args,id,judge) local f1 = args[1] -- 释放技能后 local onRoleHit = function(target,damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -5051,10 +5452,13 @@ local passivityList = { -- 直接伤害击杀目标下回合攻击[a]%暴击(TODO:目前为增加[a]%) 重写125 一次技能只触发一次被动 -- a[float] - [249] = function(role, args,id) + [249] = function(role, args,id,judge) local f1 = args[1] -- 释放技能后 local onRoleHit = function(target,damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -5073,7 +5477,7 @@ local passivityList = { -- 直接伤害每次击杀目标增加自身伤害[a]%,[b]改变,可叠加持续至战斗结束 重写132 一次技能只触发一次被动 -- a[float]b[改变类型] - [250] = function(role, args,id) + [250] = function(role, args,id,judge) local f1 = args[1] local ct = args[2] @@ -5082,6 +5486,9 @@ local passivityList = { -- 击杀数量累加 local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -5098,6 +5505,9 @@ local passivityList = { -- 释放技能时计算额外伤害 local OnSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill then extra = f1 * killNum end @@ -5107,6 +5517,9 @@ local passivityList = { -- 造成伤害时判断额外伤害 local passivityDamaging = function(func, caster, damage, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill then if func then local dd = BattleUtil.CountValue(damage, extra, ct) - damage @@ -5119,10 +5532,13 @@ local passivityList = { -- 直接伤害击杀[a]目标回复[b]%的最大生命 重写148 一次技能只触发一次被动 -- a[持续伤害状态]b[float] - [251] = function(role, args,id) + [251] = function(role, args,id,judge) local dot = args[1] local f1 = args[2] local function onHit(target, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -5148,9 +5564,12 @@ local passivityList = { -- 直接伤害击杀目标回复自身[a]点怒气 重写153 一次技能只触发一次被动 -- a[int] - [252] = function(role, args,id) + [252] = function(role, args,id,judge) local i1 = args[1] local onHit = function(target, damage, bCrit, finalDmg,damageType,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -5168,13 +5587,16 @@ local passivityList = { -- 击杀目标后对敌方血量百分比最低两名角色造成[a]%[b]伤害 重写170 一次技能只触发一次被动 -- a[float]b[伤害类型] - [253] = function(role, args,id) + [253] = function(role, args,id,judge) local f1 = args[1] local dt = args[2] -- 直接伤害后 local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --如果是技能并且这个被动已经被触发����� return - if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then + if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return end if skill and not skill.isAdd and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then @@ -5198,9 +5620,12 @@ local passivityList = { -- 直接伤害击杀目标对仇恨目标造成[a]%物理伤害 重写185 一次技能只触发一次被动 -- a[float] - [254] = function(role, args,id) + [254] = function(role, args,id,judge) local f1 = args[1] local onRoleHit = function(target,damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -5219,9 +5644,12 @@ local passivityList = { -- 技能直接击杀敌方目标时有[a]%概率获得目标剩余所有怒气(输出武将佩戴)重写197 一次技能只触发一次被动 -- a[float] - [255] = function(role, args,id) + [255] = function(role, args,id,judge) local f1 = args[1] local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -5245,6 +5673,9 @@ local passivityList = { local f1 = args[1] local f2=args[2] local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -5274,12 +5705,15 @@ local passivityList = { end, --技能击杀目标溢出伤害的[a]%将对生命百分比最高的攻击目标造成伤害 -- a[float] - [257]=function(role,args) + [257]=function(role,args,id,judge) local f1 = args[1] local dt = args[2] local point=nil -- 直接伤害后 local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and skill.owner==role and (skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra) and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then local dmg= floor(BattleUtil.ErrorCorrection((damage-finalDmg)*f1)) local list = RoleManager.Query(function(v) return v.camp ~= role.camp end) @@ -5299,11 +5733,14 @@ local passivityList = { end, --技能追加的普攻额外造成目标[a][b]%的伤害。 --a[int 属性id] b[float] - [258]=function(role,args) + [258]=function(role,args,id,judge) local f1 = args[1] local dt = args[2] -- 直接伤害后 local onPassiveDamaging = function(func, defRole, damage,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and skill.type == BattleSkillType.Normal and skill.isAdd and skill.owner==role then --如果是boss 并且额外伤害是根据最大生命则返回 if (f1==12 or f1==13) and BattleUtil.CheckIsBoss(defRole) then @@ -5319,10 +5756,13 @@ local passivityList = { end, -- 释放技能[a][b]%概率命中(必定命中舔100%或200%) -- a[int], b[float] - [259] = function(role, args) + [259] = function(role, args,id,judge) local pro = args[1] local f1 = args[2] local function onSkillCast(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type ~= BattleSkillType.Normal then role.data:AddValue(BattlePropList[pro], f1) end @@ -5330,6 +5770,9 @@ local passivityList = { role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast) local function onSkillCastEnd(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type ~= BattleSkillType.Normal then role.data:SubValue(BattlePropList[pro], f1) end @@ -5338,11 +5781,14 @@ local passivityList = { end, --释放技能时,如果目标怒气不足[a]点,技能伤害额外[b] [c]% -- a[int,怒气值]b[改变类型]c[float] - [260]=function(role,args) + [260]=function(role,args,id,judge) local anger = args[1] local type = args[2] local v1 = args[3] local onPassiveDamaging = function(func, defRole, damage,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --怒气小于规定值 if defRole.Rage>=anger then return @@ -5356,13 +5802,16 @@ local passivityList = { end, --本次技能中如果有[a]目标,额外回复[b]点怒气 -- a[持续伤害状态]b[int] - [261]=function(role,args) + [261]=function(role,args,id,judge) local dot=args[1] local i1 = args[2]--defRole, damage, bCrit, finalDmg, damageType, skill local OnRoleHit = function(skill) -- if skill and skill.owner==role and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) and role.camp~=defRole.camp and defRole and BattleLogic.BuffMgr:HasBuff(defRole, BuffName.DOT, function(buff) return buff.damageType == dot end) then -- role:AddRage(i1, CountTypeName.Add) --end + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and skill.owner==role and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) and skill then local list=skill:GetDirectTargetsNoMiss() if not list then @@ -5384,7 +5833,7 @@ local passivityList = { end, -- 每释放[a]次技能,[b]增加[c]%,可叠加[d]次(d 填0为可叠加无数次) -- a[int] b[int] c[float] d[int] - [262] = function(role, args) + [262] = function(role, args,id,judge) local num = args[1] local pro = args[2] local val = args[3] @@ -5393,6 +5842,9 @@ local passivityList = { local addNum=0 -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and skill.owner==role and (skill.type == BattleSkillType.Special or skill.type == BattleSkillType.Extra ) then releaseNum=releaseNum+1 --如果能被限制次数整除 and 小于最大叠加次数 @@ -5408,10 +5860,13 @@ local passivityList = { end, --第[a]回合技能命中前有[b]%概率清除对方目标的免疫控制效果(所有控制效果)的护盾(表现上为护盾,清除护盾为直接清除效果) --a[int] b[float] - [263]=function(role,args) + [263]=function(role,args,id,judge) local round=args[1] local pro=args[2] local onRoleDamageBefore=function(defRole, factorFunc, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --判断是否是规定回合 if BattleLogic.GetCurRound() ~= round then return @@ -5428,10 +5883,13 @@ local passivityList = { end, --释放技能时,如果目标怒气大于[a]点,额外降低目标[b]点怒气 --a[int] b[int] - [264]= function(role,args) + [264]= function(role,args,id,judge) local v1 = args[1] local v2 = args[2] local onFinalBeDamage = function(damagingFunc, defRole, damage, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if defRole.Rage<=v1 then return end @@ -5470,10 +5928,13 @@ local passivityList = { end, --攻击时伤害增加(我方每个存活的其他[a]元素武将伤害增加[b]%) --a[int] b[float] - [266] = function(role,args) + [266] = function(role,args,id,judge) local ele=args[1] local v1=args[2] local passiveBeBeDamage=function(damagingFunc, defRole, damage, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if not skill then return end @@ -5496,11 +5957,14 @@ local passivityList = { end, --技能击中受到[a,控制效果]的目标,会额外降低[b]点怒气 -- a[int 控制效果]b[int] - [267]=function(role,args) + [267]=function(role,args,id,judge) local dot=args[1] local i1 = args[2] --defRole, damage, bCrit, finalDmg, damageType, skill - local OnRoleHit = function(skill) + local OnRoleHit = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) and skill.owner==role then local list=skill:GetDirectTargetsNoMiss() if not list then @@ -5519,11 +5983,14 @@ local passivityList = { end, --概率额外 [a]敌方血量最少的目标(己方每个上阵的其他妖阵营神将可提供姑获鸟眩晕总概率的[b])。持续[c]回合 -- a[控制状态] b[float] c[int] - [268] = function(role,args) + [268] = function(role,args,id,judge) local con=args[1] local pro2=args[2] local time=args[3] local onSkillCast=function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and skill.owner==role and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) then local heros=RoleManager.GetRoleByCamp(role.camp) local num=0 @@ -5552,7 +6019,7 @@ local passivityList = { end, --受到[a]目标攻击时,自身免疫[b]和[c]效果 --a[int 持续伤害类型] b,c[int 持续伤害类型] - [269] = function(role,args) + [269] = function(role,args,id,judge) local sta1=args[1] local sta2=args[2] local sta3=args[3] @@ -5594,9 +6061,12 @@ local passivityList = { -- 技能直接伤害[a]%转化为生命治疗自己 -- a[float] - [270] = function(role, args) + [270] = function(role, args,id,judge) local f1 = args[1] local function onRoleHit(defRole, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and skill.type == BattleSkillType.Special then local treatValue = floor(damage * f1) BattleUtil.ApplyTreat(role, role, treatValue) @@ -5643,7 +6113,7 @@ local passivityList = { end, -- 释放技能时如目标处于[a]状态,解除周围[c]系神将的控制状态 -- a[持续伤害状态]b[float] c[int] - [273] = function(role, args) + [273] = function(role, args,id,judge) local dot = args[1] local f1 = args[2] local ele =args[3] @@ -5667,12 +6137,18 @@ local passivityList = { end end local onSkillCast = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special or skill.type == BattleSkillType.Extra then role.Event:AddEvent(BattleEventName.RoleHit, onHit) end end -- 技能后后 local onSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special or skill.type == BattleSkillType.Extra then role.Event:RemoveEvent(BattleEventName.RoleHit, onHit) end @@ -5730,7 +6206,7 @@ local passivityList = { -- 释放技能后[a]方 [b]最高[c]阵营 友方改变[d][e]点怒气 -- a[int,敌我方] 0:我方 1:敌方,b[int 属性类型], c[int 阵营id], d[int 改变类型], e[int] - [275] = function(role, args) + [275] = function(role, args,id,judge) local camp = args[1] local pro=args[2] local ele=args[3] @@ -5738,6 +6214,9 @@ local passivityList = { local num=args[5] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra then local list=nil if camp==0 then @@ -5759,12 +6238,15 @@ local passivityList = { -- 释放技能后 生命百分比最少[a]名[b]阵营,附加免疫控制效果,持续[c]回合 -- a[int],b[int 阵营id],c[int] - [276] = function(role, args) + [276] = function(role, args,id,judge) local num = args[1] local ele=args[2] local round=args[3] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra then local list= RoleManager.NoOrder(function(v) return v.camp == role.camp and v.element==ele end,true) if not list or #list ==0 then @@ -5785,7 +6267,7 @@ local passivityList = { end, -- 减伤改为[a] 持续回合改为[b](技能效果104专属被动) -- a[float]b[int] - [277] = function(role, args) + [277] = function(role, args,id,judge) local dot = args[1] local round=args[2] local onSkillEffectBefore = function(skill, e, func) @@ -5814,7 +6296,7 @@ local passivityList = { end, --发动技能后,[a]概率给我方[b]最高[c]名[d]阵营 [e]属性[f]改变[g],持续[h]回合 --a[float],b[int 属性],c[int], d[int],e[int 属性],f[int 改变类型],g[float] h[int] - [279] = function(role, args) + [279] = function(role, args,id,judge) local p1=args[1] local p2=args[2] local num=args[3] @@ -5825,6 +6307,9 @@ local passivityList = { local r1=args[8] local OnSkillCastEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) then BattleUtil.RandomAction(p1, function () local list= RoleManager.Query(function(v) return v.camp == role.camp and v.element==ele and not v:IsDead() end) @@ -5908,12 +6393,15 @@ local passivityList = { end, --释放技能后,额外[a]改变[b]方怒气最少的[c]阵营目标[d]点怒气 --a[int 改变类型],b[int 0:己方 1:敌方],c[int],d[int] - [283]=function(role,args) + [283]=function(role,args,id,judge) local ct=args[1] local camp=args[2] local ele=args[3] local v1=args[4] local onSkillCastEnd=function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and skill.type== BattleSkillType.Special then local list=nil if camp==0 then @@ -5959,7 +6447,7 @@ local passivityList = { --技能追加的普攻额外造成目标[a][b]%的伤害。技能每成功[c]1个目标,额外造成[d]%生命上限的伤害 --a[int 属性id] b[float] c[控制状态] d[flaot] - [285]=function(role,args) + [285]=function(role,args,id,judge) local f1 = args[1] local dt = args[2] local ctrl = args[3] @@ -5968,6 +6456,9 @@ local passivityList = { local num=0 -- 直接伤害后 local onPassiveDamaging = function(func, defRole, damage,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --如果是boss 并且额外伤害是根据最大生命则返回 local isBoss=BattleUtil.CheckIsBoss(defRole) if isBoss and f1==12 then @@ -5983,7 +6474,10 @@ local passivityList = { end role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging) --记录技能混乱敌人的数量 - local OnRoleHit = function(skill) + local OnRoleHit = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and skill.owner==role and skill.type==BattleSkillType.Special then local list=skill:GetDirectTargetsNoMiss() if not list then @@ -6025,7 +6519,9 @@ local passivityList = { local f1 = args[1] local OnDamage = function(defRole, damage, bCrit, finalDmg,damageType,skill) - + if skill and not skill.isTriggerJudge and judge==1 then + return + end --白骨精追加普攻不处罚特性 if skill and judge==1 and skill.type== BattleSkillType.Normal and skill.isAdd and skill.owner.roleId==10091 then return @@ -6037,13 +6533,15 @@ local passivityList = { --本次技能中如果有[a]目标,额外回复[b]点怒气 回复[c] [d]血量(c,d不填则不回复血量) -- a[控制状态]b[int] c[int,属性id] d[flaot] - [290]=function(role,args) + [290]=function(role,args,id,judge) local dot=args[1] local i1 = args[2] local p1 = args[3] local v1 = args[4] local OnRoleHit = function(skill) - + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and skill.owner==role and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) then local list=skill:GetDirectTargetsNoMiss() if not list then @@ -6080,6 +6578,9 @@ local passivityList = { local f1 = args[2] local f2=args[3] local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -6109,6 +6610,9 @@ local passivityList = { local ct3 = args[5] local f3 = args[6] local onSkillEffectBefore = function(skill, e, func) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill.type == BattleSkillType.Special then if e.type == 120 then -- 当前只对技能效果103生效 local factor = BattleUtil.ErrorCorrection(BattleUtil.CountValue(e.args[8], f1, ct)) @@ -6137,6 +6641,9 @@ local passivityList = { if not skill then return end + if skill and not skill.isTriggerJudge and judge==1 then + return + end BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function () --延迟一帧移除事件,防止触发帧和结束帧为同一帧时,被动未移除 local list=skill:GetDirectTargetsNoMiss() for _, role1 in ipairs(list) do @@ -6191,6 +6698,9 @@ local passivityList = { local aa=0 local onSkillCast=function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end if skill and judge==1 and skill.isAdd and not skill.isTriggerJudge then return end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index 1965278410..2e7981c913 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -472,8 +472,8 @@ function BattleUtil.Seckill(skill, atkRole, defRole) if finalDmg >= 0 then if defRole:GetRoleData(RoleDataName.Hp) <= 0 and not defRole:IsDead() then defRole:SetDead() - defRole.Event:DispatchEvent(BattleEventName.RoleDead, atkRole) - atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole) + defRole.Event:DispatchEvent(BattleEventName.RoleDead, atkRole,skill) + atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole,skill) BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoleDead, defRole, atkRole) atkRole.Event:DispatchEvent(BattleEventName.Seckill, defRole) @@ -505,7 +505,7 @@ function BattleUtil.SeckillHP(skill, atkRole, defRole, pro) if defRole:GetRoleData(RoleDataName.Hp) <= 0 and not defRole:IsDead() then defRole:SetDead() defRole.Event:DispatchEvent(BattleEventName.RoleDead, atkRole) - atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole) + atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole,skill) BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoleDead, defRole, atkRole) atkRole.Event:DispatchEvent(BattleEventName.Seckill, defRole) @@ -637,7 +637,7 @@ function BattleUtil.FinalDamage(skill, atkRole, defRole, damage, bCrit, damageTy if defRole:GetRoleData(RoleDataName.Hp) <= 0 and not defRole:IsDead() then defRole:SetDead() defRole.Event:DispatchEvent(BattleEventName.RoleDead, atkRole) - atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole) + atkRole.Event:DispatchEvent(BattleEventName.RoleKill, defRole,skill) BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoleDead, defRole, atkRole,skill) end @@ -754,7 +754,7 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i --加入被动效果 触发暴击被动 local critFunc = function(critEx) critDamageFactor = critEx end - atkRole.Event:DispatchEvent(BattleEventName.PassiveCriting, critFunc) + atkRole.Event:DispatchEvent(BattleEventName.PassiveCriting, critFunc,skill) end -- 公式伤害 = 基础伤害 * 基础伤害系数 * 增伤系数 * 爆伤系数 @@ -762,7 +762,7 @@ function BattleUtil.CalDamage(skill, atkRole, defRole, damageType, baseFactor, i -- 公式计算完成 local damageFunc = function(damage) fixDamage = damage end - atkRole.Event:DispatchEvent(BattleEventName.RoleDamageAfter, defRole, damageFunc, fixDamage) + atkRole.Event:DispatchEvent(BattleEventName.RoleDamageAfter, defRole, damageFunc, fixDamage,skill) defRole.Event:DispatchEvent(BattleEventName.RoleBeDamagedAfter, atkRole, damageFunc, fixDamage) fixDamage = max(floor(attack * 0.1), fixDamage) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua index fbc310bcc7..46920b10e8 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua @@ -366,7 +366,7 @@ function RoleLogic:AddSkill(type, isRage, isAdd, targets) type=BattleSkillType.ChaosNormal --混乱普攻使用普攻特效 effectData={self.skill[1],self.skill[2],self.skill[3],self.skill[4],{100001,{1,1,1}}} - --isTriggerJudge=false + isTriggerJudge=false end SkillManager.AddSkill(self, effectData, type, targets, isAdd, isRage,isTriggerJudge) -- From 32b4e236a0c02e3cdb6d219749c91233de78b791 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Fri, 5 Feb 2021 17:00:34 +0900 Subject: [PATCH 2/6] =?UTF-8?q?[=E6=88=98=E6=96=97]=3D=3D=3D=3D=3D=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=E5=8E=BB=E9=99=A4=E6=B2=A1?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E7=9A=84=E7=89=B9=E6=80=A7=E8=A2=AB=E5=8A=A8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/Logic/Base/Passivity.lua | 313 +----------------- .../Modules/Battle/Logic/Role/RoleLogic.lua | 2 +- 2 files changed, 12 insertions(+), 303 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index 4404162e43..ac098a0586 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -50,10 +50,7 @@ local passivityList = { local pro1 = args[2] local f2 = args[3] local pro2 = args[4] - local OnSkillCast = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end + local OnSkillCast = function(skill) BattleUtil.RandomAction(f1, function () local duration = 0 for i=1, #skill.effectCaster.effectList do @@ -73,9 +70,6 @@ local passivityList = { local dt = args[3] local OnSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.RandomAction(f1, function () local arr = BattleUtil.ChooseTarget(role, 20001) if arr[1] then @@ -94,9 +88,6 @@ local passivityList = { local f3 = args[3] local OnSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.RandomAction(f3, function () local arr = BattleUtil.ChooseTarget(role, 40000) if arr[1] then @@ -116,9 +107,6 @@ local passivityList = { local ct = args[4] local OnSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end role:AddBuff(Buff.Create(role, BuffName.PropertyChange, f2, BattlePropList[pro], f1, ct)) end role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd) @@ -133,9 +121,6 @@ local passivityList = { local f3 = args[4] local OnSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.RandomAction(f1, function () local arr = BattleUtil.ChooseTarget(role, 10321) if arr[1] then @@ -157,9 +142,6 @@ local passivityList = { local f3 = args[5] local OnSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.RandomAction(f1, function () local arr = BattleUtil.ChooseTarget(role, 10001) if arr[1] then @@ -193,9 +175,6 @@ local passivityList = { local f2 = args[3] local OnBeHit = function(atkRole,damage, bCrit, finalDmg, damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.RandomAction(f1, function () local val = floor(BattleUtil.FP_Mul(f2, role:GetRoleData(BattlePropList[pro]))) BattleUtil.CalTreat(role, role, val) @@ -213,9 +192,6 @@ local passivityList = { local triggerUid = {} local OnBeHit = function(atkRole,damage, bCrit, finalDmg, damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if atkRole.isTeam then return end @@ -243,9 +219,6 @@ local passivityList = { local dt = args[5] local OnRoleBeDamagedBefore = function(atkRole, factorFunc, damageType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if damageType == dt then BattleUtil.RandomAction(f1, function () role:AddPropertyTransfer(BattlePropList[pro1], f2, BattlePropList[pro2], 2, BattleLogic.GameDeltaTime) @@ -263,9 +236,6 @@ local passivityList = { local f2 = args[3] local OnPassiveDamaging = function(damagingFunc, atkRole, damage,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.RandomAction(f1, function () damagingFunc(floor(BattleUtil.FP_Mul(f2, role:GetRoleData(BattlePropList[pro])))) end) @@ -282,9 +252,6 @@ local passivityList = { local lastTrigger = 0 local OnBeHit = function(atkRole,damage, aaa, finalDmg, bbb, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if atkRole.isTeam then return end @@ -312,9 +279,6 @@ local passivityList = { local lastTrigger = 0 local OnBeHit = function(atkRole,damage, bCrit, finalDmg, damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if atkRole.isTeam then return end @@ -345,9 +309,6 @@ local passivityList = { local dt = args[6] local OnBeHit = function(atkRole,damage, bCrit, finalDmg, damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if damageType == dt then BattleUtil.RandomAction(f1, function () role:AddPropertyTransfer(BattlePropList[pro1], f2, BattlePropList[pro2], 2, f3) @@ -388,9 +349,6 @@ local passivityList = { local f3 = args[5] local OnSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.RandomAction(f1, function () role:AddPropertyTransfer(BattlePropList[pro1], f2, BattlePropList[pro2], 2, f3) end) @@ -407,9 +365,6 @@ local passivityList = { local ct = args[4] local OnSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end local arr = BattleUtil.ChooseTarget(role, 40000) if arr[1] then arr[1]:AddBuff(Buff.Create(role, BuffName.PropertyChange, f2, BattlePropList[pro1], f1, ct)) @@ -427,9 +382,6 @@ local passivityList = { local ct = args[4] local OnSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end local arr = BattleUtil.ChooseTarget(role, 10000) for i=1, #arr do arr[i]:AddBuff(Buff.Create(role, BuffName.PropertyChange, f2, BattlePropList[pro1], f1, ct)) @@ -511,9 +463,6 @@ local passivityList = { local triggerCount = 0 local OnBeHit = function(atkRole,damage, bCrit, finalDmg, damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if BattleUtil.GetHPPencent(role) < f1 then if triggerCount < 1 then BattleUtil.RandomAction(f2, function () @@ -533,9 +482,6 @@ local passivityList = { local f1 = args[2] local OnDead = function(atkRole,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end local arr = BattleUtil.ChooseTarget(role, 10000) for i=1, #arr do local val = floor(BattleUtil.FP_Mul(f1, role:GetRoleData(BattlePropList[pro]))) @@ -592,9 +538,6 @@ local passivityList = { local triggerUid = {} local OnRoleCrit = function(defRole, damage, bCrit, finalDmg, damageType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if triggerUid[defRole.uid] then --加入限定避免循环触发 return end @@ -617,9 +560,6 @@ local passivityList = { local f2 = args[3] local OnRoleCrit = function(defRole, damage, bCrit, finalDmg, damageType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.RandomAction(f1, function () local val = floor(BattleUtil.FP_Mul(f2, role:GetRoleData(BattlePropList[pro]))) BattleUtil.CalTreat(role, role, val) @@ -635,9 +575,6 @@ local passivityList = { local f2 = args[2] local OnPassiveDamaging = function(damagingFunc, defRole, damage,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if BattleUtil.GetHPPencent(defRole) > f1 then damagingFunc(-floor(f2 * damage)) end @@ -652,9 +589,6 @@ local passivityList = { local f2 = args[2] local OnPassiveDamaging = function(damagingFunc, defRole, damage,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if BattleUtil.GetHPPencent(defRole) < f1 then damagingFunc(-floor(f2 * damage)) end @@ -671,9 +605,6 @@ local passivityList = { local ct = args[4] local OnSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end local arr = BattleUtil.ChooseTarget(role, 20000) for i=1, #arr do arr[i]:AddBuff(Buff.Create(role, BuffName.PropertyChange, f2, BattlePropList[pro], f1, ct)) @@ -689,9 +620,6 @@ local passivityList = { local f2 = args[2] local OnSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end local arr = BattleUtil.ChooseTarget(role, 20001) if arr[1] then BattleUtil.RandomControl(f1, 1, role, arr[1], f2) @@ -733,9 +661,6 @@ local passivityList = { local f1 = args[1] local OnPassiveDamaging = function(damagingFunc,defRole, damage, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end damagingFunc(-f1) end role.Event:AddEvent(BattleEventName.PassiveDamiaging, OnPassiveDamaging) @@ -826,9 +751,6 @@ local passivityList = { local f1 = args[2] local OnBeHit = function(atkRole,damage, bCrit, finalDmg, damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if atkRole.isTeam then return end @@ -845,9 +767,6 @@ local passivityList = { local f1 = args[1] local OnDamage = function(defRole, damage, bCrit, finalDmg, damageType, dotType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.CalTreat(role, role, floor(f1 * finalDmg)) end role.Event:AddEvent(BattleEventName.RoleDamage, OnDamage) @@ -860,9 +779,6 @@ local passivityList = { local f2 = args[2] local OnPassiveCriting = function(crit,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.RandomAction(f1, function () crit(f2) end) @@ -879,9 +795,6 @@ local passivityList = { local ct = args[4] local OnSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end local arr = BattleUtil.ChooseTarget(role, 40000) if arr[1] then local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, ct) @@ -903,9 +816,6 @@ local passivityList = { local ct = args[5] local OnSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.RandomAction(f1, function () role:AddBuff(Buff.Create(role, BuffName.PropertyChange, f3, BattlePropList[pro], f2, ct)) end) @@ -998,9 +908,6 @@ local passivityList = { local ct = args[5] local OnSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.RandomAction(f1, function () local arr = BattleUtil.ChooseTarget(role, 20000) for i=1, #arr do @@ -1085,9 +992,6 @@ local passivityList = { local f1 = args[1] local f2 = args[2] local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if atkRole.isTeam then return end @@ -1103,9 +1007,6 @@ local passivityList = { local lastTrigger = 0 local OnDamage = function(defRole, damage, bCrit, finalDmg,aaa,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end lastTrigger = lastTrigger + 1 if lastTrigger > 1 then --加入限定避免循环触发 return @@ -1125,9 +1026,6 @@ local passivityList = { local lastTrigger = 0 local OnRoleCrit = function(defRole, damage, bCrit, finalDmg, damageType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end lastTrigger = lastTrigger + 1 if lastTrigger > 1 then --加入限定避免循环触发 return @@ -1148,9 +1046,6 @@ local passivityList = { local damageDic = {} local lastDamageDic = {} local OnSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end for k in pairs(damageDic) do if lastDamageDic[k] then damageDic[k] = damageDic[k] + 1 @@ -1182,9 +1077,6 @@ local passivityList = { local f3 = args[5] local OnSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end local arr = BattleUtil.ChooseTarget(role, 20000) for i=1, #arr do BattleUtil.RandomAction(f1, function ()-- @@ -1281,9 +1173,6 @@ local passivityList = { local f3 = args[4] local OnSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.RandomAction(f1, function () local list = RoleManager.GetNeighbor(role, 1) for i=1, #list do @@ -1403,9 +1292,6 @@ local passivityList = { local lastTrigger = 0 local OnDamage = function(defRole, damage, bCrit, finalDmg,damageType,dotType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end lastTrigger = lastTrigger + 1 if lastTrigger > 1 then --加入限定避免循环触发 return @@ -1432,9 +1318,6 @@ local passivityList = { local f2 = args[3] local OnKill = function(defRole,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end local buff = Buff.Create(role, BuffName.PropertyChange, f2, BattlePropList[pro], f1, 2) buff.cover = true buff.clear = false @@ -1472,9 +1355,6 @@ local passivityList = { local f2 = args[2] local OnPassiveCriting = function(crit,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.RandomAction(f1, function () crit(role:GetRoleData(RoleDataName.CritDamageFactor)+f2) end) @@ -1492,9 +1372,6 @@ local passivityList = { end local OnSkillCast, OnSkillCastEnd OnSkillCast = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end hp = floor(BattleUtil.FP_Mul(role:GetRoleData(RoleDataName.Hp), f1)) role.data:SubValue(RoleDataName.Hp, hp) @@ -1700,9 +1577,6 @@ local passivityList = { -- buff.cover = true -- 可以叠加 -- buff.clear = false -- 不可驱散 -- role:AddBuff(buff) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill and not skill.isAdd and defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then BattleUtil.CalRage(role, role, i1, CountTypeName.Add) end @@ -1801,9 +1675,6 @@ local passivityList = { local dt = args[3] -- 释放技能后 local onSkillEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill and skill.type == BattleSkillType.Special then BattleUtil.RandomAction(f1, function() BattleLogic.WaitForTrigger(0.1, function() @@ -1822,10 +1693,13 @@ local passivityList = { -- 释放技能[a]概率不消耗怒气 -- a[float] - [98] = function(role, args) + [98] = function(role, args,id,judge) local f1 = args[1] - local onRageCost = function(noCostRate, costRage, func) + local onRageCost = function(noCostRate, costRage, func,skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end local dRate = f1 local dCost = 0 if func then func(dRate, dCost) end @@ -2188,9 +2062,6 @@ local passivityList = { local i1 = args[1] -- 释放技能后 local onRoleHit = function(target,damage,bcrit,finalDmg,damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then for i = 1, i1 do role:AddSkill(BattleSkillType.Normal, false, true, nil) @@ -2211,6 +2082,9 @@ local passivityList = { -- 如果是技能的伤害则判断加成 local onPassiveDamaging = function(func, target, damage, skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end --处理伏虎觉醒十星附加的额外技能,额外技能不触发这个特性 2020/11/17 wangzhenxing if skill and skill.type== BattleSkillType.Extra and skill.owner.roleId==10015 and judge==1 then return @@ -2239,9 +2113,6 @@ local passivityList = { local f1 = args[1] -- 释放技能后 local onRoleHit = function(target,damage,bCrit,finalDmg,damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then local treat = floor(BattleUtil.FP_Mul(role:GetRoleData(RoleDataName.MaxHp), f1)) BattleUtil.CalTreat(role, role, treat) @@ -2457,9 +2328,6 @@ local passivityList = { local f1 = args[1] -- 释放技能后 local onRoleHit = function(target,damage,bCrit,finalDmg,damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then local buff = Buff.Create(role, BuffName.PropertyChange, 1, RoleDataName.Crit, f1, CountTypeName.Add) role:AddBuff(buff) @@ -2672,17 +2540,11 @@ local passivityList = { local index, tran local OnRoleDamageBefore = function(target,factorFunc,damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function(buff) return buff.damageType == dot end) then index, tran = role:AddPropertyTransfer(BattlePropList[pro], f1, BattlePropList[pro], ct) end end local OnRoleDamageAfter = function(defRole,damageFunc,fixDamage,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if index and tran then role:RemovePropertyTransfer(index, tran) end @@ -2840,17 +2702,11 @@ local passivityList = { factorFunc(f1, dt) end role.Event:AddEvent(BattleEventName.SkillCast, function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill.type == BattleSkillType.Special then role.Event:AddEvent(BattleEventName.PassiveTreatingFactor, tFactor) end end) role.Event:AddEvent(BattleEventName.SkillCastEnd, function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill.type == BattleSkillType.Special then role.Event:RemoveEvent(BattleEventName.PassiveTreatingFactor, tFactor) end @@ -3079,9 +2935,6 @@ local passivityList = { local dot = args[1] local f1 = args[2] local function onHit(target,damage,bCrit,finalDmg,damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then local maxHp = role:GetRoleData(RoleDataName.MaxHp) local value = floor(BattleUtil.ErrorCorrection(maxHp* f1)) @@ -3090,9 +2943,6 @@ local passivityList = { role.Event:RemoveEvent(BattleEventName.RoleHit, onHit) end local onDamaging = function(func, target,damage,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function(buff) return buff.damageType == dot end) then role.Event:AddEvent(BattleEventName.RoleHit, onHit) end @@ -3183,10 +3033,7 @@ local passivityList = { local f1 = args[2] local f2 = args[3] -- - local onRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end + local onRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) if skill and skill.type == BattleSkillType.Normal and not defRole:IsDead() then if BattleLogic.BuffMgr:HasBuff(defRole, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end) then local isBoss=BattleUtil.CheckIsBoss(defRole) @@ -3571,9 +3418,6 @@ local passivityList = { local i2 = args[2] -- 释放技能后 local onSkillEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end local targets = skill:GetDirectTargets() if targets and #targets > i1 then BattleUtil.CalRage(role, role, i2, 1) @@ -3588,9 +3432,6 @@ local passivityList = { local i1 = args[1] -- 释放技能后 local onSkillEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill.type == BattleSkillType.Special then local list = RoleManager.Query(function(v) return v.camp == role.camp end) --生命最少改成生命百分比最少 2020/09/29 by:王振兴 @@ -3632,9 +3473,6 @@ local passivityList = { local dt = args[2] -- 直接伤害后 local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill and not skill.isAdd and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then local list = RoleManager.Query(function(v) return v.camp ~= role.camp end) BattleUtil.SortByHpFactor(list, 1) @@ -3659,9 +3497,6 @@ local passivityList = { local af = 0 local onSkillCast = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end local maxNum = skill:GetMaxTargetNum() if maxNum and maxNum > 0 then af = BattleUtil.ErrorCorrection(f1/maxNum) @@ -3715,17 +3550,11 @@ local passivityList = { end local function onSkillCast(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill.type == BattleSkillType.Special then role.Event:AddEvent(BattleEventName.PassiveTreatingFactor, onPassiveTreatingFactor) end end local function onSkillCastEnd(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill.type == BattleSkillType.Special then role.Event:RemoveEvent(BattleEventName.PassiveTreatingFactor, onPassiveTreatingFactor) end @@ -3770,17 +3599,11 @@ local passivityList = { end local function onSkillCast(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.DeadSkill then role.Event:AddEvent(BattleEventName.PassiveTreatingFactor, onPassiveTreatingFactor) end end local function onSkillCastEnd(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.DeadSkill then role.Event:RemoveEvent(BattleEventName.PassiveTreatingFactor, onPassiveTreatingFactor) -- 对每个目标附加减伤盾 @@ -3804,9 +3627,6 @@ local passivityList = { local af = 0 local onSkillCast = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end local maxNum = skill:GetMaxTargetNum() if maxNum and maxNum > 0 then af = BattleUtil.ErrorCorrection(f1/maxNum) @@ -3829,9 +3649,6 @@ local passivityList = { local dot = DotType.Poison local onRoleDamage = function(defRole, damage, bCrit, finalDmg, damageType, dotType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if dotType == dot then BattleUtil.ApplyTreat(role, role, floor(BattleUtil.ErrorCorrection(finalDmg * f1))) end @@ -3862,9 +3679,6 @@ local passivityList = { local i1 = args[1] local function onSkillCastEnd(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end -- 对每个目标附加减伤盾 local targets = skill:GetDirectTargetsNoMiss() if targets and #targets == 1 then @@ -3884,9 +3698,6 @@ local passivityList = { local af = 0 local onSkillCast = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end local maxNum = skill:GetMaxTargetNum() if maxNum and maxNum > 0 then af = BattleUtil.ErrorCorrection(f1/maxNum) @@ -3934,9 +3745,6 @@ local passivityList = { local f1 = args[1] local onRoleHit = function(target,damage,bCrit,finalDmg,damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then local target = RoleManager.GetAliveAggro(role) BattleUtil.CalDamage(nil, role, target, 1, f1) @@ -3973,9 +3781,6 @@ local passivityList = { local i1 = args[1] local onSkillCastEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end local effectGroup = skill.effectCaster.effectList[1] local chooseId = effectGroup.chooseId local chooseLimit = floor(chooseId / 10000) % 10 @@ -3996,9 +3801,6 @@ local passivityList = { [187] = function(role, args,id,judge) local f1 = args[1] local function onSkillCast(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill.type == BattleSkillType.Normal then role.data:AddValue(RoleDataName.Crit, f1) end @@ -4006,9 +3808,6 @@ local passivityList = { role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast) local function onSkillCastEnd(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill.type == BattleSkillType.Normal then role.data:SubValue(RoleDataName.Crit, f1) end @@ -4104,9 +3903,6 @@ local passivityList = { local pro = args[1] local function onSkillTargetCheck(func,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end local list = RoleManager.Query(function(r) return r.camp == (role.camp + 1) % 2 end) @@ -4124,9 +3920,6 @@ local passivityList = { local f1 = args[1] local onHit = function(target, damage, bCrit, finalDmg, dtype, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill and skill.type == BattleSkillType.Special then -- 检测技能伤害治疗加成 local f = BattleUtil.CheckSkillDamageHeal(f1, role, target) @@ -4198,9 +3991,6 @@ local passivityList = { local f1 = args[1] local OnRoleDamageBefore = function(defRole, factorFunc, damageType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill then -- 计算概率 local cf = f1 @@ -4299,9 +4089,6 @@ local passivityList = { [197] = function(role, args,id,judge) local f1 = args[1] local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill and (skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra) and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then BattleUtil.RandomAction(f1, function() BattleUtil.CalRage(role, role, target.Rage, CountTypeName.Add) @@ -4438,9 +4225,6 @@ local passivityList = { -- 直接伤害概率无法复活 local function onRoleHit(target,damage,bCrit,finalDmg,damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if target:IsDead() then if not BattleLogic.BuffMgr:HasBuff(role, BuffName.DOT, function (buff) return buff.damageType == dot or dot == 0 end) then BattleUtil.RandomAction(f2, function() @@ -4507,9 +4291,6 @@ local passivityList = { local f1 = args[1] local ct = args[2] local passivityDamaging = function(func, caster, damage, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill and func then local dd = BattleUtil.CountValue(damage, f1, ct) - damage func(-floor(BattleUtil.ErrorCorrection(dd))) @@ -4552,9 +4333,6 @@ local passivityList = { local dt = args[3] -- 释放技能后 local onSkillEnd = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill.type == BattleSkillType.Special then BattleUtil.RandomAction(f1, function() BattleLogic.WaitForTrigger(0.1, function() @@ -4697,9 +4475,6 @@ local passivityList = { local f1 = args[2] local function OnDamage(func, atkRole, defRole, damage, skill, dotType, bCrit, damageType) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if defRole.camp ~= role.camp then if skill or dotType then local list = RoleManager.Query(function(r) return r.camp == defRole.camp and r ~= defRole end) @@ -4888,9 +4663,6 @@ local passivityList = { role:AddBuff(Buff.Create(role, BuffName.Brand, 0, "YUAN")) -- 鸳 -- local function _OnRoleHit(target,damage,bCrit,finalDmg,damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.RandomAction(rand, function() local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, CountTypeName.Sub) buff.cover = true @@ -4922,9 +4694,6 @@ local passivityList = { role:AddBuff(Buff.Create(role, BuffName.Brand, 0, "YANG")) -- 鸯 -- local function _OnRoleHit(target,damage,bCrit,finalDmg,damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.RandomAction(rand, function() local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, CountTypeName.Sub) buff.cover = true @@ -4958,9 +4727,6 @@ local passivityList = { local i1 = args[3] local function _OnRoleHit(target, damage, _, finalDmg, _, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end -- BattleUtil.RandomDot(rand, dot, role, target, i1, 1, ) if skill and skill.type == BattleSkillType.Normal then BattleUtil.RandomAction(rand, function() @@ -4978,9 +4744,6 @@ local passivityList = { local f1 = args[2] local function _OnRoleHit(target,damage,bCrit,finalDmg,damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end BattleUtil.RandomAction(rand, function() -- local dd = floor(BattleUtil.ErrorCorrection(role:GetRoleData(RoleDataName.Attack)*f1)) BattleUtil.CalDamage(nil, role, target, 1, f1, 1) @@ -5010,9 +4773,6 @@ local passivityList = { local f1 = args[1] -- local onRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end local isBoss=BattleUtil.CheckIsBoss(defRole) if isBoss then return @@ -5039,9 +4799,6 @@ local passivityList = { -- 杀敌回血 local onRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill and defRole:IsDead() then -- 回血 local dd = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[pro])*f1)) @@ -5057,9 +4814,6 @@ local passivityList = { local f1 = args[1] local OnPassiveDamaging = function(damagingFunc, target, damage,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end damagingFunc(-floor(BattleUtil.FP_Mul(f1, damage, BattleUtil.GetHPPencent(target)))) end role.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging) @@ -5071,9 +4825,6 @@ local passivityList = { local f1 = args[1] local OnPassiveDamaging = function(damagingFunc, target, damage,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end damagingFunc(-floor(BattleUtil.FP_Mul(f1, damage, 1 - BattleUtil.GetHPPencent(role)))) end role.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging) @@ -5322,9 +5073,6 @@ local passivityList = { local f1 = args[1] local f2=args[2] local onRoleHit = function(target,damage,bCrit,finalDmg,damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) and not role:IsDead() then -- local target = RoleManager.GetAliveAggro(role) --BattleUtil.CalDamage(nil, role, target, 1, f1) @@ -5486,9 +5234,6 @@ local passivityList = { -- 击杀数量累加 local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -5505,9 +5250,6 @@ local passivityList = { -- 释放技能时计算额外伤害 local OnSkillCast = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill then extra = f1 * killNum end @@ -5517,9 +5259,6 @@ local passivityList = { -- 造成伤害时判断额外伤害 local passivityDamaging = function(func, caster, damage, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill then if func then local dd = BattleUtil.CountValue(damage, extra, ct) - damage @@ -5536,9 +5275,6 @@ local passivityList = { local dot = args[1] local f1 = args[2] local function onHit(target, damage, bCrit, finalDmg, damageType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -5567,9 +5303,6 @@ local passivityList = { [252] = function(role, args,id,judge) local i1 = args[1] local onHit = function(target, damage, bCrit, finalDmg,damageType,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -5592,9 +5325,6 @@ local passivityList = { local dt = args[2] -- 直接伤害后 local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end --如果是技能并且这个被动已经被触发����� return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -5623,9 +5353,6 @@ local passivityList = { [254] = function(role, args,id,judge) local f1 = args[1] local onRoleHit = function(target,damage, bCrit, finalDmg, damageType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -5647,9 +5374,6 @@ local passivityList = { [255] = function(role, args,id,judge) local f1 = args[1] local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -6456,9 +6180,6 @@ local passivityList = { local num=0 -- 直接伤害后 local onPassiveDamaging = function(func, defRole, damage,skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end --如果是boss 并且额外伤害是根据最大生命则返回 local isBoss=BattleUtil.CheckIsBoss(defRole) if isBoss and f1==12 then @@ -6474,10 +6195,7 @@ local passivityList = { end role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging) --记录技能混乱敌人的数量 - local OnRoleHit = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end + local OnRoleHit = function(skill) if skill and skill.owner==role and skill.type==BattleSkillType.Special then local list=skill:GetDirectTargetsNoMiss() if not list then @@ -6578,9 +6296,6 @@ local passivityList = { local f1 = args[2] local f2=args[3] local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end --如果是技能并且这个被动已经被触发过 return if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return @@ -6610,9 +6325,6 @@ local passivityList = { local ct3 = args[5] local f3 = args[6] local onSkillEffectBefore = function(skill, e, func) - if skill and not skill.isTriggerJudge and judge==1 then - return - end if skill.type == BattleSkillType.Special then if e.type == 120 then -- 当前只对技能效果103生效 local factor = BattleUtil.ErrorCorrection(BattleUtil.CountValue(e.args[8], f1, ct)) @@ -6811,9 +6523,6 @@ local passivityList = { if not skill or skill.type~= BattleSkillType.Special then return end - if skill and judge==1 and not skill.isTriggerJudge then - return - end BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function () --延迟一帧移除事件,才能抓到添加效果字典里面的效果 local tv = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[pro]) * v1)) if tv and tv<=0 then diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua index 46920b10e8..32dad4a356 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua @@ -331,7 +331,7 @@ function RoleLogic:SkillCast(skill, func) noRageRate = noRageRate + rate costRage = costRage + cost end - self.Event:DispatchEvent(BattleEventName.RoleRageCost, costRage, noRageRate, _RageCostPassivity) + self.Event:DispatchEvent(BattleEventName.RoleRageCost, costRage, noRageRate, _RageCostPassivity,skill) -- 计算消耗怒气的概率,并消耗怒气 local costRate = 1 - noRageRate costRate = costRate > 1 and 1 or costRate From da1aa31b3de19a0255cf5b2a33bb78feb48ead91 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Tue, 23 Feb 2021 17:03:10 +0900 Subject: [PATCH 3/6] =?UTF-8?q?[=E6=88=98=E6=96=97]=3D=3D=3D=3D=3D=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=3D=E6=B7=B7=E4=B9=B1=E6=99=AE=E6=94=BB=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ManagedResources/~Lua/Modules/Battle/Logic/Role/Skill.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/Skill.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/Skill.lua index e1b52e1142..ed14074172 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/Skill.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/Skill.lua @@ -23,7 +23,7 @@ function Skill:Init(role, effectData, type, targets, isAdd, isRage,isTriggerJudg self.isKill = false --是否技能击杀目标 self.isAdd = isAdd self.isRage = isRage - if isTriggerJudge then + if isTriggerJudge~=nil then self.isTriggerJudge=isTriggerJudge else self.isTriggerJudge = true From 0e23ca3cf826fa8dd8e19c5734d1fbcb3a0cc700 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Thu, 25 Feb 2021 19:48:24 +0900 Subject: [PATCH 4/6] =?UTF-8?q?[=E6=88=98=E6=96=97]=3D=3D=3D=3D=3D=3D=3D?= =?UTF-8?q?=202021-0303=E5=8F=91=E5=B8=83=E8=AE=A1=E5=88=92=20=E6=88=98?= =?UTF-8?q?=E6=96=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Modules/Battle/Logic/Base/Passivity.lua | 110 ++++++++++-------- .../Modules/Battle/Logic/Misc/BattleUtil.lua | 2 +- .../Modules/Battle/Logic/Role/RoleLogic.lua | 13 +++ 3 files changed, 76 insertions(+), 49 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index ac098a0586..466a9f3877 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -1807,12 +1807,12 @@ local passivityList = { local onSkillEnd = function(skill) if skill and not skill.isTriggerJudge and judge==1 then return - end - if skill.type == BattleSkillType.Special then - for i = 1, i1 do - role:AddSkill(BattleSkillType.Normal, false, true, nil) + end + if skill.type == BattleSkillType.Special then + for i = 1, i1 do + role:AddSkill(BattleSkillType.Normal, false, true, nil) + end end - end end role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd) end, @@ -2089,7 +2089,7 @@ local passivityList = { if skill and skill.type== BattleSkillType.Extra and skill.owner.roleId==10015 and judge==1 then return end - if skill and skill.type==BattleSkillType.Special then + if skill and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Normal) then local dd = BattleUtil.CountValue(damage, f1, ct) - damage if func then func(-floor(BattleUtil.ErrorCorrection(dd))) end end @@ -2184,7 +2184,7 @@ local passivityList = { af = af + f1 end end - role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast) + role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillCast) -- 如果是技能的伤害则判断加成 local onPassiveDamaging = function(func, target, damage, skill) @@ -2456,26 +2456,27 @@ local passivityList = { deadNum = deadNum + 1 if deadNum >= i1 then deadNum = 0 - extra = extra + f1 - -- local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, ct2) - -- role:AddBuff(buff) + --extra = extra + f1 + --处理混乱后普攻不触发任何特性问题改成加buff 王振兴 2021/02/25 + local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[5], f1, ct2) + role:AddBuff(buff) end end end BattleLogic.Event:AddEvent(BattleEventName.BattleRoleDead, OnDead) - local passivityDamaging = function(func, caster, damage, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end - if skill then - if func then - local dd = BattleUtil.CountValue(damage, extra, ct2) - damage - func(-floor(BattleUtil.ErrorCorrection(dd))) - end - end - end - role.Event:AddEvent(BattleEventName.PassiveDamaging, passivityDamaging) + -- local passivityDamaging = function(func, caster, damage, skill) + -- if skill and not skill.isTriggerJudge and judge==1 then + -- return + -- end + -- if skill then + -- if func then + -- local dd = BattleUtil.CountValue(damage, extra, ct2) - damage + -- func(-floor(BattleUtil.ErrorCorrection(dd))) + -- end + -- end + -- end + -- role.Event:AddEvent(BattleEventName.PassiveDamaging, passivityDamaging) end, -- 直接伤害每次击杀目标增加自身伤害[a]%,[b]改变,可叠加持续至战斗结束 @@ -2493,37 +2494,39 @@ local passivityList = { return end if skill and defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then - killNum = killNum + 1 + -- killNum = killNum + 1 + local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[5], f1, ct) + role:AddBuff(buff) end end role.Event:AddEvent(BattleEventName.RoleHit, OnRoleHit) -- 释放技能时计算额外伤害 - local OnSkillCast = function(skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end - if skill then - extra = f1 * killNum - end - end - role.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast) + -- local OnSkillCast = function(skill) + -- if skill and not skill.isTriggerJudge and judge==1 then + -- return + -- end + -- if skill then + -- extra = f1 * killNum + -- end + -- end + -- role.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast) - -- 造成伤害时判断额外伤害 - local passivityDamaging = function(func, caster, damage, skill) - if skill and not skill.isTriggerJudge and judge==1 then - return - end - if skill then - if func then - local dd = BattleUtil.CountValue(damage, extra, ct) - damage - func(-floor(BattleUtil.ErrorCorrection(dd))) - end - end - end - role.Event:AddEvent(BattleEventName.PassiveDamaging, passivityDamaging) + -- -- 造成伤害时判断额外伤害 + -- local passivityDamaging = function(func, caster, damage, skill) + -- if skill and not skill.isTriggerJudge and judge==1 then + -- return + -- end + -- if skill then + -- if func then + -- local dd = BattleUtil.CountValue(damage, extra, ct) - damage + -- func(-floor(BattleUtil.ErrorCorrection(dd))) + -- end + -- end + -- end + -- role.Event:AddEvent(BattleEventName.PassiveDamaging, passivityDamaging) end, @@ -3093,6 +3096,9 @@ local passivityList = { if skill and not skill.isTriggerJudge and judge==1 then return end + if target:CheckHavePassive(144) then + return + end --白骨精追加普攻不触发特性 if skill and judge==1 and skill.type== BattleSkillType.Normal and skill.isAdd and skill.owner.roleId==10091 then return @@ -4129,9 +4135,9 @@ local passivityList = { BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, onRoundChange) - local function onFinalBeDamage(damagingFunc, atkRole, damage, skill, dotType, bCrit, damageType) + local function onFinalBeDamage(damagingFunc, atkRole, damage, skill, dotType, bCrit, damageType,isDirect) -- 非直接伤害不免除 - if not skill then + if not skill and not isDirect then return end -- @@ -5202,6 +5208,7 @@ local passivityList = { -- a[float] [249] = function(role, args,id,judge) local f1 = args[1] + local round = 0 -- 释放技能后 local onRoleHit = function(target,damage, bCrit, finalDmg, damageType, skill) if skill and not skill.isTriggerJudge and judge==1 then @@ -5211,6 +5218,13 @@ local passivityList = { if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return end + local curRound=BattleLogic.GetCurRound() + --每个回合只会生效一次 + if curRound>round then + round=curRound + else + return + end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then local buff = Buff.Create(role, BuffName.PropertyChange, 1, RoleDataName.Crit, f1, CountTypeName.Add) role:AddBuff(buff) @@ -6653,7 +6667,7 @@ local passivityList = { local f2=args[2] local onRoleHit = function(deadRole) BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function () - if deadRole.camp~=role.camp then + if deadRole.camp~=role.camp then role:InsertExtraSkill(f1,f2) end end) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua index 2e7981c913..2d86a93e75 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Misc/BattleUtil.lua @@ -563,7 +563,7 @@ function BattleUtil.ApplyDamage(skill, atkRole, defRole, damage, bCrit, damageTy end atkRole.Event:DispatchEvent(BattleEventName.FinalDamage, damagingFunc, defRole, damage, skill, dotType, bCrit, damageType) defRole.Event:DispatchEvent(BattleEventName.FinalBeDamage, damagingFunc, atkRole, damage, skill, dotType, bCrit, damageType) - defRole.Event:DispatchEvent(BattleEventName.FinalBeDamageEnd, damagingFunc, atkRole, damage, skill, dotType, bCrit, damageType) + defRole.Event:DispatchEvent(BattleEventName.FinalBeDamageEnd, damagingFunc, atkRole, damage, skill, dotType, bCrit, damageType,isDirect) BattleLogic.Event:DispatchEvent(BattleEventName.FinalDamage, damagingFunc, atkRole, defRole, damage, skill, dotType, bCrit, damageType) -- diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua index 32dad4a356..313007cc1f 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua @@ -126,6 +126,19 @@ function RoleLogic:CanCastSkill() return self.sp >= self.spPass and not self.IsDebug end +--检测是否有某被动 +function RoleLogic:CheckHavePassive(id) + if self.passiveList then + for index, value in ipairs(self.passiveList) do + if value and value[1] and value[1]==id then + return true + end + end + return false + end + return false +end + -- 废弃的方法 function RoleLogic:GetSkillCD() return max(self.spPass - self.sp, 0) From 7ae746b3189ed58276808b8210269e052eb7b72f Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Fri, 26 Feb 2021 17:00:05 +0900 Subject: [PATCH 5/6] =?UTF-8?q?[=E6=88=98=E6=96=97]=3D=3D=3D=3D=3D=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=3D=3D=E8=A2=AB=E5=8A=A8200=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E6=B7=B7=E4=B9=B1=E7=8A=B6=E6=80=81=E4=B8=8B=E7=9A=84?= =?UTF-8?q?=E6=89=80=E6=9C=89=E6=94=BB=E5=87=BB=E6=96=B9=E5=BC=8F=E9=83=BD?= =?UTF-8?q?=E5=8F=98=E4=B8=BA=E6=B7=B7=E4=B9=B1=E6=99=AE=E6=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/Logic/Base/Passivity.lua | 2 +- .../~Lua/Modules/Battle/Logic/Role/RoleLogic.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua index 466a9f3877..957e06fde3 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Base/Passivity.lua @@ -4190,7 +4190,7 @@ local passivityList = { damagingFunc(shareDamage) end -- 分担伤害 - BattleUtil.FinalDamage(nil, atkRole, role, shareDamage,bCrit,damageType,dotType,true) + BattleUtil.ApplyDamage(skill, atkRole, role, shareDamage,false,damageType,dotType,true) end end BattleLogic.Event:AddEvent(BattleEventName.FinalDamage, onFinalDamage) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua index 313007cc1f..d50a56460e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua @@ -375,7 +375,7 @@ function RoleLogic:AddSkill(type, isRage, isAdd, targets) local effectData = type == BattleSkillType.Normal and self.skill or self.superSkill --角色被混乱后 local isTriggerJudge=true - if self.ctrl_chaos and isRage then + if self.ctrl_chaos then type=BattleSkillType.ChaosNormal --混乱普攻使用普攻特效 effectData={self.skill[1],self.skill[2],self.skill[3],self.skill[4],{100001,{1,1,1}}} From 0bd2c53e6c38b87ace2ab14a979a56362d35fc7e Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Fri, 26 Feb 2021 18:19:54 +0900 Subject: [PATCH 6/6] =?UTF-8?q?=E3=80=90=E6=88=98=E6=96=97=E3=80=91=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=3D=3D=3D=3D=E9=99=A4=E6=AD=BB=E4=BA=A1=E6=8A=80?= =?UTF-8?q?=E8=83=BD=E5=A4=96=EF=BC=8C=E6=B7=B7=E4=B9=B1=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E6=89=80=E6=9C=89=E6=8A=80=E8=83=BD=E9=83=BD=E5=8F=98=E4=B8=BA?= =?UTF-8?q?=E6=B7=B7=E4=B9=B1=E6=99=AE=E6=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Battle/Logic/Role/RoleLogic.lua | 4 +++- .../~Lua/Modules/Battle/Logic/SkillManager.lua | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua index d50a56460e..e00ddcdb89 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Role/RoleLogic.lua @@ -397,14 +397,16 @@ end --加入额外技能,用于额外释放技能 by:王振兴 function RoleLogic:InsertExtraSkill(id,type) local effectData=BattleUtil.GetExtraSkillbyId(id) + if effectData then local skillType=BattleSkillType.Extra --如果type为1则按绝技处理,不为1的话按额外技能处理(额外技能因为被动判断会判断是否是绝技类型,所以不会触发) if type==1 then skillType=BattleSkillType.Special end + --和老史,佳琦确认果 附加技能算绝技 被沉默无法释放 可以套娃 递归触发 by:王振兴 - SkillManager.InsertSkill(self, effectData, skillType, nil, true, false) + SkillManager.InsertSkill(self, effectData, skillType, nil, true, false,true) BattleLogManager.Log( "Insert Extra Skill", "camp", self.camp, diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua index 6eda1237e5..394d35a6ab 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua @@ -57,12 +57,20 @@ function this.AddSkill(caster, effectData, type, targets, isAdd, isRage,isTrigge return skill end -- 插入技能到技能列表首位 -function this.InsertSkill(caster, effectData, type, targets, isAdd, isRage) +function this.InsertSkill(caster, effectData, type, targets, isAdd, isRage,isTriggerJudge) -- 如果超出最大限制则不再追加技能 if not this.CheckMaxCount() then return end local skill = skillPool:Get() + --角色被混乱后 + isTriggerJudge=true + if caster.ctrl_chaos and type~=BattleSkillType.DeadSkill then + type=BattleSkillType.ChaosNormal + --混乱普攻使用普攻特效 + effectData={caster.skill[1],caster.skill[2],caster.skill[3],caster.skill[4],{100001,{1,1,1}}} + isTriggerJudge=false + end skill:Init(caster, effectData, type, targets, isAdd, isRage) if type == BattleSkillType.DeadSkill then -- 死亡技能加入单独的对列 table.insert(this.DeadSkillList, 1, skill)