From 129b9ed2ace4fc58734b0796fa5c28fa7e478d83 Mon Sep 17 00:00:00 2001 From: duhui Date: Tue, 2 Mar 2021 17:14:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=98=E6=96=97=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- luafight/Modules/Battle/Logic/Base/Effect.lua | 38 +- .../Battle/Logic/Base/EffectCaster.lua | 42 +- .../Modules/Battle/Logic/Base/Passivity.lua | 1004 ++++++++++++----- luafight/Modules/Battle/Logic/BattleLogic.lua | 12 +- luafight/Modules/Battle/Logic/Buff/Shield.lua | 22 + .../Battle/Logic/Misc/BattleDefine.lua | 3 +- .../Modules/Battle/Logic/Misc/BattleUtil.lua | 133 ++- .../Modules/Battle/Logic/Role/RoleLogic.lua | 36 +- luafight/Modules/Battle/Logic/Role/Skill.lua | 8 +- .../Modules/Battle/Logic/SkillManager.lua | 67 +- luafight/Modules/Battle/Readme.txt | 42 + .../src/main/java/config/SRobotProperty.java | 5 +- 12 files changed, 1043 insertions(+), 369 deletions(-) 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 0 then - -- Чӳ1֡Ч + -- 效果延迟1帧生效 BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function() local effects = effectGroup.effects local weight = math.floor(chooseId % 10000 / 100) @@ -125,10 +125,10 @@ function EffectCaster:Cast() if count == 0 then count = #arr end - -- ȫͬʱЧ + -- 全部同时生效 for j=1, count do if arr[j] and not arr[j]:IsRealDead() then - -- Ƿ + -- 检测是否命中 if i == 1 then self.targetIsHit[arr[j]] = BattleUtil.CheckIsHit(self.skill.owner, arr[j],self.skill) end @@ -140,7 +140,7 @@ function EffectCaster:Cast() end end --- Ŀ +-- 遍历技能命中目标 function EffectCaster:ForeachTargets(func) local targets = self:GetDirectTargets() for _, role in ipairs(targets) do @@ -150,7 +150,7 @@ function EffectCaster:ForeachTargets(func) end end --- ȡֱѡĿId +-- 获取直接选择目标Id function EffectCaster:GetDirectChooseId() local effectGroup = self.effectList[1] local chooseId = effectGroup.chooseId @@ -158,12 +158,12 @@ function EffectCaster:GetDirectChooseId() end --- ȡֱܵĿ꣬Ͳ߻涨һЧĿΪֱЧĿ,(missĿ) +-- 获取技能的直接目标,和策划规定第一个效果的目标为直接效果目标,(包含miss的目标) function EffectCaster:GetDirectTargets() return self.effectTargets[1] end --- ȡֱĿ꣬missĿ꣬Ϊ +-- 获取直接目标,不包含miss的目标,可能为空 function EffectCaster:GetDirectTargetsNoMiss() local list = {} for _, role in ipairs(self.effectTargets[1]) do @@ -174,7 +174,7 @@ function EffectCaster:GetDirectTargetsNoMiss() return list end --- ȡĿ +-- 获取技能目标最大人数 function EffectCaster:GetMaxTargetNum() local mainEffect = self.effectList[1] if not mainEffect then @@ -183,7 +183,7 @@ function EffectCaster:GetMaxTargetNum() return BattleUtil.GetMaxTargetNum(mainEffect.chooseId) end --- жǷ +-- 判断是否命中 function EffectCaster:CheckTargetIsHit(role) return self.targetIsHit[role] end diff --git a/luafight/Modules/Battle/Logic/Base/Passivity.lua b/luafight/Modules/Battle/Logic/Base/Passivity.lua index f07875da9..dddd235ff 100644 --- a/luafight/Modules/Battle/Logic/Base/Passivity.lua +++ b/luafight/Modules/Battle/Logic/Base/Passivity.lua @@ -45,12 +45,12 @@ end local passivityList = { --发动技能时,[a]的概率将[b]*[c]算作[d]计算 --a[float],b[属性],c[float],d[属性] - [1] = function(role, args) + [1] = function(role, args,id,judge) local f1 = args[1] local pro1 = args[2] local f2 = args[3] local pro2 = args[4] - local OnSkillCast = function(skill) + local OnSkillCast = function(skill) BattleUtil.RandomAction(f1, function () local duration = 0 for i=1, #skill.effectCaster.effectList do @@ -64,7 +64,7 @@ local passivityList = { --发动技能后,[a]的概率对敌方随机1名施加攻击*[c]的[d]伤害。 --a[float],c[float],d[伤害类型] - [2] = function(role, args) + [2] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] local dt = args[3] @@ -82,7 +82,7 @@ local passivityList = { --发动技能后,[c]使仇恨目标受到治疗效果降低[a],持续[b] --a[float],b[int],c[float] - [3] = function(role, args) + [3] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] local f3 = args[3] @@ -100,7 +100,7 @@ local passivityList = { --发动技能后,[d]改变自身[a]属性[b],持续[c]秒 --a[属性],b[float],c[int],d[改变类型] - [4] = function(role, args) + [4] = function(role, args,id,judge) local pro = args[1] local f1 = args[2] local f2 = args[3] @@ -114,7 +114,7 @@ local passivityList = { --发动技能后,[a]的概率回复攻击最高的1人的[b]*[c]血量,持续[d]秒。 --a[float],b[属性],c[float],d[int] - [5] = function(role, args) + [5] = function(role, args,id,judge) local f1 = args[1] local pro = args[2] local f2 = args[3] @@ -134,7 +134,7 @@ local passivityList = { --发动技能后,[a]的概率提升随机角色的[b]*[c]的[d],持续[e]秒。 --a[float],b[属性],c[float],d[属性],e[int] - [6] = function(role, args) + [6] = function(role, args,id,judge) local f1 = args[1] local pro1 = args[2] local f2 = args[3] @@ -169,12 +169,12 @@ local passivityList = { --受击后,[a]的概率,回复自身的[b]*[c]的血量 --a[float],b[属性],c[float] - [8] = function(role, args) + [8] = function(role, args,id,judge) local f1 = args[1] local pro = args[2] local f2 = args[3] - local OnBeHit = function(treatingFunc) + local OnBeHit = function(atkRole,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) @@ -185,13 +185,13 @@ local passivityList = { --受击后,[a]对攻击者造成的攻击*[c]的持续伤害,持续[d]秒。 --a[float],c[float],d[int] - [9] = function(role, args) + [9] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] local f3 = args[3] local triggerUid = {} - local OnBeHit = function(atkRole) + local OnBeHit = function(atkRole,damage, bCrit, finalDmg, damageType,skill) if atkRole.isTeam then return end @@ -211,14 +211,14 @@ local passivityList = { --受击时[e],[a]的概率将[b]*[c]算作[d]计算 --a[float],b[属性],c[float],d[属性],e[伤害类型] - [10] = function(role, args) + [10] = function(role, args,id,judge) local f1 = args[1] local pro1 = args[2] local f2 = args[3] local pro2 = args[4] local dt = args[5] - local OnRoleBeDamagedBefore = function(atkRole, func, damageType) + local OnRoleBeDamagedBefore = function(atkRole, factorFunc, damageType, skill) if damageType == dt then BattleUtil.RandomAction(f1, function () role:AddPropertyTransfer(BattlePropList[pro1], f2, BattlePropList[pro2], 2, BattleLogic.GameDeltaTime) @@ -230,12 +230,12 @@ local passivityList = { --受击时,有[a]的概率抵消[b]*[c]的攻击。 --a[float],b[属性],c[float] - [11] = function(role, args) + [11] = function(role, args,id,judge) local f1 = args[1] local pro = args[2] local f2 = args[3] - local OnPassiveDamaging = function(damagingFunc, atkRole, damage) + local OnPassiveDamaging = function(damagingFunc, atkRole, damage,skill) BattleUtil.RandomAction(f1, function () damagingFunc(floor(BattleUtil.FP_Mul(f2, role:GetRoleData(BattlePropList[pro])))) end) @@ -245,13 +245,13 @@ local passivityList = { --受击后,有[a]的概率对敌方全体造成攻击*[c]的[d]伤害 --a[float],c[float],d[伤害类型] - [12] = function(role, args) + [12] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] local dt = args[3] local lastTrigger = 0 - local OnBeHit = function(atkRole) + local OnBeHit = function(atkRole,damage, aaa, finalDmg, bbb, skill) if atkRole.isTeam then return end @@ -272,13 +272,13 @@ local passivityList = { --受击后,有[a]的概率对随机1人造成[b]*[c]的真实伤害。 --a[float],b[属性],c[float] - [13] = function(role, args) + [13] = function(role, args,id,judge) local f1 = args[1] local pro = args[2] local f2 = args[3] local lastTrigger = 0 - local OnBeHit = function(atkRole) + local OnBeHit = function(atkRole,damage, bCrit, finalDmg, damageType,skill) if atkRole.isTeam then return end @@ -300,7 +300,7 @@ local passivityList = { --受击后[f],[a]的概率将[b]*[c]算作[d]计算,持续[e]秒。 --a[float],b[属性],c[float],d[属性],e[int],f[伤害类型] - [14] = function(role, args) + [14] = function(role, args,id,judge) local f1 = args[1] local pro1 = args[2] local f2 = args[3] @@ -308,7 +308,7 @@ local passivityList = { local f3 = args[5] local dt = args[6] - local OnBeHit = function(atkRole, damage, bCrit, finalDmg, damageType) + local OnBeHit = function(atkRole,damage, bCrit, finalDmg, damageType,skill) if damageType == dt then BattleUtil.RandomAction(f1, function () role:AddPropertyTransfer(BattlePropList[pro1], f2, BattlePropList[pro2], 2, f3) @@ -341,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] @@ -358,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] @@ -375,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] @@ -456,13 +456,13 @@ local passivityList = { --血量低于[a]时,[b]概率触发控制免疫,持续[c]秒。每场战斗只能触发1次。 --a[float],b[float],c[int] - [22] = function(role, args) + [22] = function(role, args,id,judge) local f1 = args[1] local f2 = args[2] local f3 = args[3] local triggerCount = 0 - local OnBeHit = function(atkRole) + local OnBeHit = function(atkRole,damage, bCrit, finalDmg, damageType,skill) if BattleUtil.GetHPPencent(role) < f1 then if triggerCount < 1 then BattleUtil.RandomAction(f2, function () @@ -477,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]))) @@ -530,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 @@ -554,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) @@ -570,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 @@ -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 @@ -1799,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) @@ -1825,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 @@ -1848,7 +1896,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 +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 @@ -1921,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 @@ -1961,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 @@ -1976,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 @@ -1986,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 @@ -1995,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) @@ -2019,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 @@ -2043,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) @@ -2057,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] @@ -2067,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) @@ -2086,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 @@ -2098,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 @@ -2122,16 +2200,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 +2224,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 +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 @@ -2171,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 @@ -2193,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 @@ -2214,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 @@ -2230,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) @@ -2275,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 @@ -2345,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] @@ -2359,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] @@ -2389,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, @@ -2422,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] @@ -2430,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 @@ -2447,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] @@ -2458,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 @@ -2474,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 @@ -2519,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 @@ -2540,19 +2664,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 +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) @@ -2626,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) @@ -2640,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 @@ -2657,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] @@ -2671,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 @@ -2702,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] @@ -2710,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 @@ -2726,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] @@ -2740,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 @@ -2778,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)) @@ -2789,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 @@ -2800,14 +2956,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 +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 @@ -2836,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] @@ -2850,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 @@ -2866,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] @@ -2895,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 @@ -2920,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 @@ -3017,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) @@ -3081,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) @@ -3184,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] @@ -3192,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) @@ -3205,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) @@ -3215,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 @@ -3231,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] -- 释放技能后 @@ -3246,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) @@ -3286,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] -- 直接伤害后 @@ -3308,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] @@ -3355,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] @@ -3407,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] @@ -3417,12 +3605,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 +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] @@ -3462,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 @@ -3493,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) @@ -3509,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] @@ -3559,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) @@ -3595,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) @@ -3616,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 @@ -3717,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) @@ -3734,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) @@ -3805,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) @@ -3882,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 @@ -3901,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 @@ -3944,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 -- @@ -3999,7 +4190,7 @@ local passivityList = { damagingFunc(shareDamage) end -- 分担伤害 - BattleUtil.FinalDamage(nil, atkRole, role, shareDamage,bCrit,damageType,dotType,true) + BattleUtil.ApplyDamage(skill, atkRole, role, shareDamage,false,damageType,dotType,true) end end BattleLogic.Event:AddEvent(BattleEventName.FinalDamage, onFinalDamage) @@ -4025,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] @@ -4039,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() @@ -4102,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) @@ -4116,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)) @@ -4138,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] @@ -4277,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 @@ -4425,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] @@ -4467,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 @@ -4498,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 @@ -4532,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] @@ -4551,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) @@ -4581,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) @@ -4605,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] @@ -4622,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) @@ -4633,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) @@ -4862,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) @@ -4878,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) @@ -4899,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 @@ -4928,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 @@ -4952,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 @@ -4975,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 @@ -4997,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) @@ -5019,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] @@ -5065,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) @@ -5094,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 @@ -5114,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 @@ -5144,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 @@ -5165,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 @@ -5191,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 @@ -5202,6 +5425,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 +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) @@ -5242,17 +5471,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 +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 @@ -5274,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 @@ -5282,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 @@ -5300,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 @@ -5326,9 +5569,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 +5580,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