battle
parent
85cbae09db
commit
cec26e2a7a
|
@ -22,6 +22,15 @@ local propertyList = {
|
|||
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 = {
|
||||
--造成[a]%的[b]伤害
|
||||
|
@ -53,9 +62,7 @@ local effectList = {
|
|||
local cb1 = args[2]
|
||||
local f2 = args[3]
|
||||
BattleLogic.WaitForTrigger(interval, function ()
|
||||
BattleUtil.RandomAction(f1, function ()
|
||||
target:AddBuff(Buff.Create(caster, BuffName.Control, f2, cb1))
|
||||
end)
|
||||
buffRandomAction(f1, caster, target, BuffName.Control, f2, cb1)
|
||||
end)
|
||||
end,
|
||||
--[d]改变[a]属性[b]%,持续[c]秒
|
||||
|
@ -235,9 +242,7 @@ local effectList = {
|
|||
else
|
||||
BattleUtil.CalDamage(caster, target, dt, f1)
|
||||
end
|
||||
BattleUtil.RandomAction(f2, function ()
|
||||
target:AddBuff(Buff.Create(caster, BuffName.Brand,0, rid))
|
||||
end)
|
||||
buffRandomAction(f2, caster, target, BuffName.Brand, 0, rid)
|
||||
end)
|
||||
end,
|
||||
--造成[a]%的[b]伤害,如果击杀,则其他人再受到此次伤害的[c]%的伤害
|
||||
|
@ -372,9 +377,7 @@ local effectList = {
|
|||
BattleLogic.WaitForTrigger(interval, function ()
|
||||
BattleUtil.CalDamage(caster, target, dt, f1)
|
||||
if BattleLogic.BuffMgr:HasBuff(target, BuffName.DOT, function (buff) return dot == 0 or buff.damageType == dot end) then
|
||||
BattleUtil.RandomAction(f2, function ()
|
||||
target:AddBuff(Buff.Create(caster, BuffName.Control, f3, ct))
|
||||
end)
|
||||
buffRandomAction(f2, caster, target, BuffName.Control, f3, ct)
|
||||
end
|
||||
end)
|
||||
end,
|
||||
|
@ -537,9 +540,7 @@ local effectList = {
|
|||
local ib1 = args[2]
|
||||
local f2 = args[3]
|
||||
BattleLogic.WaitForTrigger(interval, function ()
|
||||
BattleUtil.RandomAction(f1, function ()
|
||||
target:AddBuff(Buff.Create(caster, BuffName.Immune, f2, ib1))
|
||||
end)
|
||||
buffRandomAction(f1, caster, target, BuffName.Immune, f2, ib1)
|
||||
end)
|
||||
end,
|
||||
--[b]%改变[d]重击技能CD[a]秒 ,持续[c]秒 (0代表清除所有)
|
||||
|
|
|
@ -49,6 +49,7 @@ BattleEventName = {
|
|||
|
||||
BuffCaster = indexAdd(),
|
||||
BuffStart = indexAdd(),
|
||||
BuffDodge = indexAdd(),
|
||||
BuffTrigger = indexAdd(),
|
||||
BuffEnd = indexAdd(),
|
||||
BuffCountChange = indexAdd(),
|
||||
|
|
Loading…
Reference in New Issue