4,951
edits
Falterfire (talk | contribs) (Slightly changed formatting on provided runes) |
Falterfire (talk | contribs) (Added p._canItemUseSlot) |
||
Line 36: | Line 36: | ||
function p.getItems(checkFunc) | function p.getItems(checkFunc) | ||
return GameData.getEntities('items', checkFunc) | return GameData.getEntities('items', checkFunc) | ||
end | |||
function p._canItemUseSlot(item, equipSlot) | |||
--Function to easily check if an item can fit in a given equipment slot | |||
--Ex: p._canItemUseSlot({Bronze Platebody}, 'Platebody') returns true | |||
if type(item) == 'string' then | |||
item = p.getItem(item) | |||
end | |||
return item.validSlots ~= nil and Shared.contains(item.validSlots, equipSlot) | |||
end | end | ||