improvement: better handling of statusbar callback

This commit is contained in:
Kazhnuz 2021-03-12 20:05:54 +01:00
parent db9319fc90
commit 4bf4fdb541
2 changed files with 14 additions and 6 deletions

View file

@ -110,14 +110,12 @@ function HeroFighter:goBackToMenu()
end
-- LIFE functions
function HeroFighter:setHP(value, relative)
HeroFighter.super.setHP(self, value, relative)
self.statusbar:updateHP()
function HeroFighter:updatePP()
self.statusbar:updatePP()
end
function HeroFighter:setPP(value, relative)
HeroFighter.super.setPP(self, value, relative)
self.statusbar:updatePP()
function HeroFighter:updateHP()
self.statusbar:updateHP()
end
-- VOICE SYSTEM

View file

@ -31,10 +31,12 @@ function FighterParent:setHP(value, relative)
end
self.abstract:setHP(value, relative)
self.actor:setDamageNumber(relativeNumber)
self:updateHP()
end
function FighterParent:setPP(value, relative)
self.abstract:setPP(value, relative)
self:updatePP()
end
function FighterParent:applyDeath()
@ -48,6 +50,14 @@ function FighterParent:die()
self.actor:die()
end
function FighterParent:updatePP()
-- Fonction vide
end
function FighterParent:updateHP()
-- Fonction vide
end
function FighterParent:sendDamage(target, value, accuracy, isSpecial, isAerial)
local stats = self:getStats()
local value = value / 10