From a5655f46dde5b12041170c51496d1383e3ea3f15 Mon Sep 17 00:00:00 2001 From: Lyle hayhurst Date: Mon, 7 Jun 2021 19:44:36 -0500 Subject: [PATCH] getting skill bonuses showing --- DEVGUIDE.md | 2 +- src/systems/wfrp4e.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/DEVGUIDE.md b/DEVGUIDE.md index ea1d21a..643b04b 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -36,7 +36,7 @@ In propertyinspector/js/common.js starting at line 1274 there's various function To enable logging on the streamdeck, [follow these instructions](https://developer.elgato.com/documentation/stream-deck/sdk/create-your-own-plugin/) from Elgato. ## Property discovery -In a Foundry client browser instance, if you go to the dev console, you can browser your tokens via the `canvas.tokens` path, for exmaple `canvas.tokens.children[0].children[0].actor.items`. +In a Foundry client browser instance, if you go to the dev console, you can browser your tokens via the `canvas.tokens` path, for example `canvas.tokens.children[0].children[0].actor.data`. ## Module Deployment If you make changes to files in this project, you'll need to copy the changed files to your Foundry install folder, probably found here: `C:\Users\$USER\AppData\Local\FoundryVTT\Data\modules\MaterialDeck`. diff --git a/src/systems/wfrp4e.js b/src/systems/wfrp4e.js index d33e3bd..84b03cb 100644 --- a/src/systems/wfrp4e.js +++ b/src/systems/wfrp4e.js @@ -35,8 +35,13 @@ export class wfrp4e { getFeatures(token,featureType) { if (featureType == undefined) featureType = 'any'; const allItems = token.actor.items; + console.log(allItems); if (featureType == 'any') return allItems.filter(i => i.type == 'skill' || i.type == 'talent' || i.type == "career" || i.type == 'trait'); - else return allItems.filter(i => i.type == featureType); + return allItems.filter(i => i.type == featureType); + } + + getFeatureUses(item) { + return {available: `+${item.data.data.total.value}`}; } getHP(token) {