back_recharge
wangyuan 2019-05-14 18:18:22 +08:00
parent 85cbae09db
commit cec26e2a7a
2 changed files with 14 additions and 12 deletions

View File

@ -22,6 +22,15 @@ local propertyList = {
RoleDataName.MaxHp, RoleDataName.MaxHp,
} }
local function buffRandomAction(random, caster, target, buffType, duration, ...)
local b = Random.Range01() <= random
if b then
target:AddBuff(Buff.Create(caster, buffType, duration, ...))
else
target.Event:DispatchEvent(BattleEventName.BuffDodge, caster, buffType, ...)
end
end
--效果表 --效果表
local effectList = { local effectList = {
--造成[a]%的[b]伤害 --造成[a]%的[b]伤害
@ -53,9 +62,7 @@ local effectList = {
local cb1 = args[2] local cb1 = args[2]
local f2 = args[3] local f2 = args[3]
BattleLogic.WaitForTrigger(interval, function () BattleLogic.WaitForTrigger(interval, function ()
BattleUtil.RandomAction(f1, function () buffRandomAction(f1, caster, target, BuffName.Control, f2, cb1)
target:AddBuff(Buff.Create(caster, BuffName.Control, f2, cb1))
end)
end) end)
end, end,
--[d]改变[a]属性[b]%,持续[c]秒 --[d]改变[a]属性[b]%,持续[c]秒
@ -235,9 +242,7 @@ local effectList = {
else else
BattleUtil.CalDamage(caster, target, dt, f1) BattleUtil.CalDamage(caster, target, dt, f1)
end end
BattleUtil.RandomAction(f2, function () buffRandomAction(f2, caster, target, BuffName.Brand, 0, rid)
target:AddBuff(Buff.Create(caster, BuffName.Brand,0, rid))
end)
end) end)
end, end,
--造成[a]%的[b]伤害,如果击杀,则其他人再受到此次伤害的[c]%的伤害 --造成[a]%的[b]伤害,如果击杀,则其他人再受到此次伤害的[c]%的伤害
@ -372,9 +377,7 @@ local effectList = {
BattleLogic.WaitForTrigger(interval, function () BattleLogic.WaitForTrigger(interval, function ()
BattleUtil.CalDamage(caster, target, dt, f1) BattleUtil.CalDamage(caster, target, dt, f1)
if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end) then if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end) then
BattleUtil.RandomAction(f2, function () buffRandomAction(f2, caster, target, BuffName.Control, f3, ct)
target:AddBuff(Buff.Create(caster, BuffName.Control, f3, ct))
end)
end end
end) end)
end, end,
@ -537,9 +540,7 @@ local effectList = {
local ib1 = args[2] local ib1 = args[2]
local f2 = args[3] local f2 = args[3]
BattleLogic.WaitForTrigger(interval, function () BattleLogic.WaitForTrigger(interval, function ()
BattleUtil.RandomAction(f1, function () buffRandomAction(f1, caster, target, BuffName.Immune, f2, ib1)
target:AddBuff(Buff.Create(caster, BuffName.Immune, f2, ib1))
end)
end) end)
end, end,
--[b]%改变[d]重击技能CD[a]秒 ,持续[c]秒 0代表清除所有 --[b]%改变[d]重击技能CD[a]秒 ,持续[c]秒 0代表清除所有

View File

@ -49,6 +49,7 @@ BattleEventName = {
BuffCaster = indexAdd(), BuffCaster = indexAdd(),
BuffStart = indexAdd(), BuffStart = indexAdd(),
BuffDodge = indexAdd(),
BuffTrigger = indexAdd(), BuffTrigger = indexAdd(),
BuffEnd = indexAdd(), BuffEnd = indexAdd(),
BuffCountChange = indexAdd(), BuffCountChange = indexAdd(),