diff --git a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua index 6848e57..792dcf5 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua @@ -146,11 +146,11 @@ function Hero:receiveSignal(action_type, id) end if (action_type == "defend") then self.turnAction = "defend" - self.world:switchActiveBattler( ) + self:switchActiveBattler( ) elseif (action_type == "attack") then self:changeAnimation("hit1") else - self.world:switchActiveBattler( ) + self:switchActiveBattler( ) end end @@ -160,6 +160,12 @@ function Hero:receiveBackSignal() self:changeAnimation("walk") end +function Hero:timerResponse(timer) + if timer == "switchActiveBattler" then + self.world:switchActiveBattler() + end +end + -- ACTION FUNCTIONS -- All functions related to actions @@ -173,6 +179,10 @@ function Hero:validateAction() end end +function Hero:switchActiveBattler() + self.tweens:newTimer(0.15, "switchActiveBattler") +end + -- SPRITE FUNCTIONS -- Handle the hero sprite @@ -195,7 +205,7 @@ function Hero:animationEnded(animation) self:sendDamage(self.x + self.direction, self.y, 33, 100, false, false) core.debug:print("cbs/hero", "normal combo finished, switching actor") self:changeAnimation("idle") - self.world:switchActiveBattler( ) + self:switchActiveBattler( ) end end