+ {{/rollTotal() quickModShow 1}}
{{#rollTotal() useModTool 1}}
@@ -47136,8 +47212,6 @@ Characters with Skill: ${knowsSkill}`;
let infoDescription = values[`${sectionName}_info_description`] ?? "";
infoDescription = infoDescription.replace(/\n/g, '\\n');
- console.log(infoDescription);
-
let finalNotes = notes;
if (notes && infoDescription) {
@@ -47450,7 +47524,7 @@ Characters with Skill: ${knowsSkill}`;
rollDataArray.push(`{{bookReference=${bookReference}}}`);
}
- rollDataArray.push(`{{effectiveSkill=[[{${level} + @{modifier} + @{melee_roll_modifier}, ${meleeRollMaxNineValue} }kl1]]}}`);
+ rollDataArray.push(`{{effectiveSkill=[[{${level} + @{modifier} + @{melee_roll_modifier} + @{melee_quick_mod_total}, ${meleeRollMaxNineValue} }kl1]]}}`);
if (meleeRollMaxNine) {
rollDataArray.push(`{{maxNine=[[${meleeRollMaxNine}]]}}`);
@@ -49610,4 +49684,71 @@ Characters with Skill: ${knowsSkill}`;
}
+ on("change:repeating_melee-quick-modifier:apply", event => {
+
+ updateMeleeQuickModifiers();
+
+ });
+
+ const updateMeleeQuickModifiers = () => {
+
+ getSectionIDs("repeating_melee-quick-modifier", ids => {
+
+ let fields = [];
+
+ ids.forEach(id => {
+
+ let applyField = `repeating_melee-quick-modifier_${id}_apply`;
+
+ let nameField = `repeating_melee-quick-modifier_${id}_name`;
+
+ let modifierField = `repeating_melee-quick-modifier_${id}_modifier`;
+
+ fields.push(applyField, nameField, modifierField);
+
+ });
+
+ getAttrs(fields, values => {
+
+ let totalMod = 0;
+
+ let summaryArray = [];
+
+ let showInRoll = 0;
+
+ ids.forEach(id => {
+
+ let apply = values[`repeating_melee-quick-modifier_${id}_apply`] == "1";
+
+ if (apply) {
+
+ showInRoll = 1;
+
+ let name = values[`repeating_melee-quick-modifier_${id}_name`] ?? "";
+
+ let modifier = Number(values[`repeating_melee-quick-modifier_${id}_modifier`]) ?? 0;
+
+ totalMod += modifier;
+
+ summaryArray.push(`${name} (${modifier})`);
+
+ }
+
+ });
+
+ let summary = summaryArray.join(", ");
+
+ let keyValues = {
+ melee_quick_mod_show_in_roll: showInRoll,
+ melee_quick_mod_total: totalMod,
+ melee_quick_mod_summary: summary
+ };
+
+ setAttrs(keyValues);
+
+ });
+
+ });
+ }
+
diff --git a/GURPS/translation.json b/GURPS/translation.json
index 7db07c6a7a..b892acd6d3 100644
--- a/GURPS/translation.json
+++ b/GURPS/translation.json
@@ -1892,5 +1892,8 @@
"layer-three-label": "Layer Three Label",
"layer-four-label": "Layer Four Label",
"quick-modifiers-label": "Quick Modifiers",
- "quick-modifiers-tooltip": "Use the table below to create a set of custom modifiers that can be applied to your next your roll. If the modifier is checked, it will automatically be applied to the roll, but you must remember to uncheck the quick modifier if you don't want to use it.
Note, this is a separate set of modifiers from the ones you can add to the skill."
+ "quick-modifiers-tooltip": "Use the table below to create a set of custom modifiers that can be applied to your next your roll. If the modifier is checked, it will automatically be applied to the roll, but you must remember to uncheck the quick modifier if you don't want to use it.
Note, this is a separate set of modifiers from the ones you can add to the skill.",
+ "quick-mod-description-tooltip": "Enter a description for the quick modifier.",
+ "quick-mod-tooltip": "Enter the modifier value."
+
}
\ No newline at end of file