added item types

This commit is contained in:
Lyle hayhurst
2021-06-04 08:14:28 -05:00
parent 2dcbfbe096
commit 9ffa796eeb
3 changed files with 26 additions and 8 deletions

View File

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