Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
theripper93 committed Jan 17, 2025
1 parent c064e28 commit 64496b7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.js.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -818,10 +818,18 @@ export function initConfig() {
}

get quantity() {
if (this.item.system.uses?.max) return this.item.system.uses.max - this.item.system.uses.spent;
if (!this.activity) return null;
const showQuantityItemTypes = ["consumable"];
const consumeType = this.activity?.consume?.type;
const useAmmo = this.item.system.ammunition?.type;
const useOtherItem = this.activity?.consumption?.targets?.find(t => t.type === "itemUses");
if (useOtherItem) {
const otherItem = this.actor.items.get(useOtherItem.target);
if (otherItem && otherItem.system.uses?.max) {
return otherItem.system.uses.max - otherItem.system.uses.spent;
}
}
if (useAmmo) {
const ammoItem = this.item.system.ammunitionOptions[0]?.item;
if (!ammoItem) return null;
Expand Down

0 comments on commit 64496b7

Please sign in to comment.