[战斗]=========新英雄技能被动提交

dev_chengFeng
wangzhenxing 2023-03-01 17:24:25 +08:00
parent 480e7b1cbe
commit 47074a40d0
4 changed files with 241 additions and 3 deletions

View File

@ -2986,6 +2986,19 @@ local effectList = {
end
BattleUtil.Seckill(skill,caster,target)
end,
--瞬间恢复[a]*[b]%生命,并移除中毒灼烧状态
--a[属性],b[float]
[153] = function(caster, target, args, interval, skill)
local pro1 = args[1]
local f1 = args[2]
BattleLogic.WaitForTrigger(interval, function ()
local val = floor(BattleUtil.FP_Mul(target:GetRoleData(BattlePropList[pro1]), f1))
BattleUtil.CalTreatNoCrit(caster, target, val,1,skill)
BattleLogic.BuffMgr:ClearBuff(target, function (buff)
return clearBuffPredicate(buff,5)
end)
end)
end,
}

View File

@ -11902,6 +11902,229 @@ local passivityList = {
[454]=function(role, args,id,judge)
role.isAllBurn=true
end,
-- 释放技能后[a]%*目标数量的概率再次释放技能,伤害为初始技能伤害[b]%,追加技能是否触[c]发特性;如果目标处于[d]效果[e]状态,额外对其造成[f]%的间接伤害
-- a[float],b[float],c[int 0不触发 1触发 ],d[int],e[int],f[float] (d,e,f不填不触发)
[455] = function(role, args,id,judge)
local p1 = args[1]
local p2 = args[2]
local p3 = args[3]
local t1 = args[4]
local t2 = args[5]
local v1 = args[6]
local pro=p1
local triggerTime=0
local onSkillEnd = function(skill)
triggerTime=0
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type~=BattleSkillType.Special or skill.isAdd then
return
end
pro=p1*#skill:GetDirectTargetsNoExile()
local isTrigger=false
if p3==1 then
isTrigger=true
end
--LogError("pro=="..pro.." p1=="..p1.." len=="..#skill:GetDirectTargetsNoExile())
local isRand=BattleUtil.RandomAction(pro,function()
triggerTime=triggerTime+1
role:AddSkill(BattleSkillType.Special, false, true, nil,isTrigger)
end)
--连击中断,概率和次数回调
if not isRand then
--pro=p1
triggerTime=0
end
end
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd,nil,nil,role)
local OnPassiveDamaging = function(damagingFunc, defRole, damage,skill)
if triggerTime==0 then
return
end
local dd = BattleUtil.CountValue(damage,p2, CountTypeName.SubPencent) - damage
--LogError("dd========="..dd)
damagingFunc(-floor(dd))
-- triggerTime=0
if t1 and t2 and v1 then
if BattleLogic.BuffMgr:HasBuff(defRole, t1, function (buff)
if t1==BuffName.DOT then
return buff.damageType==t2
end
end) then
local aaa=floor(damage*v1)
BattleUtil.FinalDamageCountShield(nil,role,defRole,aaa)
end
end
end
role.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging,nil,nil,role)
end,
--技能必定暴击
[456]=function(role, args,id,judge)
local crit=false
local OnSkillCast = function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra then
crit=role.mustCrit
role.mustCrit = true
end
end
local OnSkillCastEnd = function(skill)
if skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra then
role.mustCrit = crit
end
end
role.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast)
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
end,
--如果技能目标处于[a]效果[b]状态,必定命中
--a[int],b[int]
[457]=function(role, args,id,judge)
local t1=args[1]
local t2=args[2]
local crit=false
local OnSkillCast = function(skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
if skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra then
local arr=skill:GetDirectTargets()
for i = 1, #arr do
if BattleLogic.BuffMgr:HasBuff(arr[i], t1, function (buff)
if t1==BuffName.DOT then
return buff.damageType==t2
end
end)
then
arr[i].beMustHit=true
end
end
end
end
local OnSkillCastEnd = function(skill)
if skill.type==BattleSkillType.Special or skill.type==BattleSkillType.Extra then
local arr=skill:GetDirectTargetsNoMiss()
for i = 1, #arr do
if BattleLogic.BuffMgr:HasBuff(arr[i], t1, function (buff)
if t1==BuffName.DOT then
return buff.damageType==t2
end
end)
then
arr[i].beMustHit=false
end
end
end
end
role.Event:AddEvent(BattleEventName.SkillCastBefore, OnSkillCast)
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
end,
--技能额外造成目标[a]属性 ([b]+10/目标数量)% 的伤害。
--a[int 属性id] b[float]
[458]=function(role,args,id,judge)
local f1 = args[1]
local dt = args[2]
-- 直接伤害后
local onPassiveDamaging = function(func, defRole, damage,skill)
if skill and not skill.isTriggerJudge and judge==1 then
return
end
--观音,这个被动只有额外技能才能触发 by王振兴 2021/1/21 17:48
if skill and (skill.type == BattleSkillType.Extra or skill.type == BattleSkillType.Special ) then
--如果是boss 并且额外伤害是根据最大生命则返回
if (f1==12 or f1==13) and BattleUtil.CheckIsBoss(defRole) then
return
end
local num=#skill:GetDirectTargetsNoExile()
local val = floor(BattleUtil.FP_Mul((dt+10/num)/100, defRole:GetRoleData(BattlePropList[f1])))
BattleUtil.FinalDamageCountShield(nil,role,defRole,val)
end
end
role.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging,nil,nil,role)
end,
-- 敌方神将处于[a]效果[b]状态,己方神将对其造成伤害增加[c]%;额外造成[d]属性[e]%的间接伤害,每回合同一神将最多受到[f]次额外伤害
-- a[int] b[int] c[float] d[int] e[float] f[int]
[459] = function(role, args,id,judge)
local t1 = args[1]
local t2 = args[2]
local f2 = args[3]
local p1 = args[4]
local p2 = args[5]
local num = args[6]
local function onPassiveDamaging(damagingFunc, atkRole, defRole, damage,skill,skilldotType, bCrit,damageType, dotType,isDirect)
--不是真实伤害
if not skill and not isDirect then
return
end
if atkRole.camp==role.camp and BattleLogic.BuffMgr:HasBuff(defRole, t1, function (buff) return true end) then
local dd = BattleUtil.CountValue(damage, f2, CountTypeName.AddPencent) - damage
damagingFunc(-floor(BattleUtil.ErrorCorrection(dd)))
if p1 and p2 then
if defRole.suppressTime>=num then
return
end
if (p1==12 or p1==13) and BattleUtil.CheckIsBoss(defRole) then
return
end
local val = floor(BattleUtil.FP_Mul(p2, defRole:GetRoleData(BattlePropList[p1])))
BattleUtil.FinalDamageCountShield(nil,atkRole,defRole,val)
defRole.suppressTime=defRole.suppressTime+1
end
end
end
BattleLogic.Event:AddEvent(BattleEventName.PassiveDamaging, onPassiveDamaging,nil,nil,role)
local function onRoundChange()
local list=RoleManager.QueryIncludeExile(function(v) return true end,true)
for key, value in pairs(list) do
value.suppressTime=0
end
end
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, onRoundChange,nil,nil,role)
end,
-- 受到[a]攻击有[b]%概率使攻击者[c][d],持续[e]回合,参数1[f],参数2[g],参数3[h]
-- a[int 攻击类型],b[float],c[int],d[int],e[int],f[int/float],g[int/float],h[int/float] (a:0 所有攻击 1只限制技能伤害)
[460] = function(role, args)
local type=args[1]
local f1 = args[2]
local t1 = args[3]
local t2 = args[4]
local i1 = args[5]
local v1 = args[6]
local v2 = args[7]
local v3 = args[8]
-- 技能后后
local onRoleBeHit = function(caster,damage, bCrit, finalDmg, damageType, skill)
--屏蔽相同阵营
if caster.camp==role.camp then
return
end
--检测技能
if type==1 and (not skill or skill.type==BattleSkillType.Normal)then
return
end
local buff=nil
if t1==BuffName.Suppress then
buff=Buff.Create(role,t1,i1)
end
if buff then
BattleUtil.RandomAction(f1,function()
caster:AddBuff(buff)
end)
end
end
role.Event:AddEvent(BattleEventName.RoleBeHit, onRoleBeHit,nil,nil,role)
end,
}
return passivityList

