Files
roll20-character-sheets/Top Secret/TopSecret.html
T
2025-10-22 01:21:16 -07:00

1739 lines
98 KiB
HTML

<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">
<div class="logo-text-first-line">TOP</div>
<div class="logo-text-second-line">SECRET</div>
</div>
<div class="page-title">AGENT'S DOSSIER</div>
<div class="portrait">
<input type="text" class="hidden" name="attr_character_avatar" />
<input type="text" class="hidden" name="attr_character_avatar_url" value=""/>
<input type="text" class="hidden" name="attr_character_avatar_img" value="" />
<img name="attr_character_avatar" />
<button type="roll" class="text-roll bubble-image" name="roll_portrait" title="%{portrait} | Click to display this image in chat." value="&{template:general} {{title=@{character_name}}} {{image=@{character_avatar_img}}}"></button>
</div>
</div>
<div class="two-column-grid">
<div class="span-2">
<label>CHARACTER NAME <input type="text" class="name-field" name="attr_character_name" value="" title="@{character_name}"></label>
<!-- deprecated attribute due to attribute name-->
<input type="text" class="hidden" name="attr_CharacterName">
</div>
<div class="span-2">
<label class="general-column-header nowrap">Alias <input type="text" name="attr_Alias" title="@{Alias}"></label>
<label class="general-column-header nowrap">Code Name <input type="text" name="attr_CodeName" title="@{CodeName}"></label>
</div>
</div>
<nav>
<span class="tab" title="Traits"><input type="radio" name="attr_tab" class="tab1" value="1" checked /></span>
<span class="tab" title="Stats"><input type="radio" name="attr_tab" class="tab2" value="2" /></span>
<span class="tab" title="Equipment"><input type="radio" name="attr_tab" class="tab3" value="3" /></span>
<span class="tab" title="Knowledge"><input type="radio" name="attr_tab" class="tab4" value="4" /></span>
<span class="tab" title="People"><input type="radio" name="attr_tab" class="tab5" value="5" /></span>
<span class="tab" title="Misc"><input type="radio" name="attr_tab" class="tab6" value="6" /></span>
</nav>
<div class="tab-content tab1">
<div class="three-column-fit">
<div class="traits-column">
<div class="section-title">PRIMARY PERSONAL TRAITS</div>
<div class="four-column-grid">
<span></span>
<span class="general-column-header" title="Base Score">BASE</span>
<span class="general-column-header" title="Temporary Loss %">LOSS</span>
<span class="general-column-header" title="Adjusted Score after Temp Loss calculation.">TEMP</span>
<button type="roll" class="text-roll" name="roll_physicalstrength" title="%{physicalstrength}" value="&{template:general} {{title=@{character_name} - Trait Test}} {{subtitle=Physical Strength}} {{roll_vs_target=[[1]]}} {{roll=[[1d100]]}} {{target=[[ @{physicalstrength_temp} [trait] + (?{Additional Modifier|0} [mod]) ]]}} {{Physical Strength=[[ @{physicalstrength_temp} ]]}} {{Roll Mod=[[?{Additional Modifier|0}]]}}">
<span class="row-title">Physical Strength</span>
</button>
<input type="text" name="attr_PhysicalStrength" value="0" title="@{PhysicalStrength}" class="input-med" />
<input type="text" name="attr_PhysicalStrength_loss" value="0" title="@{PhysicalStrength_loss} | Enter the percent for temporary loss. e.g. '5', '12', '15', etc." class="input-small" />
<input type="text" name="attr_PhysicalStrength_temp" value="0" title="@{PhysicalStrength_temp} | (@{PhysicalStrength} - round(@{PhysicalStrength}*(@{PhysicalStrength_loss}/100)))" class="input-med" readonly />
<button type="roll" class="text-roll" name="roll_charm" title="%{charm}" value="&{template:general} {{title=@{character_name} - Trait Test}} {{subtitle=Charm}} {{roll_vs_target=[[1]]}} {{roll=[[1d100]]}} {{target=[[ @{charm_temp} [trait] + (?{Additional Modifier|0} [mod]) ]]}} {{Charm=[[ @{charm_temp} ]]}} {{Roll Mod=[[?{Additional Modifier|0}]]}}">
<span class="row-title">Charm</span>
</button>
<input type="text" name="attr_Charm" value="0" title="@{Charm}" class="input-med" />
<input type="text" name="attr_Charm_loss" value="0" title="@{Charm_loss} | Enter the percent for temporary loss. e.g. '5', '12', '15', etc." class="input-small" />
<input type="text" name="attr_Charm_temp" value="0" title="@{Charm_temp} | (@{Charm} - round(@{Charm}*(@{Charm_loss}/100)))" class="input-med" readonly />
<button type="roll" class="text-roll" name="roll_willpower" title="%{willpower}" value="&{template:general} {{title=@{character_name} - Trait Test}} {{subtitle=Willpower}} {{roll_vs_target=[[1]]}} {{roll=[[1d100]]}} {{target=[[ @{willpower_temp} [trait] + (?{Additional Modifier|0} [mod]) ]]}} {{Willpower=[[ @{willpower_temp} ]]}} {{Roll Mod=[[?{Additional Modifier|0}]]}}">
<span class="row-title">Willpower</span>
</button>
<input type="text" name="attr_Willpower" value="0" title="@{Willpower}" class="input-med" />
<input type="text" name="attr_Willpower_loss" value="0" title="@{Willpower_loss} | Enter the percent for temporary loss. e.g. '5', '12', '15', etc." class="input-small" />
<input type="text" name="attr_Willpower_temp" value="0" title="@{Willpower_temp} | (@{Willpower} - round(@{Willpower}*(@{Willpower_loss}/100)))" class="input-med" readonly />
<button type="roll" class="text-roll" name="roll_courage" title="%{courage}" value="&{template:general} {{title=@{character_name} - Trait Test}} {{subtitle=Courage}} {{roll_vs_target=[[1]]}} {{roll=[[1d100]]}} {{target=[[ @{courage_temp} [trait] + (?{Additional Modifier|0} [mod]) ]]}} {{Courage=[[ @{courage_temp} ]]}} {{Roll Mod=[[?{Additional Modifier|0}]]}}">
<span class="row-title">Courage</span>
</button>
<input type="text" name="attr_Courage" value="0" title="@{Courage}" class="input-med" />
<input type="text" name="attr_Courage_loss" value="0" title="@{Courage_loss} | Enter the percent for temporary loss. e.g. '5', '12', '15', etc." class="input-small" />
<input type="text" name="attr_Courage_temp" value="0" title="@{Courage_temp} | (@{Courage} - round(@{Courage}*(@{Courage_loss}/100)))" class="input-med" readonly />
<button type="roll" class="text-roll" name="roll_knowledge" title="%{knowledge}" value="&{template:general} {{title=@{character_name} - Trait Test}} {{subtitle=Knowledge}} {{roll_vs_target=[[1]]}} {{roll=[[1d100]]}} {{target=[[ @{knowledge_temp} [trait] + (?{Additional Modifier|0} [mod]) ]]}} {{Knowledge=[[ @{knowledge_temp} ]]}} {{Roll Mod=[[?{Additional Modifier|0}]]}}">
<span class="row-title">Knowledge</span>
</button>
<input type="text" name="attr_Knowledge" value="0" title="@{Knowledge}" class="input-med" />
<input type="text" name="attr_Knowledge_loss" value="0" title="@{Knowledge_loss} | Enter the percent for temporary loss. e.g. '5', '12', '15', etc." class="input-small" />
<input type="text" name="attr_Knowledge_temp" value="0" title="@{Knowledge_temp} | (@{Knowledge} - round(@{Knowledge}*(@{Knowledge_loss}/100)))" class="input-med" readonly />
<button type="roll" class="text-roll" name="roll_coordination" title="%{coordination}" value="&{template:general} {{title=@{character_name} - Trait Test}} {{subtitle=Coordination}} {{roll_vs_target=[[1]]}} {{roll=[[1d100]]}} {{target=[[ @{coordination_temp} [trait] + (?{Additional Modifier|0} [mod]) ]]}} {{Coordination=[[ @{coordination_temp} ]]}} {{Roll Mod=[[?{Additional Modifier|0}]]}}">
<span class="row-title">Coordination</span>
</button>
<input type="text" name="attr_Coordination" value="0" title="@{Coordination}" class="input-med" />
<input type="text" name="attr_Coordination_loss" value="0" title="@{Coordination_loss} | Enter the percent of temporary loss." class="input-small" />
<input type="text" name="attr_Coordination_temp" value="0" title="@{Coordination_temp} | (@{Coordination} - round(@{Coordination}*(@{Coordination_loss}/100)))" class="input-med" readonly/>
</div>
<div class="instruction">(If die roll is 01-25, <strong>add 25</strong>; 26-50, <strong>add 15</strong>; 51-70, <strong>add 10</strong>; 71-90, <strong>add 5</strong>)</div>
</div>
<div class="traits-column">
<div class="section-title">SECONDARY PERSONAL TRAITS</div>
<div class="two-column-grid">
<button type="roll" class="text-roll" name="roll_offense" title="%{offense}" value="&{template:general} {{title=@{character_name} - Trait Test}} {{subtitle=Offense}} {{roll_vs_target=[[1]]}} {{roll=[[1d100]]}} {{target=[[ @{offense} [trait] + (?{Additional Modifier|0} [mod]) ]]}} {{Offense=[[ @{offense} ]]}} {{Roll Mod=[[?{Additional Modifier|0}]]}}">
<span class="row-title">Offense</span>
</button>
<input type="text" name="attr_Offense" value="0" class="input-med" title="@{Offense} | round((@{Coordination} + @{Courage})/2)" readonly/>
<details class="span-2">
<summary class="no-wrap">
<span class="general-column-header" title="Used for First Shot Determination">Net Speed</span>
<input type="text" name="attr_net_speed_total" value="0" title="@{net_speed_total}" readonly />
<button type="action" class="btn reset-image" name="act_netspeedreset" title="Reset Net Speed modifiers."></button>
<button type="roll" class="btn text-roll no-image" name="roll_net_speed" title="%{net_speed} | Sends Net Speed details to chat and adds the character to the turn order." value="&{template:general} {{title=@{character_name} - Net Speed}} {{subtitle=First Shot Determination}} {{OFFENSE=[[@{Offense}]]}} {{MODIFIERS}} {{Drawing=[[@{net_speed_drawing}]]}} {{Aiming=[[@{net_speed_aiming}]]}} {{Surprise Factor=[[@{net_speed_surprise_factor}]]}} {{Weapon Speed=[[@{net_speed_weapon_speed}]]}} {{Shooter Movement=[[@{net_speed_shooter_movement}]]}} {{Roll Mod=[[?{Additional Modifier|0}]]}} {{TOTAL=[[@{net_speed_total} + ?{Additional Modifier|0} &{tracker}]]}}">Turn Order</button>
</summary>
<select name="attr_net_speed_drawing">
<option value="0" selected>Drawing</option>
<option value="-2">Waistband, front -2</option>
<option value="-4">Hip Holster -4</option>
<option value="-5">Coat Pocket(same side)-5</option>
<option value="-6">Cross-draw hip -6</option>
<option value="-8">Shoulder Holster -8</option>
<option value="-8">Shirt Pocket -8</option>
<option value="-10">Pants Pocket(same side front)-10</option>
<option value="-10">Shoulder Sling -10</option>
<option value="-12">Waistband, back -12</option>
<option value="-12">Pants Pocket (either side rear)-12</option>
<option value="-14">Neckband -14</option>
<option value="-14">Pants Pocks(opposite side front)-14</option>
<option value="-16">Ankle or Shoe holster -16</option>
</select>
<select name="attr_net_speed_aiming">
<option value="0.0" selected>Aiming</option>
<option value="0">Normal 0</option>
<option value="10">Hip Shooting +10</option>
</select>
<select name="attr_net_speed_surprise_factor">
<option value="0" selected>Surprise Factor</option>
<option value="-3">Give opponent the first move. -3</option>
<option value="-5">Shooter surprised -5</option>
<option value="-10">Shooter completely surprised -10</option>
</select>
<select name="attr_net_speed_weapon_speed">
<option value="0.0" selected>Weapon Speed</option>
<option value="-10" title="very slow">Very Slow -10</option>
<option value="-5" title="slow">Slow -5</option>
<option value="-3" title="below average">Below Average -3</option>
<option value="0" title="average">Average 0</option>
<option value="5" title="fast">Fast +5</option>
<option value="10" title="very fast">Very Fast +10</option>
</select>
<select name="attr_net_speed_shooter_movement">
<option value="0.0" selected>Shooter's Movement</option>
<option value="0">Walking 0</option>
<option value="0">Crawling 0</option>
<option value="-20">Running -20</option>
<option value="-25">Running and Dodging -25</option>
<option value="-10">In or On moving vehicle -10</option>
<option value="-5">Wading -5</option>
</select>
</details>
<button type="roll" class="text-roll" name="roll_deception" title="%{deception}" value="&{template:general} {{title=@{character_name} - Trait Test}} {{subtitle=Deception}} {{roll_vs_target=[[1]]}} {{roll=[[1d100]]}} {{target=[[ @{deception} [trait] + (?{Additional Modifier|0} [mod]) ]]}} {{Deception=[[ @{deception} ]]}} {{Roll Mod=[[?{Additional Modifier|0}]]}}">
<span class="row-title">Deception</span>
</button>
<input type="text" name="attr_Deception" value="0" class="input-med" title="@{Deception} | round((@{Charm} + @{Courage})/2)" readonly/>
<button type="roll" class="text-roll" name="roll_evasion" title="%{evasion}" value="&{template:general} {{title=@{character_name} - Trait Test}} {{subtitle=Evasion}} {{roll_vs_target=[[1]]}} {{roll=[[1d100]]}} {{target=[[ @{evasion} [trait] + (?{Additional Modifier|0} [mod]) ]]}} {{Evasion=[[ @{evasion} ]]}} {{Roll Mod=[[?{Additional Modifier|0}]]}}">
<span class="row-title">Evasion</span>
</button>
<input type="text" name="attr_Evasion" value="0" class="input-med" title="@{Evasion} | round((@{Coordination} + @{Charm})/2)" readonly/>
<button type="roll" class="text-roll" name="roll_deactivation" title="%{deactivation}" value="&{template:general} {{title=@{character_name} - Trait Test}} {{subtitle=Deactivation}} {{roll_vs_target=[[1]]}} {{roll=[[1d100]]}} {{target=[[ @{deactivation} [trait] + (?{Additional Modifier|0} [mod]) ]]}} {{Deactivation=[[ @{deactivation} ]]}} {{Roll Mod=[[?{Additional Modifier|0}]]}}">
<span class="row-title">Deactivation</span>
</button>
<input type="text" name="attr_Deactivation" value="0" class="input-med" title="@{Deactivation} | round((@{Coordination} + @{Knowledge})/2)" readonly/>
<span class="row-title">Movement Value</span>
<input type="text" name="attr_MovementValue" value="0" class="input-med" title="@{MovementValue} | @{Coordination} + @{PhysicalStrength} + @{Willpower}" readonly/>
<span class="row-title">Life Level</span>
<span>
<input type="text" name="attr_LifeLevel" value="0" class="life-level input-med" title="@{LifeLevel}" />
<span class="division">/</span>
<input type="text" name="attr_LifeLevel_max" value="0" class="input-med" title="@{LifeLevel_max} | round((@{PhysicalStrength} + @{Willpower})/10)" readonly/>
</span>
<!-- deprecated attribute -->
<input type="text" name="attr_CurrentLifeLevel" class="hidden" value="0" />
</div>
</div>
<div class="traits-column">
<div class="section-title">TERTIARY PERSONAL TRAITS</div>
<div class="two-column-grid">
<span class="row-title">Hand-to-hand Combat Value</span>
<input type="text" name="attr_HandToHandCombatValue" value="0" class="input-med" title="@{HandToHandCombatValue} | @{PhysicalStrength} + @{Evasion}" readonly/>
<span class="row-title">Wrestling Value</span>
<input type="text" name="attr_WrestlingValue" value="0" class="input-med" title="@{WrestlingValue} | @{PhysicalStrength} + @{Offense}" readonly/>
<span class="row-title">Surprise Value</span>
<input type="text" name="attr_SurpriseValue" value="0" class="input-med" title="@{SurpriseValue} | @{Deception} + @{Evasion}" readonly/>
</div>
</div>
</div>
</div>
<div class="tab-content tab2">
<div>
<div class="section-title">VITAL STATISTICS</div>
<div class="flex-row">
<label>
<span class="right-aligned">Height</span>
<input type="text" class="height-column" name="attr_Height" title="@{Height}">
</label>
<label>
<span class="right-aligned">Weight</span>
<input type="text" class="weight-column" name="attr_Weight" title="@{Weight}">
</label>
<label>
<span class="right-aligned">Age</span>
<input type="text" class="age-column" name="attr_Age" title="@{Age}">
</label>
<label>
<span class="right-aligned">Sex</span>
<input type="text" class="sex-column" name="attr_Sex" title="@{Sex}">
</label>
<label>
<span class="right-aligned">National Origin</span>
<input type="text" name="attr_NationalOrigin" title="@{NationalOrigin}">
</label>
</div>
<div class="flex-row">
<label>
<span class="right-aligned">Handedness</span>
<input type="text" class="handedness-field" name="attr_Handedness" title="@{Handedness}"/>
</label>
<label>
<span class="right-aligned">Race</span>
<input type="text" name="attr_Race" title="@{Race}"/>
</label>
<label>
<span class="right-aligned">Glasses</span>
<input type="checkbox" name="attr_Glasses" title="@{Glasses}"/>
</label>
<label>
<span class="right-aligned">Contacts</span>
<input type="checkbox" name="attr_Contacts" title="@{Contacts}"/>
</label>
</div>
<div class="two-column-grid">
<label>Languages Known</label>
<label>Fluency</label>
<label class="nowrap">
<input type="text" class="languages-known-field" name="attr_NativeLanguage" title="@{NativeLanguage}">(Native)</input>
</label>
<input type="text" class="language-fluency-field" name="attr_NativeLanguageFluency" title="@{NativeLanguageFluency}"/>
</div>
<fieldset class="repeating_Languages">
<div class="two-column-grid">
<input type="text" class="languages-known-field" name="attr_Language" title="@{Language}" />
<input type="text" class="language-fluency-field" name="attr_LanguageFluency" title="@{LanguageFluency}" />
</div>
</fieldset>
</div>
<div>
<div class="section-title">CLASSIFIED INFORMATION</div>
<label>Bureau <input type="text" name="attr_Bureau" value="0" title="@{Bureau}"/></label>
<label>Total Experience Points <input type="text" name="attr_TotalExp" value="0" title="@{TotalExp}"/></label>
<label>Level <input type="text" name="attr_Level" value="0" title="@{Level}"/></label>
<label>Fame Points <input type="text" name="attr_FamePoints" value="0" title="@{FamePoints}"/></label>
<label>Fortune Points <input type="text" name="attr_FortunePoints" value="0" title="@{FortunePoints}"/></label>
<label>Experience Points Used <input type="text" name="attr_ExpUsed" value="0" title="@{ExpUsed}"/></label>
<label>Unused Experience Points <input type="text" name="attr_UnusedExp" value="0" title="@{UnusedExp}"/></label>
</div>
</div>
<div class="tab-content tab3">
<div>
<div class="section-title">WEAPONS</div>
<!-- Hit Determination -->
<!-- Hit Determination -->
<div class="hit-determination-grid">
<span class="hit-det-title">
<span class="row-title">HIT DETERMINATION</span>
<span class="instruction">(Applies to all weapon rolls. Adjust as-needed per shot.)</span>
</span>
<button type="action" class="hit-det-reset btn reset-image" name="act_hitDetResetAll" title="Reset all Hit Determination modifiers.">
<span>Reset All</span>
</button>
<!-- movement of shooter -->
<span class="hit-det-shooter">
<span class="row-title">Movement of Shooter</span>
<input type="text" name="attr_hit_det_move_of_shooter_total" value="0" title="@{hit_det_move_of_shooter_total}" readonly />
<button type="action" class="btn reset-image" name="act_hitDetResetMovementOfShooter" title="Reset Movement of Shooter modifiers."></button>
<select name="attr_hit_det_move_of_shooter" title="@{hit_det_move_of_shooter}">
<option value="0" selected>Stationary 0</option>
<option value="1">Stationary and prone +5</option>
<option value="2">Walking -5</option>
<option value="3">Wading -10</option>
<option value="4">Crawling -10</option>
<option value="5">Running and dodging -30</option>
<option value="6">Running -20</option>
<option class="show-mph" value="7">Vehicular Movement -10</option>
<option value="8">Drops Prone -20</option>
</select>
<label class="mph">
<span class="general-column-header">Speed of Shooter</span>
<input type="text" name="attr_hit_det_shooter_speed_multiplier" class="input-med" value="0" title="@{hit_det_shooter_speed_multiplier}" />
<span>MPH</span>
</label>
</span>
<!-- movement of target -->
<span class="hit-det-target">
<span class="row-title">Movement of Target</span>
<input type="text" name="attr_hit_det_move_of_target_total" value="0" title="@{hit_det_move_of_target_total}" readonly />
<button type="action" class="btn reset-image" name="act_hitDetResetMovementOfTarget" title="Reset Movement of Target modifiers."></button>
<select name="attr_hit_det_move_of_target" title="@{hit_det_move_of_target}">
<option value="0" selected>Stationary 0</option>
<option value="1">Walking -5</option>
<option value="2">Wading -5</option>
<option value="3">Crawling -5</option>
<option value="4">Running -10</option>
<option value="5">Running and dodging -20</option>
<option value="6" class="show-mph">Vehicular Movement -10</option>
<option value="7">Drops Prone -5</option>
</select>
<label class="mph">
<span class="general-column-header">Speed of Target</span>
<input type="text" name="attr_hit_det_target_speed_multiplier" class="input-med" value="0" title="@{hit_det_target_speed_multiplier}" />
<span>MPH</span>
</label>
</span>
<!-- wounds -->
<span class="hit-det-wounds">
<span class="row-title">Wounds</span>
<input type="text" name="attr_hit_det_wounds_total" value="0" title="@{hit_det_wounds_total}" readonly />
<button type="action" class="btn reset-image" name="act_hitDetResetWounds" title="Reset Wounds modifiers."></button>
<select name="attr_hit_det_wounds" title="@{hit_det_wounds}">
<option value="0" selected>Character firing is not wounded 0</option>
<option value="-5">Character firing is wounded, but Life Level is more than ½ normal -5</option>
<option value="-20">Character firing is wounded and Life Level is ½ or below -20</option>
</select>
</span>
<!-- misc. -->
<details class="hit-det-misc">
<summary class="nowrap">
<span class="row-title">Miscellaneous</span>
<input type="text" name="attr_hit_det_misc_total" value="0" title="@{hit_det_misc_total}" readonly />
<button type="action" class="btn reset-image" name="act_hitDetResetMisc" title="Reset Misc. modifiers."></button>
</summary>
<label>
<span>
<input type="checkbox" name="attr_hit_det_misc_weapon_at_rest" value="10" title="@{hit_det_misc_weapon_at_rest}" />
<span>Weapon at rest on solid object (not possible the phase weapon is first aimed at target) +10</span>
</span>
</label>
<label>
<span>
<input type="checkbox" name="attr_hit_det_misc_2nd_consecutive" value="-10" title="@{hit_det_misc_2nd_consecutive}" />
<span>Second consecutive shot by one character<strong>*</strong> -10</span>
</span>
</label>
<div>
<span>
<label>
<input type="checkbox" name="attr_hit_det_misc_additional_consecutive" value="-10" title="@{hit_det_misc_additional_consecutive}" />
<span>Each additional consecutive shot -10 per shot by one character<strong>*</strong> (cumulative)</span>
</label>
<strong class="indent">Which Shot?</strong><input type="text" class="input-med" name="attr_hit_det_misc_additional_consecutive_multiplier" value="1" title="@{hit_det_misc_additional_consecutive_multiplier}" />
</span>
</div>
<label>
<span>
<input type="checkbox" name="attr_hit_det_misc_wrong_hand" value="-10" title="@{hit_det_misc_wrong_hand}" />
<span>Shooting with the wrong hand (with left hand if right-handed, etc.) -10</span>
</span>
</label>
<div>
<span>
<label>
<input type="checkbox" name="attr_hit_det_misc_wounded_gun_hand" value="-5" title="@{hit_det_misc_wounded_gun_hand}" />
<span>Shooter wounded in gun arm/hand -5 per injury point</span>
</label>
<strong class="indent">Injury Points?</strong>
<input type="text" class="input-med" name="attr_hit_det_misc_wounded_gun_hand_multiplier" value="1" title="@{hit_det_misc_wounded_gun_hand_multiplier}" />
</span>
</div>
<label>
<span>
<input type="checkbox" name="attr_hit_det_misc_two_weapons" value="-30" title="@{hit_det_misc_two_weapons}" />
<span>Firing two weapons -30</span>
</span>
</label>
<label>
<span>
<input type="checkbox" name="attr_hit_det_misc_hip_shooting" value="-10" title="@{hit_det_misc_hip_shooting}" />
<span>Hipshooting -10</span>
</span>
</label>
<label>
<span>
<input type="checkbox" name="attr_hit_det_misc_obscured" value="-10" title="@{hit_det_misc_obscured}" />
<span>Target obscured (50% or less of target is visible or prone) -10</span>
</span>
</label>
<label>
<span>
<input type="checkbox" name="attr_hit_det_misc_gyrojet" value="10" title="@{hit_det_misc_gyrojet}" />
<span>Using gyrojet ammunition +10</span>
</span>
</label>
<span class="instruction"><strong>*</strong>Note that if at any point a character takes a "steadying phase”, all consecutive shot penalties revert back to zero.</span>
</details>
<!-- automatic weapons -->
<div class="hit-det-automatic">
<div class="span-all nowrap left-aligned">
<span class="row-title">Automatic Weapons</span>
<input type="text" name="attr_hit_det_automatic_total" class="larger" value="0" title="@{hit_det_automatic_total}" readonly />
<button type="action" class="btn reset-image" name="act_hitDetResetAutomaticWeapons" title="Reset Automatic Weapons. modifiers."></button>
</div>
<span class="two-column-grid general-column-header">
<span style="position: relative;bottom: -8px;">Type</span>
<span>SHOT#</span>
</span>
<span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span><span>7</span><span>8</span><span>9</span><span>10+</span>
<label>
<input type="radio" name="attr_hit_det_automatic_type" value="0" title="@{hit_det_automatic_type}" />
<span>Auto/Sub</span>
</label>
<input type="radio" class="radio-box-auto" name="attr_hit_det_automatic_auto" value="1" title="0" checked />
<input type="radio" class="radio-box-auto" name="attr_hit_det_automatic_auto" value="2" title="-11" />
<input type="radio" class="radio-box-auto" name="attr_hit_det_automatic_auto" value="3" title="-22" />
<input type="radio" class="radio-box-auto" name="attr_hit_det_automatic_auto" value="4" title="-33" />
<input type="radio" class="radio-box-auto" name="attr_hit_det_automatic_auto" value="5" title="-46" />
<input type="radio" class="radio-box-auto" name="attr_hit_det_automatic_auto" value="6" title="-63" />
<input type="radio" class="radio-box-auto" name="attr_hit_det_automatic_auto" value="7" title="-85" />
<input type="radio" class="radio-box-auto" name="attr_hit_det_automatic_auto" value="8" title="-100" />
<input type="radio" class="radio-box-auto" name="attr_hit_det_automatic_auto" value="9" title="-150" />
<input type="radio" class="radio-box-auto" name="attr_hit_det_automatic_auto" value="10" title="-200" />
<label>
<input type="radio" name="attr_hit_det_automatic_type" value="1" title="@{hit_det_automatic_type}" />
<span>Semi/Pump</span>
</label>
<input type="radio" class="radio-box-semi" name="attr_hit_det_automatic_semi" value="1" title="0" checked />
<input type="radio" class="radio-box-semi" name="attr_hit_det_automatic_semi" value="2" title="-11" />
<input type="radio" class="radio-box-semi" name="attr_hit_det_automatic_semi" value="3" title="-21" />
<input type="radio" class="radio-box-semi" name="attr_hit_det_automatic_semi" value="4" title="-32" />
<input type="radio" class="radio-box-semi" name="attr_hit_det_automatic_semi" value="5" title="-44" />
<input type="radio" class="radio-box-semi" name="attr_hit_det_automatic_semi" value="6" title="-57" />
<input type="radio" class="radio-box-semi" name="attr_hit_det_automatic_semi" value="7" title="-73" />
<input type="radio" class="radio-box-semi" name="attr_hit_det_automatic_semi" value="8" title="-96" />
<input type="radio" class="radio-box-semi" name="attr_hit_det_automatic_semi" value="9" title="-130" />
<input type="radio" class="radio-box-semi" name="attr_hit_det_automatic_semi" value="10" title="-180" />
</div>
<!-- TOTAL -->
<div class="hit-det-total">
<span>
<span class="general-column-header" title="Does not include range modifiers.">TOTAL</span>
<input type="text" name="attr_hit_det_total" class="larger" value="0" title="@{hit_det_total}" readonly="">
</span>
</div>
</div>
<!-- Weapons -->
<section>
<div class="weapons-grid">
<span class="span-2">
<button type="roll" class="text-roll" name="roll_damage" value="&{template:general} {{title=@{character_name} - Damage Roll}} {{subtitle=Hit Location/Damage}} {{roll_damage=[[1]]}} {{roll=[[1d100]]}} {{roll2=[[1d10]]}} {{roll3=[[1d10]]}}" title="%{repeating_Weapons_$X_damage}"><span>Roll Hit Location/Damage</span></button>
</span>
<span></span>
<span class="weapon-range-modifier-column">Range Modifier</span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span class="weapon-column">WEAPON</span>
<span class="weapon-pwv-column" title="Projectile Weapon Value">PWV</span>
<span class="weapon-range-modifier-subcolumn" title="Point Blank Range">PB</span>
<span class="weapon-range-modifier-subcolumn" title="Short Range">S</span>
<span class="weapon-range-modifier-subcolumn" title="Medium Range">M</span>
<span class="weapon-range-modifier-subcolumn" title="Long Range">L</span>
<span class="weapon-speed-column" title="Weapon Speed">WS</span>
<span class="weapon-rate-column" title="Max # of shots fired per phase">Rate</span>
<span class="weapon-rate-column">Ammo</span>
<span class="weapon-base-speed-column">BASE SPEED</span>
<span class="weapon-base-accuracy-column">BASE ACCURACY</span>
<span title="Hit Determination modifiers(see above)">HIT DET</span>
</div>
<fieldset class="repeating_Weapons">
<div class="weapons-grid">
<button type="roll" class="d100-roll" name="roll_attack" value="@{attack}" title="%{repeating_Weapons_$X_attack}"></button>
<button type="action" class="hidden" name="act_attack-button"></button>
<input type="text" class="hidden" name="attr_attack" value="" />
<input type="text" name="attr_Weapon" title="@{repeating_Weapons_$X_Weapon}"/>
<input type="text" name="attr_PWV" value="0" title="@{repeating_Weapons_$X_PWV}"/>
<input type="text" name="attr_RangeModifierPB" value="0" title="@{repeating_Weapons_$X_RangeModifierPB} | e.g. '0', '50', '+50', '-50', 'X', etc." />
<input type="text" name="attr_RangeModifierS" value="0" title="@{repeating_Weapons_$X_RangeModifierS} | e.g. '0', '50', '+50', '-50', 'X', etc." />
<input type="text" name="attr_RangeModifierM" value="0" title="@{repeating_Weapons_$X_RangeModifierM} | e.g. '0', '50', '+50', '-50', 'X', etc." />
<input type="text" name="attr_RangeModifierL" value="0" title="@{repeating_Weapons_$X_RangeModifierL} | e.g. '0', '50', '+50', '-50', 'X', etc." class="input-larger" />
<select name="attr_WeaponSpeedModifier" title="@{repeating_Weapons_$X_WeaponSpeedModifier}">
<option value="-10" title="very slow">VS</option>
<option value="-5" title="slow">S</option>
<option value="-3" title="below average">BA</option>
<option value="0" title="average">A</option>
<option value="5" title="fast">F</option>
<option value="10" title="very fast">VF</option>
</select>
<input type="text" class="input-small" name="attr_Rate" value="1" title="@{repeating_Weapons_$X_Rate}" />
<span>
<input type="text" class="input-small" name="attr_ammo" value="0" title="@{repeating_Weapons_$X_ammo}" />
<span class="division">/</span>
<input type="text" class="input-small" name="attr_ammo_max" value="0" title="@{repeating_Weapons_$X_ammo|max}" />
</span>
<input type="text" name="attr_BaseSpeed" value="0" title="@{repeating_Weapons_$X_BaseSpeed | @{WeaponSpeedModifier} + @{Offense}}" readonly/>
<input type="text" name="attr_BaseAccuracy" value="0" title="@{repeating_Weapons_$X_BaseAccuracy | @{PWV} + @{Offense}" readonly/>
<input type="text" name="attr_hit_det" value="0" title="@{repeating_Weapons_$X_hit_det}" class="input-larger" readonly/>
</div>
</fieldset>
</section>
</div>
<div class="three-column-fit">
<div>
<div class="section-title">EQUIPMENT CARRIED</div>
<div class="two-column-grid">
<div class="general-column-header">
<span>ITEM</span>
</div>
<div class="general-column-header">
<span>LOCATION</span>
</div>
</div>
<fieldset class="repeating_EquipmentCarried">
<div class="two-column-grid">
<div>
<input type="text" class="full-width-element" name="attr_Item" title="@{repeating_EquipmentCarried_$X_Item}"/>
</div>
<div>
<input type="text" class="full-width-element" name="attr_Location" title="@{repeating_EquipmentCarried_$X_Location}"/>
</div>
</div>
</fieldset>
</div>
<div>
<div class="section-title">OTHER ITEMS CARRIED</div>
<div class="two-column-grid">
<div class="general-column-header">
<span>ITEM</span>
</div>
<div class="general-column-header">
<span>LOCATION</span>
</div>
</div>
<fieldset class="repeating_OtherItemsCarried">
<div class="two-column-grid">
<div>
<input type="text" class="full-width-element" name="attr_Item" title="@{repeating_OtherItemsCarried_$X_Item}"/>
</div>
<div>
<input type="text" class="full-width-element" name="attr_Location" title="@{repeating_OtherItemsCarried_$X_Location}"/>
</div>
</div>
</fieldset>
</div>
<div>
<div class="section-title">MONEY & VALUABLES</div>
<div class="two-column-grid">
<div class="general-column-header">
<span>AMOUNT OR ITEM</span>
</div>
<div class="general-column-header">
<span>LOCATION</span>
</div>
</div>
<fieldset class="repeating_MoneyAndValuables">
<div class="two-column-grid">
<div>
<input type="text" class="full-width-element" name="attr_Item" title="@{repeating_MoneyAndValuables_$X_Item}"/>
</div>
<div>
<input type="text" class="full-width-element" name="attr_Location" title="@{repeating_MoneyAndValuables_$X_Location}"/>
</div>
</div>
</fieldset>
</div>
</div>
</div>
<div class="tab-content tab4">
<div>
<div class="section-title">AREAS OF KNOWLEDGE</div>
<div class="aok-grid">
<span class="span-all">
<span>
<span class="general-column-header">Superior AOK's</span>
<input type="text" class="input-med" name="attr_AreaOfKnowledgeKnown" title="@{AreaOfKnowledgeKnown} | ceil(@{Knowledge}/10)" value="0" readonly/>
</span>
<span class="right-aligned">
<span class="general-column-header">Non-Superior Score</span>
<input type="text" class="input-med" name="attr_AreaOfKnowledgeDefaultValue" title="@{AreaOfKnowledgeDefaultValue} | round(@{Knowledge}/2)" value="0" readonly />
</span>
</span>
<span></span>
<span class="general-column-header aok-col-1-heading" title="Area of Knowledge">AOK</span>
<span class="general-column-header" title="Superior AOK">SUP</span>
<span class="general-column-header">VALUE</span>
</div>
<fieldset class="repeating_AreasOfKnowledge">
<div class="aok-grid">
<button type="roll" class="d100-roll" name="roll_aok" value="&{template:general} {{title=@{character_name} - AoK Roll}} {{subtitle=@{AreasOfKnowledgeName}}} {{roll_vs_target=[[1]]}} {{roll=[[1d100]]}} {{target=[[ @{AreaOfKnowledgeValue} [aok] + (?{Additional Modifier|0} [mod]) ]]}} {{@{AreasOfKnowledgeName}=[[ @{AreaOfKnowledgeValue} ]]}} {{Roll Mod=[[?{Additional Modifier|0}]]}}" title="%{repeating_AreasOfKnowledge_$X_aok}"></button>
<div class="aok-col-1">
<input type="text" list="areas-of-knowledge" name="attr_AreasOfKnowledgeName" id="areasInput">
<datalist id="areas-of-knowledge">
<option value="Agriculture"></option>
<option value="Animal Science"></option>
<option value="Architecture"></option>
<option value="Arts & Crafts"></option>
<option value="Astronomy/Space Science"></option>
<option value="Biology/Biochemistry"></option>
<option value="Botany"></option>
<option value="Chemistry"></option>
<option value="Computer Science"></option>
<option value="Ecology/Earth Sciences"></option>
<option value="Economics/Finance"></option>
<option value="Education/Indoctrination"></option>
<option value="Engineering, Aeronautical"></option>
<option value="Engineering, Construction/Civil"></option>
<option value="Engineering, Electrical"></option>
<option value="Engineering, Hydraulic"></option>
<option value="Engineering, Industrial"></option>
<option value="Engineering, Mechanical"></option>
<option value="Engineering, Transportation"></option>
<option value="Fine Arts"></option>
<option value="Geography"></option>
<option value="Geology"></option>
<option value="Home Economics"></option>
<option value="Law"></option>
<option value="Literature"></option>
<option value="Mathematics/Accounting"></option>
<option value="Medicine/Physiology"></option>
<option value="Metallurgy"></option>
<option value="Military Science/Weaponry"></option>
<option value="Photography"></option>
<option value="Physical Education"></option>
<option value="Physics"></option>
<option value="Political Science/Ideology"></option>
<option value="Psychology"></option>
<option value="Religion"></option>
<option value="Social Sciences"></option>
<option value="World History/Current Affairs"></option>
</datalist>
<!-- deprecated attribute due to attribute's name-->
<select class="hidden" name="attr_WeaponSpeedModifier">
<option>Agriculture</option>
<option>Animal Science</option>
<option>Architecture</option>
<option>Arts & Crafts</option>
<option>Astronomy/Space Science</option>
<option>Biology/Biochemistry</option>
<option>Botany</option>
<option>Chemistry</option>
<option>Computer Science</option>
<option>Ecology/Earth Sciences</option>
<option>Economics/Finance</option>
<option>Education/Indoctrination</option>
<option>Engineering, Aeronautical</option>
<option>Engineering, Construction/Civil</option>
<option>Engineering, Electrical</option>
<option>Engineering, Hydraulic</option>
<option>Engineering, Industrial</option>
<option>Engineering, Mechanical</option>
<option>Engineering, Transportation</option>
<option>Fine Arts</option>
<option>Geography</option>
<option>Geology</option>
<option>Home Economics</option>
<option>Law</option>
<option>Literature</option>
<option>Mathematics/Accounting</option>
<option>Medicine/Physiology</option>
<option>Metallurgy</option>
<option>Military Science/Weaponry</option>
<option>Photography</option>
<option>Physical Education</option>
<option>Physics</option>
<option>Political Science/Ideology</option>
<option>Psychology</option>
<option>Religion</option>
<option>Social Sciences</option>
<option>World History/Current Affairs</option>
</select>
</div>
<input type="checkbox" name="attr_AreasOfKnowledgeSuperior" value="1" title="@{repeating_AreasOfKnowledge_$X_AreasOfKnowledgeSuperior}" />
<input type="text" class="input-med" name="attr_AreaOfKnowledgeValue" title="@{repeating_AreasOfKnowledge_$X_AreaOfKnowledgeValue}"/>
</div>
</fieldset>
</div>
</div>
<div class="tab-content tab5">
<div class="three-column-fit">
<div>
<div class="section-title">FRIENDS</div>
<fieldset class="repeating_Friends">
<button type="roll" class="text-roll bubble-image" name="roll_info" title="%{info}" value="&{template:general} {{title=@{character_name} - Friends}} {{subtitle=@{name}}} {{description=@{description}}}"></button>
<input type="text" class="full-width-element" name="attr_Name" title="@{repeating_Friends_$X_Name}" />
<textarea name="attr_description" title="@{repeating_Friends_$X_description}"></textarea>
</fieldset>
</div>
<div>
<div class="section-title">CONTACTS</div>
<fieldset class="repeating_Contacts">
<button type="roll" class="text-roll bubble-image" name="roll_info" title="%{info}" value="&{template:general} {{title=@{character_name} - Contacts}} {{subtitle=@{name}}} {{description=@{description}}}"></button>
<input type="text" class="full-width-element" name="attr_Name" title="@{repeating_Contacts_$X_Name}" />
<textarea name="attr_description" title="@{repeating_Contacts_$X_description}"></textarea>
</fieldset>
</div>
<div>
<div class="section-title">ENEMIES</div>
<fieldset class="repeating_Enemies">
<button type="roll" class="text-roll bubble-image" name="roll_info" title="%{info}" value="&{template:general} {{title=@{character_name} - Enemies}} {{subtitle=@{name}}} {{description=@{description}}}"></button>
<input type="text" class="full-width-element" name="attr_Name" title="@{repeating_Enemies_$X_Name}" />
<textarea name="attr_description" title="@{repeating_Enemies_$X_description}"></textarea>
</fieldset>
</div>
</div>
</div>
<div class="tab-content tab6">
<div class="three-column-fit">
<div>
<div class="section-title">RESIDENCE</div>
<textarea class="text-area residence-text-area" name="attr_Residence" title="@{Residence}"></textarea>
</div>
<div>
<div class="section-title">COVER</div>
<textarea class="text-area cover-text-area" name="attr_Cover" title="@{Cover}"></textarea>
</div>
<div>
<div class="section-title">BRIEF PERSONAL HISTORY</div>
<textarea class="text-area history-text-area" name="attr_BriefPersonalHistory" title="@{BriefPersonalHistory}"></textarea>
</div>
<div class="notes-col">
<div class="section-title">NOTES</div>
<textarea class="text-area notes-text-area" name="attr_Notes" title="@{Notes}"></textarea>
</div>
<div>
<div class="section-title">MISCELLANEOUS</div>
<fieldset class="repeating_miscellaneous">
<button type="roll" class="text-roll bubble-image" name="roll_info" title="%{info}" value="&{template:general} {{title=@{character_name} - Misc.}} {{subtitle=@{name}}} {{description=@{description}}}"></button>
<input type="text" class="full-width-element" name="attr_Name" title="@{repeating_miscellaneous_$X_Name}" />
<textarea name="attr_description" title="@{repeating_miscellaneous_$X_description}"></textarea>
</fieldset>
</div>
</div>
</div>
<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.3 10/22/25'</strong>
<li>Further rounding refinements. Upon further review, only the Superior AOK count should be rounded up using ceiling.</li>
</ol>
<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">
{{#title}}<div class="sheet-heading">{{title}}</div>{{/title}}
{{#subtitle}}<div class="sheet-subheading">{{subtitle}}</div>{{/subtitle}}
<div class="sheet-body">
{{#roll_attack}}
{{#roll}}
<div class="sheet-row-full">
<strong>Roll = </strong>{{roll}}<span> vs </span>{{target}}
</div>
<!-- auto hit 5 or less? -->
{{#rollLess() roll 6}}
<div class="sheet-row-full">
<span class="sheet-success">Auto Hit!</span>
</div>
{{/rollLess() roll 6}}
<!-- otherwise check for normal success/fail -->
{{#^rollLess() roll 6}}
<!-- auto fail 95+ -->
{{#rollGreater() roll 96}}
<div class="sheet-row-full">
<span class="sheet-fail">Auto Miss...</span>
</div>
{{/rollGreater() roll 96}}
<!-- otherwise check for normal success/fail -->
{{#^rollGreater() roll 96}}
<!-- check for misfire -->
{{#rollTotal() roll 99}}
<div class="sheet-row-full">
<span class="sheet-success">Weapon Misfires!</span>
</div>
{{/rollTotal() roll 99}}
<!-- otherwise check for normal success/fail -->
{{#^rollTotal() roll 99}}
<!-- check for jam -->
{{#rollTotal() roll 100}}
<div class="sheet-row-full">
<span class="sheet-success">Weapon Jams!</span>
</div>
{{/rollTotal() roll 100}}
<!-- otherwise check for normal success/fail -->
{{#^rollTotal() roll 100}}
<!-- hit weapon? -->
{{#rollTotal() roll target}}
<div class="sheet-row-full">
<span class="sheet-success">Hit Targets Weapon!</span>
</div>
{{/rollTotal() roll target}}
<!-- otherwise check for normal success/fail -->
{{#^rollTotal() roll target}}
{{#rollLess() roll target}}
<div class="sheet-row-full">
<span class="sheet-success">Hit!</span>
</div>
{{/rollLess() roll target}}
{{#^rollLess() roll target}}
<div class="sheet-row-full">
<span class="sheet-fail">Miss...</span>
</div>
{{/^rollLess() roll target}}
{{/^rollTotal() roll target}}
{{/^rollTotal() roll 100}}
{{/^rollTotal() roll 99}}
{{/^rollGreater() roll 96}}
{{/^rollLess() roll 6}}
{{/roll}}
{{#base_accuracy}}
<div class="sheet-row">
<span class="sheet-key">Base Accuracy</span>
<span class="sheet-value">{{base_accuracy}}</span>
</div>
{{/base_accuracy}}
{{#range_mod}}
<div class="sheet-row">
<span class="sheet-key">Range Mod{{#targets_range}} ({{targets_range}}){{/targets_range}}</span>
<span class="sheet-value">{{range_mod}}</span>
</div>
{{/range_mod}}
{{#hit_det_mod}}
<div class="sheet-row">
<span class="sheet-key">Hit Det Mod</span>
<span class="sheet-value">{{hit_det_mod}}</span>
</div>
{{/hit_det_mod}}
{{#roll_mod}}
<div class="sheet-row">
<span class="sheet-key">Roll Mod</span>
<span class="sheet-value">{{roll_mod}}</span>
</div>
{{/roll_mod}}
{{#ammo}}
<div class="sheet-row">
<span class="sheet-key">Ammo</span>
<strong class="sheet-value">{{ammo}}/{{ammo_max}}</strong>
</div>
{{/ammo}}
<!-- used for invalid range note -->
{{#text_center}}
<div class="sheet-row-full">
<span>{{text_center}}</span>
</div>
{{/text_center}}
<!-- show damage roll button -->
{{#roll}}
<!-- auto hit -->
{{#rollLess() roll 6}}
<div class="sheet-row-full">
<span title="Roll Hit location, Type of Wound and Seriousness.">{{#damage_button}}{{damage_button}}{{/damage_button}}</span>
</div>
{{/rollLess() roll 6}}
{{#^rollLess() roll 6}}
<!-- regular hit -->
{{#rollLess() roll target}}
<div class="sheet-row-full">
<span title="Roll Hit location, Type of Wound and Seriousness.">{{#damage_button}}{{damage_button}}{{/damage_button}}</span>
</div>
{{/rollLess() roll target}}
{{/^rollLess() roll 6}}
{{/roll}}
{{/roll_attack}}
{{#roll_damage}}
<!-- Location d100 -->
{{#roll}}
<div class="sheet-row-full">
<strong>Hit Location </strong>{{roll}}<span>
</div>
<div class="sheet-row-full">
{{#rollBetween() roll 1 9}}
<span class="sheet-damage">Head/Neck</span>
{{/rollBetween() roll 1 9}}
{{#rollBetween() roll 10 16}}
<span class="sheet-damage">Right Arm</span>
{{/rollBetween() roll 10 16}}
{{#rollBetween() roll 17 18}}
<span class="sheet-damage">Right Hand</span>
{{/rollBetween() roll 17 18}}
{{#rollBetween() roll 19 25}}
<span class="sheet-damage">Left Arm</span>
{{/rollBetween() roll 19 25}}
{{#rollBetween() roll 26 27}}
<span class="sheet-damage">Left Hand</span>
{{/rollBetween() roll 26 27}}
{{#rollBetween() roll 28 46}}
<span class="sheet-damage">Chest or Upper Back</span>
{{/rollBetween() roll 28 46}}
{{#rollBetween() roll 47 64}}
<span class="sheet-damage">Abdomen or Lower Back</span>
{{/rollBetween() roll 47 64}}
{{#rollBetween() roll 65 79}}
<span class="sheet-damage">Right Leg</span>
{{/rollBetween() roll 65 79}}
{{#rollBetween() roll 80 82}}
<span class="sheet-damage">Right Foot</span>
{{/rollBetween() roll 80 82}}
{{#rollBetween() roll 83 97}}
<span class="sheet-damage">Left Leg</span>
{{/rollBetween() roll 83 97}}
{{#rollBetween() roll 98 100}}
<span class="sheet-damage">Left Foot</span>
{{/rollBetween() roll 98 100}}
</div>
{{/roll}}
<!-- Type d10 -->
{{#roll2}}
<div class="sheet-row-full">
<strong>Type of Wound </strong>{{roll2}}<span>
</div>
<div class="sheet-row-full">
<strong>Seriousness </strong>{{roll3}}<span>
</div>
<div class="sheet-row-full">
{{#rollBetween() roll2 1 2}}
{{#rollBetween() roll3 1 5}}
<span class="sheet-damage">Light Abrasion (1pt)</span>
{{/rollBetween() roll3 1 5}}
{{#rollBetween() roll3 6 10}}
<span class="sheet-damage">Serious Abrasion (2pt)</span>
{{/rollBetween() roll3 6 10}}
{{/rollBetween() roll2 1 2}}
{{#rollBetween() roll2 3 4}}
{{#rollBetween() roll3 1 5}}
<span class="sheet-damage">Light Incision (3pt)</span>
{{/rollBetween() roll3 1 5}}
{{#rollBetween() roll3 6 10}}
<span class="sheet-damage">Serious Incision (4pt)</span>
{{/rollBetween() roll3 6 10}}
{{/rollBetween() roll2 3 4}}
{{#rollBetween() roll2 5 6}}
{{#rollBetween() roll3 1 5}}
<span class="sheet-damage">Light Laceration (5pt)</span>
{{/rollBetween() roll3 1 5}}
{{#rollBetween() roll3 6 10}}
<span class="sheet-damage">Serious Laceration (6pt)</span>
{{/rollBetween() roll3 6 10}}
{{/rollBetween() roll2 5 6}}
{{#rollBetween() roll2 7 8}}
{{#rollBetween() roll3 1 5}}
<span class="sheet-damage">Light Puncture (7pt)</span>
{{/rollBetween() roll3 1 5}}
{{#rollBetween() roll3 6 10}}
<span class="sheet-damage">Serious Puncture (8pt)</span>
{{/rollBetween() roll3 6 10}}
{{/rollBetween() roll2 7 8}}
{{#rollTotal() roll2 9}}
{{#rollBetween() roll3 1 5}}
<span class="sheet-damage">Light Fracture (9pt)</span>
{{/rollBetween() roll3 1 5}}
{{#rollBetween() roll3 6 10}}
<span class="sheet-damage">Serious Fracture (10pt)</span>
{{/rollBetween() roll3 6 10}}
{{/rollTotal() roll2 9}}
{{#rollTotal() roll2 10}}
{{#rollBetween() roll3 1 5}}
<span class="sheet-damage">Light Internal Damage (11pt)</span>
{{/rollBetween() roll3 1 5}}
{{#rollBetween() roll3 6 10}}
<span class="sheet-damage">Serious Internal Damage (12pt)</span>
{{/rollBetween() roll3 6 10}}
{{/rollTotal() roll2 10}}
</div>
{{/roll2}}
{{/roll_damage}}
{{#roll_vs_target}}
{{#roll}}
<div class="sheet-row-full">
<strong>Roll = </strong>{{roll}}<span> vs </span>{{target}}
</div>
{{/roll}}
{{#target}}
{{#rollLess() roll target}}
<div class="sheet-row-full">
<span class="sheet-success">Success!</span>
</div>
{{/rollLess() roll target}}
{{#^rollLess() roll target}}
<div class="sheet-row-full">
<span class="sheet-fail">Fail...</span>
</div>
{{/^rollLess() roll target}}
{{/target}}
{{/roll_vs_target}}
{{#description}}
<div class="sheet-row-full sheet-left">
<span>{{description}}</span>
</div>
{{/description}}
{{#image}}
<div class="sheet-row-full">
<span class="sheet-image">
{{image}}
</span>
</div>
{{/image}}
{{#allprops() ammo ammo_max base_accuracy damage_button description footer hit_det_mod image range_mod roll roll2 roll3 roll_attack roll_damage roll_mod roll_vs_target subtitle target targets_range text_center title}}
<div class="sheet-row">
<span class="sheet-key">{{key}}</span>
<span class="sheet-value">{{value}}</span>
</div>
{{/allprops() ammo ammo_max base_accuracy damage_button description footer hit_det_mod image range_mod roll roll2 roll3 roll_attack roll_damage roll_mod roll_vs_target subtitle target targets_range text_center title}}
</div>
<div class="sheet-row-full sheet-footer">
{{#footer}}
<span>{{footer}}</span>
{{/footer}}
</div>
</rolltemplate>
<script type="text/worker">
// GLOBAL
// concatenates repeating attribute names (repeating section, rowID, attribute)
const section_attribute = (section, id, field) => `repeating_${section}_${id}_${field}`;
// use regex to check for non-integers
const integerRegex = /^[+-]?\d+$/;
const tempLossesCalc = () => {
getAttrs(
[
'physicalstrength',
'physicalstrength_loss',
'charm',
'charm_loss',
'willpower',
'willpower_loss',
'courage',
'courage_loss',
'knowledge',
'knowledge_loss',
'coordination',
'coordination_loss',
],
(v) => {
const output = {};
const valPhysicalStrength = +v.physicalstrength || 0;
const valPhysicalStrength_loss = +v.physicalstrength_loss || 0;
const valCharm = +v.charm || 0;
const valCharm_loss = +v.charm_loss || 0;
const valWillpower = +v.willpower || 0;
const valWillpower_loss = +v.willpower_loss || 0;
const valCourage = +v.courage || 0;
const valCourage_loss = +v.courage_loss || 0;
const valKnowledge = +v.knowledge || 0;
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));
setAttrs(output);
},
);
};
const traitCalc = () => {
getAttrs(
[
'physicalstrength',
'physicalstrength_loss',
'physicalstrength_temp',
'charm',
'charm_loss',
'charm_temp',
'willpower',
'willpower_loss',
'willpower_temp',
'courage',
'courage_loss',
'courage_temp',
'knowledge',
'knowledge_loss',
'knowledge_temp',
'coordination',
'coordination_loss',
'coordination_temp',
],
(v) => {
const output = {};
const physicalstrength_loss = +v.physicalstrength_loss || 0;
const physicalstrength_temp = +v.physicalstrength_temp || 0;
const charm_loss = +v.charm_loss || 0;
const charm_temp = +v.charm_temp || 0;
const willpower_loss = +v.willpower_loss || 0;
const willpower_temp = +v.willpower_temp || 0;
const courage_loss = +v.courage_loss || 0;
const courage_temp = +v.courage_temp || 0;
const knowledge_loss = +v.knowledge_loss || 0;
const knowledge_temp = +v.knowledge_temp || 0;
const coordination_loss = +v.coordination_loss || 0;
const coordination_temp = +v.coordination_temp || 0;
// only use temp value if a loss has been entered
const physicalstrength = physicalstrength_loss > 0 ? physicalstrength_temp : +v.physicalstrength || 0;
const charm = charm_loss > 0 ? charm_temp : +v.charm || 0;
const willpower = willpower_loss > 0 ? willpower_temp : +v.willpower || 0;
const courage = courage_loss > 0 ? courage_temp : +v.courage || 0;
const knowledge = knowledge_loss > 0 ? knowledge_temp : +v.knowledge || 0;
const coordination = coordination_loss > 0 ? coordination_temp : +v.coordination || 0;
// secondary calcs
const offense = Math.round((courage + coordination) / 2);
// console.log(`Change detected: offense:${offense}`);
output.offense = offense;
const deception = Math.round((charm + courage) / 2);
// console.log(`Change detected: deception:${deception}`);
output.deception = deception;
const evasion = Math.round((coordination + charm) / 2);
// console.log(`Change detected: evasion:${evasion}`);
output.evasion = evasion;
const deactivation = Math.round((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);
// console.log(`Change detected: lifelevel_max:${lifelevelMax}`);
output.lifelevel_max = lifelevelMax;
// tertiary calcs
const handtohandcombatvalue = physicalstrength + evasion;
// console.log(`Change detected: handtohandcombatvalue:${handtohandcombatvalue}`);
output.handtohandcombatvalue = handtohandcombatvalue;
const wrestlingvalue = physicalstrength + offense;
// console.log(`Change detected: wrestlingvalue:${wrestlingvalue}`);
output.wrestlingvalue = wrestlingvalue;
const surprisevalue = deception + evasion;
// console.log(`Change detected: surprisevalue:${surprisevalue}`);
output.surprisevalue = surprisevalue;
// AOK
const AOKdefault = Math.round(knowledge / 2);
// console.log(`Change detected: AOKdefault:${AOKdefault}`);
output.AreaOfKnowledgeDefaultValue = AOKdefault;
const AOKknown = Math.ceil(knowledge / 10);
// console.log(`Change detected: AOKknown:${AOKknown}`);
output.AreaOfKnowledgeKnown = AOKknown;
setAttrs(output);
},
);
};
// temp losses
on(
'change:physicalstrength change:physicalstrength_loss change:charm change:charm_loss change:willpower change:willpower_loss change:courage change:courage_loss change:knowledge change:knowledge_loss change:coordination change:coordination_loss',
(eventInfo) => {
// console.log(`Change detected: ${eventInfo.sourceAttribute}`);
tempLossesCalc();
},
);
// trait calcs
on(
'change:physicalstrength change:physicalstrength_temp change:charm change:charm_temp change:willpower change:willpower_temp change:courage change:courage_temp change:knowledge change:knowledge_temp change:coordination change:coordination_temp',
(eventInfo) => {
// console.log(`Change detected: ${eventInfo.sourceAttribute}`);
traitCalc();
},
);
// weapon calcs
on('change:repeating_weapons', (eventInfo) => {
// console.log(`Change detected: ${eventInfo.sourceAttribute}`);
const id = eventInfo.sourceAttribute.split('_')[2];
getAttrs(['offense', 'hit_det_total', `repeating_weapons_${id}_weaponspeedmodifier`, `repeating_weapons_${id}_pwv`], (v) => {
const output = {};
const offense = +v.offense || 0;
const weaponSpeed = +v[`repeating_weapons_${id}_weaponspeedmodifier`] || 0;
const PWV = +v[`repeating_weapons_${id}_pwv`] || 0;
const hitDetTotal = v.hit_det_total || 0;
output[`repeating_weapons_${id}_basespeed`] = offense + weaponSpeed;
output[`repeating_weapons_${id}_baseaccuracy`] = offense + PWV;
output[`repeating_weapons_${id}_hit_det`] = hitDetTotal;
setAttrs(output, {silent: true});
});
});
on('change:offense', (eventInfo) => {
// console.log(`Change detected: ${eventInfo.sourceAttribute}`);
getSectionIDs('repeating_weapons', (idArray) => {
const output = {};
const fields = ['offense'];
_.each(idArray, (id) => {
fields.push(section_attribute('weapons', id, 'weaponspeedmodifier'));
fields.push(section_attribute('weapons', id, 'pwv'));
});
getAttrs(fields, (v) => {
idArray.forEach((id) => {
const offense = +v.offense || 0;
const weaponSpeed = +v[section_attribute('weapons', id, 'weaponspeedmodifier')];
const PWV = +v[section_attribute('weapons', id, 'pwv')];
output[section_attribute('weapons', id, 'basespeed')] = offense + weaponSpeed;
output[section_attribute('weapons', id, 'baseaccuracy')] = offense + PWV;
});
setAttrs(output, {silent: true});
});
});
});
// first shot determination chart ie net speed calc
on(
'change:offense change:net_speed_drawing change:net_speed_aiming change:net_speed_surprise_factor change:net_speed_weapon_speed change:net_speed_shooter_movement clicked:netspeedreset',
(eventInfo) => {
// console.log(`Change detected: ${eventInfo.sourceAttribute}`);
getAttrs(['offense', 'net_speed_drawing', 'net_speed_aiming', 'net_speed_surprise_factor', 'net_speed_weapon_speed', 'net_speed_shooter_movement'], (v) => {
const output = {};
let actionButton = eventInfo.triggerName;
actionButton = actionButton.replace('clicked:', '');
const offense = +v.offense || 0;
const net_speed_drawing = +v.net_speed_drawing || 0;
const net_speed_aiming = +v.net_speed_aiming || 0;
const net_speed_surprise_factor = +v.net_speed_surprise_factor || 0;
const net_speed_weapon_speed = +v.net_speed_weapon_speed || 0;
const net_speed_shooter_movement = +v.net_speed_shooter_movement || 0;
if (actionButton !== 'netspeedreset') {
output.net_speed_total = offense + net_speed_drawing + net_speed_aiming + net_speed_surprise_factor + net_speed_weapon_speed + net_speed_shooter_movement;
} else {
// console.log(`Change detected: Reset`);
output.net_speed_drawing = '';
output.net_speed_aiming = '';
output.net_speed_surprise_factor = '';
output.net_speed_weapon_speed = '';
output.net_speed_shooter_movement = '';
output.net_speed_total = offense;
}
setAttrs(output, {silent: true});
});
},
);
// hit determination chart
// movement of shooter
on('change:hit_det_move_of_shooter change:hit_det_shooter_speed_multiplier clicked:hitDetResetAll clicked:hitDetResetMovementOfShooter', (eventInfo) => {
// console.log(`Change detected: ${eventInfo.sourceAttribute}`);
getAttrs(['hit_det_move_of_shooter', 'hit_det_shooter_speed_multiplier'], (v) => {
const output = {};
let actionButton = eventInfo.triggerName;
actionButton = actionButton.replace('clicked:', '');
if (actionButton !== 'hitdetresetmovementofshooter' && actionButton !== 'hitdetresetall') {
let moveShooter = +v.hit_det_move_of_shooter || 0;
let speedMult = 0;
if (moveShooter === 7) {
speedMult = +Math.max(0, v.hit_det_shooter_speed_multiplier || 0);
}
const moveShooterValues = {
0: 0, // Stationary
1: 5, // Stationary and prone
2: -5, // Walking
3: -10, // Wading
4: -10, // Crawling
5: -30, // Running and dodging
6: -20, // Running
7: -10, // Vehicular Movement
8: -20, // Drops Prone
};
moveShooter = moveShooterValues[moveShooter] || 0;
output.hit_det_move_of_shooter_total = moveShooter - speedMult;
output.hit_det_shooter_speed_multiplier = speedMult;
} else {
// console.log(`Change detected: Reset`);
output.hit_det_move_of_shooter_total = 0;
output.hit_det_move_of_shooter = 0;
output.hit_det_shooter_speed_multiplier = 0;
}
setAttrs(output);
});
});
// movement of target
on('change:hit_det_move_of_target change:hit_det_target_speed_multiplier clicked:hitDetResetAll clicked:hitDetResetMovementOfTarget', (eventInfo) => {
// console.log(`Change detected: ${eventInfo.sourceAttribute}`);
getAttrs(['hit_det_move_of_target', 'hit_det_target_speed_multiplier'], (v) => {
const output = {};
let actionButton = eventInfo.triggerName;
actionButton = actionButton.replace('clicked:', '');
if (actionButton !== 'hitdetresetmovementoftarget' && actionButton !== 'hitdetresetall') {
let moveTarget = +v.hit_det_move_of_target || 0;
let speedMult = 0;
if (moveTarget === 6) {
speedMult = +Math.max(0, v.hit_det_target_speed_multiplier || 0);
}
const moveTargetValues = {
0: 0, // Stationary
1: -5, // Walking
2: -5, // Wading
3: -5, // Crawling
4: -10, // Running
5: -20, // Running and dodging
6: -10, // Vehicular Movement
7: -5, // Drops Prone
};
moveTarget = moveTargetValues[moveTarget] || 0;
output.hit_det_move_of_target_total = moveTarget - speedMult;
output.hit_det_target_speed_multiplier = speedMult;
} else {
// console.log(`Change detected: Reset`);
output.hit_det_move_of_target_total = 0;
output.hit_det_move_of_target = 0;
output.hit_det_target_speed_multiplier = 0;
}
setAttrs(output);
});
});
// wounds
on('change:hit_det_wounds clicked:hitDetResetAll clicked:hitDetResetWounds', (eventInfo) => {
// console.log(`Change detected: ${eventInfo.sourceAttribute}`);
getAttrs(['hit_det_wounds'], (v) => {
const output = {};
let actionButton = eventInfo.triggerName;
actionButton = actionButton.replace('clicked:', '');
if (actionButton !== 'hitdetresetwounds' && actionButton !== 'hitdetresetall') {
const valWounds = +v.hit_det_wounds || 0;
output.hit_det_wounds_total = valWounds;
} else {
// console.log(`Change detected: Reset`);
output.hit_det_wounds_total = 0;
output.hit_det_wounds = 0;
}
setAttrs(output);
});
});
// miscellaneous
on(
'change:hit_det_misc_weapon_at_rest change:hit_det_misc_2nd_consecutive change:hit_det_misc_additional_consecutive change:hit_det_misc_additional_consecutive_multiplier change:hit_det_misc_wrong_hand change:hit_det_misc_wounded_gun_hand change:hit_det_misc_wounded_gun_hand_multiplier change:hit_det_misc_two_weapons change:hit_det_misc_hip_shooting change:hit_det_misc_obscured change:hit_det_misc_gyrojet change:hit_det_misc_total clicked:hitDetResetAll clicked:hitDetResetMisc',
(eventInfo) => {
// console.log(`Change detected: ${eventInfo.sourceAttribute}`);
getAttrs(
[
'hit_det_misc_weapon_at_rest',
'hit_det_misc_2nd_consecutive',
'hit_det_misc_additional_consecutive',
'hit_det_misc_additional_consecutive_multiplier',
'hit_det_misc_wrong_hand',
'hit_det_misc_wounded_gun_hand',
'hit_det_misc_wounded_gun_hand_multiplier',
'hit_det_misc_two_weapons',
'hit_det_misc_hip_shooting',
'hit_det_misc_obscured',
'hit_det_misc_gyrojet',
'hit_det_misc_total',
],
(v) => {
const output = {};
let actionButton = eventInfo.triggerName;
actionButton = actionButton.replace('clicked:', '');
if (actionButton !== 'hitdetresetmisc' && actionButton !== 'hitdetresetall') {
const valWeapon_at_rest = +v.hit_det_misc_weapon_at_rest || 0;
const val2nd_consecutive = +v.hit_det_misc_2nd_consecutive || 0;
const valAdditional_consecutive = +v.hit_det_misc_additional_consecutive || 0;
const valAdditional_consecutive_multiplier = +v.hit_det_misc_additional_consecutive_multiplier || 0;
const valWrong_hand = +v.hit_det_misc_wrong_hand || 0;
const valWounded_gun_hand = +v.hit_det_misc_wounded_gun_hand || 0;
const valWounded_gun_hand_multiplier = +v.hit_det_misc_wounded_gun_hand_multiplier || 0;
const valTwo_weapons = +v.hit_det_misc_two_weapons || 0;
const valHip_shooting = +v.hit_det_misc_hip_shooting || 0;
const valObscured = +v.hit_det_misc_obscured || 0;
const valGyrojet = +v.hit_det_misc_gyrojet || 0;
output.hit_det_misc_weapon_at_rest = valWeapon_at_rest;
output.hit_det_misc_2nd_consecutive = val2nd_consecutive;
output.hit_det_misc_additional_consecutive = valAdditional_consecutive;
output.hit_det_misc_additional_consecutive_multiplier = valAdditional_consecutive_multiplier;
output.hit_det_misc_wrong_hand = valWrong_hand;
output.hit_det_misc_wounded_gun_hand = valWounded_gun_hand;
output.hit_det_misc_wounded_gun_hand_multiplier = valWounded_gun_hand_multiplier;
output.hit_det_misc_two_weapons = valTwo_weapons;
output.hit_det_misc_hip_shooting = valHip_shooting;
output.hit_det_misc_obscured = valObscured;
output.hit_det_misc_gyrojet = valGyrojet;
output.hit_det_misc_total =
valWeapon_at_rest +
val2nd_consecutive +
valAdditional_consecutive * valAdditional_consecutive_multiplier +
valWrong_hand +
valWounded_gun_hand * valWounded_gun_hand_multiplier +
valTwo_weapons +
valHip_shooting +
valObscured +
valGyrojet;
} else {
// console.log(`Change detected: Reset`);
output.hit_det_misc_weapon_at_rest = 0;
output.hit_det_misc_2nd_consecutive = 0;
output.hit_det_misc_additional_consecutive = 0;
output.hit_det_misc_additional_consecutive_multiplier = 1;
output.hit_det_misc_wrong_hand = 0;
output.hit_det_misc_wounded_gun_hand = 0;
output.hit_det_misc_wounded_gun_hand_multiplier = 1;
output.hit_det_misc_two_weapons = 0;
output.hit_det_misc_hip_shooting = 0;
output.hit_det_misc_obscured = 0;
output.hit_det_misc_gyrojet = 0;
output.hit_det_misc_total = 0;
}
setAttrs(output);
},
);
},
);
// automatic weapons
on('change:hit_det_automatic_auto change:hit_det_automatic_semi change:hit_det_automatic_type clicked:hitDetResetAll clicked:hitDetResetAutomaticWeapons', (eventInfo) => {
// console.log(`Change detected: ${eventInfo.sourceAttribute}`);
getAttrs(['hit_det_automatic_auto', 'hit_det_automatic_semi', 'hit_det_automatic_type'], (v) => {
const output = {};
let actionButton = eventInfo.triggerName;
actionButton = actionButton.replace('clicked:', '');
if (actionButton !== 'hitdetresetautomaticweapons' && actionButton !== 'hitdetresetall') {
const valType = +v.hit_det_automatic_type || 0;
const valAuto = +v.hit_det_automatic_auto || 1; // #of shots
const valSemi = +v.hit_det_automatic_semi || 1; // #of shots
const autoValues = {
1: 0, // auto shot 0
2: -11, // auto shot 1
3: -22, // auto shot 2
4: -33, // auto shot 3
5: -46, // auto shot 4
6: -63, // auto shot 5
7: -85, // auto shot 6
8: -100, // auto shot 7
9: -150, // auto shot 8
10: -200, // auto shot 10+
};
const semiValues = {
1: 0, // semi-auto shot 0
2: -11, // semi-auto shot 1
3: -21, // semi-auto shot 2
4: -32, // semi-auto shot 3
5: -44, // semi-auto shot 4
6: -57, // semi-auto shot 5
7: -73, // semi-auto shot 6
8: -96, // semi-auto shot 7
9: -130, // semi-auto shot 8
10: -180, // semi-auto shot 10+
};
// type is auto or semi-auto
const valAutomatic = valType === 0 ? autoValues[valAuto] : semiValues[valSemi];
// mutually exclusive reset
if (valType === 0) {
output.hit_det_automatic_semi = 1;
} else if (valType === 1) {
output.hit_det_automatic_auto = 1;
}
output.hit_det_automatic_total = valAutomatic;
} else {
// console.log(`Change detected: Reset`);
output.hit_det_automatic_total = 0;
output.hit_det_automatic_auto = 1;
output.hit_det_automatic_semi = 1;
}
setAttrs(output);
});
});
// hit determination total
on('change:hit_det_move_of_shooter_total change:hit_det_move_of_target_total change:hit_det_wounds_total change:hit_det_misc_total change:hit_det_automatic_total', (eventInfo) => {
// console.log(`Change detected: ${eventInfo.sourceAttribute}`);
getSectionIDs('repeating_weapons', (idArray) => {
const output = {};
const fields = ['hit_det_move_of_shooter_total', 'hit_det_move_of_target_total', 'hit_det_wounds_total', 'hit_det_misc_total', 'hit_det_automatic_total'];
_.each(idArray, (id) => {
fields.push(section_attribute('weapons', id, 'hit_det'));
});
getAttrs(fields, (v) => {
const hit_det_move_of_shooter_total = +v.hit_det_move_of_shooter_total || 0;
const hit_det_move_of_target_total = +v.hit_det_move_of_target_total || 0;
const hit_det_wounds_total = +v.hit_det_wounds_total || 0;
const hit_det_misc_total = +v.hit_det_misc_total || 0;
const hit_det_automatic_total = +v.hit_det_automatic_total || 0;
const hitDetTotal = hit_det_move_of_shooter_total + hit_det_move_of_target_total + hit_det_wounds_total + hit_det_misc_total + hit_det_automatic_total;
output.hit_det_total = hitDetTotal;
idArray.forEach((id) => {
output[section_attribute('weapons', id, 'hit_det')] = hitDetTotal;
});
setAttrs(output, {silent: true});
});
});
});
// enables drag/drop of action buttons by syncing with a normal button
// non-repeating buttons
const buttonSet = [];
on('change:character_name sheet:opened', (eventInfo) => {
getSectionIDs('repeating_weapons', (idArrayWeapons) => {
getAttrs(['character_name'], (v) => {
let allAttributeValues = {};
// process non-repeating buttons
allAttributeValues = buttonSet.reduce((all, one) => {
return {...all, [one]: `%{${v.character_name}|${one}-button}`};
}, {});
// process each repeating sections buttons
idArrayWeapons.forEach((id) => {
// repeating buttons
const repeatingButtonSet = ['attack'];
const attribute_values = repeatingButtonSet.reduce((all, one) => {
return {...all, [`repeating_weapons_${id}_${one}`]: `%{${v.character_name}|repeating_weapons_${id}_${one}-button}`};
}, {});
allAttributeValues = {...allAttributeValues, ...attribute_values};
});
setAttrs(allAttributeValues, {silent: true});
});
});
});
// Attack roll CRP act_attack
on('clicked:repeating_weapons:attack-button', (eventInfo) => {
// console.log(`Change detected: ${eventInfo.sourceAttribute}`);
const trigger = eventInfo.triggerName.replace('clicked:', '').replace('attack-button', '');
// console.log(`Change detected: trigger:${trigger}`);
getAttrs([`${trigger}ammo`, `${trigger}rangemodifierpb`, `${trigger}rangemodifiers`, `${trigger}rangemodifierm`, `${trigger}rangemodifierl`], (v) => {
const output = {};
const ammo = +v[`${trigger}ammo`] || 0;
const rangeModPb = v[`${trigger}rangemodifierpb`];
const rangeModS = v[`${trigger}rangemodifiers`];
const rangeModM = v[`${trigger}rangemodifierm`];
const rangeModL = v[`${trigger}rangemodifierl`];
// Range QUERY
startRoll(`!{{template:default}}{{ask=![[?{Range to target?|PB,0|S,1|M,2|L,3}]]}}`, (question) => {
const query = question.results.ask.result;
if (query === 0 && integerRegex.test(rangeModPb)) {
const roll_string = `&{template:general} {{title=@{character_name} - Attack Roll}} {{subtitle=Weapon - @{${trigger}Weapon}}} {{roll_attack=[[1]]}} {{roll=[[1d100]]}} {{target=[[ @{${trigger}BaseAccuracy} [base] + (${rangeModPb} [range]) + (@{${trigger}hit_det} [hit det]) + (?{Additional Modifier|0} [mod]) ]]}} {{base_accuracy=[[@{${trigger}BaseAccuracy}]]}} {{range_mod=[[${rangeModPb}]]}} {{targets_range=PB}} {{hit_det_mod=[[@{${trigger}hit_det}]]}} {{roll_mod=[[?{Additional Modifier|0}]]}} {{ammo=@{${trigger}ammo}}} {{ammo_max=@{${trigger}ammo|max}}} {{damage_button=[Roll Location/Damage](~damage)}}`;
// reduce ammo
output[`${trigger}ammo`] = ammo - 1;
setAttrs(output);
startRoll(roll_string, (attack_roll) => {
console.log(attack_roll);
// const result = attack_roll.results.attack.result;
finishRoll(attack_roll.rollId);
});
} else if (query === 1 && integerRegex.test(rangeModS)) {
const roll_string = `&{template:general} {{title=@{character_name} - Attack Roll}} {{subtitle=Weapon - @{${trigger}Weapon}}} {{roll_attack=[[1]]}} {{roll=[[1d100]]}} {{target=[[ @{${trigger}BaseAccuracy} [base] + (${rangeModS} [range]) + (@{${trigger}hit_det} [hit det]) + (?{Additional Modifier|0} [mod]) ]]}} {{base_accuracy=[[@{${trigger}BaseAccuracy}]]}} {{range_mod=[[${rangeModS}]]}} {{targets_range=Short}} {{hit_det_mod=[[@{${trigger}hit_det}]]}} {{roll_mod=[[?{Additional Modifier|0}]]}} {{ammo=@{${trigger}ammo}}} {{ammo_max=@{${trigger}ammo|max}}} {{damage_button=[Roll Location/Damage](~damage)}}`;
// reduce ammo
output[`${trigger}ammo`] = ammo - 1;
setAttrs(output);
startRoll(roll_string, (attack_roll) => {
console.log(attack_roll);
// const result = attack_roll.results.attack.result;
finishRoll(attack_roll.rollId);
});
} else if (query === 2 && integerRegex.test(rangeModM)) {
const roll_string = `&{template:general} {{title=@{character_name} - Attack Roll}} {{subtitle=Weapon - @{${trigger}Weapon}}} {{roll_attack=[[1]]}} {{roll=[[1d100]]}} {{target=[[ @{${trigger}BaseAccuracy} [base] + (${rangeModM} [range]) + (@{${trigger}hit_det} [hit det]) + (?{Additional Modifier|0} [mod]) ]]}} {{base_accuracy=[[@{${trigger}BaseAccuracy}]]}} {{range_mod=[[${rangeModM}]]}} {{targets_range=Med}} {{hit_det_mod=[[@{${trigger}hit_det}]]}} {{roll_mod=[[?{Additional Modifier|0}]]}} {{ammo=@{${trigger}ammo}}} {{ammo_max=@{${trigger}ammo|max}}} {{damage_button=[Roll Location/Damage](~damage)}}`;
// reduce ammo
output[`${trigger}ammo`] = ammo - 1;
setAttrs(output);
startRoll(roll_string, (attack_roll) => {
console.log(attack_roll);
// const result = attack_roll.results.attack.result;
finishRoll(attack_roll.rollId);
});
} else if (query === 3 && integerRegex.test(rangeModL)) {
const roll_string = `&{template:general} {{title=@{character_name} - Attack Roll}} {{subtitle=Weapon - @{${trigger}Weapon}}} {{roll_attack=[[1]]}} {{roll=[[1d100]]}} {{target=[[ @{${trigger}BaseAccuracy} [base] + (${rangeModL} [range]) + (@{${trigger}hit_det} [hit det]) + (?{Additional Modifier|0} [mod]) ]]}} {{base_accuracy=[[@{${trigger}BaseAccuracy}]]}} {{range_mod=[[${rangeModL}]]}} {{targets_range=Long}} {{hit_det_mod=[[@{${trigger}hit_det}]]}} {{roll_mod=[[?{Additional Modifier|0}]]}} {{ammo=@{${trigger}ammo}}} {{ammo_max=@{${trigger}ammo|max}}} {{damage_button=[Roll Location/Damage](~damage)}}`;
// reduce ammo
output[`${trigger}ammo`] = ammo - 1;
setAttrs(output);
startRoll(roll_string, (attack_roll) => {
console.log(attack_roll);
// const result = attack_roll.results.attack.result;
finishRoll(attack_roll.rollId);
});
} else {
// user picked a range that is not allowed.
// console.log(`Change detected: RANGE N/A`);
let queryRange = '';
if (query === 0) {
queryRange = 'Point Blank';
}
if (query === 1) {
queryRange = 'Short';
}
if (query === 2) {
queryRange = 'Medium';
}
if (query === 3) {
queryRange = 'Long';
}
const roll_string = `&{template:general} {{title=@{character_name} - Attack Roll}} {{subtitle=Weapon - @{${trigger}Weapon}}} {{roll_attack=[[1]]}} {{text_center=Oops, **${queryRange} Range** is not valid.%NEWLINE%(choose a different range)}}`;
startRoll(roll_string, (attack_roll) => {
console.log(attack_roll);
finishRoll(attack_roll.rollId);
});
}
});
});
});
on('change:character_avatar', (eventInfo) => {
// console.log(`Change detected: ${eventInfo.sourceAttribute}`);
getAttrs(['character_avatar'], (v) => {
const output = {};
output.character_avatar_url = v['character_avatar'];
output.character_avatar_img = `<img src="${v['character_avatar']}">`;
setAttrs(output, {silent: true});
});
});
// one-time update to fix attribute names
on('sheet:opened', (eventInfo) => {
// console.log(`Change detected: sheet_version check`);
getSectionIDs('repeating_AreasOfKnowledge', (idArray) => {
const output = {};
const fields = ['sheet_version', 'charactername', 'lifelevel', 'currentlifelevel'];
_.each(idArray, (id) => {
fields.push(section_attribute('AreasOfKnowledge', id, 'WeaponSpeedModifier'));
});
getAttrs(fields, (v) => {
const sheetVersion = +v.sheet_version || 0;
const characterName = v.charactername || '';
const oldLifeLevel = +v.lifelevel || 0;
const oldCurrentLifeLevel = +v.currentlifelevel || 0;
// bail if already updated
if (sheetVersion > 1.3) {
console.log(`Change detected: Sheet v${sheetVersion} is current`);
return;
}
if (sheetVersion === 0) {
if (characterName !== '') {
console.log(`Change detected: character_name updated to ${characterName}`);
output.character_name = characterName;
}
if (oldLifeLevel !== 0) {
console.log(`Change detected: lifelevel has been changed to lifelevel_max`);
output.lifelevel_max = oldLifeLevel;
}
if (oldCurrentLifeLevel !== 0) {
console.log(`Change detected: currentlifelevel has been changed to lifelevel`);
output.lifelevel = oldCurrentLifeLevel;
}
idArray.forEach((id) => {
const currentValue = v[section_attribute('AreasOfKnowledge', id, 'WeaponSpeedModifier')];
console.log(`Change detected: AreasOfKnowledgeName updated to ${currentValue}`);
output[section_attribute('AreasOfKnowledge', id, 'AreasOfKnowledgeName')] = currentValue;
});
traitCalc();
output.sheet_version = 1;
console.log(`Change detected: Sheet updated to v1.0`);
}
if (sheetVersion === 1) {
traitCalc();
output.sheet_version = 1.1;
console.log(`Change detected: Sheet updated to v1.1`);
}
if (sheetVersion === 1.1) {
traitCalc();
output.sheet_version = 1.2;
console.log(`Change detected: Sheet updated to v1.2`);
}
if (sheetVersion === 1.2) {
traitCalc();
output.sheet_version = 1.3;
console.log(`Change detected: Sheet updated to v1.3`);
} else if (sheetVersion >= 1.3) {
console.log(`Change detected: Sheet v${sheetVersion} is current`);
}
setAttrs(output, {silent: true});
});
});
});
</script>