From 72cccdcaf209df3b2a232a908000d3d2976eea9f Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 3 Jul 2021 19:28:58 +0200 Subject: [PATCH] feat: add qteSuccess and qteFailure conditions --- .../controllers/fighters/systems/choregraphy/init.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua index ce7be2d..707f49f 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/init.lua @@ -20,6 +20,7 @@ function ChoregraphySystem:new(action, choregraphy) self.qte = {} self.qte.current = nil self.qte.wasSuccess = false + self.qte.list = {} end function ChoregraphySystem:update(dt) @@ -50,9 +51,15 @@ end function ChoregraphySystem:checkCondition(condition) local conditionArgs = utils.string.split(condition, ":") local success = true + if (conditionArgs[1] == "sentDamage" and (not self.haveSentDamage)) then success = false + elseif (conditionArgs[1] == "qteSuccess" and (not self.qte.list[tonumber(conditionArgs[2])])) then + success = false + elseif (conditionArgs[1] == "qteFailure" and (self.qte.list[tonumber(conditionArgs[2])])) then + success = false end + return success end @@ -69,6 +76,8 @@ end function ChoregraphySystem:endQte(success) self.qte.current = nil self.qte.wasSuccess = success + + table.insert(self.qte.list, success) end function ChoregraphySystem:sendDamage(power, type, element, isSpecial)