GCA Import, added more rules to capture frequency of appearance and self-control rolls for advantages/disadvantages.
+
Bug fix for Roll Options. If you selected Private Roll, the next time the sheet opens, it changed the option to Custom Roll. Reported by PL M.
+
Chat Box, update display of Armor Divisor when rolling damage to use the same style as skill. Reported by Jared.
+
GCA Import bug. Added some error checking to try to capture null data values for an advantage. Reported by Bob G.
+
Combat Location Tab. Added character and campaign settings options to update Current Hit Points when location damage is changed.
@@ -13195,6 +13195,16 @@ visualize what it will look like in chat.
Pull Request:
+
+
Bug fix for Roll Options. If you selected Private Roll, the next time the sheet opens, it changed the option to Custom Roll. Reported by PL M.
+
Chat Box, update display of Armor Divisor when rolling damage to use the same style as skill. Reported by Jared.
+
GCA Import bug. Added some error checking to try to capture null data values for an advantage. Reported by Bob G.
+
Combat Location Tab. Added character and campaign settings options to update Current Hit Points when location damage is changed.
+
+
+
Version: 2.6.3
+
+
Pull Request: 2/15/2021
Added optional Header Buttons for selecting the modifier types for for skill rolls. Option can be selected on the sheet and campaign options.
GCA Import, modifier notes. Updated import to handle cases modifiers of modifiers for a advantage/disadvantage. Reported by Valter
@@ -13870,7 +13880,7 @@ visualize what it will look like in chat.
-
Show RAW Notes
+
Active Defenses
@@ -13885,6 +13895,24 @@ visualize what it will look like in chat.
+
+
+
+
Damage Table
+
+
+
+
+ Update Hit Points
+
+
+
+ If checked, when applying damage to a location, current Hit Points is updated.
+
+
+
+
+
@@ -15459,7 +15487,7 @@ visualize what it will look like in chat.
Armor Divisor:
-
{{armorDivisor}}
+
{{armorDivisor}}
{{/rollGreater() armorDivisor 1}}
@@ -15685,9 +15713,9 @@ visualize what it will look like in chat.
var noop = function () {}; // do nothing callback function.
- var version = "2.6.3";
+ var version = "2.6.4";
- var latestChangesDate = "2/15/2021";
+ var latestChangesDate = "2/22/2021";
var modCascade = true;
@@ -20049,7 +20077,7 @@ visualize what it will look like in chat.
// check for dice modifier
// 3d6+1; diceType = 6+1; diceType=6; diceModifier=1;
- if (diceType.includes("+")) {
+ if (diceType && diceType.includes("+")) {
arrDiceTypeModifier = diceType.split("+");
@@ -20057,7 +20085,7 @@ visualize what it will look like in chat.
diceModifier = parseInt(arrDiceTypeModifier[1]);
- } else if (diceType.includes("-")) {
+ } else if (diceType && diceType.includes("-")) {
arrDiceTypeModifier = diceType.split("-");
@@ -21302,7 +21330,7 @@ visualize what it will look like in chat.
var move = 0;
- if ( moveValue.toString().includes("/") ) {
+ if ( moveValue && moveValue.toString().includes("/") ) {
// split the value
// move = 8/16
@@ -21345,7 +21373,7 @@ visualize what it will look like in chat.
var arrMoveValue;
- if ( moveValue.toString().includes("/") ) {
+ if ( moveValue && moveValue.toString().includes("/") ) {
// split the value
// move = 8/16
@@ -26447,6 +26475,65 @@ The attacker may choose to hit the original target or the limb you used to parry
});
}
+ // check if damage table hit points were modified
+ on (`change:repeating_hitlocation:damage`, event => {
+
+ let previousValue = Number.isNaN(event.previousValue) ? 0 : Number(event.previousValue);
+
+ let newValue = Number.isNaN(event.newValue) ? 0 : Number(event.newValue);
+
+ updateCurrentHitPointsByDamageTable(previousValue, newValue);
+
+ });
+
+
+ /**
+ * If option to update Hit Points when changing damage table location damage
+ * is on, then update the current Hit Points.
+ *
+ * @param int previousValue Value before damage was applied
+ * @param int newValue Value after damage was applied
+ */
+ function updateCurrentHitPointsByDamageTable(previousValue, newValue) {
+
+ let arrValues = [
+ "damage_update_hit_points",
+ "hit_points"
+ ];
+
+ getAttrs(arrValues, values => {
+
+ let diff = 0;
+
+ let updateHitPoints = values.damage_update_hit_points === "1";
+
+ // if previous and newvalue are the same, use 0 for previous value
+ if (previousValue === newValue) {
+
+ // special case, use previous = 0 and just use the newValue
+ diff = 0 - newValue;
+
+ } else {
+
+ // normal process
+ diff = previousValue - newValue;
+
+ }
+
+ if (updateHitPoints) {
+
+ let hitPoints = Number(values.hit_points);
+
+ let newHitPoints = hitPoints - diff;
+
+ setAttrs({hit_points: newHitPoints});
+
+ }
+
+ });
+
+ }
+
on("change:selected_token", event => {
setSelectedMacro();
@@ -28406,14 +28493,14 @@ The attacker may choose to hit the original target or the limb you used to parry
let defenseInfo = "";
// check for unbalanced parry
- if (parryScore.includes("U")) {
+ if (parryScore && parryScore.includes("U")) {
defenseInfo = "U";
// just need number
skill = Number(parryScore.replace("U", ""));
- } else if (parryScore.includes("F")) {
+ } else if (parryScore && parryScore.includes("F")) {
defenseInfo = "F";
@@ -28455,7 +28542,7 @@ The attacker may choose to hit the original target or the limb you used to parry
return dieRoll;
}
- if (damageDie.includes("~")) {
+ if (damageDie && damageDie.includes("~")) {
// example: ~1d+1
// remove ~
@@ -28849,7 +28936,7 @@ The attacker may choose to hit the original target or the limb you used to parry
getGcaValuesForRepeatingLanguage(uniqueKeys, rows, name, basedon, advantage);
- } else if (basedon.includes("Cultural Familiarity")) {
+ } else if (basedon && basedon.includes("Cultural Familiarity")) {
getGcaValuesForCulturalFamiliarity(uniqueKeys, rows, name, advantage);
@@ -29028,13 +29115,13 @@ The attacker may choose to hit the original target or the limb you used to parry
let spokenLevel = -3;
- if (basedon.includes("spoken")) {
+ if (basedon && basedbasedon.includes("spoken")) {
spokenLevel = getLanguageValueFromGca(advantage.level);
writtenLevel = -3;
- } else if (basedon.includes("written")) {
+ } else if (basedon && basedon.includes("written")) {
spokenLevel = -3;
@@ -29122,7 +29209,7 @@ The attacker may choose to hit the original target or the limb you used to parry
*/
function getGcaValuesForRepeatingLanguage(uniqueKeys, rows, name, basedon, advantage) {
- basedon = basedon.toLowerCase();
+ basedon = basedon ? basedon.toLowerCase() : "";
let idkey = advantage.IDKey.trim();
@@ -29682,19 +29769,19 @@ The attacker may choose to hit the original target or the limb you used to parry
let rating = 0;
- if (levelName.includes("6 or less")) {
+ if (levelName && levelName.includes("6 or less")) {
rating = 6;
- } else if (levelName.includes("9 or less")) {
+ } else if (levelName && levelName.includes("9 or less")) {
rating = 9;
- } else if (levelName.includes("12 or less")) {
+ } else if (levelName && levelName.includes("12 or less")) {
rating = 12;
- } else if (levelName.includes("15 or less")) {
+ } else if (levelName && levelName.includes("15 or less")) {
rating = 15;
@@ -29738,19 +29825,19 @@ The attacker may choose to hit the original target or the limb you used to parry
}
- if (shortName.includes("6 or less")) {
+ if (shortName && shortName.includes("6 or less")) {
rating = 6;
- } else if (shortName.includes("9 or less")) {
+ } else if (shortName && shortName.includes("9 or less")) {
rating = 9;
- } else if (shortName.includes("12 or less")) {
+ } else if (shortName && shortName.includes("12 or less")) {
rating = 12;
- } else if (shortName.includes("15 or less")) {
+ } else if (shortName && shortName.includes("15 or less")) {
rating = 15;
@@ -29853,7 +29940,7 @@ The attacker may choose to hit the original target or the limb you used to parry
let name = skill.name;
- if (!skill.type.includes("Tech")) {
+ if (skill.type && !skill.type.includes("Tech")) {
getGcaValuesForSkill(uniqueKeys, rows, name, skill, importNotes);
@@ -30105,7 +30192,7 @@ The attacker may choose to hit the original target or the limb you used to parry
let name = skill.name;
- if (skill.type.includes("Tech")) {
+ if (skill.type && skill.type.includes("Tech")) {
getGcaValuesForTechniques(uniqueKeys, rows, name, skill, skills, importNotes);
@@ -30212,13 +30299,13 @@ The attacker may choose to hit the original target or the limb you used to parry
let defaultValue = 0;
- if (techDefault.includes(" - ")) {
+ if (techDefault && techDefault.includes(" - ")) {
arrDefault = techDefault.split(" - ");
defaultValue = -1 * Number(arrDefault[1]);
- } else if (techDefault.includes(" + ")) {
+ } else if (techDefault && techDefault.includes(" + ")) {
arrDefault = techDefault.split(" + ");
@@ -30249,13 +30336,13 @@ The attacker may choose to hit the original target or the limb you used to parry
let maxValue = 0;
- if (upto.includes(" - ")) {
+ if (upto && upto.includes(" - ")) {
arrUpto = upto.split(" - ");
maxValue = -1 * Number(arrUpto[1]);
- } else if (upto.includes(" + ")) {
+ } else if (upto && upto.includes(" + ")) {
arrUpto = upto.split(" + ");
@@ -30666,7 +30753,7 @@ The attacker may choose to hit the original target or the limb you used to parry
let resistedby = "";
// example: "class": "Regular/R-HT",
- if (spell.class.includes("/R-")) {
+ if (spell.class && spell.class.includes("/R-")) {
let arrClass = spell.class.split("/R-");
@@ -30783,17 +30870,19 @@ The attacker may choose to hit the original target or the limb you used to parry
getAttrs(["roll"], values => {
- let rollValue = values.roll;
+ let rollValue = values.roll ?? "";
let rollOption;
+ console.log("rollValue", rollValue);
+
rollValue = rollValue.trim();
if (rollValue === "") {
rollOption = "public";
- } else if (rollValue === "/w gm --l ") {
+ } else if (rollValue === "/w gm --l") {
rollOption = "deprecated";
- } else if (rollValue === "/w gm ") {
+ } else if (rollValue === "/w gm") {
rollOption = "private";
} else {
rollOption = "custom";
diff --git a/GURPS/sheet.json b/GURPS/sheet.json
index 499cacc87d..27bccd0af7 100644
--- a/GURPS/sheet.json
+++ b/GURPS/sheet.json
@@ -12,7 +12,7 @@
"displayname": "Display Roll Modifier Options in Header",
"displaytranslationkey": "display-modifier-in-header-label",
"type": "checkbox",
- "value": "0",
+ "value": "1",
"description": "If checked, the options for No Modifier Prompt, Single Modifier Prompt and Extended Modifier Prompts will be displayed to the right of the character name above the tabs.",
"descriptiontranslationkey": "display-modifier-in-header-tooltip"
},
@@ -55,13 +55,13 @@
"descriptiontranslationkey": "sheet-roll-modifier-option-desc"
},
{
- "attribute": "roll",
+ "attribute": "roll_",
"displayname": "Chat Roll Types",
"displaytranslationkey": "sheet-chat-roll-types-display-option",
"type": "select",
"options": [
- "Public Rolls|public",
- "Private Skill|private",
+ "Public Rolls| ",
+ "Private Skill|/w gm",
"Custom Rolls|custom"
],
"optiontranslationkeys": [
@@ -107,25 +107,6 @@
"description": "Enter a macro to run when a skill button is clicked.",
"descriptiontranslationkey": "roll-option-macro-desc"
},
- {
- "attribute": "roll",
- "displayname": "Chat Roll Display [Depracated]",
- "displaytranslationkey": "sheet-chat-roll-display-option",
- "type": "select",
- "options": [
- "Public Rolls|",
- "Private Skill Levels deprecated|/w gm --l ",
- "Private Rolls|/w gm "
- ],
- "optiontranslationkeys": [
- "sheet-public-rolls",
- "sheet-private-skill-levels",
- "sheet-private-rolls"
- ],
- "default": "",
- "description": "Select how rolls are display in chat window. Private Skill Levels deprecated will default to private, since it doesn't work with rolltemplates.",
- "descriptiontranslationkey": "sheet-chat-roll-dislpay-option-desc"
- },
{
"attribute": "speed_tracker",
"displayname": "Basic Speed Button Option",
@@ -250,6 +231,15 @@
"description": "Enter notes for Special damage type.",
"descriptiontranslationkey": "sheet-damage-type-note-spec-desc"
},
+ {
+ "attribute": "damage_update_hit_points",
+ "displayname": "Update Hit Points",
+ "displaytranslationkey": "update-hit-points-label",
+ "type": "checkbox",
+ "value": "1",
+ "description": "If checked, when applying damage to a location, current Hit Points is updated.",
+ "descriptiontranslationkey": "update-hit-points-tooltip"
+ },
{
"attribute": "penalty_per_spell_on",
"displayname": "Penalty for each spell ON",
diff --git a/GURPS/translation.json b/GURPS/translation.json
index e5892d215c..8b784eea16 100644
--- a/GURPS/translation.json
+++ b/GURPS/translation.json
@@ -734,6 +734,9 @@
"user-created-label": "User Created",
"active-defenses-label": "Active Defenses",
"activate-custom-roll-modifier-tooltip": "You can turn on the custom modifiers by going to Sheet Options Tab then to Skill Modifier Tools and checking the tools to use.",
+ "damage-table-label": "Damage Table",
+ "update-hit-points-label": "Update Hit Points",
+ "update-hit-points-tooltip": "If checked, when applying damage to a location, current Hit Points is updated.",
"type-label": "Type",
"active-defense-type-tooltip": "Changing the Type will also update success/fail notes for that active defense. Parry, Block, and Block have default notes that can be changed on the options page. NOTE Changing the Type will clear any previous notes you entered.",
"abbreviation-information-label": "Info",