Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
theripper93 committed Nov 28, 2023
1 parent 431142e commit 3835788
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 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.

6 changes: 5 additions & 1 deletion scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,13 @@ export function initConfig() {
if (consumeType === "ammo") {
const ammoItem = this.actor.items.get(this.item.system.consume.target);
if (!ammoItem) return null;
return ammoItem.system.quantity;
return Math.floor((ammoItem.system.quantity ?? 0) / this.item.system.consume.amount);
} else if (consumeType === "attribute") {
return getProperty(this.actor.system, this.item.system.consume.target);
} else if (consumeType === "charges") {
const chargesItem = this.actor.items.get(this.item.system.consume.target);
if (!chargesItem) return null;
return Math.floor((chargesItem.system.uses?.value ?? 0) / this.item.system.consume.amount);
} else if (showQuantityItemTypes.includes(this.item.type)) {
return this.item.system.uses?.value ?? this.item.system.quantity;
} else if (this.item.system.uses.value !== null) {
Expand Down

0 comments on commit 3835788

Please sign in to comment.