From 0494ff83f2942b7354e8ce72b5d38ee66191c769 Mon Sep 17 00:00:00 2001 From: lvxinran Date: Fri, 27 Nov 2020 16:52:55 +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 | 6 +- .../Modules/Battle/Logic/Base/Passivity.lua | 525 +++++++++++++++--- .../Modules/Battle/Logic/BattleLogManager.lua | 2 + luafight/Modules/Battle/Logic/BattleLogic.lua | 54 +- luafight/Modules/Battle/Logic/Buff/Immune.lua | 20 +- luafight/Modules/Battle/Logic/Buff/Shield.lua | 14 +- .../Battle/Logic/Misc/BattleDefine.lua | 8 + .../Modules/Battle/Logic/Misc/BattleUtil.lua | 13 +- .../Logic/Monster/MonsterSkill/MSkill.lua | 1 - .../Monster/MonsterSkill/MSkillGroup.lua | 1 - .../Logic/Monster/MonsterSkill/MTrigger.lua | 1 - .../Modules/Battle/Logic/Role/RoleLogic.lua | 64 ++- .../Modules/Battle/Logic/SkillManager.lua | 38 +- 13 files changed, 592 insertions(+), 155 deletions(-) diff --git a/luafight/Modules/Battle/Logic/Base/Effect.lua b/luafight/Modules/Battle/Logic/Base/Effect.lua index 615e9ab12..2525f4aad 100644 --- a/luafight/Modules/Battle/Logic/Base/Effect.lua +++ b/luafight/Modules/Battle/Logic/Base/Effect.lua @@ -2271,7 +2271,7 @@ local effectList = { BattleUtil.FinalDamage(skill, caster, target, damage, nil, 0, nil, true) end) end, - --瞬间恢复[a]*[b]%生命 + --瞬间恢复目标[a]*[b]%生命 --a[属性],b[float] [119] = function(caster, target, args, interval, skill) local pro1 = args[1] @@ -2281,7 +2281,9 @@ local effectList = { BattleUtil.CalTreat(caster, target, val) end) end, - + + + } return effectList \ No newline at end of file diff --git a/luafight/Modules/Battle/Logic/Base/Passivity.lua b/luafight/Modules/Battle/Logic/Base/Passivity.lua index a45cb7ea7..9acc343e9 100644 --- a/luafight/Modules/Battle/Logic/Base/Passivity.lua +++ b/luafight/Modules/Battle/Logic/Base/Passivity.lua @@ -50,7 +50,6 @@ local passivityList = { local pro1 = args[2] local f2 = args[3] local pro2 = args[4] - local OnSkillCast = function(skill) BattleUtil.RandomAction(f1, function () local duration = 0 @@ -664,7 +663,7 @@ local passivityList = { local OnPassiveDamaging = function(damagingFunc) damagingFunc(-f1) end - role.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging) + role.Event:AddEvent(BattleEventName.PassiveDamiaging, OnPassiveDamaging) end, --进入战斗[a]秒后,造成的伤害提升[b],持续[c]秒 @@ -1479,7 +1478,6 @@ local passivityList = { [78] = function(role, args) local pro = args[1] local f1 = args[2] - LogBattle("开始治疗") --这里加一个延时,防止执行时显示层还没有初始化,从而没有表现 BattleLogic.WaitForTrigger(0.05, function() local val = floor(BattleUtil.FP_Mul(f1, role:GetRoleData(BattlePropList[pro]))) @@ -1531,13 +1529,17 @@ local passivityList = { role.data:CountValue(BattlePropList[pro], f1, ct) end, - -- 技能伤害增加[a]%,[b]改变 +-- 技能伤害增加[a]%,[b]改变 -- a[float]b[改变类型] - [91] = function(role, args) + [91] = function(role, args,id,judge) local f1 = args[1] local ct = args[2] - local passivityDamaging = function(func, caster, damage) - if func then + local passivityDamaging = function(func, caster, damage,skill, dotType, bCrit) + --处理伏虎觉醒十星附加的额外技能,额外技能不触发这个特性 2020/11/17 wangzhenxing + if skill and skill.type== BattleSkillType.Extra and skill.owner.roleId==10015 and judge==1 then + return + 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 @@ -1706,7 +1708,7 @@ local passivityList = { local arr = RoleManager.Query(function (r) return r.camp == role.camp end) BattleUtil.SortByHpFactor(arr, 1) - -- 检测技能伤害治疗加成 + -- 检测技能伤害���疗加成 local f = BattleUtil.CheckSkillDamageHeal(f1, role, arr[1]) -- 治疗血量最低队友实际伤害的f1% BattleUtil.ApplyTreat(role, arr[1], floor(BattleUtil.ErrorCorrection(allDamage*f))) @@ -1910,7 +1912,8 @@ local passivityList = { [109] = function(role, args) local i1 = args[1] local onBeSkillCastEnd = function(skill) - if skill.type == BattleSkillType.Normal then + --同阵营普工加血不触发被动 + if skill.type == BattleSkillType.Normal and skill.owner and skill.owner.camp~=role.camp then role:AddRage(i1, CountTypeName.Add) end end @@ -1952,13 +1955,17 @@ local passivityList = { -- 战斗第[a]回合造成伤害必定暴击 -- a[int] - [112] = function(role, args) + [112] = function(role, args,id,judge) local i1 = args[1] local function onRoleDamageAfter(target) target.isFlagCrit = false role.Event:RemoveEvent(BattleEventName.RoleDamageAfter, onRoleDamageAfter) end - local function onRoleDamageBefore(target) + local function onRoleDamageBefore(target, factorFunc, damageType, skill) + --处理伏虎觉醒十星附加的额外技能,额外技能不触发这个特性 2020/11/17 wangzhenxing + if skill and skill.type== BattleSkillType.Extra and skill.owner.roleId==10015 and judge==1 then + return + end if BattleLogic.GetCurRound() == i1 then target.isFlagCrit = true role.Event:AddEvent(BattleEventName.RoleDamageAfter, onRoleDamageAfter) @@ -2003,9 +2010,9 @@ local passivityList = { end, - -- 战斗第[a]回合增加[c]%的自身伤害持续[e]回合,[f]改变 + -- 战斗第[a]回合增加[c]%的自身伤害持续[e]回合,[f]改变 -- a[int]c[float]e[int]f[改变] - [115] = function(role, args) + [115] = function(role, args,id,judge) local i1 = args[1] local f1 = args[2] local i2 = args[3] or 1 @@ -2013,7 +2020,11 @@ local passivityList = { -- 如果是技能的伤害则判断加成 local onPassiveDamaging = function(func, target, damage, skill) - if skill then + --处理伏虎觉醒十星附加的额外技能,额外技能不触发这个特性 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 local dd = BattleUtil.CountValue(damage, f1, ct) - damage if func then func(-floor(BattleUtil.ErrorCorrection(dd))) end end @@ -2495,7 +2506,8 @@ local passivityList = { -- 普攻后 local onSkillEnd = function(skill) - if skill.type == BattleSkillType.Normal then + --己方普攻不会触发被动 + if skill.type == BattleSkillType.Normal and skill.owner and skill.owner.camp~=role.camp then local caster = skill.owner local attack = role:GetRoleData(RoleDataName.Attack) local damage = floor(BattleUtil.ErrorCorrection(attack * 0.2)) @@ -2518,7 +2530,6 @@ local passivityList = { local list = skill:GetDirectTargetsNoMiss() if list then local tv = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[pro]) * f1)) - LogBattle(role:GetRoleData(pro).." ".. f1.." " .. tv) for _, r in ipairs(list) do local auraBuff = Buff.Create(role, BuffName.HOT, i1, 1, tv) auraBuff.interval = 1 @@ -2542,7 +2553,6 @@ local passivityList = { local list = skill:GetDirectTargetsNoMiss() if list then local tv = floor(BattleUtil.ErrorCorrection(role:GetRoleData(BattlePropList[pro]) * f1)) - LogBattle(role:GetRoleData(pro).." ".. f1.." " .. tv) for _, r in ipairs(list) do local auraBuff = Buff.Create(role, BuffName.HOT, i1, 1, tv) auraBuff.interval = 1 @@ -2738,7 +2748,7 @@ local passivityList = { role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillCastEnd) end, - -- 受到攻击有[a]%概率使攻击者[b](每回合造成被击者自身20%攻击力的伤害)持续[c]回合 + -- 受到攻击有[a]%概率使攻击者[b](每回合造成被击者自身20%攻击力的伤害)持续[c]回合 -- a[float]b[持续伤害状态]c[int] [147] = function(role, args) local f1 = args[1] @@ -2747,14 +2757,13 @@ local passivityList = { -- 技能后后 local onRoleBeHit = function(caster) + local attack = role:GetRoleData(RoleDataName.Attack) local damage = floor(BattleUtil.ErrorCorrection(attack * 0.2)) BattleUtil.RandomDot(f1, dot, role, caster, i1, 1, damage) end role.Event:AddEvent(BattleEventName.RoleBeHit, onRoleBeHit) end, - - -- 直接伤害击杀[a]目标回复[b]%的最大生命 -- a[持续伤害状态]b[float] [148] = function(role, args) @@ -3025,7 +3034,7 @@ local passivityList = { -- 技能后后 local onBeSkillCastEnd = function(skill) - if skill.type == BattleSkillType.Normal then + if skill.type == BattleSkillType.Normal and skill.owner and skill.owner.camp~=role.camp then local attack = role:GetRoleData(RoleDataName.Attack) local damage = floor(BattleUtil.ErrorCorrection(attack * f2)) BattleUtil.RandomDot(f1, dot, role, skill.owner, i1, 1, damage) @@ -3613,8 +3622,8 @@ local passivityList = { table.insert(cl, {v, ct}) end end - role.Event:DispatchEvent(BattleEventName.PassiveDamageShare, _CallBack) - atkRole.Event:DispatchEvent(BattleEventName.PassiveDamageBeShare, _CallBack) + role.Event:DispatchEvent(BattleEventName.PassiveDamageShare, _CallBack,skill) + atkRole.Event:DispatchEvent(BattleEventName.PassiveDamageBeShare, _CallBack,skill) ff = BattleUtil.CountChangeList(ff, cl) -- 计算分摊伤害 @@ -3791,29 +3800,49 @@ local passivityList = { local immune = function(buff) return buff.type == BuffName.Control and (BattleUtil.ChecklistIsContainValue(ctrls,buff.ctrlType)) end - + local curBuff=nil BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, function(curRound) -- 第i1回合开始 if curRound == 1 then - role.buffFilter:Add(immune) + -- role.buffFilter:Add(immune) + curBuff=Buff.Create(role, BuffName.Immune, 1,4,immune) + role:AddBuff(curBuff) end -- 第i1+i2回合结束 if curRound == 2 then - for i = 1, role.buffFilter.size do - if role.buffFilter.buffer[i] == immune then - role.buffFilter:Remove(i) - break - end + -- for i = 1, role.buffFilter.size do + -- if role.buffFilter.buffer[i] == immune then + -- role.buffFilter:Remove(i) + -- break + -- end + -- end + if curBuff then + BattleLogic.BuffMgr:ClearBuff(role, function (buff) + return buff==curBuff + end) end + end end) end, -- 对敌方造成伤害如被分摊其分摊比降低[a]% -- a[float] - [196] = function(role, args) + [196] = function(role, args,id,judge) local f1 = args[1] - local onDamageBeShare = function(func) + local type = args[2] + local onDamageBeShare = function(func,skill) + --普攻不会被降低分摊 2020/11/17 wangzhenxing lihaiyang + if type==1 and skill and skill.type~=BattleSkillType.Normal then + return + end + if type==2 and skill and skill.type~=BattleSkillType.Special and skill.type~=BattleSkillType.Extra 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 func then func(f1, CountTypeName.Sub) end end role.Event:AddEvent(BattleEventName.PassiveDamageBeShare, onDamageBeShare) @@ -3888,7 +3917,18 @@ local passivityList = { local onFinalDamage = function(damagingFunc, atkRole, defRole, damage, skill, dotType, bCrit, damageType) if not role:IsDead() and skill and role.position ~= defRole.position and defRole.camp == role.camp and defRole.element == role.element then - local shareDamage = floor(BattleUtil.ErrorCorrection(damage * f1)) + local ff = 1 -- 分摊比 + -- 检测被动对分摊比的影响 + local cl = {} + local function _CallBack(v, ct) + if v then + table.insert(cl, {v, ct}) + end + end + role.Event:DispatchEvent(BattleEventName.PassiveDamageShare, _CallBack,skill) + atkRole.Event:DispatchEvent(BattleEventName.PassiveDamageBeShare, _CallBack,skill) + ff = BattleUtil.CountChangeList(ff, cl) + local shareDamage = floor(BattleUtil.ErrorCorrection(damage * f1*ff)) -- 被攻击武将自身伤害 if damagingFunc then damagingFunc(shareDamage) @@ -3898,7 +3938,7 @@ local passivityList = { end end BattleLogic.Event:AddEvent(BattleEventName.FinalDamage, onFinalDamage) - + end, -- 初始怒气增加[a]点并且目标血量低于[b]%时即有概率秒杀(对应秒杀技能) @@ -4009,9 +4049,7 @@ local passivityList = { role.Event:AddEvent(BattleEventName.PassiveDamaging, passivityDamaging) end, - - - --技能治疗系数[a]改变[b]%(作用于主动技能效果103) + --技能治疗系数[a]改变[b]%(作用于主动技能效果103) --a[改变类型]b[float] [206] = function(role, args) local ct = args[1] @@ -4029,7 +4067,6 @@ local passivityList = { role.Event:AddEvent(BattleEventName.SkillEffectBefore, onSkillEffectBefore) end, - -- 释放技能有[a]%几率对敌方后排造成[b]%[c]伤害 -- a[float]b[float]c[伤害类型] [207] = function(role, args) @@ -4793,18 +4830,18 @@ local passivityList = { end, -- (直接伤害(目前没有明确定义直接伤害))直接伤害击杀目标自身增加[a]点怒气 重写92被动效果 每次释放技能只触发一次 -- a[int] - [245] = function(role, args) + [245] = function(role, args,id) local i1 = args[1] local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) --如果是技能并且这个被动已经被触发过 return - if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,245) then + if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return end if skill and not skill.isAdd and defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then role:AddRage(i1, CountTypeName.Add) if skill then -- skill.isTriggePassivity=true - table.insert(skill.triggerPassivityId,245) + table.insert(skill.triggerPassivityId,id) end end end @@ -4813,14 +4850,14 @@ local passivityList = { -- 直接伤害每次击杀目标增加[a]%的[b]可叠加持续至战斗结束[c]改变 重写103效果 每次释放技能只触发一次 -- a[float]b[属性]c[改变类型] - [246] = function(role, args) + [246] = function(role, args,id) local f1 = args[1] local pro = args[2] local ct = args[3] -- 释放技能后 local onRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) --如果是技能并且这个被动已经被触发过 return - if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,246) then + if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return end if defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then @@ -4829,7 +4866,7 @@ local passivityList = { role:AddBuff(buff) if skill then --skill.isTriggePassivity=true - table.insert(skill.triggerPassivityId,246) + table.insert(skill.triggerPassivityId,id) end end end @@ -4837,12 +4874,12 @@ local passivityList = { end, -- 直接伤害击杀目标后追加[a]次普攻 重写114 一次技能只触发一次被动 -- a[int] - [247] = function(role, args) + [247] = function(role, args,id) local i1 = args[1] -- 释放技能后 local onRoleHit = function(target,damage, bCrit, finalDmg, damageType, skill) --如果是技能并且这个被动已经被触发过 return - if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,247) then + if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then @@ -4851,7 +4888,7 @@ local passivityList = { end if skill then -- skill.isTriggePassivity=true - table.insert(skill.triggerPassivityId,247) + table.insert(skill.triggerPassivityId,id) end end end @@ -4860,12 +4897,12 @@ local passivityList = { -- 直接伤害击杀目标回复自身[a]%的[b] 重写116 一次技能只触发一次被动 -- a[float] - [248] = function(role, args) + [248] = function(role, args,id) local f1 = args[1] -- 释放技能后 local onRoleHit = function(target,damage, bCrit, finalDmg, damageType, skill) --如果是技能并且这个被动已经被触发过 return - if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,248) then + if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then @@ -4873,7 +4910,7 @@ local passivityList = { BattleUtil.CalTreat(role, role, treat) if skill then -- skill.isTriggePassivity=true - table.insert(skill.triggerPassivityId,248) + table.insert(skill.triggerPassivityId,id) end end end @@ -4882,12 +4919,12 @@ local passivityList = { -- 直接伤害击杀目标下回合攻击[a]%暴击(TODO:目前为增加[a]%) 重写125 一次技能只触发一次被动 -- a[float] - [249] = function(role, args) + [249] = function(role, args,id) local f1 = args[1] -- 释放技能后 local onRoleHit = function(target,damage, bCrit, finalDmg, damageType, skill) --如果是技能并且这个被动已经被触发过 return - if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,249) then + if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then @@ -4895,7 +4932,7 @@ local passivityList = { role:AddBuff(buff) if skill then --skill.isTriggePassivity=true - table.insert(skill.triggerPassivityId,249) + table.insert(skill.triggerPassivityId,id) end end end @@ -4904,7 +4941,7 @@ local passivityList = { -- 直接伤害每次击杀目标增加自身伤害[a]%,[b]改变,可叠加持续至战斗结束 重写132 一次技能只触发一次被动 -- a[float]b[改变类型] - [250] = function(role, args) + [250] = function(role, args,id) local f1 = args[1] local ct = args[2] @@ -4914,14 +4951,14 @@ local passivityList = { -- 击杀数量累加 local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill) --如果是技能并且这个被动已经被触发过 return - if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,250) then + if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return end if skill and defRole:IsDead() and not BattleUtil.CheckIsNoDead(defRole) then killNum = killNum + 1 if skill then --skill.isTriggePassivity=true - table.insert(skill.triggerPassivityId,250) + table.insert(skill.triggerPassivityId,id) end end end @@ -4950,12 +4987,12 @@ local passivityList = { -- 直接伤害击杀[a]目标回复[b]%的最大生命 重写148 一次技能只触发一次被动 -- a[持续伤害状态]b[float] - [251] = function(role, args) + [251] = function(role, args,id) local dot = args[1] local f1 = args[2] local function onHit(target, damage, bCrit, finalDmg, damageType, skill) --如果是技能并且这个被动已经被触发过 return - if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,251) then + if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then @@ -4964,7 +5001,7 @@ local passivityList = { BattleUtil.ApplyTreat(role, role, value) if skill then --skill.isTriggePassivity=true - table.insert(skill.triggerPassivityId,251) + table.insert(skill.triggerPassivityId,id) end end role.Event:RemoveEvent(BattleEventName.RoleHit, onHit) @@ -4979,18 +5016,18 @@ local passivityList = { -- 直接伤害击杀目标回复自身[a]点怒气 重写153 一次技能只触发一次被动 -- a[int] - [252] = function(role, args) + [252] = function(role, args,id) local i1 = args[1] local onHit = function(target, damage, bCrit, finalDmg,damageType,skill) --如果是技能并且这个被动已经被触发过 return - if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,252) then + if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then role:AddRage(i1, CountTypeName.Add) if skill then --skill.isTriggePassivity=true - table.insert(skill.triggerPassivityId,252) + table.insert(skill.triggerPassivityId,id) end end end @@ -4999,13 +5036,13 @@ local passivityList = { -- 击杀目标后对敌方血量百分比最低两名角色造成[a]%[b]伤害 重写170 一次技能只触发一次被动 -- a[float]b[伤害类型] - [253] = function(role, args) + [253] = function(role, args,id) 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,253) then + --如果是技能并且这个被动已经被触发����� return + 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 @@ -5020,7 +5057,7 @@ local passivityList = { end if skill then --skill.isTriggePassivity=true - table.insert(skill.triggerPassivityId,253) + table.insert(skill.triggerPassivityId,id) end end end @@ -5029,11 +5066,11 @@ local passivityList = { -- 直接伤害击杀目标对仇恨目标造成[a]%物理伤害 重写185 一次技能只触发一次被动 -- a[float] - [254] = function(role, args) + [254] = function(role, args,id) local f1 = args[1] local onRoleHit = function(target,damage, bCrit, finalDmg, damageType, skill) --如果是技能并且这个被动已经被触发过 return - if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,254) then + if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return end if target:IsDead() and not BattleUtil.CheckIsNoDead(target) then @@ -5041,7 +5078,7 @@ local passivityList = { BattleUtil.CalDamage(nil, role, target, 1, f1) if skill then --skill.isTriggePassivity=true - table.insert(skill.triggerPassivityId,254) + table.insert(skill.triggerPassivityId,id) end end end @@ -5050,11 +5087,11 @@ local passivityList = { -- 技能直接击杀敌方目标时有[a]%概率获得目标剩余所有怒气(输出武将佩戴)重写197 一次技能只触发一次被动 -- a[float] - [255] = function(role, args) + [255] = function(role, args,id) local f1 = args[1] local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) --如果是技能并且这个被动已经被触发过 return - if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,255) then + if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) then return end if skill and skill.type == BattleSkillType.Special and target:IsDead() and not BattleUtil.CheckIsNoDead(target) then @@ -5062,7 +5099,7 @@ local passivityList = { role:AddRage(target.Rage, CountTypeName.Add) if skill then --skill.isTriggePassivity=true - table.insert(skill.triggerPassivityId,255) + table.insert(skill.triggerPassivityId,id) end end) end @@ -5072,12 +5109,16 @@ local passivityList = { -- 直接伤害击杀目标释放[a]技能。 重新243 一次技能只触发一次被动 -- a[float] - [256] = function(role, args) + [256] = function(role, args,id,judge) local f1 = args[1] local f2=args[2] local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) --如果是技能并且这个被动已经被触发过 return - if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,256) then + if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,id) 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 target:IsDead() and not BattleUtil.CheckIsNoDead(target) and not role:IsDead() then @@ -5087,11 +5128,343 @@ local passivityList = { role:InsertExtraSkill(f1,f2) if skill then --skill.isTriggePassivity=true - table.insert(skill.triggerPassivityId,256) + table.insert(skill.triggerPassivityId,id) end end end role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit) end, + --技能击杀目标溢出伤害的[a]%将对生命百分比最高的攻击目标造成伤害 + -- a[float] + [257]=function(role,args) + local f1 = args[1] + local dt = args[2] + local point=nil + -- 直接伤害后 + local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill) + 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) + list = BattleUtil.SortByHpFactor(list,0) + -- if not list[1]:IsDead() then + if list then + if not point then + point=list[1] + end + BattleUtil.ApplyDamage(nil,role,point,dmg) + end + + -- end + end + end + role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit) + end, + --技能追加的普攻额外造成目标[a][b]%的伤害。 + --a[int 属性id] b[float] + [258]=function(role,args) + 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 then + return + end + if skill and skill.type == BattleSkillType.Normal and skill.isAdd and skill.owner==role then + local val = -floor(BattleUtil.FP_Mul(dt, defRole:GetRoleData(BattlePropList[f1]))) + if func then + func(val) + end + end + end + role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging) + end, + -- 释放技能[a][b]%概率命中(必定命中舔100%或200%) + -- a[int], b[float] + [259] = function(role, args) + local pro = args[1] + local f1 = args[2] + local function onSkillCast(skill) + if skill.type ~= BattleSkillType.Normal then + role.data:AddValue(BattlePropList[pro], f1) + end + end + role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast) + + local function onSkillCastEnd(skill) + if skill.type ~= BattleSkillType.Normal then + role.data:SubValue(BattlePropList[pro], f1) + end + end + role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillCastEnd) + end, + --释放技能时,如果目标怒气不足[a]点,技能伤害额外[b] [c]% + -- a[int,怒气值]b[改变类型]c[float] + [260]=function(role,args) + local anger = args[1] + local type = args[2] + local v1 = args[3] + local onPassiveDamaging = function(func, defRole, damage,skill) + --怒气小于规定值 + if defRole.Rage>=anger then + return + end + if skill and skill.type~=BattleSkillType.Monster and skill.type~=BattleSkillType.Normal and skill.owner==role then + local dmgDeduction = damage - floor(BattleUtil.ErrorCorrection(BattleUtil.CountValue(damage,v1,type))) + if func then func(dmgDeduction) end + end + end + role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging) + end, + --本次技能中如果有[a]目标,额外回复[b]点怒气 + -- a[持续伤害状态]b[int] + [261]=function(role,args) + 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 skill.owner==role and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) and skill then + local list=skill:GetDirectTargetsNoMiss() + if not list then + return + end + local num=0 + for key, value in pairs(list) do + local isHave=BattleLogic.BuffMgr:HasBuff(value, BuffName.DOT, function(buff) return buff.damageType == dot and buff.caster==role and buff.startRound == BattleLogic.GetCurRound() end) + if isHave then + num=num+1 + end + end + if num>0 then + role:AddRage(i1, CountTypeName.Add) + end + end + end + role.Event:AddEvent(BattleEventName.SkillCastEnd, OnRoleHit) + end, + -- 每释放[a]次技能,[b]增加[c]%,可叠加[d]次 + -- a[int] b[int] c[float] d[int] + [262] = function(role, args) + local num = args[1] + local pro = args[2] + local val = args[3] + local time = args[4] + local releaseNum=0 + local addNum=0 + -- 释放技能后 + local onSkillEnd = function(skill) + 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