From f3d44e06d19c63d6225c28873498ed00de8d1c87 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 17:03:37 +0200 Subject: [PATCH] feat: add a way to wait for the end of something already started --- .../game/utils/choregraphy/arguments.lua | 1 + .../systems/choregraphy/step/init.lua | 1 + .../choregraphy/step/waitActorFinished.lua | 20 +++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/waitActorFinished.lua diff --git a/sonic-radiance.love/game/utils/choregraphy/arguments.lua b/sonic-radiance.love/game/utils/choregraphy/arguments.lua index e4ce5a5..8a4d3f2 100644 --- a/sonic-radiance.love/game/utils/choregraphy/arguments.lua +++ b/sonic-radiance.love/game/utils/choregraphy/arguments.lua @@ -8,6 +8,7 @@ return { ["jump"] = {"power", "bounceNumber", "blockProcess"}, ["jumpTo"] = {"origin", "x", "y", "duration", "blockProcess"}, ["jumpBack"] = {"duration", "blockProcess"}, + ["waitActorFinished"] = {"waitFor"}, --[name] = {args}, } diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua index 3cc435d..2dd3b8c 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/init.lua @@ -9,5 +9,6 @@ actions["playSFX"] = require(baseURI .. "playSFX") actions["sendDamage"] = require(baseURI .. "sendDamage") actions["setAnimation"] = require(baseURI .. "setAnimation") actions["wait"] = require(baseURI .. "wait") +actions["waitActorFinished"] = require(baseURI .. "waitActorFinished") return actions diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/waitActorFinished.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/waitActorFinished.lua new file mode 100644 index 0000000..7392a3f --- /dev/null +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/waitActorFinished.lua @@ -0,0 +1,20 @@ +local StepParent = require "scenes.battlesystem.controllers.fighters.systems.choregraphy.step.parent" +local WaitActorFinishedStep = StepParent:extend() + +function WaitActorFinishedStep:new(controller, args) + WaitActorFinishedStep.super.new(self, controller, args) +end + +function WaitActorFinishedStep:start() + self.choregraphy.actor:blockChoregraphy(true, self, self.arguments.waitFor) +end + +function WaitActorFinishedStep:update(dt) + +end + +function WaitActorFinishedStep:getSignal(signal) + +end + +return WaitActorFinishedStep;