diff --git a/modules/warhero-actor.js b/modules/warhero-actor.js index 1f5a8e2..6319301 100644 --- a/modules/warhero-actor.js +++ b/modules/warhero-actor.js @@ -179,13 +179,17 @@ export class WarheroActor extends Actor { for (let slotName in game.system.warhero.config.slotNames) { let slotDef = game.system.warhero.config.slotNames[slotName] containers[slotName] = duplicate(slotDef) - containers[slotName].content = this.items.filter(it => (it.type == 'weapon' || it.type == 'armor' || it.type == 'shield' || it.type == 'equipment') + containers[slotName].content = this.items.filter(it => (it.type == 'money' || it.type == 'weapon' || it.type == 'armor' || it.type == 'shield' || it.type == 'equipment') && it.system.slotlocation == slotName) let slotUsed = 0 - for (let item of containers[slotName].content) { + for (let item of containers[slotName].content) { let q = (item.system.quantity) ? item.system.quantity : 1 containers[slotName].nbslots += (item.system.providedslot?? 0) * q - slotUsed += item.system.slotused * q + if ( item.type == "money") { + slotUsed += Math.ceil(item.system.quantity / 1000) + } else { + slotUsed += item.system.slotused * q + } } slotUsed = Math.ceil(slotUsed) containers[slotName].slotUsed = slotUsed diff --git a/system.json b/system.json index c98d2d6..f6f4230 100644 --- a/system.json +++ b/system.json @@ -107,7 +107,7 @@ "styles": [ "styles/simple.css" ], - "version": "10.0.31", + "version": "10.0.32", "compatibility": { "minimum": "10", "verified": "10", @@ -115,7 +115,7 @@ }, "title": "Warhero RPG", "manifest": "https://www.uberwald.me/gitea/public/fvtt-warhero/raw/branch/master/system.json", - "download": "https://www.uberwald.me/gitea/uberwald/fvtt-warhero/archive/fvtt-warhero-10.0.31.zip", + "download": "https://www.uberwald.me/gitea/uberwald/fvtt-warhero/archive/fvtt-warhero-10.0.32.zip", "url": "https://www.uberwald.me/gitea/public/fvtt-warhero", "background": "images/ui/warhero_welcome_page.webp", "id": "fvtt-warhero" diff --git a/template.json b/template.json index 6be2fbe..f578182 100644 --- a/template.json +++ b/template.json @@ -240,7 +240,8 @@ "language", "condition", "class", - "genericitem" + "genericitem", + "money" ], "templates": { "commonclassrace": { @@ -264,6 +265,11 @@ } } }, + "money": { + "quantity": 0, + "slotlocation": "backpack", + "description": "" + }, "genericitem": { "description": "" }, diff --git a/templates/item-money-sheet.html b/templates/item-money-sheet.html new file mode 100644 index 0000000..ae76433 --- /dev/null +++ b/templates/item-money-sheet.html @@ -0,0 +1,37 @@ +
+
+ +
+

+
+
+ + {{> systems/fvtt-warhero/templates/partial-item-nav.html}} + + + {{!-- Sheet Body --}} +
+ + {{> systems/fvtt-warhero/templates/partial-item-description.html}} + + +
+
    +
  • + +
  • +
  • + +
  • +
+ +
+ +
+