Fix for #2729 - Max Tech Level missing

This commit is contained in:
amandasearle
2017-07-19 13:20:01 -05:00
parent d92301fea2
commit 94e4b86e0d
2 changed files with 83 additions and 14 deletions
+82 -14
View File
@@ -16,7 +16,7 @@
<div class="sheet-col-1-4 sheet-small-label sheet-center"><input class="sheet-underlined sheet-center" type="text" placeholder="Character Name" name="attr_character_name"><br/>Character Name</div>
<div class="sheet-col-1-7 sheet-small-label sheet-center"><input class="sheet-underlined sheet-center" type="text" placeholder="Race" name="attr_Race"><br/>Genotype</div>
<div class="sheet-col-1-10 sheet-center">&nbsp;</div>
<div class="sheet-col-1-8 sheet-center sheet-margin-top"><p class="sheet-last-updated">Sheet last updated<br/>17 July 2017</p></div>
<div class="sheet-col-1-8 sheet-center sheet-margin-top"><p class="sheet-last-updated">Sheet last updated<br/>19 July 2017</p></div>
</div>
</div>
@@ -60,6 +60,8 @@
<div class="sheet-section-core">
<div class="sheet-row">
<!-- Character Information -->
<div class="sheet-col-1-2 sheet-padr">
@@ -148,6 +150,8 @@
</div>
<!-- Combat Basics -->
<div class="sheet-col-1-2 sheet-padr">
<h4 class="sheet-center">Combat Basics </h4>
@@ -300,7 +304,9 @@
</div>
</div>
</div>
<!-- Core Stats -->
<div class="sheet-row">
@@ -413,6 +419,8 @@
</div>
<!-- Saving Throws -->
<div class="sheet-col-1-2 sheet-padr">
<h4 class="sheet-center">Saving Throws </h4>
@@ -465,6 +473,8 @@
<div class="sheet-col-1-1 sheet-center">&nbsp;</div>
<!-- Movement -->
<h4 class="sheet-center">Movement </h4>
<div class="sheet-row sheet-padb">
@@ -493,6 +503,8 @@
</div>
<!-- Languages, Birth Sign, Lucky Roll -->
<div class="sheet-col-1-1">
<h4 class="sheet-center">Languages - Birth Sign - Lucky Rolls </h4>
@@ -4381,7 +4393,7 @@
<hr/>
</div>
<!-- INVENTORY -->
<!-- INVENTORY-ARTIFACTS -->
<div class="sheet-section-inventory">
@@ -4401,9 +4413,16 @@
<h4 class="sheet-center">Artifacts </h4>
<div class="sheet-col-1-5 sheet-center">
<button type="roll" class="sheet-roll" name="roll_ArtifactCombatCheck"
value="&{template:MccTabbed} {{background=[[0]]}} {{combat=1}} {{name=@{character_name}}} {{title=Artifact Combat Check}} {{flavortext=You try to figure out the artifact in the heat of battle.}} {{rolltype=Artifact Check : }} {{classability=[[ @{ActionDie} [Action Die] - (?{Complexity Level|1}) [Complexity Level] ]] }}" >Artifact Combat Check</button>
<div class="sheet-row">
<div class="sheet-col-1-4 sheet-right sheet-padr sheet-hd-row">Maximum Tech Level</br></div>
<div class="sheet-col-1-12 sheet-small-label sheet-padr sheet-center" Title="This is based on your INT attribute."><input class="sheet-underlined" type="number" name="attr_intMaxTech" value="0" readonly="readonly"><br/></div>
<div class="sheet-col-1-4 sheet-center">&nbsp;</div>
<div class="sheet-col-1-4 sheet-center">
<button type="roll" class="sheet-roll" name="roll_ArtifactCombatCheck"
value="&{template:MccTabbed} {{background=[[0]]}} {{combat=1}} {{name=@{character_name}}} {{title=Artifact Combat Check}} {{flavortext=You try to figure out the artifact in the heat of battle.}} {{rolltype=Artifact Check : }} {{classability=[[ @{ActionDie} [Action Die] - (?{Complexity Level|1}) [Complexity Level] ]] }}" >Artifact Combat Check</button>
</div>
</div>
<div class="sheet-col-1-1 sheet-center">&nbsp;</div>
@@ -5188,15 +5207,27 @@
<h4 class="sheet-center">Artifacts </h4>
<div class="sheet-col-1-5 sheet-center">
<button type="roll" class="sheet-roll" name="roll_ArtifactCombatCheck"
value="&{template:MccTabbed} {{background=[[0]]}} {{combat=1}} {{name=@{character_name}}} {{title=Artifact Combat Check}} {{flavortext=You try to figure out the artifact in the heat of battle.}} {{rolltype=Artifact Check : }} {{classability=[[ @{ActionDie} [Action Die] - (?{Complexity Level|1}) [Complexity Level] ]] }}" >Artifact Combat Check</button>
</div>
<div class="sheet-row">
<div class="sheet-col-1-4 sheet-right sheet-padr sheet-hd-row">Maximum Tech Level</br></div>
<div class="sheet-col-1-12 sheet-small-label sheet-padr sheet-center" Title="This is based on your INT attribute."><input class="sheet-underlined" type="number" name="attr_intMaxTech" value="0" readonly="readonly"><br/></div>
<div class="sheet-col-1-23 sheet-center">&nbsp;</div>
<div class="sheet-col-1-4 sheet-center">
<button type="roll" class="sheet-roll" name="roll_ArtifactCombatCheck"
value="&{template:MccTabbed} {{background=[[0]]}} {{combat=1}} {{name=@{character_name}}} {{title=Artifact Combat Check}} {{flavortext=You try to figure out the artifact in the heat of battle.}} {{rolltype=Artifact Check : }} {{classability=[[ @{ActionDie} [Action Die] - (?{Complexity Level|1}) [Complexity Level] ]] }}" >Artifact Combat Check</button>
</div>
<div class="sheet-col-1-23 sheet-center">&nbsp;</div>
<div class="sheet-col-1-4 sheet-padr sheet-center">
<button type="roll" class="sheet-roll" name="roll_ZeroLevelAIRecognition"
value="&{template:MccTabbed} {{background=[[5]]}} {{class=1}} {{name=@{character_name}}} {{title=AI Recognition Roll}} {{flavortext=...A.R.E...Y.O.U...H.U.M.A.N.?...}} {{rolltype=AI Recognition : }} {{airoll=[[ 1d20 [Die Roll] + @{AILuckyRoll}[Lucky Roll] + (?{Bonus/Minus|0}) [Bonus/Minus] ]] }} " >AI Recognition</button>
</div>
</div>
<div class="sheet-col-1-7 sheet-padl">
<button type="roll" class="sheet-roll" name="roll_ZeroLevelAIRecognition"
value="&{template:MccTabbed} {{background=[[5]]}} {{class=1}} {{name=@{character_name}}} {{title=AI Recognition Roll}} {{flavortext=...A.R.E...Y.O.U...H.U.M.A.N.?...}} {{rolltype=AI Recognition : }} {{airoll=[[ 1d20 [Die Roll] + @{AILuckyRoll}[Lucky Roll] + (?{Bonus/Minus|0}) [Bonus/Minus] ]] }} " >AI Recognition</button>
</div>
<div class="sheet-col-1-1 sheet-center">&nbsp;</div>
@@ -6542,8 +6573,45 @@ calculateMod = function(attributes) {
});
}
on("change:int", function(e) {
var attr = e.sourceAttribute;
calculateMaxTech([attr]);
});
calculateMaxTech = function(attributes) {
attributes.map(function(attr) {
getAttrs([attr], function(v) {
var attrMaxTechLevel = attr + 'MaxTech';
var updatedVal = {};
if (v[attr] >= 24) {
updatedVal[attrMaxTechLevel] = 7;
} else if (v[attr] >= 18 && v[attr] <= 23) {
updatedVal[attrMaxTechLevel] = 6;
} else if (v[attr] >= 15 && v[attr] <= 17) {
updatedVal[attrMaxTechLevel] = 5;
} else if (v[attr] >= 12 && v[attr] <= 14) {
updatedVal[attrMaxTechLevel] = 4;
} else if (v[attr] >= 10 && v[attr] <= 11) {
updatedVal[attrMaxTechLevel] = 3;
} else if (v[attr] >= 8 && v[attr] <= 9) {
updatedVal[attrMaxTechLevel] = 2;
} else if (v[attr] >= 4 && v[attr] <= 7) {
updatedVal[attrMaxTechLevel] = 1;
} else if (v[attr] <= 3) {
updatedVal[attrMaxTechLevel] = 0;
} else {
updatedVal[attrMaxTechLevel] = 0
}
setAttrs(updatedVal);
});
});
}
validateAttrMods = function() {
calculateMod(['str', 'int', 'agi', 'per', 'sta', 'luck', 'luckstarting']);
calculateMaxTech(['int']);
}
/* ---- BEGIN: TheAaronSheet.js ---- */
+1
View File
@@ -17,6 +17,7 @@ This is a MCC sheet that uses tabs and Roll Templates. It also includes a 0-lev
* Updated Plantient
* Added Show Information button to Mutation section - now you can show your mutations without rolling a die!
* Added Rover
* Fix for #2729 - Added Max Tech level box to Inv/Artifact tab and 0-level sheet. This value is calculated automatically using sheetworkers.
#### 1.0
* Based on my DCC Sheet