19 lines
644 B
Lua
19 lines
644 B
Lua
|
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
|