- Added an updates summary to show sheet changes.

- Changed rounding on Traits and AOK calcs to 'ceil' (ie round up to the next whole number) to be in accordance to the rule book p5. Double check that your existing Superior AOK's count is correct since your PC's may have been shorted by one in the past due to this rounding error. FYI: it appears the sheet has always had this rounding bug. Thank you John B. for bringing this to my attention.
This commit is contained in:
vince
2025-10-20 10:12:58 -07:00
parent 3549149415
commit 1d70f3100a
2 changed files with 76 additions and 38 deletions
+22
View File
@@ -601,6 +601,28 @@
z-index: 1;
}
.ui-dialog .tab-content .charsheet details.updates[open] > ul {
margin: auto;
margin-top: .25em;
outline: 1px solid #000;
padding: .5em 1em 1em 1em;
}
.ui-dialog .tab-content .charsheet details.updates[open] ul ol > strong {
margin-block: .5em;
margin-left: -1.85em;
}
.ui-dialog .tab-content .charsheet details.updates > summary {
margin: 0;
text-align: right;
width: 100%;
}
.ui-dialog .tab-content .charsheet details.updates[open] > summary::after {
display: none;
}
.ui-dialog .tab-content .charsheet details[open] > summary:hover::after {
opacity: 1;
}
+54 -38
View File
@@ -1,26 +1,4 @@
<!--
10/14/25'
1. removed extra logs
2. added trait calcs to the version update instead of on every sheet open.
9/23/25'
1. add version check to fix/migrate a couple attribute names. ie characterName changed to character_name, repeating_AreasOfKnowledge_$X_WeaponSpeedModifier changed to repeating_AreasOfKnowledge_$X_AreaOfKnowledgeName
2. updated lifelevel to include lifelevel|max (better for token bar graph indication)
3. moved all sheet attribute calcs to sheetworkers
4. added Weapon rolls (projectile weapons)
5. added a Hit Determination mods section and calcs that can be used to adjust weapon rolls
6. added a Hit Location and Damage roll (directly from the sheet and/or from the attack result in chat)
7. added Temp Losses and calcs for Primary Traits
8. added AoK rolls
9. added a First Shot Determination mods section with a roll to the Turn order
10. added '&{template:general}' handles attack/damage logic. Can be used for custom macros as well.
11. added Primary and Secondary test rolls
12. added info rolls to Friends, Contacts, and Enemies
13. added a repeating Miscellaneous section with info roll.
14. added the portrait image to the top of the sheet (pulls from the character_avatar if set)
15. darkmode added for the sheet and roll template
16. other misc. layout/design tweaks
-->
<input type="text" class="hidden" name="attr_sheet_version" value="0" title="@{sheet_version}" />
<input type="text" class="hidden" name="attr_sheet_version" value="0" title="@{sheet_version}" />
<div class="main">
<div class="header-grid">
<div class="logo-text">
@@ -775,7 +753,40 @@
</div>
</div>
</div>
<span class="instruction" title="Sheet Version" style="float:right;"><span>v</span><span name="attr_sheet_version"></span></span>
<details class="updates" title="Sheet Updates">
<summary><span class="instruction" title="Sheet Version"><span>v</span><span name="attr_sheet_version"></span></span></summary>
<ul>
<ol>
<strong>v1.2 10/20/25'</strong>
<li>Added an updates summary to show sheet changes.</li>
<li>Changed rounding on Traits and AOK calcs to 'ceil' (ie round up to the next whole number) to be in accordance to the rule book p5. Double check that your existing Superior AOK's count is correct since your PC's may have been shorted by one in the past due to this rounding error. FYI: it appears the sheet has always had this rounding bug. Thank you John B. for bringing this to my attention.</li>
</ol>
<ol>
<strong>v1.1 10/14/25'</strong>
<li>Removed extra sheetworker logs.</li>
<li>Added trait calcs to the version update instead of on every sheet open.</li>
</ol>
<ol>
<strong>v1.0 9/23/25'</strong>
<li>Added a version check to fix/migrate a couple attribute names characterName changed to character_name, </li>repeating_AreasOfKnowledge_$X_WeaponSpeedModifier changed to repeating_AreasOfKnowledge_$X_AreaOfKnowledgeName
<li>Updated lifelevel to include lifelevel|max (better for token bar graph indication).</li>
<li>Moved all sheet attribute calcs to sheetworkers.</li>
<li>Added Weapon rolls (projectile weapons).</li>
<li>Added a Hit Determination mods section and calcs that can be used to adjust weapon rolls.</li>
<li>Added a Hit Location and Damage roll (directly from the sheet and/or from the attack result in chat).</li>
<li>Added Temp Losses and calcs for Primary Traits.</li>
<li>Added AoK rolls.</li>
<li>Added a First Shot Determination mods section with a roll to the Turn order.</li>
<li>Added '&{template:general}' handles attack/damage logic. Can be used for custom macros as well.</li>
<li>Added Primary and Secondary test rolls.</li>
<li>Added info rolls to Friends, Contacts, and Enemies.</li>
<li>Added a repeating Miscellaneous section with info roll.</li>
<li>Added the portrait image to the top of the sheet (pulls from the character_avatar if set).</li>
<li>Darkmode added for the sheet and roll template.</li>
<li>Other misc. layout/design tweaks made.</li>
</ol>
</ul>
</details>
</div>
<rolltemplate class="sheet-rolltemplate-general">
@@ -1106,12 +1117,12 @@
const valKnowledge_loss = +v.knowledge_loss || 0;
const valCoordination = +v.coordination || 0;
const valCoordination_loss = +v.coordination_loss || 0;
output.PhysicalStrength_temp = valPhysicalStrength - Math.round(valPhysicalStrength * (valPhysicalStrength_loss / 100));
output.Charm_temp = valCharm - Math.round(valCharm * (valCharm_loss / 100));
output.Willpower_temp = valWillpower - Math.round(valWillpower * (valWillpower_loss / 100));
output.Courage_temp = valCourage - Math.round(valCourage * (valCourage_loss / 100));
output.Knowledge_temp = valKnowledge - Math.round(valKnowledge * (valKnowledge_loss / 100));
output.Coordination_temp = valCoordination - Math.round(valCoordination * (valCoordination_loss / 100));
output.PhysicalStrength_temp = valPhysicalStrength - Math.ceil(valPhysicalStrength * (valPhysicalStrength_loss / 100));
output.Charm_temp = valCharm - Math.ceil(valCharm * (valCharm_loss / 100));
output.Willpower_temp = valWillpower - Math.ceil(valWillpower * (valWillpower_loss / 100));
output.Courage_temp = valCourage - Math.ceil(valCourage * (valCourage_loss / 100));
output.Knowledge_temp = valKnowledge - Math.ceil(valKnowledge * (valKnowledge_loss / 100));
output.Coordination_temp = valCoordination - Math.ceil(valCoordination * (valCoordination_loss / 100));
setAttrs(output);
},
);
@@ -1162,22 +1173,22 @@
const coordination = coordination_loss > 0 ? coordination_temp : +v.coordination || 0;
// secondary calcs
const offense = Math.round((courage + coordination) / 2);
const offense = Math.ceil((courage + coordination) / 2);
// console.log(`Change detected: offense:${offense}`);
output.offense = offense;
const deception = Math.round((charm + courage) / 2);
const deception = Math.ceil((charm + courage) / 2);
// console.log(`Change detected: deception:${deception}`);
output.deception = deception;
const evasion = Math.round((coordination + charm) / 2);
const evasion = Math.ceil((coordination + charm) / 2);
// console.log(`Change detected: evasion:${evasion}`);
output.evasion = evasion;
const deactivation = Math.round((coordination + knowledge) / 2);
const deactivation = Math.ceil((coordination + knowledge) / 2);
// console.log(`Change detected: deactivation:${deactivation}`);
output.deactivation = deactivation;
const movementvalue = coordination + physicalstrength + willpower;
// console.log(`Change detected: movementvalue:${movementvalue}`);
output.movementvalue = movementvalue;
const lifelevelMax = Math.round((physicalstrength + willpower) / 10);
const lifelevelMax = Math.ceil((physicalstrength + willpower) / 10);
// console.log(`Change detected: lifelevel_max:${lifelevelMax}`);
output.lifelevel_max = lifelevelMax;
// tertiary calcs
@@ -1191,10 +1202,10 @@
// console.log(`Change detected: surprisevalue:${surprisevalue}`);
output.surprisevalue = surprisevalue;
// AOK
const AOKdefault = Math.round(knowledge / 2);
const AOKdefault = Math.ceil(knowledge / 2);
// console.log(`Change detected: AOKdefault:${AOKdefault}`);
output.AreaOfKnowledgeDefaultValue = AOKdefault;
const AOKknown = Math.round(knowledge / 10);
const AOKknown = Math.ceil(knowledge / 10);
// console.log(`Change detected: AOKknown:${AOKknown}`);
output.AreaOfKnowledgeKnown = AOKknown;
setAttrs(output);
@@ -1704,7 +1715,12 @@
traitCalc();
output.sheet_version = 1.1;
console.log(`Change detected: Sheet updated to v1.1`);
} else if (sheetVersion > 1) {
}
if (sheetVersion === 1.1) {
traitCalc();
output.sheet_version = 1.2;
console.log(`Change detected: Sheet updated to v1.2`);
} else if (sheetVersion >= 1.2) {
console.log(`Change detected: Sheet v${sheetVersion} is current`);
}
setAttrs(output, {silent: true});