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 32cd446d50..e08ac6dfd3 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) @@ -380,7 +341,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] @@ -397,7 +358,7 @@ 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] @@ -414,7 +375,7 @@ 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] @@ -502,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 () @@ -519,11 +477,11 @@ 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) local arr = BattleUtil.ChooseTarget(role, 10000) for i=1, #arr do local val = floor(BattleUtil.FP_Mul(f1, role:GetRoleData(BattlePropList[pro]))) @@ -572,14 +530,14 @@ 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 triggerUid[defRole.uid] then --加入限定避免循环触发 return end @@ -596,12 +554,12 @@ 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) BattleUtil.RandomAction(f1, function () local val = floor(BattleUtil.FP_Mul(f2, role:GetRoleData(BattlePropList[pro]))) BattleUtil.CalTreat(role, role, val) @@ -612,11 +570,11 @@ 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 BattleUtil.GetHPPencent(defRole) > f1 then damagingFunc(-floor(f2 * damage)) end @@ -626,11 +584,11 @@ 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 BattleUtil.GetHPPencent(defRole) < f1 then damagingFunc(-floor(f2 * damage)) end @@ -640,7 +598,7 @@ 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] @@ -657,7 +615,7 @@ 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] @@ -699,10 +657,10 @@ 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) damagingFunc(-f1) end role.Event:AddEvent(BattleEventName.PassiveDamiaging, OnPassiveDamaging) @@ -793,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 @@ -808,10 +763,10 @@ 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) BattleUtil.CalTreat(role, role, floor(f1 * finalDmg)) end role.Event:AddEvent(BattleEventName.RoleDamage, OnDamage) @@ -819,11 +774,11 @@ 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) BattleUtil.RandomAction(f1, function () crit(f2) end) @@ -833,7 +788,7 @@ 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] @@ -853,7 +808,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] @@ -945,7 +900,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] @@ -1037,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 @@ -1049,12 +1001,12 @@ 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) lastTrigger = lastTrigger + 1 if lastTrigger > 1 then --加入限定避免循环触发 return @@ -1069,11 +1021,11 @@ 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) lastTrigger = lastTrigger + 1 if lastTrigger > 1 then --加入限定避免循环触发 return @@ -1087,7 +1039,7 @@ 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] @@ -1117,7 +1069,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] @@ -1214,7 +1166,7 @@ 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] @@ -1333,13 +1285,13 @@ 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) lastTrigger = lastTrigger + 1 if lastTrigger > 1 then --加入限定避免循环触发 return @@ -1360,12 +1312,12 @@ 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) local buff = Buff.Create(role, BuffName.PropertyChange, f2, BattlePropList[pro], f1, 2) buff.cover = true buff.clear = false @@ -1398,11 +1350,11 @@ 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) BattleUtil.RandomAction(f1, function () crit(role:GetRoleData(RoleDataName.CritDamageFactor)+f2) end) @@ -1411,7 +1363,7 @@ local passivityList = { end, --释放技能时,自己损失[a]%当前生命值,为此次技能增加等量伤害。 --a[float] - [73] = function(role, args) + [73] = function(role, args,id,judge) local f1 = args[1] local hp=0 @@ -1583,21 +1535,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 +1569,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) @@ -1625,17 +1586,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 +1637,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 +1647,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,7 +1669,7 @@ 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] @@ -1720,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 @@ -1734,7 +1710,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 +1721,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 +1768,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 +1779,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,27 +1801,33 @@ 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.type == BattleSkillType.Special then - for i = 1, i1 do - role:AddSkill(BattleSkillType.Normal, false, true, nil) + 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 end - end end role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd) end, -- 直接伤害每次击杀目标增加[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 +1841,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 +1870,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 +1912,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 +1972,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 +2015,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 +2033,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 +2046,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 +2058,10 @@ 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 target:IsDead() and not BattleUtil.CheckIsNoDead(target) then for i = 1, i1 do role:AddSkill(BattleSkillType.Normal, false, true, nil) @@ -2067,11 +2082,14 @@ 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 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 @@ -2091,10 +2109,10 @@ 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 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 +2123,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 +2133,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 +2155,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,21 +2170,27 @@ 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 af = af + f1 end end - role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast) + role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillCast) -- 如果是技能的伤害则判断加成 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 +2200,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 +2239,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 +2256,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 +2281,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 +2305,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 +2324,10 @@ 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 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 +2369,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 +2442,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] @@ -2408,28 +2456,32 @@ 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 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]改变,可叠加持续至战斗结束 -- a[float]b[改变类型] - [132] = function(role, args) + [132] = function(role, args,id,judge) local f1 = args[1] local ct = args[2] @@ -2438,32 +2490,43 @@ 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 + -- 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 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 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, @@ -2471,7 +2534,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 +2542,12 @@ local passivityList = { local index, tran - local OnRoleDamageBefore = function(target) + local OnRoleDamageBefore = function(target,factorFunc,damageType,skill) 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 index and tran then role:RemovePropertyTransfer(index, tran) end @@ -2496,7 +2559,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 +2570,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 +2592,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 +2640,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 +2666,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 +2674,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,7 +2698,7 @@ 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) @@ -2680,7 +2758,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 +2772,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 +2795,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 +2809,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 +2846,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 +2854,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 +2876,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 +2890,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 +2934,10 @@ 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 target:IsDead() and not BattleUtil.CheckIsNoDead(target) then local maxHp = role:GetRoleData(RoleDataName.MaxHp) local value = floor(BattleUtil.ErrorCorrection(maxHp* f1)) @@ -2843,7 +2945,7 @@ local passivityList = { end role.Event:RemoveEvent(BattleEventName.RoleHit, onHit) end - local onDamaging = function(func, target) + local onDamaging = function(func, target,damage,skill) if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function(buff) return buff.damageType == dot end) then role.Event:AddEvent(BattleEventName.RoleHit, onHit) end @@ -2854,7 +2956,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 +2977,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 +2995,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 +3009,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,7 +3031,7 @@ 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] @@ -2949,13 +3060,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 +3088,17 @@ 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 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 @@ -3071,9 +3190,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 +3257,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 +3363,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 +3371,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 +3387,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 +3397,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,7 +3419,7 @@ 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] -- 释放技能后 @@ -3300,7 +3434,7 @@ local passivityList = { -- 释放技能后给当前血量最少的2名队友附加无敌吸血盾持续[a]回合 -- a[int] - [168] = function(role, args) + [168] = function(role, args,id,judge) local i1 = args[1] -- 释放技能后 local onSkillEnd = function(skill) @@ -3340,7 +3474,7 @@ 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] -- 直接伤害后 @@ -3362,7 +3496,7 @@ 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] @@ -3409,7 +3543,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] @@ -3461,7 +3595,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] @@ -3492,7 +3626,7 @@ 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] @@ -3516,7 +3650,7 @@ local passivityList = { -- 对别人造成的中毒伤害的[a]%用于治疗自己 -- a[float] - [179] = function(role, args) + [179] = function(role, args,id,judge) local f1 = args[1] local dot = DotType.Poison @@ -3547,7 +3681,7 @@ local passivityList = { -- 攻击单体目标时额外降低目标[a]点怒气 -- a[int] - [181] = function(role, args) + [181] = function(role, args,id,judge) local i1 = args[1] local function onSkillCastEnd(skill) @@ -3563,7 +3697,7 @@ 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] @@ -3613,10 +3747,10 @@ 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 target:IsDead() and not BattleUtil.CheckIsNoDead(target) then local target = RoleManager.GetAliveAggro(role) BattleUtil.CalDamage(nil, role, target, 1, f1) @@ -3649,7 +3783,7 @@ local passivityList = { -- 攻击纵排目标时额外降低目标[a]点怒气 -- a[int] - [186] = function(role, args) + [186] = function(role, args,id,judge) local i1 = args[1] local onSkillCastEnd = function(skill) @@ -3670,7 +3804,7 @@ 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.type == BattleSkillType.Normal then @@ -3771,10 +3905,10 @@ 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) local list = RoleManager.Query(function(r) return r.camp == (role.camp + 1) % 2 end) @@ -3788,7 +3922,7 @@ 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) @@ -3859,7 +3993,7 @@ 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) @@ -3936,7 +4070,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,7 +4092,7 @@ 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 (skill.type == BattleSkillType.Special or skill.type==BattleSkillType.Extra) and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then @@ -3998,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 -- @@ -4079,7 +4216,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 +4230,7 @@ local passivityList = { role.Event:AddEvent(BattleEventName.PassiveSeckill, onPassiveSeckill) -- 直接伤害概率无法复活 - local function onRoleHit(target) + local function onRoleHit(target,damage,bCrit,finalDmg,damageType,skill) 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,7 +4293,7 @@ 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) @@ -4170,12 +4307,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,7 +4332,7 @@ 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] @@ -4331,7 +4471,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 @@ -4479,7 +4619,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 +4661,14 @@ 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) BattleUtil.RandomAction(rand, function() local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, CountTypeName.Sub) buff.cover = true @@ -4552,14 +4692,14 @@ 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) BattleUtil.RandomAction(rand, function() local buff = Buff.Create(role, BuffName.PropertyChange, 0, BattlePropList[pro], f1, CountTypeName.Sub) buff.cover = true @@ -4586,7 +4726,7 @@ 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] @@ -4605,11 +4745,11 @@ 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) BattleUtil.RandomAction(rand, function() -- local dd = floor(BattleUtil.ErrorCorrection(role:GetRoleData(RoleDataName.Attack)*f1)) BattleUtil.CalDamage(nil, role, target, 1, f1, 1) @@ -4635,7 +4775,7 @@ 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) @@ -4659,7 +4799,7 @@ 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] @@ -4676,10 +4816,10 @@ 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) damagingFunc(-floor(BattleUtil.FP_Mul(f1, damage, BattleUtil.GetHPPencent(target)))) end role.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging) @@ -4687,10 +4827,10 @@ 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) damagingFunc(-floor(BattleUtil.FP_Mul(f1, damage, 1 - BattleUtil.GetHPPencent(role)))) end role.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging) @@ -4916,12 +5056,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 +5075,10 @@ 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 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 +5096,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 +5128,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 +5155,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 +5181,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,14 +5206,25 @@ local passivityList = { -- 直接伤害击杀目标下回合攻击[a]%暴击(TODO:目前为增加[a]%) 重写125 一次技能只触发一次被动 -- a[float] - [249] = function(role, args,id) + [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 + return + end --如果是技能并且这个被动已经被触发过 return 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) @@ -5073,7 +5239,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] @@ -5119,7 +5285,7 @@ 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) @@ -5148,7 +5314,7 @@ 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) --如果是技能并且这个被动已经被触发过 return @@ -5168,13 +5334,13 @@ 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) --如果是技能并且这个被动已经被触发����� 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,7 +5364,7 @@ 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) --如果是技能并且这个被动已经被触发过 return @@ -5219,7 +5385,7 @@ 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) --如果是技能并且这个被动已经被触发过 return @@ -5245,6 +5411,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 +5443,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 +5471,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 +5494,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 +5508,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 +5519,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 +5540,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 +5571,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 +5580,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 +5598,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 +5621,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 +5666,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 +5695,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 +5721,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 +5757,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 +5799,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 +5851,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 +5875,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 +5944,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 +5952,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 +5976,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 +6005,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 +6034,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 +6045,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 +6131,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 +6185,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] @@ -5983,7 +6209,7 @@ local passivityList = { end role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging) --记录技能混乱敌人的数量 - local OnRoleHit = function(skill) + local OnRoleHit = function(skill) if skill and skill.owner==role and skill.type==BattleSkillType.Special then local list=skill:GetDirectTargetsNoMiss() if not list then @@ -6025,7 +6251,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 +6265,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 @@ -6137,6 +6367,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 +6424,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 @@ -6310,9 +6546,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 @@ -6443,7 +6676,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 5f4d7a55f8..dbf05ce36e 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) @@ -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) -- @@ -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 51135071ff..e00ddcdb89 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) @@ -331,7 +344,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 @@ -366,7 +379,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) -- 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