55 lines
1.3 KiB
Lua
55 lines
1.3 KiB
Lua
|
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
|