From 3cd71cdbbaf170e04521fe80063a79bfc90638f0 Mon Sep 17 00:00:00 2001 From: Chris Schmalz Date: Sun, 17 Sep 2023 14:26:06 -0700 Subject: [PATCH] Move stress and resolve out of Other --- module/actor/actor-sheet.js | 2 +- module/actor/actor.js | 17 ++++++++++------- system.json | 2 +- template.json | 29 ++++++++++++++++------------- templates/actor/actor-sheet.html | 20 ++++++++++---------- 5 files changed, 38 insertions(+), 32 deletions(-) diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index f18410b..d8fa483 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -356,7 +356,7 @@ export class MothershipActorSheet extends ActorSheet { // Rollable Item/Anything with a description that we want to click on. html.find('.calm-roll').click(ev => { - const attribute = this.actor.system.other.stress; + const attribute = this.actor.system.stress; attribute.label = "Calm"; this.actor.rollStress(attribute); }); diff --git a/module/actor/actor.js b/module/actor/actor.js index 43b197c..373ffc7 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -833,13 +833,8 @@ export class MothershipActor extends Actor { //exit function return; } - -//////////////////////////need to update choose XYZ functions to respect rollString if its passed - -//////////////////////////find a way to make the above 3 functions just return the needed information - -/////////////////////////////// need to get the relevant stats and prepare for rolling SET ROLLTARGET - + //retrieve the attribute (and its mod if available) + let rollTarget = this.actor.system.stats[attribute].value + this.actor.system.stats[attribute].mod; //roll the dice //parse the roll string let parsedRollString = this.parseRollString(rollString,aimFor); @@ -853,6 +848,14 @@ export class MothershipActor extends Actor { //I LEFT OFF HERE :)/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////need to update choose XYZ functions to respect rollString if its passed + +//////////////////////////find a way to make the above 3 functions just return the needed information + +/////////////////////////////// need to get the relevant stats and prepare for rolling SET ROLLTARGET + + + //push chat message //make message let macroMsg = await rollResult.toMessage({ diff --git a/system.json b/system.json index a6be5c7..ca761dc 100644 --- a/system.json +++ b/system.json @@ -70,7 +70,7 @@ "gridDistance": 1, "gridUnits": "meter", "primaryTokenAttribute": "health", - "secondaryTokenAttribute": "other.stress", + "secondaryTokenAttribute": "stress", "url": "https://github.com/Futil/foundry-mothership", "manifest": "https://raw.githubusercontent.com/Futil/foundry-mothership/dev/system.json", "download": "https://github.com/Futil/foundry-mothership/archive/dev.zip", diff --git a/template.json b/template.json index 449b571..2807033 100644 --- a/template.json +++ b/template.json @@ -10,11 +10,13 @@ "health": { "value": 10, "min": 0, - "max": 10 + "max": 10, + "label" : "Health" }, "hits": { "value" : 0, - "max" : 2 + "max" : 2, + "label" : "Wounds" } } }, @@ -22,6 +24,18 @@ "templates": [ "base" ], + "stress": { + "value": 2, + "min": 2, + "max": 20, + "label" : "Stress" + }, + "resolve": { + "value": 0, + "min": 0, + "max": 85, + "label" : "Resolve" + }, "biography": "", "notes": "", "weight" : { @@ -98,17 +112,6 @@ "damageReduction": 0, "label": "Armor" } - }, - "other": { - "stress": { - "value": 2, - "min": 2, - "max": 20, - "label" : "Stress" - }, - "resolve": { - "value": 0 - } } }, "creature": { diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index 3a6b4a0..8524bc8 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -112,14 +112,14 @@ {{#if system.settings.useCalm}}
- +
-
- +
Current
@@ -128,13 +128,13 @@ {{else}}
- +
-
- +
Current
Minimum
@@ -145,10 +145,10 @@ {{else}}
- +
-