sheet updates to support new settings

This commit is contained in:
Chris Schmalz
2023-09-25 15:17:06 -07:00
parent ace2a70956
commit 7bb901a6f2
6 changed files with 66 additions and 14 deletions
+49 -7
View File
@@ -41,6 +41,7 @@ export class MothershipActorSheet extends ActorSheet {
data.data.system.settings.useCalm = game.settings.get("mosh", "useCalm");
data.data.system.settings.hideWeight = game.settings.get("mosh", "hideWeight");
data.data.system.settings.firstEdition = game.settings.get("mosh", "firstEdition");
data.data.system.settings.androidPanic = game.settings.get("mosh", "androidPanic");
//SKILL XP BUTTONS
@@ -356,17 +357,58 @@ export class MothershipActorSheet extends ActorSheet {
this.actor.reloadWeapon(li.dataset.itemId);
});
// Rollable Item/Anything with a description that we want to click on.
// Calm - Panic Check
html.find('.calm-roll').click(ev => {
const attribute = this.actor.system.other.stress;
attribute.label = "Calm";
this.actor.rollStress(attribute);
//check if 1e
if (game.settings.get("mosh", "firstEdition")) {
//check if android + android panic enabled
if (game.settings.get("mosh", "androidPanic") && this.actor.system.class.value.toLowerCase() === 'android') {
//call rollTable for: 1e Android Panic Check Using Calm
this.actor.rollTable(`GCtYeCCQVQJ5M6SE`,null,`high`,false,false,'system.other.calm.value','>');
//this is not android + android panic enabled
} else {
//call rollTable for: 1e Regular Panic Check Using Calm
this.actor.rollTable(`MOYI6Ntj5OVFYk06`,null,`high`,false,false,'system.other.calm.value','>');
}
//this is 0e
} else {
//check if android + android panic enabled
if (game.settings.get("mosh", "androidPanic") && this.actor.system.class.value.toLowerCase() === 'android') {
//call rollTable for: 0e Android Panic Check Using Calm
this.actor.rollTable(`VW6HQ29T7zClNIZ6`,null,`high`,false,false,'system.other.calm.value','>');
//this is not android + android panic enabled
} else {
//call rollTable for: 0e Regular Panic Check Using Calm
this.actor.rollTable(`kqKpQAXyLTEEyz6Z`,null,`high`,false,false,'system.other.calm.value','>');
}
}
});
// Rollable Item/Anything with a description that we want to click on.
// Stress - Panic Check
html.find('.stress-roll').click(ev => {
//call rollTable for panic check
this.actor.rollTable(`ypcoikqHLhnc9tNs`,null,`high`,false,false,'system.other.stress.value','>');
//check if 1e
if (game.settings.get("mosh", "firstEdition")) {
//check if android + android panic enabled
if (game.settings.get("mosh", "androidPanic") && this.actor.system.class.value.toLowerCase() === 'android') {
//call rollTable for: 1e Android Panic Check Using Stress
this.actor.rollTable(`aBnY19jlhPXzibCt`,null,`high`,false,false,'system.other.stress.value','>');
//this is not android + android panic enabled
} else {
//call rollTable for: 1e Regular Panic Check Using Stress
this.actor.rollTable(`ypcoikqHLhnc9tNs`,null,`high`,false,false,'system.other.stress.value','>');
}
//this is 0e
} else {
//check if android + android panic enabled
if (game.settings.get("mosh", "androidPanic") && this.actor.system.class.value.toLowerCase() === 'android') {
//call rollTable for: 0e Android Panic Check Using Stress-0e
this.actor.rollTable(`egJ11m2mJM3HBd6d`,null,`high`,false,false,'system.other.stress_0e.value','>');
//this is not android + android panic enabled
} else {
//call rollTable for: 0e Regular Panic Check Using Stress-0e
this.actor.rollTable(`1vCm4ElRPotQXgNB`,null,`high`,false,false,'system.other.stress_0e.value','>');
}
}
});
// Drag events for macros.
+5 -4
View File
@@ -72,10 +72,11 @@ export class MothershipCreatureSheet extends ActorSheet {
if (data.data.system.settings == null) {
data.data.system.settings = {};
}
data.data.system.settings.useCalm = game.settings.get("mosh", "useCalm");
data.data.system.settings.hideWeight = game.settings.get("mosh", "hideWeight");
data.data.system.settings.firstEdition = game.settings.get("mosh", "firstEdition");
}
data.data.system.settings.useCalm = game.settings.get("mosh", "useCalm");
data.data.system.settings.hideWeight = game.settings.get("mosh", "hideWeight");
data.data.system.settings.firstEdition = game.settings.get("mosh", "firstEdition");
data.data.system.settings.androidPanic = game.settings.get("mosh", "androidPanic");
return data.data;
}
+1
View File
@@ -41,6 +41,7 @@ export class MothershipShipSheet extends ActorSheet {
superData.settings.useCalm = game.settings.get("mosh", "useCalm");
superData.settings.hideWeight = game.settings.get("mosh", "hideWeight");
superData.settings.firstEdition = game.settings.get("mosh", "firstEdition");
superData.settings.androidPanic = game.settings.get("mosh", "androidPanic");
let maxHull = superData.supplies.hull.max;
+8
View File
@@ -39,6 +39,14 @@ export class MothershipItemSheet extends ItemSheet {
}
}
if (data.data.system.settings == null) {
data.data.system.settings = {};
}
data.data.system.settings.useCalm = game.settings.get("mosh", "useCalm");
data.data.system.settings.hideWeight = game.settings.get("mosh", "hideWeight");
data.data.system.settings.firstEdition = game.settings.get("mosh", "firstEdition");
data.data.system.settings.androidPanic = game.settings.get("mosh", "androidPanic");
return data.data;
}
+2 -2
View File
@@ -134,8 +134,8 @@
"label" : "Stress"
},
"stress_0e": {
"value": 0,
"min": 0,
"value": 2,
"min": 2,
"max": 999,
"label" : "Stress"
},
+1 -1
View File
@@ -333,7 +333,7 @@
<div class="grid grid-3col" style="grid-template-columns: 44px 14px 42px; margin-left:6px;">
<input class="square-input" type="text" name="system.stats.armor.value" value="{{system.stats.armor.value}}" data-dtype="Number" />
<div class="mainstatmod-title" style="top: 10px;">+</div>
<div class="mainsavemod-input" style="top: 5px;"type="text" name="system.stats.armor.mod" value="{{system.stats.armor.mod}}" ></div>
<div class="mainsavemod-input" style="top: 5px;" type="text" name="system.stats.armor.mod" value="{{system.stats.armor.mod}}" data-dtype="Number">{{system.stats.armor.mod}}</div>
</div>
</div>
{{/unless}}