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

55 lines
1.3 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")
Control = Buff:New()
--初始化Buff通过传入一些自定义参数控制成长相关的数值
function Control:SetData(...)
--log("Control:SetData")
local args = {...}
self.ctrlType = args[1]
end
--初始化后调用一次
function Control:OnStart()
--log("Control:OnStart")
if self.ctrlType == 1 then --眩晕
self.target.enable = false
elseif self.ctrlType == 2 then --沉默
elseif self.ctrlType == 3 then --嘲讽
self.target.lockTarget = self.caster
elseif self.ctrlType == 4 then --禁疗
elseif self.ctrlType == 5 then --致盲
end
end
--间隔N帧触发返回true时表示继续触发返回false立刻触发OnEnd
function Control:OnTrigger()
--log("Control:OnTrigger")
return true
end
--效果结束时调用一次
function Control:OnEnd()
--log("Control:OnEnd")
if self.ctrlType == 1 then --眩晕
self.target.enable = true
elseif self.ctrlType == 2 then --沉默
elseif self.ctrlType == 3 then --嘲讽
self.target.lockTarget = nil
elseif self.ctrlType == 4 then --禁疗
elseif self.ctrlType == 5 then --致盲
end
end
--只有当cover字段为true时触发返回true则被新效果覆盖
function Control:OnCover(newBuff)
--log("Control:OnCover")
return true
end
return Control