sonic-radiance/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/actions/parent.lua

63 lines
1.2 KiB
Lua
Raw Normal View History

local ActionParent = Object:extend()
local ChoregraphySystem = require "scenes.battlesystem.choregraphy"
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:loadChoregraphy(skillname)
2021-05-16 08:48:05 +02:00
local skill = core.datas:get("skills", skillname)
self:loadChoregraphyFromSkill(skill)
end
function ActionParent:loadChoregraphyFromSkill(skill)
2021-08-08 13:11:36 +02:00
self.choregraphy = ChoregraphySystem(self, skill.choregraphy, skill.subChoregraphy)
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:choregraphyEnded()
self.choregraphy = nil
self:finishAction()
end
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
return ActionParent