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 58dba9d..d74a383 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 @@ -12,6 +12,8 @@ function ChoregraphySystem:new(action, choregraphy) self.world = self.actor.world self.target = action.target + self.haveSentDamage = false + self.currentStepId = 0 self.currentStep = nil self.stepList = choregraphy @@ -38,7 +40,7 @@ function ChoregraphySystem:switchStep() self.currentStepId = self.currentStepId + 1 local stepData = choregraphyUtils.getStepDatas(self.stepList[self.currentStepId]) core.debug:print("cbs/choregraphy", "Starting step " .. stepData.name) - if (stepObjectList[stepData.name] ~= nil) then + if (stepObjectList[stepData.name] ~= nil and self:checkCondition(stepData.condition)) then self.currentStep = stepObjectList[stepData.name](self, stepData.arguments) end else @@ -46,6 +48,15 @@ function ChoregraphySystem:switchStep() end 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 + end + return success +end + function ChoregraphySystem:addQTE(action, origin, qteBaseData, blockProcess) local qteData = choregraphyUtils.getQteDatas(qteBaseData) if (qteObjectList[qteData.name] ~= nil) then @@ -64,10 +75,9 @@ end function ChoregraphySystem:sendDamage(power, accuracy, isSpecial, isAerial) if (self.target ~= nil) then if (self.fighter.isAlive) then - self.fighter:sendDamage(self.target, power, accuracy, isSpecial, isAerial) - return true + self.haveSentDamage = self.fighter:sendDamage(self.target, power, accuracy, isSpecial, isAerial) else - return false + self.haveSentDamage = false end end end diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/sendDamage.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/sendDamage.lua index 92e5548..67c5a39 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/sendDamage.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/systems/choregraphy/step/sendDamage.lua @@ -15,7 +15,7 @@ function SendDamage:start() - self.choregraphy.haveSentDamage = self.choregraphy:sendDamage(power, accuracy, isSpecial, isAerial) + self.choregraphy:sendDamage(power, accuracy, isSpecial, isAerial) self:finish() end