From b2b6fe2e77ce02786ce6ec184edb223cb089dbf0 Mon Sep 17 00:00:00 2001 From: LilLiteralist <104447108+LilLiteralist@users.noreply.github.com> Date: Sat, 23 Sep 2023 14:35:40 +0300 Subject: [PATCH 1/3] Update StarWarsSagaEdition.css --- Star Wars Saga Edition/StarWarsSagaEdition.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Star Wars Saga Edition/StarWarsSagaEdition.css b/Star Wars Saga Edition/StarWarsSagaEdition.css index c986f725c49..e52632c2469 100644 --- a/Star Wars Saga Edition/StarWarsSagaEdition.css +++ b/Star Wars Saga Edition/StarWarsSagaEdition.css @@ -330,10 +330,10 @@ .sectAttack-show:checked ~ .sectAttack, .sect-show:not(:checked) ~ .sect, .SkillShow:not(:checked) + .SkillBody, -.other-mod-toggle:not(:checked) ~ .repcontainer .other-mod-off, -.other-mod-toggle:not(:checked) ~ .other-mod-off, -.other-mod-toggle:checked ~ .repcontainer .other-mod-on, -.other-mod-toggle:checked ~ .other-mod-on { +.other-mod-toggle:checked ~ .repcontainer .other-mod-off, +.other-mod-toggle:checked ~ .other-mod-off, +.other-mod-toggle:not(:checked) ~ .repcontainer .other-mod-on, +.other-mod-toggle:not(:checked) ~ .other-mod-on { display: none; } From 9e0740354a981934081067225abf5d765196ea45 Mon Sep 17 00:00:00 2001 From: LilLiteralist <104447108+LilLiteralist@users.noreply.github.com> Date: Sat, 23 Sep 2023 14:36:06 +0300 Subject: [PATCH 2/3] Update sheet.json --- Star Wars Saga Edition/sheet.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Star Wars Saga Edition/sheet.json b/Star Wars Saga Edition/sheet.json index 3e119059d46..fce0fa8405a 100644 --- a/Star Wars Saga Edition/sheet.json +++ b/Star Wars Saga Edition/sheet.json @@ -4,7 +4,7 @@ "authors": " Alicia G (original author), Stephen C (maintainer)", "roll20userid": "2889, 436906", "preview": "StarWarsSagaEditionpreview.png", - "instructions": "# Character Sheet\r Inspired by the Saga Edition sheet by Mad Irishman Productions. This sheet auto-calculates statistics using the rules as written. Most (but not all) supplement rules have been taken into account. If you feel that there is something incorrect or missing, please contact the authors. \r\r\r **Last Updated:** 19 September, 2023\r\r\r View the Wiki for the Change Log and more information on the sheet including complete list of attributes and rolls: https://wiki.roll20.net/Star_Wars_Saga_Edition_Character_Sheet", + "instructions": "# Character Sheet\r Inspired by the Saga Edition sheet by Mad Irishman Productions. This sheet auto-calculates statistics using the rules as written. Most (but not all) supplement rules have been taken into account. If you feel that there is something incorrect or missing, please contact the authors. \r\r\r **Last Updated:** 23 September, 2023\r\r\r View the Wiki for the Change Log and more information on the sheet including complete list of attributes and rolls: https://wiki.roll20.net/Star_Wars_Saga_Edition_Character_Sheet", "legacy": false, "printable": true } From 9763932feafb44e97b7f48a997f02eefece4a393 Mon Sep 17 00:00:00 2001 From: LilLiteralist <104447108+LilLiteralist@users.noreply.github.com> Date: Sat, 23 Sep 2023 14:37:15 +0300 Subject: [PATCH 3/3] Completed Other Modifiers toggles Adding options to quickly set NPC skills in Settings Every roll on the sheet which queries for Other Modifiers should now have an option to turn that off. --- .../StarWarsSagaEdition.html | 210 +++++++++++++----- 1 file changed, 157 insertions(+), 53 deletions(-) diff --git a/Star Wars Saga Edition/StarWarsSagaEdition.html b/Star Wars Saga Edition/StarWarsSagaEdition.html index 57660cea055..d8be2ffc044 100644 --- a/Star Wars Saga Edition/StarWarsSagaEdition.html +++ b/Star Wars Saga Edition/StarWarsSagaEdition.html @@ -18,13 +18,15 @@  Skill Focus as 1/2 level house rule
-  No "Other Modifiers" prompt for skills
-  No "Other Modifiers" prompt for attacks (nonfunctional)
+ +  "Other Modifiers" prompt on skill checks
+  "Other Modifiers" prompt on attack rolls
 Speed notes
 Damage Reduction
 Shield Rating
 Immunities
