From 32bb1b542516575b99368e4a62ac920ea7709a87 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 3 Jul 2021 10:44:17 +0200 Subject: [PATCH] chore: remove deprecated recomputation functions --- .../game/abstractmobs/character/init.lua | 7 ------- .../game/abstractmobs/ennemy/init.lua | 4 ---- sonic-radiance.love/game/abstractmobs/parent.lua | 16 ---------------- .../game/abstractmobs/statmanager.lua | 7 ------- 4 files changed, 34 deletions(-) diff --git a/sonic-radiance.love/game/abstractmobs/character/init.lua b/sonic-radiance.love/game/abstractmobs/character/init.lua index 843be24..b80d55e 100644 --- a/sonic-radiance.love/game/abstractmobs/character/init.lua +++ b/sonic-radiance.love/game/abstractmobs/character/init.lua @@ -24,13 +24,6 @@ function AbstractCharacter:initBasicElements() self:initLevel() end -function AbstractCharacter:createStats() - local statNames = self:getStatList() - local stats = {} - - return stats -end - function AbstractCharacter:updateHPPP() if (self.hp ~= nil) then self.hp = math.min(self.hp, self.stats:get(self.stats.HPMAX)) diff --git a/sonic-radiance.love/game/abstractmobs/ennemy/init.lua b/sonic-radiance.love/game/abstractmobs/ennemy/init.lua index bee003c..1a71cd8 100644 --- a/sonic-radiance.love/game/abstractmobs/ennemy/init.lua +++ b/sonic-radiance.love/game/abstractmobs/ennemy/init.lua @@ -35,10 +35,6 @@ function AbstractEnnemy:initBasicElements() self.turns = self.data.turns end -function AbstractEnnemy:createStats() - return self.data.stats -end - function AbstractEnnemy:createSkills() return self.data.skills end diff --git a/sonic-radiance.love/game/abstractmobs/parent.lua b/sonic-radiance.love/game/abstractmobs/parent.lua index 5c6728a..c948512 100644 --- a/sonic-radiance.love/game/abstractmobs/parent.lua +++ b/sonic-radiance.love/game/abstractmobs/parent.lua @@ -8,7 +8,6 @@ function AbstractMobParent:new(serializeFields, listSerializable, statManager) self:initBasicElements() self.stats = statManager(self) - self.stats:setStats(self:createStats()) self.skills = self:createSkills() self.statuts = {} self:initLife() @@ -29,21 +28,6 @@ function AbstractMobParent:getProtecTypes() return {} end -function AbstractMobParent:createStats() - local stats = {} - - stats.hpmax = 0 - stats.ppmax = 0 - stats.attack = 0 - stats.power = 0 - stats.defense = 0 - stats.technic = 0 - stats.mind = 0 - stats.speed = 0 - - return stats -end - function AbstractMobParent:createSkills() return {} end diff --git a/sonic-radiance.love/game/abstractmobs/statmanager.lua b/sonic-radiance.love/game/abstractmobs/statmanager.lua index 4c19330..a06ac5d 100644 --- a/sonic-radiance.love/game/abstractmobs/statmanager.lua +++ b/sonic-radiance.love/game/abstractmobs/statmanager.lua @@ -15,13 +15,6 @@ function StatManager:new(owner) self.owner = owner end -function StatManager:setStats(stats) - self.list = {} - for key, value in pairs(stats) do - self.list[key] = value - end -end - function StatManager:get(statname) return self:computeStat(statname) end