miduo_server/luafight/Modules/Battle/Logic/Buff/DOT.lua

49 lines
1.2 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

require("Modules/Battle/Logic/Base/Buff")
DOT = Buff:New()
--初始化Buff通过传入一些自定义参数控制成长相关的数值
function DOT:SetData(...)
--log("DOT:SetData")
self.interval,
self.damageType, --1 燃烧 2 中毒 3 流血
self.damagePro, --1 物理 2 魔法
self.damageFactor = ... --伤害系数
self.isDeBuff = true
--if self.damageType == 2 then
-- self.cover = true
-- self.layer = 1
--else
-- self.cover = false
-- self.layer = nil
--end
end
--初始化后调用一次
function DOT:OnStart()
--log("DOT:OnStart")
end
--间隔N帧触发返回true时表示继续触发返回false立刻触发OnEnd
function DOT:OnTrigger()
--log("DOT:OnTrigger")
BattleUtil.CalDamage(self.caster, self.target, self.damagePro, self.damageFactor,0, true)
return true
end
--效果结束时调用一次
function DOT:OnEnd()
--log("DOT:OnEnd")
end
--只有当cover字段为true时触发返回true则被新效果覆盖
function DOT:OnCover(newBuff)
--log("DOT:OnCover")
--if self.damageType == 2 then
-- newBuff.layer = self.layer + 1
-- newBuff.damageFactor =
--end
return true
end
return DOT