[战斗]===================法相被动提交
parent
754c01c918
commit
5127ef5d90
|
|
@ -7886,19 +7886,25 @@ local passivityList = {
|
|||
end
|
||||
BattleLogic.Event:AddEvent(BattleEventName.RoleRealDead, onBattleRoleDead,nil,nil,role)
|
||||
end,
|
||||
--死亡后有[a]%概率[b]%血量复活,并回复[c]点怒气
|
||||
--a[float],b[float],c[int]
|
||||
--死亡后有[a]%概率[b]%血量复活,并回复[c]点怒气,最多触发[d]次(d不填为无限次)
|
||||
--a[float],b[float],c[int],d[int]
|
||||
[329]=function (role,args,id,judge)
|
||||
local p1=args[1]
|
||||
local p2=args[2]
|
||||
local num=args[3]
|
||||
local time=args[4]
|
||||
local aaa=0
|
||||
local onRoleRealDead = function(deadRole)
|
||||
--如果死亡的不是自身
|
||||
if deadRole~=role then
|
||||
return
|
||||
end
|
||||
if time and aaa>=time then
|
||||
return
|
||||
end
|
||||
BattleUtil.RandomAction(p1, function ()
|
||||
deadRole:SetRelive(p2,role)
|
||||
aaa=aaa+1
|
||||
BattleUtil.CalRage(role, role,num,CountTypeName.Add)
|
||||
end)
|
||||
end
|
||||
|
|
@ -11655,5 +11661,242 @@ local passivityList = {
|
|||
end
|
||||
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundEnd, onRoundChange,nil,nil,role)
|
||||
end,
|
||||
--攻击附加自身[a]属性[b]%的间接伤害,由受击目标平分
|
||||
--a[int],b[float]
|
||||
[446]=function(role,args,id,judge)
|
||||
local p1=args[1]
|
||||
local v1=args[2]
|
||||
local onSkillEnd = function(skill)
|
||||
if skill and not skill.isTriggerJudge and judge==1 then
|
||||
return
|
||||
end
|
||||
|
||||
local list = skill:GetDirectTargetsNoMiss()
|
||||
local len=#list
|
||||
if list and len>0 then
|
||||
local damage = floor(BattleUtil.FP_Mul(role:GetRoleData(BattlePropList[p1]), v1)/len)
|
||||
for i = 1, #list do
|
||||
BattleUtil.FinalDamage(nil, role, list[i],damage)
|
||||
end
|
||||
end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillEnd,nil,nil,role)
|
||||
end,
|
||||
--每回合开始时,以自身[a]的[b]%为全体神将添加御甲,可叠加,持续至战斗结束
|
||||
--a[int],b[float]
|
||||
[447]=function (role,args,id,judge)
|
||||
local p1=args[1]
|
||||
local v1=args[2]
|
||||
local onRoundStart= function(round)
|
||||
if role:IsDead() then
|
||||
return
|
||||
end
|
||||
local list = RoleManager.Query(function(v) return v.camp == role.camp end)
|
||||
for i = 1, #list do
|
||||
local val = floor(BattleUtil.FP_Mul(v1, role:GetRoleData(BattlePropList[p1])))
|
||||
--如果身上有御甲就添加御甲的值
|
||||
BattleUtil.AddBlood(list[i],val)
|
||||
end
|
||||
end
|
||||
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundStart,onRoundStart,nil,nil,role)
|
||||
end,
|
||||
|
||||
-- 技能直接伤害的[a]%治疗友方生命最少[b]名队友,并恢复目标[c]属性[d]%的血量
|
||||
-- a[float],b[int],c[int],d[float]
|
||||
[448] = function(role, args,id,judge)
|
||||
local f1 = args[1]
|
||||
local num = args[2]
|
||||
local p1 = args[3]
|
||||
local v1 = args[4]
|
||||
local allDamage = 0
|
||||
local OnHit = function(atkRole, damage, bCrit, finalDmg, damageType, skill)
|
||||
if skill and skill.type == BattleSkillType.Special then
|
||||
--吸血修改,finaldag 改成 damage by:王振兴 2020/08/17
|
||||
allDamage = allDamage + damage
|
||||
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,nil,nil,role)
|
||||
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.NoOrder(function (r) return r.camp == role.camp and r.deadFilter end)
|
||||
local len=#arr
|
||||
if arr==nil or len==0 then
|
||||
return
|
||||
end
|
||||
if num<len then
|
||||
num=len
|
||||
end
|
||||
BattleUtil.SortByHpFactor(arr, 1)
|
||||
for i = 1, num do
|
||||
-- 检测技能伤害<E4BCA4><E5AEB3><EFBFBD>疗加成
|
||||
local f = BattleUtil.CheckSkillDamageHeal(f1, role, arr[i])
|
||||
-- 治疗血量最低队友实际伤害的f1%
|
||||
BattleUtil.ApplyTreat(role, arr[i], floor(BattleUtil.ErrorCorrection(allDamage*f)))
|
||||
local dd = floor(BattleUtil.ErrorCorrection(arr[i]:GetRoleData(BattlePropList[p1])*v1))
|
||||
BattleUtil.FinalTreat(role, arr[i], dd)
|
||||
end
|
||||
-- 清空伤害记录
|
||||
allDamage = 0
|
||||
end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.SkillCast, onSkillCast,nil,nil,role)
|
||||
role.Event:AddEvent(BattleEventName.SkillCastEnd, onSkillCastEnd,nil,nil,role)
|
||||
end,
|
||||
--受到直接伤害有[a]%的概率给全体神将回复[b]点怒气
|
||||
--a[float],b[int]
|
||||
[449]=function (role,args,id,judge)
|
||||
local p1=args[1]
|
||||
local v1=args[2]
|
||||
local isTrigger=true
|
||||
local onBeHit = function(caster,damage, bCrit, finalDmg, damageType,skill)
|
||||
if skill==nil then
|
||||
return
|
||||
end
|
||||
if isTrigger==false then
|
||||
return
|
||||
end
|
||||
BattleUtil.RandomAction(p1,function()
|
||||
local list = RoleManager.Query(function(v) return v.camp == role.camp end)
|
||||
for i = 1, #list do
|
||||
local r = list[i]
|
||||
if r and not r:IsDead() then
|
||||
BattleUtil.CalRage(role,r,v1,CountTypeName.Add)
|
||||
isTrigger=false
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.RoleBeHit, onBeHit,nil,nil,role)
|
||||
|
||||
local onRoleTurnStart=function()
|
||||
isTrigger=true
|
||||
end
|
||||
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundStart,onRoleTurnStart,nil,nil,role)
|
||||
end,
|
||||
--主动治疗己方神将时,治疗如果溢出,溢出血量的[a]%转化为御甲
|
||||
--a[float]
|
||||
[450] = function(role, args,id,judge)
|
||||
local pro = args[1]
|
||||
local onRoleTreat=function(target,realTreat,treat)
|
||||
local hp=treat- realTreat
|
||||
if hp>0 then
|
||||
local value=floor(hp*pro)
|
||||
BattleUtil.AddBlood(target,value)
|
||||
end
|
||||
end
|
||||
local OnSkillCast = function(skill)
|
||||
if skill and not skill.isTriggerJudge and judge==1 then
|
||||
return
|
||||
end
|
||||
|
||||
role.Event:AddEvent(BattleEventName.RoleTreat, onRoleTreat,nil,nil,role)
|
||||
|
||||
end
|
||||
local OnSkillCastEnd = function(skill)
|
||||
if skill and not skill.isTriggerJudge and judge==1 then
|
||||
return
|
||||
end
|
||||
role.Event:RemoveEvent(BattleEventName.RoleTreat,onRoleTreat,nil,nil,role)
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast,nil,nil,role)
|
||||
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd,nil,nil,role)
|
||||
end,
|
||||
--[a]%概率免疫减怒
|
||||
--a[float]
|
||||
[451]=function(role,args)
|
||||
local pro=args[1]
|
||||
BattleUtil.RandomAction(pro,function()
|
||||
role.isImmuneReduceRage=true
|
||||
end)
|
||||
end,
|
||||
-- 释放技能后[a]%概率再次释放技能,伤害为初始技能伤害[b]%,释放次数每增加1,概率是之前的[c]%;控制概率为之前[d]%
|
||||
-- a[float],b[float],c[float]
|
||||
[452] = function(role, args,id,judge)
|
||||
local p1 = args[1]
|
||||
local p2 = args[2]
|
||||
local p3 = args[3]
|
||||
local p4 = args[4]
|
||||
local pro=p1
|
||||
local triggerTime=0
|
||||
|
||||
local onSkillEnd = function(skill)
|
||||
if skill and not skill.isTriggerJudge and judge==1 then
|
||||
return
|
||||
end
|
||||
if skill.type~=BattleSkillType.Special then
|
||||
return
|
||||
end
|
||||
pro=p1*(p3^triggerTime)
|
||||
local isRand=BattleUtil.RandomAction(pro,function()
|
||||
triggerTime=triggerTime+1
|
||||
role:AddSkill(BattleSkillType.Special, false, false, nil)
|
||||
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)
|
||||
if triggerTime==0 then
|
||||
return
|
||||
end
|
||||
local dd = BattleUtil.CountValue(damage,p2, CountTypeName.SubPencent) - damage
|
||||
damagingFunc(-floor(dd))
|
||||
end
|
||||
|
||||
role.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging,nil,nil,role)
|
||||
|
||||
local onPassiveRandomControl = function(func, ctrl2,target,rand)
|
||||
if triggerTime==0 then
|
||||
return
|
||||
end
|
||||
local subValue=floor(rand-rand*p4)
|
||||
if func then func(subValue, CountTypeName.Sub) end
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.PassiveRandomControl, onPassiveRandomControl,nil,nil,role)
|
||||
|
||||
end,
|
||||
|
||||
-- 技能,普攻治疗治疗有[a]%概率解除目标的禁疗效果
|
||||
-- a[float]
|
||||
[453] = function(role, args,id,judge)
|
||||
local pro = args[1]
|
||||
local curSkill = nil
|
||||
local disposeCtrlNoHeal = function(caster,target)
|
||||
if caster==role and target.ctrl_noheal then
|
||||
BattleUtil.RandomAction(pro,function()
|
||||
BattleLogic.BuffMgr:ClearBuff(target, function (buff)
|
||||
return buff.type == BuffName.Control and buff.ctrlType==4
|
||||
end)
|
||||
end)
|
||||
end
|
||||
end
|
||||
local OnSkillCast = function(skill)
|
||||
curSkill=skill
|
||||
BattleLogic.Event:AddEvent(BattleEventName.DisposeRoleCtrl_noheal,disposeCtrlNoHeal)
|
||||
end
|
||||
local OnSkillCastEnd = function(skill)
|
||||
curSkill=nil
|
||||
BattleLogic.Event:RemoveEvent(BattleEventName.DisposeRoleCtrl_noheal,disposeCtrlNoHeal)
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.SkillCast, OnSkillCast)
|
||||
role.Event:AddEvent(BattleEventName.SkillCastEnd, OnSkillCastEnd)
|
||||
end,
|
||||
}
|
||||
return passivityList
|
||||
|
|
@ -1464,7 +1464,7 @@ function BattleUtil.RandomControl(rand, ctrl, caster, target, round,skill)
|
|||
table.insert(cl, {v, ct})
|
||||
end
|
||||
end
|
||||
caster.Event:DispatchEvent(BattleEventName.PassiveRandomControl, _CallBack, ctrl, target)
|
||||
caster.Event:DispatchEvent(BattleEventName.PassiveRandomControl, _CallBack, ctrl, target,rand)
|
||||
target.Event:DispatchEvent(BattleEventName.PassiveBeRandomControl, _CallBack, ctrl, target)
|
||||
BattleLogic.Event:DispatchEvent(BattleEventName.PassiveBeRandomControl, _CallBack, ctrl,caster,target)
|
||||
rand = BattleUtil.CountChangeList(rand, cl)
|
||||
|
|
|
|||
Loading…
Reference in New Issue