From 9b83593faa9ce2e01fd27fbadd5a0d6170fd2598 Mon Sep 17 00:00:00 2001 From: BuildAndDie Date: Thu, 8 Dec 2016 09:01:32 -0600 Subject: [PATCH 1/2] Open Legend: Presence rare error with HP calc Fixed an error where if fortitude hadn't been adjusted yet, presence would add 20 at a time instead of 2 to HP. --- Open Legend Basic by Great Moustache/Open Legend.html | 5 ++++- Open Legend Basic by Great Moustache/ReadMe.md | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Open Legend Basic by Great Moustache/Open Legend.html b/Open Legend Basic by Great Moustache/Open Legend.html index 54452ed42e..e7feb27788 100644 --- a/Open Legend Basic by Great Moustache/Open Legend.html +++ b/Open Legend Basic by Great Moustache/Open Legend.html @@ -452,7 +452,7 @@ repeating_items if(values.fortitude_score*1 > values.fortitude_substitution*1) { score = values.fortitude_score*1; } else { - score = values.fortitude_substitution; + score = values.fortitude_substitution*1; } setAttrs({ "hit_point_max": 2*(score + values.presence_score*1 + values.will_score*1) + 10 - values.lethal_damage*1 + values.hit_point_feats*1 + values.hit_point_other*1 @@ -2032,6 +2032,9 @@ var TAS = TAS || (function(){
+
+
2016.12.07 :: Version 1.6.7 y
+
diff --git a/Open Legend Basic by Great Moustache/ReadMe.md b/Open Legend Basic by Great Moustache/ReadMe.md index 437f82c4a1..227210504f 100644 --- a/Open Legend Basic by Great Moustache/ReadMe.md +++ b/Open Legend Basic by Great Moustache/ReadMe.md @@ -5,6 +5,12 @@ ### Changelog +### 1.6.7 on 2016 December 7th +* Fixed a strange error where Presence would add 20 at a time to HP + - Caused by fortitude substitution not be forced into an integer type +* Added an indicator at top left of sheet to display current version of the sheet + - More functionality later with the gear to add changing of default values for the sheet + ### 1.6.5 on 2016 December 1st * Fixed Actions to recalculate the roll string when any attribute is changed - Prior, you had to make a change to the action for the roll string to update if an attribute had been changed. From 61770ec47807e73fbb41490bb0404fb6c21fe677 Mon Sep 17 00:00:00 2001 From: BuildAndDie Date: Sun, 11 Dec 2016 13:11:11 -0600 Subject: [PATCH 2/2] Attribute Substitution updating issue * Fixed Attribute Substitution not updating if the Primary Attribute is changed - Modified On Change to be function, and calling from calcAgility function as well --- .../Open Legend.css | 63 ++++++ .../Open Legend.html | 211 +++++++++++------- .../ReadMe.md | 4 +- 3 files changed, 194 insertions(+), 84 deletions(-) diff --git a/Open Legend Basic by Great Moustache/Open Legend.css b/Open Legend Basic by Great Moustache/Open Legend.css index 151cb1466f..8022af57b7 100644 --- a/Open Legend Basic by Great Moustache/Open Legend.css +++ b/Open Legend Basic by Great Moustache/Open Legend.css @@ -515,6 +515,69 @@ input.sheet-checks25 { display: inline; margin-left: -2px; margin-right: -2px; +} + /*** Slider Checkbox ***/ +input.sheet-checkboxSliderInvis { + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 2; + position: absolute; + width: 100%; + height: 100%; + opacity: 0; + cursor: pointer; +} +.sheet-checkboxSlider { + width: 60px; + height: 20px; + background: #333; + margin-left: auto; + margin-right: auto; + margin-top: 5px; + margin-bottom: 5px; + border-radius: 25px; + position: relative; +} + /*** On position ***/ +.sheet-checkboxSlider:before { + content: 'On'; + position: absolute; + top: 1px; + left: 6px; + height: 2px; + color: #26ca28; + font-size: 14px; +} + /*** Off position ***/ +.sheet-checkboxSlider:after { + content: 'Off'; + position: absolute; + top: 1px; + left: 32px; + height: 1px; + color: #ddd; + font-size: 14px; +} + /*** Clickable 'Pill' ***/ +.sheet-checkboxSlider label { + display: block; + width: 15px; + height: 10px; + border-radius: 25px; + transition: all .5s ease; + cursor: pointer; + position: absolute; + z-index: 1; + top: 5px; + left: 6px; + background: #ddd; +} + /*** Checkbox Checked ***/ +.sheet-checkboxSlider input[type=checkbox]:checked + label { + left: 30px; + background: #26ca28; } /* Settings button as gear (uses letter 'y' in pictos font) as a checkbox to be used with javascript */ .sheet-settings { diff --git a/Open Legend Basic by Great Moustache/Open Legend.html b/Open Legend Basic by Great Moustache/Open Legend.html index e7feb27788..9ddbcb12f1 100644 --- a/Open Legend Basic by Great Moustache/Open Legend.html +++ b/Open Legend Basic by Great Moustache/Open Legend.html @@ -71,6 +71,9 @@ repeating_actions attr_action_target attr_action_special attr_action_settings + attr_power_target + attr_use_power_level + attr_power_level attr_feat_total_points attr_feat_points_spent repeating_featsLeft attr_feat_left_name attr_feat_left_show_name attr_feat_left_cost @@ -129,6 +132,7 @@ repeating_items calcMovement(); calcPrescience(); calcProtection(); + calcAllActionRolls(); }); // Function to determine dice number :: takes in the attribute score :: outputs the dice number @@ -167,7 +171,11 @@ repeating_items // Anytime Agility Substitution is selected on("change:agility_substitution_select", function() { - getAttrs(["agility_substitution_select", "learning_score", "logic_score", "perception_score", "will_score", "deception_score", "persuasion_score", "alteration_score", "creation_score", "energy_score", "entropy_score", "influence_score", "movement_score", "prescience_score", "protection_score"], function(values) { + calcAgilitySub(); + }); + // Function for Agility Substitution is selected + function calcAgilitySub() { + getAttrs(["agility_substitution_select", "learning_score", "logic_score", "perception_score", "will_score", "deception_score", "persuasion_score", "presence_score", "alteration_score", "creation_score", "energy_score", "entropy_score", "influence_score", "movement_score", "prescience_score", "protection_score"], function(values) { var score = 0; if(values.agility_substitution_select === "Learning") { score = values.learning_score*1; @@ -204,11 +212,15 @@ repeating_items "agility_substitution": score }); }); - }); + }; // Anytime Fortitude Substitution is selected on("change:fortitude_substitution_select", function() { - getAttrs(["fortitude_substitution_select", "learning_score", "logic_score", "perception_score", "will_score", "deception_score", "persuasion_score", "alteration_score", "creation_score", "energy_score", "entropy_score", "influence_score", "movement_score", "prescience_score", "protection_score"], function(values) { + calcFortitudeSub(); + }); + // Anytime Fortitude Substitution is selected + function calcFortitudeSub() { + getAttrs(["fortitude_substitution_select", "learning_score", "logic_score", "perception_score", "will_score", "deception_score", "persuasion_score", "presence_score", "alteration_score", "creation_score", "energy_score", "entropy_score", "influence_score", "movement_score", "prescience_score", "protection_score"], function(values) { var score = 0; if(values.fortitude_substitution_select === "Learning") { score = values.learning_score*1; @@ -245,11 +257,15 @@ repeating_items "fortitude_substitution": score }); }); - }); + }; // Anytime Might Substitution is selected on("change:might_substitution_select", function() { - getAttrs(["might_substitution_select", "learning_score", "logic_score", "perception_score", "will_score", "deception_score", "persuasion_score", "alteration_score", "creation_score", "energy_score", "entropy_score", "influence_score", "movement_score", "prescience_score", "protection_score"], function(values) { + calcMightSub(); + }); + // Anytime Might Substitution is selected + function calcMightSub() { + getAttrs(["might_substitution_select", "learning_score", "logic_score", "perception_score", "will_score", "deception_score", "persuasion_score", "presence_score", "alteration_score", "creation_score", "energy_score", "entropy_score", "influence_score", "movement_score", "prescience_score", "protection_score"], function(values) { var score = 0; if(values.might_substitution_select === "Learning") { score = values.learning_score*1; @@ -286,13 +302,13 @@ repeating_items "might_substitution": score }); }); - }); + }; // Function to calculate Evasion, called when changes made to Armor, Shield, Agility, or evasion other function calcEvasion() { getAttrs(["agility_score", "agility_substitution", "armor", "shield", "evasion_other"], function(values) { var score = 0; - if (values.agility_score*1 > values.agility_substitution*1) { + if (values.agility_score*1 >= values.agility_substitution*1) { score = values.agility_score*1; } else { score = values.agility_substitution*1; @@ -307,7 +323,7 @@ repeating_items function calcToughness() { getAttrs(["fortitude_score", "fortitude_substitution", "will_score", "toughness_other"], function(values) { var score = 0; - if (values.fortitude_score*1 > values.fortitude_substitution*1) { + if (values.fortitude_score*1 >= values.fortitude_substitution*1) { score = values.fortitude_score*1; } else { score = values.fortitude_substitution*1; @@ -449,7 +465,7 @@ repeating_items function calcHitPoints() { getAttrs(["fortitude_score", "fortitude_substitution", "presence_score", "will_score", "lethal_damage", "hit_point_feats", "hit_point_other"], function(values) { var score = 0; - if(values.fortitude_score*1 > values.fortitude_substitution*1) { + if(values.fortitude_score*1 >= values.fortitude_substitution*1) { score = values.fortitude_score*1; } else { score = values.fortitude_substitution*1; @@ -478,13 +494,14 @@ repeating_items // Anytime Agility score is changed, update cost and dice on("change:agility_score change:agility_dice_d20 change:agility_cost_modifier change:agility_dice_modifier", function() { - calcAgility(); + calcAgility(); calcEvasion(); // call to recalculate evasion score calcAllActionRolls(); }); // Function for calculating everything to do with Agility function calcAgility() { + calcAgilitySub(); getAttrs(["agility_score", "agility_dice_d20", "agility_cost_modifier", "agility_dice_modifier"], function(values) { var score = values.agility_score*1 + values.agility_dice_modifier*1; var scoreCost = values.agility_score*1 + values.agility_cost_modifier*1; @@ -520,6 +537,7 @@ repeating_items // Function for calculating everything to do with Fortitude function calcFortitude() { + calcFortitudeSub(); getAttrs(["fortitude_score", "fortitude_dice_d20", "fortitude_cost_modifier", "fortitude_dice_modifier"], function(values) { var score = values.fortitude_score*1 + values.fortitude_dice_modifier*1; var scoreCost = values.fortitude_score*1 + values.fortitude_cost_modifier*1; @@ -550,6 +568,7 @@ repeating_items // Function for calculating everything to do with Might function calcMight() { + calcMightSub(); getAttrs(["might_score", "might_dice_d20", "might_cost_modifier", "might_dice_modifier"], function(values) { var score = values.might_score*1 + values.might_dice_modifier*1; var scoreCost = values.might_score*1 + values.might_cost_modifier*1; @@ -574,10 +593,9 @@ repeating_items // Anytime deception score is changed, update cost and dice on("change:deception_score change:deception_dice_d20 change:deception_cost_modifier change:deception_dice_modifier", function() { calcDeception(); - calcHeavy(); - calcEvasion(); - calcToughness(); - calcHitPoints(); + calcAgility(); + calcFortitude(); + calcMight(); calcAllActionRolls(); }); @@ -608,10 +626,9 @@ repeating_items on("change:presence_score change:presence_dice_d20 change:presence_cost_modifier change:presence_dice_modifier", function() { calcPresence(); calcResolve(); - calcHeavy(); - calcEvasion(); - calcToughness(); - calcHitPoints(); + calcAgility(); + calcFortitude(); + calcMight(); calcAllActionRolls(); }); @@ -641,10 +658,9 @@ repeating_items // Anytime persuasion score is changed, update cost and dice on("change:persuasion_score change:persuasion_dice_d20 change:persuasion_cost_modifier change:persuasion_dice_modifier", function() { calcPersuasion(); - calcHeavy(); - calcEvasion(); - calcToughness(); - calcHitPoints(); + calcAgility(); + calcFortitude(); + calcMight(); calcAllActionRolls(); }); @@ -674,10 +690,9 @@ repeating_items // Anytime learning score is changed, update cost and dice on("change:learning_score change:learning_dice_d20 change:learning_cost_modifier change:learning_dice_modifier", function() { calcLearning(); - calcHeavy(); - calcEvasion(); - calcToughness(); - calcHitPoints(); + calcAgility(); + calcFortitude(); + calcMight(); calcAllActionRolls(); }); @@ -707,10 +722,9 @@ repeating_items // Anytime logic score is changed, update cost and dice on("change:logic_score change:logic_dice_d20 change:logic_cost_modifier change:logic_dice_modifier", function() { calcLogic(); - calcHeavy(); - calcEvasion(); - calcToughness(); - calcHitPoints(); + calcAgility(); + calcFortitude(); + calcMight(); calcAllActionRolls(); }); @@ -740,10 +754,9 @@ repeating_items // Anytime perception score is changed, update cost and dice on("change:perception_score change:perception_dice_d20 change:perception_cost_modifier change:perception_dice_modifier", function() { calcPerception(); - calcHeavy(); - calcEvasion(); - calcToughness(); - calcHitPoints(); + calcAgility(); + calcFortitude(); + calcMight(); calcAllActionRolls(); }); @@ -774,10 +787,9 @@ repeating_items on("change:will_score change:will_dice_d20 change:will_cost_modifier change:will_dice_modifier", function() { calcWill(); calcResolve(); // call to recalculate resolve - calcToughness(); // For if/when Presence is switched with Will to determine Toughness - calcHitPoints(); // call to update hitpoints - calcEvasion(); - calcHitPoints(); + calcAgility(); + calcFortitude(); + calcMight(); calcAllActionRolls(); }); @@ -807,10 +819,9 @@ repeating_items // Anytime alteration score is changed, update cost and dice on("change:alteration_score change:alteration_dice_d20 change:alteration_cost_modifier change:alteration_dice_modifier", function() { calcAlteration(); - calcHeavy(); - calcEvasion(); - calcToughness(); - calcHitPoints(); + calcAgility(); + calcFortitude(); + calcMight(); calcAllActionRolls(); }); @@ -840,10 +851,9 @@ repeating_items // Anytime creation score is changed, update cost and dice on("change:creation_score change:creation_dice_d20 change:creation_cost_modifier change:creation_dice_modifier", function() { calcCreation(); - calcHeavy(); - calcEvasion(); - calcToughness(); - calcHitPoints(); + calcAgility(); + calcFortitude(); + calcMight(); calcAllActionRolls(); }); @@ -873,10 +883,9 @@ repeating_items // Anytime energy score is changed, update cost and dice on("change:energy_score change:energy_dice_d20 change:energy_cost_modifier change:energy_dice_modifier", function() { calcEnergy(); - calcHeavy(); - calcEvasion(); - calcToughness(); - calcHitPoints(); + calcAgility(); + calcFortitude(); + calcMight(); calcAllActionRolls(); }); @@ -906,10 +915,9 @@ repeating_items // Anytime entropy score is changed, update cost and dice on("change:entropy_score change:entropy_dice_d20 change:entropy_cost_modifier change:entropy_dice_modifier", function() { calcEntropy(); - calcHeavy(); - calcEvasion(); - calcToughness(); - calcHitPoints(); + calcAgility(); + calcFortitude(); + calcMight(); calcAllActionRolls(); }); @@ -939,10 +947,9 @@ repeating_items // Anytime influence score is changed, update cost and dice on("change:influence_score change:influence_dice_d20 change:influence_cost_modifier change:influence_dice_modifier", function() { calcInfluence(); - calcHeavy(); - calcEvasion(); - calcToughness(); - calcHitPoints(); + calcAgility(); + calcFortitude(); + calcMight(); calcAllActionRolls(); }); @@ -972,10 +979,9 @@ repeating_items // Anytime movement score is changed, update cost and dice on("change:movement_score change:movement_dice_d20 change:movement_cost_modifier change:movement_dice_modifier", function() { calcMovement(); - calcHeavy(); - calcEvasion(); - calcToughness(); - calcHitPoints(); + calcAgility(); + calcFortitude(); + calcMight(); calcAllActionRolls(); }); @@ -1005,10 +1011,9 @@ repeating_items // Anytime prescience score is changed, update cost and dice on("change:prescience_score change:prescience_dice_d20 change:prescience_cost_modifier change:prescience_dice_modifier", function() { calcPrescience(); - calcHeavy(); - calcEvasion(); - calcToughness(); - calcHitPoints(); + calcAgility(); + calcFortitude(); + calcMight(); calcAllActionRolls(); }); @@ -1038,10 +1043,9 @@ repeating_items // Anytime protection score is changed, update cost and dice on("change:protection_score change:protection_dice_d20 change:protection_cost_modifier change:protection_dice_modifier", function() { calcProtection(); - calcHeavy(); - calcEvasion(); - calcToughness(); - calcHitPoints(); + calcAgility(); + calcFortitude(); + calcMight(); calcAllActionRolls(); }); @@ -1259,7 +1263,7 @@ repeating_items getSectionIDs("repeating_actions", function(actionsArray) { if(actionsArray.length > 0) { _.each(actionsArray, function(currentID, i) { - getAttrs(["repeating_actions_" + currentID + "_action_attribute", "repeating_actions_" + currentID + "_dice_d20", "agility_score", "agility_dice_modifier", "fortitude_score", "fortitude_dice_modifier", "might_score", "might_dice_modifier", "learning_score", "learning_dice_modifier", "logic_score", "logic_dice_modifier", "perception_score", "perception_dice_modifier", "will_score", "will_dice_modifier", "deception_score", "deception_dice_modifier", "persuasion_score", "persuasion_dice_modifier", "presence_score", "presence_dice_modifier", "alteration_score", "alteration_dice_modifier", "creation_score", "creation_dice_modifier", "energy_score", "energy_dice_modifier", "entropy_score", "entropy_dice_modifier", "influence_score", "influence_dice_modifier", "movement_score", "movement_dice_modifier", "prescience_score", "prescience_dice_modifier", "protection_score", "protection_dice_modifier"], function(v) { + getAttrs(["repeating_actions_" + currentID + "_action_attribute", "repeating_actions_" + currentID + "_dice_d20", "repeating_actions_" + currentID + "_use_power_level", "repeating_actions_" + currentID + "_power_level", "agility_score", "agility_dice_modifier", "fortitude_score", "fortitude_dice_modifier", "might_score", "might_dice_modifier", "learning_score", "learning_dice_modifier", "logic_score", "logic_dice_modifier", "perception_score", "perception_dice_modifier", "will_score", "will_dice_modifier", "deception_score", "deception_dice_modifier", "persuasion_score", "persuasion_dice_modifier", "presence_score", "presence_dice_modifier", "alteration_score", "alteration_dice_modifier", "creation_score", "creation_dice_modifier", "energy_score", "energy_dice_modifier", "entropy_score", "entropy_dice_modifier", "influence_score", "influence_dice_modifier", "movement_score", "movement_dice_modifier", "prescience_score", "prescience_dice_modifier", "protection_score", "protection_dice_modifier"], function(v) { var update = {}; var score = 0; if(v["repeating_actions_" + currentID + "_action_attribute"] === "Agility") { @@ -1311,6 +1315,11 @@ repeating_items roll = "[[" + v["repeating_actions_" + currentID + "_dice_d20"] + " + [[" + number + "+?{# of Advantage/Disadvantage Dice|0}]]" + type + "k?{Do you have Advantage or Disadvantage?|Neither,h|Advantage,h|Disadvantage,l}" + number + "]]"; } } + if(v["repeating_actions_" + currentID + "_use_power_level"] === "Yes") { + update["repeating_actions_" + currentID + "_power_target"] = "[[10 + " + v["repeating_actions_" + currentID + "_power_level"]*2 + "]]"; + } else { + update["repeating_actions_" + currentID + "_power_target"] = ""; + } update["repeating_actions_" + currentID + "_dice_roll"] = roll; setAttrs(update); }); @@ -1319,6 +1328,20 @@ repeating_items }); }; + // On Change for Use Power Level in actions + on("change:repeating_actions:use_power_level change:repeating_actions:power_level", function() { + getAttrs(["repeating_actions_use_power_level", "repeating_actions_power_level"], function(values) { + if(values.repeating_actions_use_power_level === "Yes") { + setAttrs({ + "repeating_actions_power_target": "[[10 + " + values.repeating_actions_power_level*2 + "]]" + }); + } else { + setAttrs({ + "repeating_actions_power_target": "" + }); + } + }); + }); // On Change for calculating rolls for Actions on("change:repeating_actions:action_attribute change:repeating_actions:dice_d20", function() { getAttrs(["repeating_actions_action_attribute", "repeating_actions_dice_d20", "agility_score", "agility_dice_modifier", "fortitude_score", "fortitude_dice_modifier", "might_score", "might_dice_modifier", "learning_score", "learning_dice_modifier", "logic_score", "logic_dice_modifier", "perception_score", "perception_dice_modifier", "will_score", "will_dice_modifier", "deception_score", "deception_dice_modifier", "persuasion_score", "persuasion_dice_modifier", "presence_score", "presence_dice_modifier", "alteration_score", "alteration_dice_modifier", "creation_score", "creation_dice_modifier", "energy_score", "energy_dice_modifier", "entropy_score", "entropy_dice_modifier", "influence_score", "influence_dice_modifier", "movement_score", "movement_dice_modifier", "prescience_score", "prescience_dice_modifier", "protection_score", "protection_dice_modifier"], function(values) { @@ -2032,11 +2055,11 @@ var TAS = TAS || (function(){
-
-
2016.12.07 :: Version 1.6.7 y
-
+
+
2016.12.07 Version 1.6.7 y
+
-
+
Character Name
@@ -2794,18 +2817,19 @@ var TAS = TAS || (function(){
-
Actions
+
Primary Actions
+
Attacks, Boons, & Banes
+
+
Settings
Name (click to roll)
-
-
y
-
+
Name:
@@ -2855,6 +2879,9 @@ var TAS = TAS || (function(){
+ +
Use Power level:
+
Description/Special/Flavor Text
@@ -2890,20 +2917,23 @@ var TAS = TAS || (function(){
-
+
+
-
+
+
Click to roll Initiative
Base
Armor Penalty(ft)
Armor Feat(ft)
+
-
Lethal Damage
+
Lethal Damage
-
 
+
@@ -3404,6 +3434,21 @@ var TAS = TAS || (function(){
Total Roll
{{/roll}}{{/target}} + + {{#powertarget}} +
+ {{#rollLess() roll powertarget}} +
Success with Twist
or Failure
+ {{/rollLess() roll powertarget}} + {{#^rollLess() roll powertarget}} +
Success
+ {{/^rollLess() roll powertarget}} +
Boon CR
+
Power Level
+
{{powertarget}}
+
{{powerlevel}}
+
+ {{/powertarget}} {{#description}}
diff --git a/Open Legend Basic by Great Moustache/ReadMe.md b/Open Legend Basic by Great Moustache/ReadMe.md index 227210504f..21242a9843 100644 --- a/Open Legend Basic by Great Moustache/ReadMe.md +++ b/Open Legend Basic by Great Moustache/ReadMe.md @@ -5,9 +5,11 @@ ### Changelog -### 1.6.7 on 2016 December 7th +### 1.6.7 on 2016 December 10th * Fixed a strange error where Presence would add 20 at a time to HP - Caused by fortitude substitution not be forced into an integer type +* Fixed Attribute Substitution not updating if the Primary Attribute is changed + - Modified On Change to be function, and calling from calcAgility function as well * Added an indicator at top left of sheet to display current version of the sheet - More functionality later with the gear to add changing of default values for the sheet