added basics of getItems()

This commit is contained in:
Lyle hayhurst
2021-06-03 08:42:08 -05:00
parent 87a031ae44
commit 2dcbfbe096

View File

@@ -106,9 +106,13 @@ export class wfrp4e {
* Items * Items
*/ */
getItems(token,itemType) { getItems(token,itemType) {
if (itemType == undefined) itemType = 'any'; if (itemType == undefined) itemType = 'any';
const allItems = token.actor.items; const allItems = token.actor.items;
if (itemType == 'any') return allItems.filter(i => i.type == 'item'); console.log("allitems: "+ allItems);
if (itemType == 'any') return allItems.filter(i => i.type == "weapon" ||
i.type == "armour" ||
i.type == "ammunition" ); // i.type == 'item');
} }
getItemUses(item) { getItemUses(item) {