feat: add qteSuccess and qteFailure conditions

This commit is contained in:
Kazhnuz 2021-07-03 19:28:58 +02:00
parent 6a37f12776
commit 72cccdcaf2

View file

@ -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)