40 lines
684 B
Lua
40 lines
684 B
Lua
local ActionParent = Object:extend()
|
|
|
|
function ActionParent:new(fighter)
|
|
self.fighter = fighter
|
|
self.target = nil
|
|
self.choregraphy = nil
|
|
|
|
self.isStarted = false
|
|
end
|
|
|
|
function ActionParent:update(dt)
|
|
if (self.choregraphy ~= nil) then
|
|
self.choregraphy:update(dt)
|
|
end
|
|
end
|
|
|
|
function ActionParent:needTarget()
|
|
-- needTarget, targetEnnemies
|
|
return false, false
|
|
end
|
|
|
|
function ActionParent:setTarget(target)
|
|
self.target = target
|
|
end
|
|
|
|
function ActionParent:start()
|
|
self.isStarted = true
|
|
self:startAction()
|
|
end
|
|
|
|
function ActionParent:startAction()
|
|
|
|
self:finishAction()
|
|
end
|
|
|
|
function ActionParent:finishAction()
|
|
self.fighter:finishAction()
|
|
end
|
|
|
|
return ActionParent
|