2020-07-19 22:38:59 +02:00
|
|
|
local ActionParent = Object:extend()
|
|
|
|
|
2020-07-24 19:20:48 +02:00
|
|
|
local ChoregraphySystem = require "scenes.battlesystem.controllers.fighters.systems.choregraphy"
|
|
|
|
|
2020-07-19 22:38:59 +02:00
|
|
|
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
|
|
|
|
|
2020-07-24 19:20:48 +02:00
|
|
|
function ActionParent:loadChoregraphy(skillname)
|
|
|
|
local skill = game.skills:getSkillData(skillname)
|
|
|
|
self.choregraphy = ChoregraphySystem(self, skill.choregraphy)
|
|
|
|
end
|
|
|
|
|
|
|
|
function ActionParent:loadChoregraphyFromSkill(skill)
|
|
|
|
self.choregraphy = ChoregraphySystem(self, skill.choregraphy)
|
|
|
|
end
|
|
|
|
|
2020-07-19 22:38:59 +02:00
|
|
|
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
|
|
|
|
|
2020-07-24 19:20:48 +02:00
|
|
|
function ActionParent:choregraphyEnded()
|
2020-07-25 11:38:59 +02:00
|
|
|
self.choregraphy = nil
|
2020-07-24 19:20:48 +02:00
|
|
|
self:finishAction()
|
|
|
|
end
|
|
|
|
|
2020-07-19 22:38:59 +02:00
|
|
|
function ActionParent:startAction()
|
|
|
|
|
|
|
|
self:finishAction()
|
|
|
|
end
|
|
|
|
|
|
|
|
function ActionParent:finishAction()
|
|
|
|
self.fighter:finishAction()
|
|
|
|
end
|
|
|
|
|
2021-04-25 12:21:17 +02:00
|
|
|
function ActionParent:draw()
|
|
|
|
if (self.choregraphy ~= nil) then
|
|
|
|
self.choregraphy:draw()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-07-19 22:38:59 +02:00
|
|
|
return ActionParent
|