Stress Roll Fixes + Capacity Calculation - 0.1.3

This commit is contained in:
Martin Jencka
2020-11-28 09:48:35 -07:00
parent e30cd95751
commit ecb94e9e34
5 changed files with 33 additions and 12 deletions
+13
View File
@@ -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;
+4 -7
View File
@@ -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 = "";
+1 -1
View File
@@ -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,
+8 -2
View File
@@ -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,
+7 -2
View File
@@ -293,7 +293,6 @@
</div>
{{!-- Owned Items Tab --}}
<div class="tab items" data-group="primary" data-tab="items">
<!-- ARMOR -->
<ol class="items-list">
<li class="item flexrow item-header">
@@ -366,8 +365,14 @@
</li>
{{/each}}
{{/if}}
</ol>
{{#unless data.settings.hideWeight}}
<div class="item flex-group-left item-header">
<div class="skill-stat" style="flex-grow: 1.5;">Carrying Capacity: {{data.weight.capacity}}</div>
<div class="skill-stat">Current Weight: {{data.weight.current}}</div>
</div>
{{/unless}}
</div>
{{!-- Owned Skills Tab --}}
<div class="tab items" data-group="primary" data-tab="skills">