View File

@ -238,13 +238,13 @@ function BattleUtil.SortByRage(arr, sort)
if r1==r2 then
return a.position>b.position
else
return r1 < r2
return r1 > r2
end
else
if r1==r2 then
return a.position>b.position
else
return r1 > r2
return r1 < r2
end
end
end)
@ -1413,7 +1413,7 @@ function BattleUtil.CheckIsHit(atkRole, defRole,skill)
BattleLogic.Event:DispatchEvent(BattleEventName.PassiveChangeRoleHit,addHitFunc,atkRole,defRole)
local hitCondition = clamp(atkRole:GetRoleData(RoleDataName.Hit)+addHit - defRole:GetRoleData(RoleDataName.Dodge), 0, 1)
isHit = hitRandom <= hitCondition
return mustHit or isHit
return mustHit or defRole.beMustHit or isHit
end

View File

@ -98,6 +98,7 @@ function RoleLogic:Init(uid, data, position)
self.bloodShield = nil
self.IsCanAddSkill = true -- 是否可以追加技能
self.mustHit=false --必定命中
self.beMustHit=false --必定被命中
self.mustCrit=false --必定暴击
self.isBanBlood=false --是否禁止上御甲
self.isImmuneAllReduceShield = false --免疫敌方无敌盾(敌方无敌盾对自己无效)
@ -107,6 +108,7 @@ function RoleLogic:Init(uid, data, position)
self.isNormalAttackAddRage=true --普攻是否回复怒气
self.curMainTarget=nil --当前主目标
self.isAllBurn = false --是否视敌方全体为燃烧
self.suppressTime = 0 --被压制的次数
self.passiveList = {}
if data.passivity and #data.passivity > 0 then
--排序363类型的排在前面