miduo_client/Assets/ManagedResources/~Lua/Modules/Battle/Logic/Buff/Exile.lua

36 lines
875 B
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.

Exile = Buff:New()
--初始化Buff通过传入一些自定义参数控制成长相关的数值
function Exile:SetData(...)
-- 刷新排序等级
self.sort = 4
end
--初始化后调用一次
function Exile:OnStart()
self.target.isExile = true
if self.caster.exileTargets then
table.insert(self.caster.exileTargets,self.target)
end
self.target.Event:DispatchEvent(BattleEventName.RoleBeExile, self)
end
--间隔N帧触发返回true时表示继续触发返回false立刻触发OnEnd
function Exile:OnTrigger()
return true
end
--效果结束时调用一次
function Exile:OnEnd()
self.target.isExile = false
self.target.Event:DispatchEvent(BattleEventName.RoleExileEnd, self)
end
--只有当cover字段为true时触发返回true则被新效果覆盖
function Exile:OnCover(newBuff)
return true
end
return Exile