【战斗】==============被动346 347 348 349 350 提交
parent
dbf05190bc
commit
08ecd82227
|
@ -8147,5 +8147,126 @@ local passivityList = {
|
|||
end
|
||||
BattleLogic.Event:AddEvent(BattleEventName.DotBuffEnd, OnBuffEnd,nil,nil,role)
|
||||
end,
|
||||
--技能对[a]阵营/职业目标 伤害[b]改变[c]% ,[d]类型(1:阵营 2:职业)
|
||||
-- a[int] b[int],c[float],d[int]
|
||||
[346]=function(role,args,id,judge)
|
||||
local v1=args[1]
|
||||
local ct=args[2]
|
||||
local v2=args[3]
|
||||
local type=args[4]
|
||||
local OnPassiveDamaging = function(damagingFunc, defRole, damage,skill)
|
||||
if skill and not skill.isTriggerJudge and judge==1 then
|
||||
return
|
||||
end
|
||||
if not defRole then
|
||||
return
|
||||
end
|
||||
if defRole.camp==role.camp then
|
||||
return
|
||||
end
|
||||
--如果不是限定阵营
|
||||
if type==1 and defRole.element~=v1 then
|
||||
return
|
||||
end
|
||||
--如果不是限定职业
|
||||
if type==2 and defRole.professionId~=v1 then
|
||||
return
|
||||
end
|
||||
damagingFunc(-floor(v2 * damage))
|
||||
end
|
||||
role.Event:AddEvent(BattleEventName.PassiveDamaging, OnPassiveDamaging,nil,nil,role)
|
||||
end,
|
||||
--敌方单位死亡立即回复满血(没有表现)
|
||||
[347]=function(role,args,id,judge)
|
||||
|
||||
local onRoleHit = function(deadRole)
|
||||
if deadRole.camp==role.camp then
|
||||
return
|
||||
end
|
||||
--BattleLogic.WaitForTrigger(BattleLogic.GameDeltaTime, function ()
|
||||
local addHp=role:GetRoleData(RoleDataName.MaxHp) - role:GetRoleData(RoleDataName.Hp)
|
||||
role.data:AddValue(RoleDataName.Hp,addHp)
|
||||
--end)
|
||||
end
|
||||
BattleLogic.Event:AddEvent(BattleEventName.RoleRealDead, onRoleHit,nil,nil,role)
|
||||
end,
|
||||
--第[a]回合结束后,自身血量未降低到[b]%,[c]属性[d]改变 [e]% 持续[f]回合,[g]属性[h]改变 [i]% 持续[j]回合(g,h,i,j任一参数不填都不会生效)
|
||||
--a[int],b[float],c[int 属性],d[int 改变类型],e[float],f[int], g[int 属性],h[int,改变类型],i[float],j[int]
|
||||
[348]=function(role,args,id,judge)
|
||||
local round = args[1]
|
||||
local prop = args[2]
|
||||
local pro1 = args[3]
|
||||
local ct1 = args[4]
|
||||
local v1 = args[5]
|
||||
local r1 = args[6]
|
||||
local pro2 = args[7]
|
||||
local ct2 = args[8]
|
||||
local v2 = args[9]
|
||||
local r2 = args[10]
|
||||
local OnRoundEnd=function(curRound)
|
||||
if curRound~= round then
|
||||
return
|
||||
end
|
||||
local curProp=BattleUtil.GetHPPencent(role)
|
||||
if curProp<=prop then
|
||||
return
|
||||
end
|
||||
|
||||
if r1 and pro1 and v1 and ct1 then
|
||||
role:AddBuff(Buff.Create(role,BuffName.PropertyChange, r1, BattlePropList[pro1], v1, ct1))
|
||||
end
|
||||
|
||||
if r2 and pro2 and v2 and ct2 then
|
||||
role:AddBuff(Buff.Create(role,BuffName.PropertyChange, r2, BattlePropList[pro2], v2, ct2))
|
||||
end
|
||||
end
|
||||
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundEnd,OnRoundEnd)
|
||||
end,
|
||||
--每回合最多减少[a]点怒气(不受放逐影响)
|
||||
--a[int]
|
||||
[349]=function(role,args,id,judge)
|
||||
local maxNum=args[1]
|
||||
role.RoundMaxSubRage=maxNum
|
||||
local OnRoundEnd=function(curRound)
|
||||
role.AllSubRage=0
|
||||
end
|
||||
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundEnd,OnRoundEnd)
|
||||
end,
|
||||
-- 第[a]回合中,敌人受到的任何伤害会对其他敌人造成该伤害[b]%的间接伤害
|
||||
-- a[int],b[float]
|
||||
[350] = function(role, args,id,judge)
|
||||
|
||||
local i1 = args[1]
|
||||
local f1 = args[2]
|
||||
|
||||
local function OnDamage(func, atkRole, defRole, damage, skill, dotType, bCrit, damageType)
|
||||
if skill==nil then
|
||||
return
|
||||
end
|
||||
if skill and not skill.isTriggerJudge and judge==1 then
|
||||
return
|
||||
end
|
||||
if defRole.camp ~= role.camp then
|
||||
if skill or dotType then
|
||||
local list = RoleManager.Query(function(r) return r.camp == defRole.camp and r ~= defRole end)
|
||||
for _, r in ipairs(list) do
|
||||
local dd = floor(BattleUtil.ErrorCorrection(damage* f1))
|
||||
BattleUtil.FinalDamage(nil, atkRole, r, dd)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function onRoundChange(curRound)
|
||||
if curRound == i1 then
|
||||
BattleLogic.Event:AddEvent(BattleEventName.FinalDamage, OnDamage)
|
||||
elseif curRound == i1 + 1 then
|
||||
BattleLogic.Event:RemoveEvent(BattleEventName.FinalDamage, OnDamage)
|
||||
end
|
||||
end
|
||||
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, onRoundChange)
|
||||
|
||||
end,
|
||||
|
||||
}
|
||||
return passivityList
|
|
@ -654,8 +654,20 @@ function BattleUtil.CalRage(caster, target, value, countType)
|
|||
return
|
||||
end
|
||||
local lastRage=target.Rage
|
||||
--如果每回合减的怒气超过了每回合上限就不再减怒
|
||||
if (countType==3 or countType==4) and target.RoundMaxSubRage~=0 and target.RoundMaxSubRage<=target.AllSubRage then
|
||||
return
|
||||
end
|
||||
--这个减的怒气+已经间的怒气> 怒气限制
|
||||
if (countType==3 or countType==4) and target.RoundMaxSubRage~=0 and value+target.AllSubRage>target.RoundMaxSubRage then
|
||||
value=target.RoundMaxSubRage-target.AllSubRage
|
||||
end
|
||||
-- 操作怒气
|
||||
local deltaRage = target:AddRage(value, countType)
|
||||
if (countType==3 or countType==4) and target.RoundMaxSubRage~=0 then
|
||||
target.AllSubRage=target.AllSubRage-deltaRage
|
||||
end
|
||||
|
||||
BattleLogic.Event:DispatchEvent(BattleEventName.RecordRageChange, caster, target, deltaRage,countType,value,lastRage)
|
||||
-- 用于记录统计
|
||||
BattleLogic.Event:DispatchEvent(BattleEventName.RecordRage, caster, target, deltaRage)
|
||||
|
|
|
@ -62,7 +62,8 @@ function RoleLogic:Init(uid, data, position)
|
|||
self.aiOrder = data.ai
|
||||
self.aiIndex = 1
|
||||
self.aiTempCount = 0
|
||||
|
||||
self.RoundMaxSubRage=0 --每回合最多减少怒气
|
||||
self.AllSubRage =0 -- 每回合减少的怒气
|
||||
self.IsDebug = false
|
||||
self.enemyType = EnemyType.normal
|
||||
self.lockTarget = nil --嘲讽
|
||||
|
|
Loading…
Reference in New Issue