diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index a7c5016..54d1124 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -56,6 +56,7 @@ export class MothershipActorSheet extends ActorSheet { const weapons = []; const armors = []; + let curWeight = 0; // Iterate through items, allocating to containers // let totalWeight = 0; for (let i of sheetData.items) { @@ -64,6 +65,7 @@ export class MothershipActorSheet extends ActorSheet { if (i.type === 'item') { gear.push(i); + curWeight+=item.weight; } else if (i.type === 'skill') { skills.push(i); } else if (i.type === 'armor') { @@ -73,6 +75,17 @@ export class MothershipActorSheet extends ActorSheet { } } + if(actorData.data.weight == undefined){ + actorData.data.weight = { + "current" : 0, + "capacity" : 0 + }; + } + + actorData.data.weight.capacity = Math.ceil((actorData.data.stats.strength.value/10) + 3); + actorData.data.weight.current = curWeight; + console.log("Current Weight: " + curWeight + " Capacity: " + actorData.data.weight.capacity); + // Assign and return actorData.gear = gear; actorData.skills = skills; diff --git a/module/actor/actor.js b/module/actor/actor.js index 7d9529a..ad7d814 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -323,10 +323,10 @@ export class MothershipActor extends Actor { if (!attribute.label && isNaN(attributeName)) attributeName = attribute.charAt(0)?.toUpperCase() + attribute.toLowerCase().slice(1); - console.log("Got here baybee"); - + let isStress = (attribute.label == "Stress" ? true : false); // Roll - let diceformular = "1d100"; + let diceformular = (isStress ? "2d10" : "1d100"); + console.log(attribute); @@ -371,11 +371,8 @@ export class MothershipActor extends Actor { let critical = false; - if (r._total == 0) + if (r._total == 0 && !isStress || rSplit[0] == rSplit[1] && !isStress) critical = true; - else if (rSplit[0] == rSplit[1]) { - critical = true; - } //Here's where we handle the result text. let resultText = ""; diff --git a/system.json b/system.json index 63a02d8..5743f3f 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "name": "mosh", "title": "MoSh - Unofficial Mothership", "description": "The unofficial Mothership system for FoundryVTT.", - "version": "0.1.2", + "version": "0.1.3", "minimumCoreVersion": "0.7.0", "compatibleCoreVersion": "0.7.7", "templateVersion": 2, diff --git a/template.json b/template.json index 6fb2cc0..0cdcdb8 100644 --- a/template.json +++ b/template.json @@ -24,10 +24,13 @@ ], "biography": "", "notes": "", + "weight" : { + "current" : 0, + "capacity" : 0 + }, "settings" : { "useCalm" : false }, - "class": { "value": "" }, @@ -168,7 +171,10 @@ "supplies": { "hull": { "value": 10, - "max": 10 + "max": 10, + "75" : 0, + "50" : 0, + "25" : 0 }, "fuel": { "value": 10, diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index b8fd33a..995607f 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -293,7 +293,6 @@ {{!-- Owned Items Tab --}}