- + +
@@ -44,6 +46,11 @@
Choose individual skills          
+
+ + + +
 Acrobatics
 Athletics (house rule)
 Climb
@@ -79,8 +86,8 @@
Vehicles
-  No "Other Modifiers" prompt for attacks
-  No "Other Modifiers" prompt for skills
+  "Other Modifiers" prompt for attacks
+  "Other Modifiers" prompt for skills
 Constitution score (for Yuuzhan Vong vehicles)
 Grapple modifier increases beyond Colossal size
@@ -295,7 +302,9 @@
- + + +  Initiative as Decimal
@@ -2204,7 +2213,9 @@
- + + +  Initiative as Decimal @@ -4249,7 +4260,7 @@
For help, please see the wiki page.
-Last updated: 19 September 2023 +Last updated: 23 September 2023
@@ -5199,6 +5210,94 @@ }); }); }); +on("change:NoneNPCSkills",function() { + setAttrs({ + "show-Acrobatics":0, + "show-Athletics":0, + "show-Climb":0, + "show-Deception":0, + "show-Endurance":0, + "show-GatherInformation":0, + "show-Initiative":0, + "show-Jump":0, + "show-KnowledgeBureaucracy":0, + "show-KnowledgeGalacticLore":0, + "show-KnowledgeLifeSciences":0, + "show-KnowledgePhysicalSciences":0, + "show-KnowledgeSocialSciences":0, + "show-KnowledgeTactics":0, + "show-KnowledgeTechnology":0, + "show-Mechanics":0, + "show-Perception":0, + "show-Persuasion":0, + "show-Pilot":0, + "show-Ride":0, + "show-Stealth":0, + "show-Survival":0, + "show-Swim":0, + "show-TreatInjury":0, + "show-UseComputer":0, + "show-UsetheForce":0 + }); +}); +on("change:CrucialNPCSkills",function() { + setAttrs({ + "show-Acrobatics":1, + "show-Athletics":0, + "show-Climb":0, + "show-Deception":1, + "show-Endurance":0, + "show-GatherInformation":0, + "show-Initiative":1, + "show-Jump":0, + "show-KnowledgeBureaucracy":0, + "show-KnowledgeGalacticLore":0, + "show-KnowledgeLifeSciences":0, + "show-KnowledgePhysicalSciences":0, + "show-KnowledgeSocialSciences":0, + "show-KnowledgeTactics":0, + "show-KnowledgeTechnology":0, + "show-Mechanics":0, + "show-Perception":1, + "show-Persuasion":1, + "show-Pilot":0, + "show-Ride":0, + "show-Stealth":1, + "show-Survival":0, + "show-Swim":0, + "show-TreatInjury":0, + "show-UseComputer":0 + }); +}); +on("change:StandardNPCSkills",function() { + setAttrs({ + "show-Acrobatics":1, + "show-Athletics":0, + "show-Climb":1, + "show-Deception":1, + "show-Endurance":1, + "show-GatherInformation":1, + "show-Initiative":1, + "show-Jump":1, + "show-KnowledgeBureaucracy":1, + "show-KnowledgeGalacticLore":1, + "show-KnowledgeLifeSciences":1, + "show-KnowledgePhysicalSciences":1, + "show-KnowledgeSocialSciences":1, + "show-KnowledgeTactics":1, + "show-KnowledgeTechnology":1, + "show-Mechanics":1, + "show-Perception":1, + "show-Persuasion":1, + "show-Pilot":1, + "show-Ride":1, + "show-Stealth":1, + "show-Survival":1, + "show-Swim":1, + "show-TreatInjury":1, + "show-UseComputer":1 + }); +}); on("clicked:SecondWind", function() { getAttrs(["hp_max","hp", "Second_Wind", "Second_Wind_Count", "hidden_second_wind"], function(values) { // get the hp, hp_max, second wind stat, and coerce into a numerical values. @@ -5267,19 +5366,57 @@ setAttrs({"Status": status}); }); }); - -on('change:QueryAttackModifier', () => { - const section = 'attack'; - repeatingSectionIds(`repeating_${section}`, idarray => { - const fieldnames = idarray.reduce((rows,id) => [...rows, `repeating_${section}_${id}_vehicle-AttackModifierCheckbox`], ''); - getAttrs(['vehicle-AttackModifierCheckbox', ...fieldnames], v => { - const output = {}; - idarray.forEach(id => { - output[`repeating_${section}_${id}_vehicle-AttackModifierCheckbox`] = v['vehicle-AttackModifierPrompt']; - }); - setAttrs(output); - }); +on('change:QueryAttackModifier',()=>{ + getSectionIDs('repeating_attack',(idArray)=>{ + // create an array of all the repeating section attribute names we want to get the values of. + const getArr = idArray.map(id => `repeating_attack_${id}_WeaponAttack`); + getAttrs(['QueryAttackModifier',...getArr],(attributes) => { + // An object to store our changes in + const setObj = {}; + //Assuming that QueryAttackModifier is 1 when it should be the query and 0 when it should be just the 0[Other] + let replaceRx; + let replaceContent; + if(+attributes.QueryAttackModifier){ + replaceRx = /0\[other\]/gi; + replaceContent = '?{Other Modifiers (Attack)|0}[Other]' + }else{ + replaceRx = /\?\{Other Modifiers \(Attack\)\|0\}\[Other\]/gi; + replaceContent = '0[Other]'; + } + idArray.forEach(id => { + const attrName = `repeating_attack_${id}_WeaponAttack`; + setObj[attrName] = attributes[attrName].replace(replaceRx,replaceContent); + }); + // Apply our changes + setAttrs(setObj,{silent:true}); + }); + }); +}); +on('change:QuerySkillModifier change:repeating_npc-skill',()=>{ + getSectionIDs('repeating_npc-skill',(idArray)=>{ + // create an array of all the repeating section attribute names we want to get the values of. + const getArr = idArray.map(id => `repeating_npc-skill_${id}_Formula`); + getAttrs(['QuerySkillModifier',...getArr],(attributes) => { + // An object to store our changes in + const setObj = {}; + //Assuming that QuerySkillModifier is 1 when it should be the query and 0 when it should be just the 0[Other] + let replaceRx; + let replaceContent; + if(+attributes.QuerySkillModifier){ + replaceRx = /0\[other\]/gi; + replaceContent = '?{Other Modifiers|0}[Other]' + }else{ + replaceRx = /\?\{Other Modifiers\|0\}\[Other\]/gi; + replaceContent = '0[Other]'; + } + idArray.forEach(id => { + const attrName = `repeating_npc-skill_${id}_Formula`; + setObj[attrName] = attributes[attrName].replace(replaceRx,replaceContent); + }); + // Apply our changes + setAttrs(setObj,{silent:true}); }); + }); }); on("change:FocusHouseRule", function() { @@ -5591,7 +5728,6 @@ setAttrs({"inventory": summary}); }); }); - on("change:repeating_organization remove:repeating_organization", function() { console.log("Changing org score"); repeatingSum("OrganizationScore","organization","criteria_max"); @@ -5613,38 +5749,6 @@ setAttrs({"repeating_attack_vehicle-WeaponPosition":weaponposition}); }); }); -/* THIS SECTION IS NO LONGER NEEDED, BUT SOMETHING LIKE IT WILL BE NECESSARY FOR replace IN THE REPEATING ATTACKS -on("change:vehicle-AttackModifierPrompt", function(v) { - getAttrs(["vehicle-AttackModifierPrompt"], function(v) { - let VehicleAttackModPrompt = v["vehicle-AttackModifierPrompt"]; - console.log("Checkbox: " + VehicleAttackModPrompt); - getSectionIDs("repeating_attack", function(IDArray) { - var fieldNames = []; - var output = []; - for (var i=0; i < IDArray.length; i++) { - fieldNames.push("repeating_attack_" + IDArray[i] + "_vehicle-AttackModifierCheckbox"); - output.push("repeating_attack_" + IDArray[i] + "_vehicle-AttackModifierCheckbox" + ":" + VehicleAttackModPrompt); - } - console.log(output); - setAttrs({output}); - }); - }); -}); - -on('change:vehicle-AttackModifierPrompt', () => { - const section = 'attack'; - repeatingSectionIds(`repeating_${section}`, idarray => { - const fieldnames = idarray.reduce((rows,id) => [...rows, `repeating_${section}_${id}_vehicle-AttackModifierCheckbox`], ''); - getAttrs(['vehicle-AttackModifierCheckbox', ...fieldnames], v => { - const output = {}; - idarray.forEach(id => { - output[`repeating_${section}_${id}_vehicle-AttackModifierCheckbox`] = v['vehicle-AttackModifierPrompt']; - }); - setAttrs(output); - }); - }); -}); -*/ // ====== Functions ====== \\ var ArmorPerception = function() {