36 lines
982 B
Lua
36 lines
982 B
Lua
require("TimedActions/ISBaseTimedAction")
|
|
|
|
WreckerTimedAction = ISBaseTimedAction:derive("WreckerTimedAction")
|
|
|
|
function WreckerTimedAction:isValid()
|
|
return self.isValidFunc ~= nil
|
|
and self.isValidFunc(self.character, self.arg1, self.arg2) == true
|
|
end
|
|
|
|
function WreckerTimedAction:start()
|
|
end
|
|
|
|
function WreckerTimedAction:perform()
|
|
if self:isValid() and self.performFunc then
|
|
self.performFunc(self.character, self.arg1, self.arg2)
|
|
end
|
|
ISBaseTimedAction.perform(self)
|
|
end
|
|
|
|
function WreckerTimedAction:stop()
|
|
ISBaseTimedAction.stop(self)
|
|
end
|
|
|
|
function WreckerTimedAction:new(character, time, isValidFunc, performFunc, arg1, arg2)
|
|
local action = ISBaseTimedAction.new(self, character)
|
|
action.maxTime = time
|
|
action.stopOnWalk = false
|
|
action.stopOnRun = false
|
|
action.useProgressBar = true
|
|
action.isValidFunc = isValidFunc
|
|
action.performFunc = performFunc
|
|
action.arg1 = arg1
|
|
action.arg2 = arg2
|
|
return action
|
|
end
|