From ea78b67a50103ce00515b2c0fe373aafc29e0087 Mon Sep 17 00:00:00 2001 From: mealzz Date: Sat, 26 Feb 2022 18:57:14 -0500 Subject: [PATCH 1/2] Add 'Value' and 'Weight' fields to armor. --- template.json | 3 ++- templates/item/item-armor-sheet.html | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/template.json b/template.json index b14cabe..0fccb3f 100644 --- a/template.json +++ b/template.json @@ -255,7 +255,8 @@ "templates": [ "base" ], - "bonus": 10 + "bonus": 10, + "value" : 0 }, "condition": { "templates": [ diff --git a/templates/item/item-armor-sheet.html b/templates/item/item-armor-sheet.html index cc96d0b..25dd90a 100644 --- a/templates/item/item-armor-sheet.html +++ b/templates/item/item-armor-sheet.html @@ -23,7 +23,7 @@ {{!-- Sheet Tab Navigation --}} {{!-- Sheet Body --}} @@ -34,9 +34,18 @@ {{editor content=data.description target="data.description" button=true owner=owner editable=true}} - {{!-- Attributes Tab --}} -
- {{!-- As you add new fields, add them in here! --}} + {{!-- Item Tab --}} +
+
+
+ + +
+
+ + +
+
From d0ca41865caee427e67d27fb06691bb5df3f682b Mon Sep 17 00:00:00 2001 From: mealzz Date: Sat, 26 Feb 2022 19:28:55 -0500 Subject: [PATCH 2/2] Include armor, weapon, and item qty weight in charcter weight calculation. --- module/actor/actor-sheet.js | 4 +++- template.json | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index 38727c3..568fddf 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -102,11 +102,12 @@ export class MothershipActorSheet extends ActorSheet { if (i.type === 'item') { gear.push(i); - curWeight+=item.weight; + curWeight+=item.weight*item.quantity; } else if (i.type === 'skill') { skills.push(i); } else if (i.type === 'armor') { armors.push(i); + curWeight+=item.weight; } else if (i.type === 'weapon') { //We need to update this from the old system. if(item.ranges.value == "" && item.ranges.medium > 0){ @@ -115,6 +116,7 @@ export class MothershipActorSheet extends ActorSheet { } weapons.push(i); + curWeight+=item.weight; } else if (i.type === 'condition') { // We'll handle the pip html here. if (item.treatment == null) { diff --git a/template.json b/template.json index 0fccb3f..eb3945e 100644 --- a/template.json +++ b/template.json @@ -240,6 +240,7 @@ "critDmg": "", "critEffect": "", "bonus": 0, + "weight": 0, "cost" : 0, "ranges": { "short": 0, @@ -256,7 +257,8 @@ "base" ], "bonus": 10, - "value" : 0 + "weight": 0, + "cost" : 0 }, "condition": { "templates": [