From 75914d694de1bb3c4060f9dccca15f9bee0873c5 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 25 Jul 2020 08:44:59 +0200 Subject: [PATCH] chore: hook up the damage system to the choregraphy system --- .../fighters/systems/choregraphy/init.lua | 13 +++++++++++++ 1 file changed, 13 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 a9899a5..61f3bbf 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 @@ -9,6 +9,7 @@ function ChoregraphySystem:new(action, choregraphy) self.actor = self.fighter.actor self.assets = self.fighter.actor.assets self.world = self.actor.world + self.target = action.target self.currentStepId = 0 self.currentStep = nil @@ -36,12 +37,24 @@ function ChoregraphySystem:switchStep() end 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 + else + return false + end + end +end + function ChoregraphySystem:endStep() self.currentStep = nil end function ChoregraphySystem:endChoregraphy() self.action:choregraphyEnded() + self.fighter.turnSystem:applyDeath() end function ChoregraphySystem:haveNextStep()