sonic-radiance/sonic-radiance.love/game/abstractmobs/character/statmanager.lua

19 lines
644 B
Lua
Raw Normal View History

2021-07-03 10:34:13 +02:00
local StatManager = require "game.abstractmobs.statmanager"
local CharacterStatManager = StatManager:extend()
function CharacterStatManager:new(owner)
CharacterStatManager.super.new(self, owner)
end
function CharacterStatManager:computeStat(statname, ignoreEquip)
local stat = self.owner:getLevelStat(statname) + self.owner:getEquipStats(statname, ignoreEquip)
return stat
end
function CharacterStatManager:predictStat(statname, category, name)
local data = core.datas:get("items", name)
local boost = data.statsBoost[statname] or 0
return self:computeStat(statname, category) + boost
end
return CharacterStatManager