【战斗】新增觉醒被动效果
parent
14bab99f0e
commit
d54fb77bda
|
|
@ -664,7 +664,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]秒
|
||||
|
|
@ -1706,7 +1706,7 @@ local passivityList = {
|
|||
|
||||
local arr = RoleManager.Query(function (r) return r.camp == role.camp end)
|
||||
BattleUtil.SortByHpFactor(arr, 1)
|
||||
-- 检测技能伤害治疗加成
|
||||
-- 检测技能伤害<EFBFBD><EFBFBD>疗加成
|
||||
local f = BattleUtil.CheckSkillDamageHeal(f1, role, arr[1])
|
||||
-- 治疗血量最低队友实际伤害的f1%
|
||||
BattleUtil.ApplyTreat(role, arr[1], floor(BattleUtil.ErrorCorrection(allDamage*f)))
|
||||
|
|
@ -3794,20 +3794,28 @@ 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,
|
||||
|
|
@ -5007,7 +5015,7 @@ local passivityList = {
|
|||
local dt = args[2]
|
||||
-- 直接伤害后
|
||||
local onRoleHit = function(target, damage, bCrit, finalDmg, damageType, skill)
|
||||
--如果是技能并且这个被动已经被触发过 return
|
||||
--如果是技能并且这个被动已经被触发<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> return
|
||||
if skill and BattleUtil.ChecklistIsContainValue(skill.triggerPassivityId,253) then
|
||||
return
|
||||
end
|
||||
|
|
@ -5096,5 +5104,256 @@ local passivityList = {
|
|||
end
|
||||
role.Event:AddEvent(BattleEventName.RoleHit, onRoleHit)
|
||||
end,
|
||||
--技能击杀目标溢出伤害的[a]%将对生命百分比最高的攻击目标造成伤害
|
||||
[257]=function(role,args)
|
||||
local f1 = args[1]
|
||||
local dt = args[2]
|
||||
-- 直接伤害后
|
||||
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((finalDmg-damage)*f1))
|
||||
LogError("溢出伤害:"..dmg)
|
||||
local list = RoleManager.Query(function(v) return v.camp ~= role.camp end)
|
||||
list = BattleUtil.SortByHpFactor(list,0)
|
||||
if not list[1]:IsDead() then
|
||||
BattleUtil.ApplyDamage(nil,target,list[1],dmg)
|
||||
end
|
||||
end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.RoleBeHit, onRoleHit)
|
||||
end,
|
||||
--技能追加的普攻额外造成目标[a][b]%的伤害。
|
||||
[258]=function(role,args)
|
||||
local f1 = args[1]
|
||||
local dt = args[2]
|
||||
-- 直接伤害后
|
||||
local onPassiveDamaging = function(func, defRole, damage,skill)
|
||||
if skill and skill.type == BattleSkillType.Normal and skill.isAdd 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]%概率命中
|
||||
-- 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[a,怒气值]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 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]
|
||||
local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill)
|
||||
if defRole and BattleLogic.BuffMgr:HasBuff(defRole, BuffName.DOT, function(buff) return buff.damageType == dot end) then
|
||||
role:AddRage(i1, CountTypeName.Add)
|
||||
end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.RoleHit, 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.type == BattleSkillType.Special or skill.type == BattleSkillType.Extra ) then
|
||||
releaseNum=releaseNum+1
|
||||
--如果能被限制次数整除 and 小于最大叠加次数
|
||||
if releaseNum>0 and releaseNum%num==0 and addNum<time then
|
||||
role.data:AddValue(BattlePropList[pro],val)
|
||||
addNum=addNum+1
|
||||
end
|
||||
end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd)
|
||||
end,
|
||||
--第[a]回合技能命中前有[b]%概率清除对方目标的免疫控制效果(所有控制效果)的护盾(表现上为护盾,清除护盾为直接清除效果)
|
||||
[263]=function(role,args)
|
||||
local round=args[1]
|
||||
local pro=args[2]
|
||||
local onRoleDamageBefore=function(defRole, factorFunc, damageType, skill)
|
||||
--判断是否是规定回合
|
||||
if BattleLogic.GetCurRound() ~= round then
|
||||
return
|
||||
end
|
||||
if defRole and defRole.camp~=role.camp and skill.owner==role and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) then
|
||||
BattleUtil.RandomAction(pro, function()
|
||||
BattleLogic.BuffMgr:ClearBuff(target, function(buff)
|
||||
return buff.type == BuffName.Immune and (buff.immuneType == 4 or buff.immuneType == 2)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.RoleDamagedBefore,onRoleDamageBefore)
|
||||
end,
|
||||
--释放技能时,如果目标怒气大于[a]点,额外降低目标[b]点怒气
|
||||
[264]= function(role,args)
|
||||
local v1 = args[1]
|
||||
local v2 = args[2]
|
||||
local onFinalBeDamage = function(damagingFunc, atkRole, damage, skill)
|
||||
if role.Rage<=v1 then
|
||||
return
|
||||
end
|
||||
if atkRole==role and skill and skill.type~=BattleSkillType.Monster and skill.type~=BattleSkillType.Normal then
|
||||
role:AddRage(v2,CountTypeName.Sub)
|
||||
end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.FinalBeDamage,onFinalBeDamage)
|
||||
end,
|
||||
--受技能攻击时有[a]%概率给攻击者及周围没有[b]状态的敌方武将附加[c]状态,造成自身[d] [e]% 的伤害持续[f]回合
|
||||
[265] = function(role,args)
|
||||
local pro=args[1]
|
||||
local state1=args[2]
|
||||
local state2=args[3]
|
||||
local pro1=args[4]
|
||||
local v1 = args[5]
|
||||
local time= args[6]
|
||||
local onFinalBeDamage = function(damagingFunc, atkRole, damage, skill)
|
||||
--受到敌方技能攻击
|
||||
if atkRole.camp~=role.camp and skill and skill.type~=BattleSkillType.Monster and skill.type~=BattleSkillType.Normal then
|
||||
BattleUtil.RandomAction(f1, function ()
|
||||
local list = RoleManager.GetNeighbor(atkRole, 1)
|
||||
table.insert(list,atkRole)
|
||||
for i=1, #list do
|
||||
--如果目标身上没有灼烧效果
|
||||
if not BattleLogic.BuffMgr:HasBuff(list[i], BuffName.DOT, function (buff) return buff.type== BuffName.DOT and buff.damageType==state1 end) then
|
||||
local damage = BattleUtil.ErrorCorrection(v1 * role:GetRoleData(BattlePropList[pro1]))
|
||||
BattleUtil.RandomDot(1, state2, role, list[i], time, 1, floor(damage))
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.FinalBeDamage,onFinalBeDamage)
|
||||
end,
|
||||
--攻击时伤害增加(我方每个存活的其他[a]元素武将伤害增加[b]%)
|
||||
[266] = function(role,args)
|
||||
local ele=args[1]
|
||||
local v1=args[2]
|
||||
local passiveBeBeDamage=function(damagingFunc, atkRole, damage, skill)
|
||||
if atkRole.camp==role.camp and not atkRole:IsDead() and role.element==ele then
|
||||
if damagingFunc then
|
||||
local dd = BattleUtil.CountValue(damage,v1)
|
||||
damagingFunc(-floor(BattleUtil.ErrorCorrection(dd)))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
role.Event:AddEvent(BattleEventName.PassiveBeDamaging,passiveBeBeDamage)
|
||||
end,
|
||||
--技能击中受到[a,控制效果]的目标,会额外降低[b]点怒气
|
||||
-- a[状态]b[int]
|
||||
[267]=function(role,args)
|
||||
local dot=args[1]
|
||||
local i1 = args[2]
|
||||
local OnRoleHit = function(defRole, damage, bCrit, finalDmg, damageType, skill)
|
||||
if skill and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) and skill.owner==role and defRole and BattleLogic.BuffMgr:HasBuff(defRole, BuffName.Control, function(buff) return buff.ctrlType == dot end) then
|
||||
role:AddRage(i1, CountTypeName.Sub)
|
||||
end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.RoleHit, OnRoleHit)
|
||||
end,
|
||||
--概率额外[a] [b]敌方血量[b]最少的目标(己方每个上阵的其他妖阵营神将可提供姑获鸟眩晕总概率的[c])。持续[d]回合
|
||||
--a[float] b[控制状态] c[float] d[int]
|
||||
[268] = function(role,args)
|
||||
local pro1=args[1]
|
||||
local con=args[2]
|
||||
local pro2=args[3]
|
||||
local time=args[4]
|
||||
local onSkillCast=function(skill)
|
||||
if skill and skill.owner==role and (skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra) then
|
||||
local list = RoleManager.Query(function(v) return role.camp == v.camp end)
|
||||
local num=0
|
||||
for _, r in pairs(list) do
|
||||
if r~=role and r.element==role.element then
|
||||
num=num+1
|
||||
end
|
||||
end
|
||||
local list = RoleManager.Query(function(v) return v.camp ~= role.camp end)
|
||||
--生命最少改成生命百分比最少 2020/09/29 by:王振兴
|
||||
list=BattleUtil.SortByProp(list, RoleDataName.Hp, 1)
|
||||
if list and list[1] then
|
||||
BattleUtil.RandomControl(pro2*num, con, role,list[1],time)
|
||||
end
|
||||
end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.SkillCast,onSkillCast)
|
||||
end,
|
||||
--受到[a]目标攻击时,自身免疫[b]和[c]效果
|
||||
--a[int 持续伤害类型] b,c[int 持续伤害类型]
|
||||
[269] = function(role,args)
|
||||
local sta1=args[1]
|
||||
local sta2=args[2]
|
||||
local sta3=args[3]
|
||||
local skiller=nil
|
||||
local immune = function(buff)
|
||||
return buff.type == BuffName.DOT and (buff.damageType==sta2 or buff.damageType==sta3)
|
||||
end
|
||||
local curBuff=nil
|
||||
|
||||
local onRoleDamageBefore=function(defRole, factorFunc, damageType, skill)
|
||||
if defRole==role and skill.owner and skill.owner.camp~= role.camp and BattleLogic.BuffMgr:HasBuff(skill.owner, BuffName.DOT, function (buff) return buff.damageType == sta1 end) then
|
||||
curBuff=Buff.Create(role, BuffName.Immune, 1,4,immune)
|
||||
role:AddBuff(curBuff)
|
||||
skiller=skill.owner
|
||||
end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.RoleDamageBefore,onRoleDamageBefore)
|
||||
|
||||
-- 释放技能后
|
||||
local onSkillEnd = function(skill)
|
||||
if skill and skill.owner==skiller then
|
||||
if curBuff then
|
||||
BattleLogic.BuffMgr:ClearBuff(role, function (buff)
|
||||
return buff==curBuff
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd)
|
||||
end,
|
||||
|
||||
|
||||
}
|
||||
return passivityList
|
||||
|
|
@ -13,11 +13,13 @@ end
|
|||
local immune3 = function(buff)
|
||||
return buff.type == BuffName.Shield and buff.shieldType == ShieldTypeName.AllReduce
|
||||
end
|
||||
--自定义免疫
|
||||
local immune4=nil
|
||||
|
||||
--初始化Buff,通过传入一些自定义参数控制成长相关的数值
|
||||
function Immune:SetData(...)
|
||||
|
||||
self.immuneType = ...
|
||||
function Immune:SetData(type,func)
|
||||
self.immuneType =type
|
||||
immune4=func
|
||||
self.isBuff = true
|
||||
|
||||
-- 刷新排序等级
|
||||
|
|
@ -35,6 +37,13 @@ function Immune:OnStart()
|
|||
self.target.buffFilter:Add(immune2)
|
||||
elseif self.immuneType == 3 then --免疫无敌盾
|
||||
self.target.buffFilter:Add(immune3)
|
||||
elseif self.immuneType==4 then--自定义免疫
|
||||
if immune4 then
|
||||
self.target.buffFilter:Add(immune4)
|
||||
end
|
||||
end
|
||||
if condition then
|
||||
-- body
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -56,6 +65,9 @@ function Immune:OnEnd()
|
|||
immune = immune2
|
||||
elseif self.immuneType == 3 then --免疫无敌盾
|
||||
immune = immune3
|
||||
elseif self.immuneType == 3 then--自定义免疫
|
||||
mmune=immune4
|
||||
immune4=nil
|
||||
end
|
||||
for i = 1, self.target.buffFilter.size do
|
||||
if self.target.buffFilter.buffer[i] == immune then
|
||||
|
|
|
|||
Loading…
Reference in New Issue