feat: add a way to remove equipment

This commit is contained in:
Kazhnuz 2021-04-23 09:23:13 +02:00
parent 50981a7823
commit f65edf1924

View file

@ -26,6 +26,14 @@ function CharacterEquip:setEquip(category, name)
self.stats = self:createStats()
end
function CharacterEquip:removeEquip(category)
if (not utils.string.isEmpty(self.equip[category])) then
game.loot:addItem(category, self.equip[category], 1)
self.equip[category] = ""
self.stats = self:createStats()
end
end
function CharacterEquip:predictStat(statName, category, name)
local data = itemutils.getItemData(category, name)
local boost = data.statsBoost[statName] or 0