From f65edf192411922d1639c5e7bb33d01f8b62288c Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 23 Apr 2021 09:23:13 +0200 Subject: [PATCH] feat: add a way to remove equipment --- sonic-radiance.love/game/abstractmobs/character/equip.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sonic-radiance.love/game/abstractmobs/character/equip.lua b/sonic-radiance.love/game/abstractmobs/character/equip.lua index 64c2eb3..cc5230c 100644 --- a/sonic-radiance.love/game/abstractmobs/character/equip.lua +++ b/sonic-radiance.love/game/abstractmobs/character/equip.lua @@ -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