sonic-radiance/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua
2021-08-08 13:11:36 +02:00

57 lines
1.8 KiB
Lua

local ChoregraphySystem = Object:extend()
local QteMixin = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.mixins.qtes"
local StepsMixin = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.mixins.steps"
local TagsMixin = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.mixins.tags"
local CountersMixin = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.mixins.counters"
local WrappersMixin = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.mixins.wrappers"
local SubChoregraphiesMixin = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.mixins.subchoregraphies"
local TweenManager = require "birb.classes.time"
ChoregraphySystem:implement(QteMixin)
ChoregraphySystem:implement(StepsMixin)
ChoregraphySystem:implement(TagsMixin)
ChoregraphySystem:implement(CountersMixin)
ChoregraphySystem:implement(WrappersMixin)
ChoregraphySystem:implement(SubChoregraphiesMixin)
function ChoregraphySystem:new(action, choregraphy, subChoregraphy)
self:initWrappers(action)
self:initSteps(choregraphy)
self:initQte()
self:initTagActions()
self:initCounters()
self:initSubchoregraphies(subChoregraphy)
self.tweens = TweenManager(self)
self.actor:resetFrameSignal()
end
function ChoregraphySystem:update(dt)
self:updateQte(dt)
self:updateSteps(dt)
self.tweens:update(dt)
self:updateSubChoregraphies(dt)
end
function ChoregraphySystem:timerResponse(signal)
if (signal == "startNextTarget") then
self:startNextTarget()
end
end
function ChoregraphySystem:endChoregraphy()
self.actor:choregraphyEnded()
self.action:choregraphyEnded()
self.fighter.turnSystem:applyDeath()
end
function ChoregraphySystem:draw()
self:drawQte()
self:drawSubChoregraphies()
end
return ChoregraphySystem