diff --git a/luafight/Modules/Battle/Logic/Base/Effect.lua b/luafight/Modules/Battle/Logic/Base/Effect.lua index 196f9e408..275e79a4f 100644 --- a/luafight/Modules/Battle/Logic/Base/Effect.lua +++ b/luafight/Modules/Battle/Logic/Base/Effect.lua @@ -2337,7 +2337,7 @@ local effectList = { BattleLogic.WaitForTrigger(interval, function () if (pro==12 or pro==13) and BattleUtil.CheckIsBoss(target) then return - end + end local damage = floor(BattleUtil.ErrorCorrection(f1 * target:GetRoleData(BattlePropList[pro]))) BattleUtil.FinalDamage(skill, caster, target, damage, nil, 0, nil, true) end) @@ -2353,7 +2353,41 @@ local effectList = { target:AddBuff(Buff.Create(caster, BuffName.PropertyChange, i1, BattlePropList[pro], f1, ct)) end) end, - + --造成[a]%的[b]伤害,目标数量大于等于[c],伤害[d]改变[e]%;目标数量小于[f],对其额外造成[g]属性[h]%的伤害(e,h填0 为魂印修改数值3) + --a[float],b[伤害类型],c[int],d[int],e[float] f[int] g[int] h[float] + [126] = function(caster, target, args, interval, skill) + local f1 = args[1] + local dt = args[2] + local num = args[3] + local ct = args[4] + local f2 = args[5] + local num2 =args[6] + local p1 = args[7] + local f3 = args[8] + -- 改变值 = 技能最大目标数 - 当前目标数 + local maxNum = skill:GetMaxTargetNum() + local curNum = #skill:GetDirectTargets() + if curNum>=num and f2>0 then + f1=BattleUtil.CountValue(f1,f2,ct) + end + BattleLogic.WaitForTrigger(interval, function () + BattleUtil.CalDamage(skill, caster, target, dt, f1) + --伤害命中才会给目标上buff + if skill and skill:CheckTargetIsHit(target) then + if curNum f1 then damagingFunc(-floor(f2 * damage)) end @@ -584,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 @@ -598,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] @@ -615,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] @@ -657,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) @@ -746,11 +746,11 @@ local passivityList = { --被指定[a]造成伤害时,回复[b]生命 --a[职业],b[int] - [40] = function(role, args) + [40] = function(role, args,id,judge) local i1 = args[1] local f1 = args[2] - local OnBeHit = function(atkRole) + local OnBeHit = function(atkRole,damage, bCrit, finalDmg, damageType,skill) if atkRole.isTeam then return end @@ -763,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) @@ -774,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) @@ -788,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] @@ -808,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] @@ -900,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] @@ -988,10 +988,10 @@ local passivityList = { end, --受击后,有[a]的概率对攻击者造成眩晕,持续[b]秒。 --a[float],b[int] - [54] = function(role, args) + [54] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] - local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType) + local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType,skill) if atkRole.isTeam then return end @@ -1001,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 @@ -1021,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 @@ -1039,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] @@ -1069,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] @@ -1155,7 +1155,7 @@ local passivityList = { local f2 = args[2] local f3 = args[3] - local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType) + local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType,skill) if not bCrit then local ar1 = BattleUtil.FP_Mul(role:GetRoleData(RoleDataName.Attack), f3) local ar2 = BattleUtil.FP_Mul(damage, f1) @@ -1166,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] @@ -1275,7 +1275,7 @@ local passivityList = { local f2 = args[3] local f3 = args[4] - local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType) + local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType,skill) BattleUtil.RandomAction(f1, function () local val = floor(BattleUtil.FP_Mul(role:GetRoleData(BattlePropList[pro1]), f2)) role:AddBuff(Buff.Create(role, BuffName.Shield, f3, ShieldTypeName.NormalReduce, val, 0)) @@ -1285,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 @@ -1312,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 @@ -1333,7 +1333,7 @@ local passivityList = { local dt = args[3] local lastTrigger = 0 - local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType) + local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType,skill) if atkRole.isTeam then return end @@ -1350,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) @@ -1363,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 @@ -1535,22 +1535,31 @@ 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.type == BattleSkillType.Special then + 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.type == BattleSkillType.Special then + 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 end @@ -1560,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) @@ -1577,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 @@ -1622,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) @@ -1632,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 @@ -1648,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] @@ -1672,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 @@ -1686,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 @@ -1697,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) @@ -1738,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] @@ -1749,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 @@ -1765,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 @@ -1797,24 +1839,34 @@ local passivityList = { - -- 释放技能后给除自己外己方生命最少的武将附加无敌盾持续[b]回合(只剩自己则不加) - --b[属性] - [104] = function(role, args) + -- 释放技能后给除自己外己方生命最少的[a]名武将附加无敌盾持续[b]回合(只剩自己则不加) + -- a[int] b[int] + [104] = function(role, args,id,judge) local i1 = args[1] + local num = args[2] -- 释放技能后 local onSkillEnd = function(skill) + if skill and not skill.isTriggerJudge and judge==1 then + return + end + local heros={} if skill.type == BattleSkillType.Special then local list = RoleManager.Query(function(v) return v.camp == role.camp end) BattleUtil.SortByHpFactor(list, 1) local target = nil for i = 1, #list do if not list[i]:IsRealDead() and list[i] ~= role then - target = list[i] - break + -- target = list[i] + table.insert(heros,list[i]) + -- break end end - if target then - target:AddBuff(Buff.Create(role, BuffName.Shield, i1, ShieldTypeName.AllReduce, 0, 0)) + if heros then + for i = 1, i1 do + if heros[i] then + heros[i]:AddBuff(Buff.Create(role, BuffName.Shield, num, ShieldTypeName.AllReduce, 0, 0)) + end + end end end end @@ -1825,10 +1877,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 @@ -1848,7 +1903,7 @@ local passivityList = { local pro = args[2] local i1 = args[3] - local onBeHit = function(caster, damage) + local onBeHit = function(caster,damage, bCrit, finalDmg, damageType,skill) local list = RoleManager.Query(function(v) return v.camp == role.camp end) list = BattleUtil.SortByProp(list, BattlePropList[pro], 1) for i = 1, i1 do @@ -1864,10 +1919,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 @@ -1921,10 +1979,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 @@ -1961,6 +2022,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 @@ -1976,9 +2040,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 @@ -1986,6 +2053,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 @@ -1995,10 +2065,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) @@ -2019,11 +2089,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 @@ -2043,10 +2116,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) @@ -2057,7 +2130,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] @@ -2067,6 +2140,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) @@ -2086,6 +2162,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 @@ -2098,21 +2177,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 @@ -2122,16 +2207,20 @@ 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.cover = true + --属性buff覆盖存在问题,暂时不覆盖 + buff.cover = false role:AddBuff(buff) end end @@ -2142,7 +2231,7 @@ local passivityList = { [120] = function(role, args) local f1 = args[1] - local onBeHit = function(caster, damage) + local onBeHit = function(caster,damage, bCrit, finalDmg, damageType,skill) local list = RoleManager.Query(function(v) return v.camp == role.camp end) for i = 1, #list do local r = list[i] @@ -2157,10 +2246,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 @@ -2171,11 +2263,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 @@ -2193,11 +2288,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 @@ -2214,10 +2312,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 @@ -2230,10 +2331,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) @@ -2275,10 +2376,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 @@ -2345,7 +2449,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] @@ -2359,28 +2463,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] @@ -2389,32 +2497,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, @@ -2422,7 +2541,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] @@ -2430,12 +2549,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 @@ -2447,7 +2566,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] @@ -2458,12 +2577,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 @@ -2474,13 +2599,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 @@ -2519,12 +2647,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 @@ -2540,19 +2671,27 @@ local passivityList = { role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd) end, - -- 释放普攻后给目标附加治疗效果每回合回复[a]的[b]%点生命持续[c]回合 - -- a[属性]b[float]c[int] - [138] = function(role, args) + -- 释放普攻后给目标附加治疗效果每回合回复[a]的[b]%点生命持续[c]回合(额外加目标[d][e]%生命 ,d e不填不会添加) + -- a[属性]b[float]c[int] d[int] e[float] + [138] = function(role, args,id,judge) local pro = args[1] local f1 = args[2] local i1 = args[3] + local pro2 = args[4] + 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 local tv = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[pro]) * f1)) for _, r in ipairs(list) do + if pro2 and f2 then + tv=tv+floor(BattleUtil.ErrorCorrection(r:GetRoleData(BattlePropList[pro2]) * f2)) + end local auraBuff = Buff.Create(role, BuffName.HOT, i1, 1, tv) auraBuff.interval = 1 r:AddBuff(auraBuff) @@ -2566,7 +2705,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) @@ -2601,15 +2740,15 @@ local passivityList = { end, - -- 战斗第[a]回合无敌 + -- 战斗第开始无敌[a]回合 -- a[int] [141] = function(role, args) local i1 = args[1] local buff BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, function(curRound) -- 第i1回合开始 - if curRound == i1 then - buff = Buff.Create(role, BuffName.Shield, 0, ShieldTypeName.AllReduce, 0, 0) + if curRound == 1 then + buff = Buff.Create(role, BuffName.Shield, i1, ShieldTypeName.AllReduce, 0, 0) buff.clear = false role:AddBuff(buff) end @@ -2626,7 +2765,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) @@ -2640,12 +2779,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 @@ -2657,7 +2802,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] @@ -2671,12 +2816,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 @@ -2702,7 +2853,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] @@ -2710,12 +2861,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 @@ -2726,7 +2883,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] @@ -2740,11 +2897,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 @@ -2778,10 +2941,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)) @@ -2789,7 +2952,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 @@ -2800,14 +2963,14 @@ 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] local ct = args[4] local attor = {} - local onRoleBeHit = function(caster) + local onRoleBeHit = function(caster,damage, bCrit, finalDmg, damageType,skill) if not attor[caster.position] then attor[caster.position] = 1 end @@ -2821,6 +2984,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 @@ -2836,7 +3002,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] @@ -2850,11 +3016,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 @@ -2866,7 +3038,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] @@ -2895,13 +3067,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 @@ -2920,12 +3095,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 @@ -2942,7 +3122,7 @@ local passivityList = { role.Event:AddEvent(BattleEventName.RoleHit, onHit) end, - -- 复活友方第[a]位阵亡的英雄并回复其[b]%的生命每场战斗触发[c]次;复活的如果是[d]阵营,回复[e]% + -- 复活友方[a]位阵亡的英雄并回复其[b]%的生命每场战斗触发[c]次;复活的如果是[d]阵营,回复[e]% -- a[int]b[float]c[int] d[int] e[float] (d,e不配就不会额外回复) [154] = function(role, args) local i1 = args[1] @@ -2961,7 +3141,7 @@ local passivityList = { f1=v1 end counter = counter + 1 - if counter == i1 then + if counter <= i1 then deadRole:SetRelive(f1) end end @@ -3015,20 +3195,28 @@ local passivityList = { role.Event:AddEvent(BattleEventName.BuffCaster, OnBuffCaster) end, - -- 释放技能后回复当前本方阵容最靠前武将[a]点怒气 - -- a[int] - [158] = function(role, args) + -- 释放技能后回复当前本方阵容最靠前[a]名武将[b]点怒气 + -- a[int] b[int] + [158] = function(role, args,id,judge) local i1 = args[1] + local num = args[2] 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) return a.position < b.position end) + local aaa = 0 for i= 1, #list do if list[i] and not list[i]:IsRealDead() then - BattleUtil.CalRage(role, list[i], i1, CountTypeName.Add) - break + BattleUtil.CalRage(role, list[i], num, CountTypeName.Add) + aaa=aaa+1 + if aaa==i1 then + break + end end end end @@ -3081,11 +3269,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) @@ -3184,7 +3375,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] @@ -3192,6 +3383,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) @@ -3205,7 +3399,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) @@ -3215,12 +3409,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 @@ -3231,7 +3431,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] -- 释放技能后 @@ -3246,7 +3446,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) @@ -3286,7 +3486,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] -- 直接伤害后 @@ -3308,7 +3508,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] @@ -3355,7 +3555,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] @@ -3407,7 +3607,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] @@ -3417,12 +3617,12 @@ local passivityList = { end local function onSkillCast(skill) - if skill.type == BattleSkillType.Special then + 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.type == BattleSkillType.Special then + if skill.type == BattleSkillType.Special or skill.type==BattleSkillType.DeadSkill then role.Event:RemoveEvent(BattleEventName.PassiveTreatingFactor, onPassiveTreatingFactor) -- 对每个目标附加减伤盾 local targets = skill:GetDirectTargets() @@ -3438,7 +3638,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] @@ -3462,7 +3662,7 @@ local passivityList = { -- 对别人造成的中毒伤害的[a]%用于治疗自己 -- a[float] - [179] = function(role, args) + [179] = function(role, args,id,judge) local f1 = args[1] local dot = DotType.Poison @@ -3493,7 +3693,7 @@ local passivityList = { -- 攻击单体目标时额外降低目标[a]点怒气 -- a[int] - [181] = function(role, args) + [181] = function(role, args,id,judge) local i1 = args[1] local function onSkillCastEnd(skill) @@ -3509,7 +3709,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] @@ -3559,10 +3759,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) @@ -3595,7 +3795,7 @@ local passivityList = { -- 攻击纵排目标时额外降低目标[a]点怒气 -- a[int] - [186] = function(role, args) + [186] = function(role, args,id,judge) local i1 = args[1] local onSkillCastEnd = function(skill) @@ -3616,7 +3816,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 @@ -3717,10 +3917,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) @@ -3734,7 +3934,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) @@ -3805,7 +4005,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) @@ -3882,7 +4082,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 @@ -3901,7 +4104,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 @@ -3944,9 +4147,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 -- @@ -3999,7 +4202,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) @@ -4025,7 +4228,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] @@ -4039,7 +4242,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() @@ -4102,7 +4305,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) @@ -4116,12 +4319,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)) @@ -4138,7 +4344,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] @@ -4277,7 +4483,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 @@ -4425,7 +4631,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] @@ -4467,14 +4673,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 @@ -4498,14 +4704,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 @@ -4532,7 +4738,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] @@ -4551,11 +4757,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) @@ -4565,23 +4771,26 @@ local passivityList = { end, -- 大闹天宫胜利次数 - [225] = function(role, args) + [225] = function(role, args,id,judge) --王振兴添加 local f1 = args[1] local pro1 = args[2] local ct1 = args[3] local maxNum = args[4] -- 紫+橙 - local num = OutDataManager.GetOutData(role.camp, OutDataName.WinTimes) - + local num = OutDataManager.GetOutData(role.camp,id) + -- LogError("id: "..id.." 胜利次数:"..num) num = min(maxNum, num) + if num==0 then + return + end BattleUtil.AddProp(role, pro1, f1 * num, ct1) end, -- 斩杀生命低于[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) @@ -4605,7 +4814,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] @@ -4622,10 +4831,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) @@ -4633,10 +4842,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) @@ -4768,7 +4977,7 @@ local passivityList = { -- 猎妖之路专属 -- 根据同时拥有夜明珠的数量获得效果:2个:[c]改变[a]的[b];3个:[f]改变[d]的[e];4个:[i]改变[g]的[h] -- a[float],b[属性],c[改变类型],d[float],e[属性],f[改变类型],g[float],h[属性],i[改变类型] - [237] = function(role, args) + [237] = function(role, args,id,judge) local f1 = args[1] local pro1 = args[2] local ct1 = args[3] @@ -4780,7 +4989,7 @@ local passivityList = { local ct3 = args[9] - local num = OutDataManager.GetOutData(role.camp, OutDataName.DarkGlowBallNum) + local num = OutDataManager.GetOutData(role.camp,id) if num >= 2 then BattleUtil.AddProp(role, pro1, f1, ct1) end @@ -4794,7 +5003,7 @@ local passivityList = { -- 猎妖之路专属 -- 在大闹天空的第[a]层中,我方武将[d]改变[b]的[c],[g改变[e]的[f] -- a[位置],b[float],c[属性],d[改变类型],e[float],f[属性],g[改变类型] - [238] = function(role, args) + [238] = function(role, args,id,judge) local flr = args[1] local f1 = args[2] local pro1 = args[3] @@ -4803,7 +5012,7 @@ local passivityList = { local pro2 = args[6] local ct2 = args[7] - if OutDataManager.GetOutData(role.camp, OutDataName.DaNaoTianGongFloor) == flr then + if OutDataManager.GetOutData(role.camp,id) == flr then BattleUtil.AddProp(role, pro1, f1, ct1) BattleUtil.AddProp(role, pro2, f2, ct2) end @@ -4811,7 +5020,7 @@ local passivityList = { -- 猎妖之路专属 -- 每有一件紫色品质以上的战利品,我方武将[d]改变[b]的[c],[g改变[e]的[f],最多[h]层 -- b[float],c[属性],d[改变类型],e[float],f[属性],g[改变类型],h[int] - [239] = function(role, args) + [239] = function(role, args,id,judge) local f1 = args[1] local pro1 = args[2] local ct1 = args[3] @@ -4821,7 +5030,7 @@ local passivityList = { local maxNum = args[7] -- 紫+橙 - local num = OutDataManager.GetOutData(role.camp, OutDataName.OrangeGloryItemNum) + OutDataManager.GetOutData(role.camp, OutDataName.RedGloryItemNum) + local num = OutDataManager.GetOutData(role.camp, id) num = min(maxNum, num) BattleUtil.AddProp(role, pro1, f1 * num, ct1) BattleUtil.AddProp(role, pro2, f2 * num, ct2) @@ -4829,15 +5038,15 @@ local passivityList = { -- 猎妖之路专属 -- 每使用一次神秘药水,我方武将[c]改变[a]的[b],最多[d]层 -- a[float],b[属性],c[改变类型],d[int] - [240] = function(role, args) + [240] = function(role, args,id,judge) local f1 = args[1] local pro1 = args[2] local ct1 = args[3] local maxNum = args[4] -- 紫+橙 - local num = OutDataManager.GetOutData(role.camp, OutDataName.MisteryLiquidUsedTimes) - + local num = OutDataManager.GetOutData(role.camp, id) + --LogError("笔使用次数:"..num) num = min(maxNum, num) BattleUtil.AddProp(role, pro1, f1 * num, ct1) end, @@ -4862,12 +5071,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) @@ -4878,10 +5090,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) @@ -4899,9 +5111,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 @@ -4928,6 +5143,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 @@ -4952,10 +5170,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 @@ -4975,10 +5196,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 @@ -4997,17 +5221,24 @@ 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 isKill =false -- 释放技能后 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 + 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) + -- local buff = Buff.Create(role, BuffName.PropertyChange, 1, RoleDataName.Crit, f1, CountTypeName.Add) + -- role:AddBuff(buff) + isKill = true if skill then --skill.isTriggePassivity=true table.insert(skill.triggerPassivityId,id) @@ -5015,11 +5246,31 @@ local passivityList = { end end role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit) + + local onRoundChange=function(round2) + if round2==round+1 and isKill then + role.mustCrit=true + else + role.mustCrit=false + isKill=false + end + round=round2 + end + + BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, onRoundChange) + + + local onRoundStart=function(round2) + isKill=false + end + + BattleLogic.Event:AddEvent(BattleEventName.BattleRoundStart, onRoundStart) + end, -- 直接伤害每次击杀目标增加自身伤害[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] @@ -5065,7 +5316,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) @@ -5094,7 +5345,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 @@ -5114,13 +5365,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 @@ -5144,7 +5395,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 @@ -5165,7 +5416,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 @@ -5191,6 +5442,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 @@ -5202,6 +5456,9 @@ local passivityList = { if skill and skill.type== BattleSkillType.ChaosNormal and judge==1 then return end + if not skill 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) @@ -5217,12 +5474,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) @@ -5242,17 +5502,19 @@ 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) - --如果是boss 并且额外伤害是根据最大生命则返回 - local isBoss=BattleUtil.CheckIsBoss(defRole) - if isBoss and (f1==12 or f1==13) then + 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 + return + end local val = -floor(BattleUtil.FP_Mul(dt, defRole:GetRoleData(BattlePropList[f1]))) if func then func(val) @@ -5263,10 +5525,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 @@ -5274,6 +5539,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 @@ -5282,11 +5550,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 @@ -5300,13 +5571,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 @@ -5326,9 +5600,9 @@ local passivityList = { end role.Event:AddEvent(BattleEventName.SkillCastEnd, OnRoleHit) end, - -- 每释放[a]次技能,[b]增加[c]%,可叠加[d]次 + -- 每释放[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] @@ -5337,11 +5611,16 @@ 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 小于最大叠加次数 - if releaseNum>0 and releaseNum%num==0 and addNum