diff --git a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua index d81e195..5bcb8b0 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua @@ -20,8 +20,6 @@ function Hero:new(world, x, y, owner, charnumber) self:initSprite() self:initChoregraphySystem() - self:initVoices() - self.side = "heroes" end @@ -53,8 +51,6 @@ function Hero:setActive() self.world.cursor:set(self.startx, self.starty, "cursorMove") - --self:talk("turnstart") - self.directionPrevious = self.direction end @@ -343,22 +339,6 @@ function Hero:animationEnded(animation) end end -function Hero:initVoices() - self:addVoiceEffect("move") - self:addVoiceEffect("turnstart") -end - -function Hero:addVoiceEffect(name) - local completename = self.owner.name .. "_" .. name - local path = "datas/gamedata/characters/" .. self.owner.name .. "/voices/" .. name .. ".wav" - self.assets:newSFX(completename, path) -end - -function Hero:talk(name) - local completename = self.owner.name .. "_" .. name - self.assets.sfx[completename]:play() -end - -- DRAW FUNCTIONS -- Draw everything related to the hero diff --git a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua index 39c5bcc..d2a4c00 100644 --- a/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua +++ b/sonic-radiance.love/scenes/battlesystem/controllers/fighters/character.lua @@ -13,6 +13,7 @@ function HeroFighter:new(owner, character, id) self.super.new(self, owner, true, id) self.statusbar = StatusBar(self) + self:initVoices() self.action = nil @@ -47,6 +48,7 @@ end function HeroFighter:startAction() core.debug:print("cbs/heroFighter", "launching the action menu") self.action = nil + self:talk("turnstart") self.turnSystem.scene.menu:set( self ) end @@ -120,6 +122,24 @@ function HeroFighter:setPP(value, relative) self.statusbar:updatePP() end +-- VOICE SYSTEM + +function HeroFighter:initVoices() + self:addVoiceEffect("move") + self:addVoiceEffect("turnstart") +end + +function HeroFighter:addVoiceEffect(name) + local completename = self.name .. "_" .. name + local path = "datas/gamedata/characters/" .. self.name .. "/voices/" .. name .. ".wav" + self.assets:newSFX(completename, path) +end + +function HeroFighter:talk(name) + local completename = self.name .. "_" .. name + self.assets.sfx[completename]:play() +end + -- DRAW FUNCTIONS function HeroFighter:drawIcon(x, y) local iconID = 1