Files
roll20-character-sheets-tester/Adventurers Revised Edition (hbCyber)/sheet.html
T
hbCyberandjean.s.lemay 9596861599 [Adventurers Revised Edition (hbCyber)] v1.1 (#6282)
- Refactored layout, added game logo
- Refactored sheet.json

Co-authored-by: jean.s.lemay <jean.s.lemay@velocity-solutions.com>
2020-04-27 11:22:13 -04:00

1941 lines
57 KiB
HTML

<div class="sheet-wrapper">
<!-- Headers -->
<div class="sheet-panel-container sheet-panel-container--center">
<!-- Hidden Input: Current View -->
<input type="hidden"
class="sheet-id-attr-curr-view"
name="attr_curr_view"
value="view_player" />
<!-- Header: Player -->
<div class="sheet-id-header-player sheet-panel sheet-flex sheet-flex-row sheet-flex-no-wrap sheet-items-center sheet-justify-between">
<!-- Logo -->
<img class="sheet-flex-none sheet-h-20"
src="https://i.imgur.com/NNPJHgP.png" />
<!-- Button: GM View -->
<button type="action"
class="sheet-flex-none sheet-text-sm"
name="act_btn_gm_view">
GM mode &rarr;
</button>
</div>
<!-- Header: GM -->
<div class="sheet-id-header-gm sheet-panel sheet-flex sheet-flex-row sheet-flex-no-wrap sheet-items-center sheet-justify-between">
<!-- Button: Player View -->
<button type="action"
class="sheet-flex-none sheet-text-sm"
name="act_btn_player_view">
&larr; Player mode
</button>
<span class="sheet-flex-initial sheet-text-right">
Use this mode to set up NPCs.
</span>
</div>
</div>
<!-- Views -->
<div class="sheet-panel-container sheet-mt-8">
<!-- Hidden Input: Current View -->
<input type="hidden"
class="sheet-id-attr-curr-view"
name="attr_curr_view"
value="view_player" />
<!-- View: Player -->
<div class="sheet-id-view-player sheet-panel">
<!-- Stats -->
<div class="sheet-container-stats">
<!-- Row: Headers -->
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Header: Value -->
<span class="sheet-col-span-1 sheet-text-sm">Value</span>
<!-- Header: Mod -->
<span class="sheet-col-span-1 sheet-text-sm">Mod.</span>
<!-- Spacer -->
<div class="sheet-col-span-5"></div>
<!-- Header: Current -->
<span class="sheet-col-span-1 sheet-text-sm">Current</span>
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Header: Mod -->
<span class="sheet-col-span-1 sheet-text-sm">Mod.</span>
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Row: Str & End -->
<!-- Label: Str -->
<span class="sheet-col-span-1">Str</span>
<!-- Input: Str -->
<input type="number"
name="attr_str"
class="sheet-col-span-1 sheet-w-full"
value="0" />
<!-- Input: Str Mod -->
<input type="number"
name="attr_str_mod"
class="sheet-col-span-1 sheet-w-full"
value="0" />
<input type="hidden"
name="attr_str_max"
value="6" />
<input type="hidden"
name="attr_str_computed" />
<!-- Button: Roll Str -->
<button type="roll"
class="sheet-col-span-1 sheet-button"
title="Roll"
value="/roll 2d6 + @{str_computed} Str">
</button>
<!-- Button: Roll Str with Adv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--advantage"
title="Roll with advantage"
value="/roll 3d6k2 + @{str_computed} Str (Advantage)">
</button>
<!-- Button: Roll Str with Disadv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--disadvantage"
title="Roll with disadvantage"
value="/roll 3d6dh1 + @{str_computed} Str (Disadvantage)">
</button>
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Label: End -->
<span class="sheet-col-span-1">End</span>
<!-- Input: End -->
<input type="number"
name="attr_end"
class="sheet-col-span-1 sheet-w-full"
value="0" />
<!-- Value: End Max Base -->
<span class="sheet-col-span-1 sheet-font-mono">
<span>/</span>
<span name="attr_end_max_base"
value="3">3</span>
</span>
<!-- Input: End Mod -->
<input type="number"
name="attr_end_max_mod"
class="sheet-col-span-1 sheet-w-full"
value="0" />
<input type="hidden"
name="attr_end_max"
value="3" />
<!-- Label: End Max -->
<span class="sheet-col-span-1">
Max.
<span class="sheet-text-sm sheet-italic">(Str + Agi + 3)</span>
</span>
<!-- Row: Agi & Her -->
<!-- Label: Agi -->
<span class="sheet-col-span-1">Agi</span>
<!-- Input: Agi -->
<input type="number"
name="attr_agi"
class="sheet-col-span-1 sheet-w-full"
value="0" />
<!-- Input: Agi Mod -->
<input type="number"
name="attr_agi_mod"
class="sheet-col-span-1 sheet-w-full"
value="0" />
<input type="hidden"
name="attr_agi_max"
value="6" />
<input type="hidden"
name="attr_agi_computed" />
<!-- Button: Roll Agi -->
<button type="roll"
class="sheet-col-span-1 sheet-button"
title="Roll"
value="/roll 2d6 + @{agi_computed} Agi">
</button>
<!-- Button: Roll Agi with Adv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--advantage"
title="Roll with advantage"
value="/roll 3d6k2 + @{agi_computed} Agi (Advantage)">
</button>
<!-- Button: Roll Agi with Disadv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--disadvantage"
title="Roll with disadvantage"
value="/roll 3d6dh1 + @{agi_computed} Agi (Disadvantage)">
</button>
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Label: Her -->
<span class="sheet-col-span-1">Her</span>
<!-- Input: Her -->
<input type="number"
name="attr_her"
class="sheet-col-span-1 sheet-w-full"
value="0" />
<!-- Value: Her Max Base -->
<span class="sheet-col-span-1 sheet-font-mono">
<span>/</span>
<span name="attr_her_max_base"
value="1">1</span>
</span>
<!-- Input: Her Max Mod -->
<input type="number"
name="attr_her_max_mod"
class="sheet-col-span-1 sheet-w-full"
value="0" />
<input type="hidden"
name="attr_her_max"
value="1" />
<!-- Label: Her Max -->
<span class="sheet-col-span-1">
At session start
<span class="sheet-text-sm sheet-italic">(Lowest Stat + 1, Min. 1)</span>
</span>
<!-- Row: Mnd & Exp -->
<!-- Label: Mnd -->
<span class="sheet-col-span-1">Mnd</span>
<!-- Input: Mnd -->
<input type="number"
name="attr_mnd"
class="sheet-col-span-1 sheet-w-full"
value="0" />
<!-- Input: Mnd Mod -->
<input type="number"
name="attr_mnd_mod"
class="sheet-col-span-1 sheet-w-full"
value="0" />
<input type="hidden"
name="attr_mnd_max"
value="6" />
<input type="hidden"
name="attr_mnd_computed" />
<!-- Button: Roll Mnd -->
<button type="roll"
class="sheet-col-span-1 sheet-button"
title="Roll"
value="/roll 2d6 + @{mnd_computed} Mnd">
</button>
<!-- Button: Roll Mnd with Adv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--advantage"
title="Roll with advantage"
value="/roll 3d6k2 + @{mnd_computed} Mnd (Advantage)">
</button>
<!-- Button: Roll Mnd with Disadv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--disadvantage"
title="Roll with disadvantage"
value="/roll 3d6dh1 + @{mnd_computed} Mnd (Disadvantage)">
</button>
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Label: Exp -->
<span class="sheet-col-span-1">Exp</span>
<!-- Input: Exp -->
<input type="number"
name="attr_exp"
class="sheet-col-span-1 sheet-w-full"
value="0" />
<!-- Spacer -->
<div class="sheet-col-span-3"></div>
<!-- Empty Row -->
<div class="sheet-col-span-12"></div>
<!-- Row: Money, Movement & Enc -->
<!-- Label: Money -->
<span class="sheet-col-span-1">Money</span>
<!-- Input: Money -->
<input type="number"
name="attr_money"
class="sheet-col-span-2 sheet-w-3/4"
value="0" />
<!-- Value: Movement -->
<input type="hidden"
name="attr_movement"
value="10" />
<span class="sheet-col-span-4">
<span class="sheet-text-sm sheet-font-bold">Movement:</span>
<span class="sheet-font-mono"
name="attr_movement">10</span>
<span class="sheet-text-sm">yards</span>
</span>
<!-- Enc -->
<div class="sheet-col-span-5 sheet-flex sheet-flex-row sheet-flex-no-wrap sheet-items-baseline">
<!-- Hidden Input Fields -->
<input type="hidden"
name="attr_enc_total"
value="0" />
<input type="hidden"
name="attr_enc_threshold"
value="0" />
<input type="hidden"
name="attr_enc_threshold_max"
value="0" />
<input type="hidden"
name="attr_enc_is_encumbered"
value="false" />
<input type="hidden"
name="attr_enc_is_max_capacity"
value="false" />
<input type="hidden"
name="attr_enc_is_over_capacity"
value="false" />
<input type="hidden"
class="sheet-id-attr-enc-status"
name="attr_enc_status"
value="" />
<!-- Label: Enc -->
<span class="sheet-flex-none sheet-text-sm sheet-font-bold">
Enc (Str-based)
</span>
<!-- Label: Current -->
<span class="sheet-flex-none sheet-text-sm sheet-ml-8">
Current:
</span>
<!-- Value: Enc Total -->
<span class="sheet-flex-none sheet-font-mono sheet-ml-2"
name="attr_enc_total">0</span>
<!-- Label: Threshold -->
<span class="sheet-flex-none sheet-text-sm sheet-text-purple-600 sheet-ml-8">
Threshold:
</span>
<!-- Value: Enc Threshold -->
<span class="sheet-flex-none sheet-font-mono sheet-text-purple-600 sheet-ml-2"
name="attr_enc_threshold">0</span>
<!-- Label: Enc Max -->
<span class="sheet-flex-none sheet-text-sm sheet-text-red-700 sheet-ml-8">
Max.:
</span>
<!-- Value: Enc Max -->
<span class="sheet-flex-none sheet-font-mono sheet-text-red-700 sheet-ml-2"
name="attr_enc_threshold_max">0</span>
<!-- Encumbrance: Warning Labels -->
<span class="sheet-id-enc-label-encumbered
sheet-flex-none sheet-text-sm sheet-text-purple-600 sheet-font-bold sheet-ml-8">
&rarr; Encumbered.
</span>
<span class="sheet-id-enc-label-max-capacity
sheet-flex-none sheet-text-sm sheet-text-red-700 sheet-font-bold sheet-ml-8">
&rarr; At max. capacity.
</span>
<span class="sheet-id-enc-label-over-capacity
sheet-flex-none sheet-text-sm sheet-text-red-700 sheet-font-bold sheet-ml-8">
&rarr; Over capacity!
</span>
</div>
</div>
<!-- Tabs -->
<div class="sheet-flex sheet-flex-row sheet-flex-no-wrap sheet-items-end sheet-mt-6">
<!-- Hidden Input: Current Tab -->
<input type="hidden"
class="sheet-id-attr-curr-tab"
name="attr_curr_tab"
value="tab_concept" />
<!-- Tab: Concept -->
<button type="action"
class="sheet-id-tab-button-concept
sheet-flex-none sheet-tab"
name="act_tab_concept">
Concept
</button>
<!-- Spacer -->
<div class="sheet-flex-none sheet-tab-spacer"></div>
<!-- Tab: Skills -->
<button type="action"
class="sheet-id-tab-button-skills
sheet-flex-none sheet-tab"
name="act_tab_skills">
Skills
<span class="sheet-font-mono">(<span name="attr_num_skills">0</span>)</span>
</button>
<!-- Spacer -->
<div class="sheet-flex-none sheet-tab-spacer"></div>
<!-- Tab: Weapons -->
<button type="action"
class="sheet-id-tab-button-weapons
sheet-flex-none sheet-tab"
name="act_tab_weapons">
Weapons
<span class="sheet-font-mono">(<span name="attr_num_weapons">0</span>)</span>
</button>
<!-- Spacer -->
<div class="sheet-flex-none sheet-tab-spacer"></div>
<!-- Tab: Armor -->
<button type="action"
class="sheet-id-tab-button-armor
sheet-flex-none sheet-tab"
name="act_tab_armor">
Armor
<span class="sheet-font-mono">(<span name="attr_num_armor">0</span>)</span>
</button>
<!-- Spacer -->
<div class="sheet-flex-none sheet-tab-spacer"></div>
<!-- Tab: Items -->
<button type="action"
class="sheet-id-tab-button-items
sheet-flex-none sheet-tab"
name="act_tab_items">
Items
<span class="sheet-font-mono">(<span name="attr_num_items">0</span>)</span>
</button>
<!-- Spacer -->
<div class="sheet-flex-1 sheet-tab-spacer"></div>
</div>
<!-- Tab Panels -->
<div class="sheet-panel-container">
<!-- Hidden Input: Current Tab -->
<input type="hidden"
class="sheet-id-attr-curr-tab"
name="attr_curr_tab"
value="tab_concept" />
<!-- Panel: Concept -->
<div class="sheet-id-tab-concept sheet-panel sheet-mt-6">
<div class="sheet-container-concept">
<!-- Row: Archetype & Definition #1 -->
<!-- Label: Archetype -->
<span class="sheet-col-span-1">Archetype</span>
<!-- Input: Archetype -->
<input type="text"
name="attr_archetype"
spellcheck="false"
class="sheet-col-span-1 sheet-text-sm sheet-w-full" />
<!-- Button: Chat Archetype -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--chat"
title="Send to chat"
value="&{template:text} {{title=Archetype}} {{subtitle=Concept}} {{text=@{archetype}}}">
</button>
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Label: Definition #1 -->
<span class="sheet-col-span-1">Definition #1</span>
<!-- Input: Definition #1 -->
<input type="text"
name="attr_definition1"
spellcheck="false"
class="sheet-col-span-1 sheet-text-sm sheet-w-full" />
<!-- Button: Chat Definition #1 -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--chat"
title="Send to chat"
value="&{template:text} {{title=Definition #1}} {{subtitle=Concept}} {{text=@{definition1}}}">
</button>
<!-- Row: Definition #2 & Definition #3 -->
<!-- Label: Definition #2 -->
<span class="sheet-col-span-1">Definition #2</span>
<!-- Input: Definition #2 -->
<input type="text"
name="attr_definition2"
spellcheck="false"
class="sheet-col-span-1 sheet-text-sm sheet-w-full" />
<!-- Button: Chat Definition #2 -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--chat"
title="Send to chat"
value="&{template:text} {{title=Definition #2}} {{subtitle=Concept}} {{text=@{definition2}}}">
</button>
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Label: Definition #3 -->
<span class="sheet-col-span-1">Definition #3</span>
<!-- Input: Definition #3 -->
<input type="text"
name="attr_definition3"
spellcheck="false"
class="sheet-col-span-1 sheet-text-sm sheet-w-full" />
<!-- Button: Chat Definition #3 -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--chat"
title="Send to chat"
value="&{template:text} {{title=Definition #3}} {{subtitle=Concept}} {{text=@{definition3}}}">
</button>
</div>
</div>
<!-- Panel: Skills -->
<div class="sheet-id-tab-skills sheet-panel sheet-mt-2">
<!-- Repeating Section: Skills -->
<fieldset class="repeating_skills">
<div class="sheet-container-skill
sheet-mb-2">
<!-- Row: Name, Focus & Limitation -->
<!-- Label: Name -->
<span class="sheet-col-span-1">Name</span>
<!-- Input: Name -->
<input type="text"
class="sheet-col-span-1 sheet-w-full sheet-text-sm"
spellcheck="false"
name="attr_skill_name" />
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Label: Focus -->
<span class="sheet-col-span-1">Focus</span>
<!-- Input: Focus -->
<input type="text"
class="sheet-col-span-1 sheet-w-full sheet-text-sm"
spellcheck="false"
name="attr_skill_focus" />
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Label: Limitation -->
<span class="sheet-col-span-1">Limit.</span>
<!-- Input: Limitation -->
<input type="text"
class="sheet-col-span-1 sheet-w-full sheet-text-sm"
spellcheck="false"
name="attr_skill_limit" />
<!-- Button: Chat -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--chat"
title="Send to chat"
value="&{template:skill} {{name=@{skill_name}}} {{focus=@{skill_focus}}} {{limit=@{skill_limit}}} {{basic=@{skill_basic}}} {{advanced=@{skill_advanced}}} {{is_advanced=@{skill_is_advanced_computed}}} {{power=@{skill_power}}} {{is_power=@{skill_is_power_computed}}}">
</button>
<!-- Row: Basic -->
<!-- Label: Basic -->
<span class="sheet-col-span-1">Basic</span>
<!-- Input: Basic -->
<input type="text"
class="sheet-col-span-8 sheet-w-full sheet-text-sm"
spellcheck="false"
name="attr_skill_basic" />
<!-- Row: Advanced -->
<!-- Label: Advanced -->
<span class="sheet-col-span-1">Advanced</span>
<!-- Input Container: Advanced -->
<div class="sheet-col-span-8 sheet-flex sheet-flex-row sheet-flex-no-wrap sheet-items-center">
<!-- Input: Advanced Checkbox -->
<input type="checkbox"
class="sheet-flex-none sheet-checkbox"
name="attr_skill_is_advanced"
value="true" />
<!-- Input: Advanced -->
<input type="hidden"
name="attr_skill_is_advanced_computed" />
<input type="text"
class="sheet-flex-1 sheet-text-sm sheet-ml-2"
spellcheck="false"
name="attr_skill_advanced" />
</div>
<!-- Row: Power -->
<!-- Label: Power -->
<span class="sheet-col-span-1 sheet-self-y-start">Power</span>
<!-- Input Container: Power -->
<div class="sheet-col-span-8 sheet-flex sheet-flex-row sheet-flex-no-wrap sheet-items-center">
<!-- Input: Power Checkbox -->
<input type="checkbox"
class="sheet-flex-none sheet-self-start sheet-checkbox"
name="attr_skill_is_power"
value="true" />
<!-- Input: Power -->
<input type="hidden"
class="sheet-id-attr-skill-is-power-computed"
name="attr_skill_is_power_computed" />
<textarea class="sheet-id-attr-skill-is-power-computed-textarea
sheet-flex-1 sheet-textarea sheet-text-sm sheet-mb-0 sheet-ml-2"
spellcheck="false"
name="attr_skill_power"></textarea>
</div>
</div>
</fieldset>
</div>
<!-- Panel: Weapons -->
<div class="sheet-id-tab-weapons sheet-panel sheet-mt-4">
<!-- Container: Headers & Subheaders -->
<div class="sheet-container-headers
sheet-mb-2">
<!-- Row: Headers -->
<!-- Label: Name -->
<span class="sheet-col-span-1 sheet-font-bold">Name</span>
<!-- Label: Group -->
<span class="sheet-col-span-1 sheet-font-bold">Group</span>
<!-- Label: Att -->
<span class="sheet-col-span-4 sheet-font-bold">Att</span>
<!-- Spacer: Button -->
<button class="sheet-col-span-1 sheet-button sheet-button--hidden"></button>
<!-- Spacer: Button -->
<button class="sheet-col-span-1 sheet-button sheet-button--hidden"></button>
<!-- Label: Cost -->
<span class="sheet-col-span-1 sheet-font-bold">Cost</span>
<!-- Label: Keywords -->
<span class="sheet-col-span-1 sheet-font-bold">Keywords</span>
<!-- Label: Enc -->
<span class="sheet-col-span-1 sheet-font-bold">Enc</span>
<!-- Spacer: Button -->
<button class="sheet-col-span-1 sheet-button sheet-button--hidden"></button>
<!-- Row: Sub-Headers -->
<!-- Spacer -->
<div class="sheet-col-span-2"></div>
<!-- Label: Fixed -->
<span class="sheet-col-span-1 sheet-text-sm">Fixed</span>
<!-- Label: Str -->
<span class="sheet-col-span-1 sheet-text-sm">Str</span>
<!-- Label: Agi -->
<span class="sheet-col-span-1 sheet-text-sm">Agi</span>
<!-- Label: Mnd -->
<span class="sheet-col-span-1 sheet-text-sm">Mnd</span>
<!-- Spacer: Button -->
<button class="sheet-col-span-1 sheet-button sheet-button--hidden"></button>
<!-- Spacer: Button -->
<button class="sheet-col-span-1 sheet-button sheet-button--hidden"></button>
<!-- Spacer -->
<div class="sheet-col-span-3"></div>
<!-- Spacer: Button -->
<button class="sheet-col-span-1 sheet-button sheet-button--hidden"></button>
</div>
<!-- Repeating Section: Weapons -->
<fieldset class="repeating_weapons">
<div class="sheet-container-weapon
sheet-mb-2">
<!-- Input: Name -->
<input type="text"
class="sheet-col-span-1 sheet-w-full sheet-text-sm"
spellcheck="false"
name="attr_weapon_name" />
<!-- Input: Group -->
<input type="text"
class="sheet-col-span-1 sheet-w-full sheet-text-sm"
spellcheck="false"
name="attr_weapon_group" />
<!-- Input: Att Fixed -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_weapon_att_fixed" />
<!-- Input: Att Str -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_weapon_att_str" />
<!-- Input: Att Agi -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_weapon_att_agi" />
<!-- Input: Att Mnd -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_weapon_att_mnd" />
<!-- Hidden Input: Att Computed -->
<input type="hidden"
name="attr_weapon_att_computed" />
<!-- Button: Roll Att -->
<button type="roll"
class="sheet-col-span-1 sheet-button"
title="Roll"
value="/roll 2d6 + @{weapon_att_computed} Att @{weapon_name}">
</button>
<!-- Button: Roll Att with Adv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--advantage"
title="Roll with advantage"
value="/roll 3d6k2 + @{weapon_att_computed} Att @{weapon_name} (Advantage)">
</button>
<!-- Input: Cost -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_weapon_cost" />
<!-- Input: Keywords -->
<input type="text"
class="sheet-col-span-1 sheet-w-full sheet-text-sm"
spellcheck="false"
name="attr_weapon_keywords" />
<!-- Input: Enc -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_weapon_enc" />
<!-- Button: Chat -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--chat"
title="Send to chat"
value="&{template:weapon} {{name=@{weapon_name}}} {{group=@{weapon_group}}} {{att_computed=@{weapon_att_computed}}} {{att_fixed=@{weapon_att_fixed}}} {{att_str=@{weapon_att_str}}} {{att_agi=@{weapon_att_agi}}} {{att_mnd=@{weapon_att_mnd}}} {{cost=@{weapon_cost}}} {{enc=@{weapon_enc}}} {{keywords=@{weapon_keywords}}}">
</button>
</div>
</fieldset>
</div>
<!-- Panel: Armor -->
<div class="sheet-id-tab-armor sheet-panel sheet-mt-4">
<!-- Container: Headers & Subheaders -->
<div class="sheet-container-headers
sheet-mb-2">
<!-- Row: Headers -->
<!-- Label: Name/Type -->
<span class="sheet-col-span-1 sheet-font-bold">Name</span>
<!-- Label: Def -->
<span class="sheet-col-span-1 sheet-font-bold">Def</span>
<!-- Spacer -->
<div class="sheet-col-span-3"></div>
<!-- Spacer: Button -->
<button class="sheet-col-span-1 sheet-button sheet-button--hidden"></button>
<!-- Spacer: Button -->
<button class="sheet-col-span-1 sheet-button sheet-button--hidden"></button>
<!-- Label: Cost -->
<span class="sheet-col-span-1 sheet-font-bold">Cost</span>
<!-- Label: AR -->
<span class="sheet-col-span-1 sheet-font-bold">AR</span>
<!-- Spacer: Button -->
<button class="sheet-col-span-1 sheet-button sheet-button--hidden"></button>
<!-- Label: Keywords -->
<span class="sheet-col-span-1 sheet-font-bold">Keywords</span>
<!-- Label: Enc -->
<span class="sheet-col-span-1 sheet-font-bold">Enc</span>
<!-- Spacer: Button -->
<button class="sheet-col-span-1 sheet-button sheet-button--hidden"></button>
<!-- Row: Sub-Headers -->
<!-- Spacer -->
<div class="col-span-1"></div>
<!-- Label: Fixed -->
<span class="sheet-col-span-1 sheet-text-sm">Fixed</span>
<!-- Label: Str -->
<span class="sheet-col-span-1 sheet-text-sm">Str</span>
<!-- Label: Agi -->
<span class="sheet-col-span-1 sheet-text-sm">Agi</span>
<!-- Label: Mnd -->
<span class="sheet-col-span-1 sheet-text-sm">Mnd</span>
<!-- Spacer -->
<div class="sheet-col-span-8"></div>
</div>
<!-- Repeating Section: Armor -->
<fieldset class="repeating_armor">
<div class="sheet-container-armor
sheet-mb-2">
<!-- Input: Name/Type -->
<input type="text"
class="sheet-col-span-1 sheet-w-full sheet-text-sm"
spellcheck="false"
name="attr_armor_name" />
<!-- Input: Def Fixed -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_armor_def_fixed" />
<!-- Input: Def Str -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_armor_def_str" />
<!-- Input: Def Agi -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_armor_def_agi" />
<!-- Input: Def Mnd -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_armor_def_mnd" />
<!-- Hidden Input: Def Computed -->
<input type="hidden"
name="attr_armor_def_computed" />
<!-- Button: Roll Def -->
<button type="roll"
class="sheet-col-span-1 sheet-button"
title="Roll"
value="/roll 2d6 + @{armor_def_computed} Def @{armor_name}">
</button>
<!-- Button: Roll Def with Adv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--advantage"
title="Roll with advantage"
value="/roll 3d6k2 + @{armor_def_computed} Def @{armor_name} (Advantage)">
</button>
<!-- Input: Cost -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_armor_cost" />
<!-- Input: AR -->
<input type="text"
class="sheet-col-span-1 sheet-w-full"
spellcheck="false"
name="attr_armor_ar" />
<!-- Button: Roll AR -->
<button type="roll"
class="sheet-col-span-1 sheet-button"
title="Roll"
value="/roll 1d6 AR @{armor_name} @{armor_ar}">
</button>
<!-- Input: Keywords -->
<input type="text"
class="sheet-col-span-1 sheet-w-full sheet-text-sm"
spellcheck="false"
name="attr_armor_keywords" />
<!-- Input: Enc -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_armor_enc" />
<!-- Button: Chat -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--chat"
title="Send to chat"
value="&{template:armor} {{name=@{armor_name}}} {{def_computed=@{armor_def_computed}}} {{def_fixed=@{armor_def_fixed}}} {{def_str=@{armor_def_str}}} {{def_agi=@{armor_def_agi}}} {{def_mnd=@{armor_def_mnd}}} {{cost=@{armor_cost}}} {{enc=@{armor_enc}}} {{ar=@{armor_ar}}} {{keywords=@{armor_keywords}}}">
</button>
</div>
</fieldset>
</div>
<!-- Panel: Items -->
<div class="sheet-id-tab-items sheet-panel sheet-mt-4">
<!-- Container: Headers -->
<div class="sheet-container-headers
sheet-mb-2">
<!-- Label: Name -->
<span class="sheet-col-span-1 sheet-font-bold">Name</span>
<!-- Label: Cost -->
<span class="sheet-col-span-1 sheet-font-bold">Cost</span>
<!-- Label: Keywords -->
<span class="sheet-col-span-1 sheet-font-bold">Keywords</span>
<!-- Label: Enc -->
<span class="sheet-col-span-1 sheet-font-bold">Enc</span>
<!-- Spacer: Button -->
<button class="sheet-col-span-1 sheet-button sheet-button--hidden"></button>
</div>
<!-- Repeating Section: Items -->
<fieldset class="repeating_items">
<div class="sheet-container-item
sheet-mb-2">
<!-- Input: Name -->
<input type="text"
class="sheet-col-span-1 sheet-w-full sheet-text-sm"
spellcheck="false"
name="attr_item_name" />
<!-- Input: Cost -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_item_cost" />
<!-- Input: Keywords -->
<input type="text"
class="sheet-col-span-1 sheet-w-full sheet-text-sm"
spellcheck="false"
name="attr_item_keywords" />
<!-- Input: Enc -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_item_enc" />
<!-- Button: Chat -->
<button type="roll"
class="item margin-l-s button button--chat"
title="Send to chat"
value="&{template:item} {{name=@{item_name}}} {{cost=@{item_cost}}} {{keywords=@{item_keywords}}} {{enc=@{item_enc}}}">
</button>
</div>
</fieldset>
</div>
</div>
</div>
<!-- View: GM -->
<div class="sheet-id-view-gm sheet-panel">
<!-- Repeating Section: NPCs -->
<fieldset class="repeating_npc">
<div class="sheet-container-npc
sheet-mb-2">
<!-- Row: Name, Keywords & Movement -->
<!-- Label: Name -->
<span class="col-span-1">Name</span>
<!-- Input: Name -->
<input type="text"
class="sheet-col-span-4 sheet-w-full sheet-text-sm"
spellcheck="false"
name="attr_npc_name" />
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Label: Keywords -->
<span class="sheet-col-span-2 sheet-text-right sheet-pr-px">Keywords</span>
<!-- Input: Keywords -->
<input type="text"
class="sheet-col-span-9 sheet-w-full sheet-text-sm"
spellcheck="false"
name="attr_npc_keywords" />
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Value: Move -->
<input type="hidden"
name="attr_npc_move"
value="10" />
<span class="sheet-col-span-2 sheet-text-center">
<span class="sheet-text-sm sheet-font-bold">Movement:</span>
<span class="sheet-font-mono" name="attr_npc_move"></span>
</span>
<!-- Row: Str, Agi, Mnd & End -->
<!-- Label: Str -->
<span class="sheet-col-span-1">Str</span>
<!-- Input: Str -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_npc_str" />
<!-- Button: Roll Str -->
<button type="roll"
class="sheet-col-span-1 sheet-button"
title="Roll"
value="/roll 2d6 + @{npc_str} @{npc_name} Str">
</button>
<!-- Button: Roll Str with Adv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--advantage"
title="Roll with advantage"
value="/roll 3d6k2 + @{npc_str} @{npc_name} Str (Advantage)">
</button>
<!-- Button: Roll Str with Disadv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--disadvantage"
title="Roll with disadvantage"
value="/roll 3d6dh1 + @{npc_str} @{npc_name} Str (Disadvantage)">
</button>
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Label: Agi -->
<span class="sheet-col-span-1">Agi</span>
<!-- Input: Agi -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_npc_agi" />
<!-- Button: Roll Agi -->
<button type="roll"
class="sheet-col-span-1 sheet-button"
title="Roll"
value="/roll 2d6 + @{npc_agi} @{npc_name} Agi">
</button>
<!-- Button: Roll Agi with Adv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--advantage"
title="Roll with advantage"
value="/roll 3d6k2 + @{npc_agi} @{npc_name} Agi (Advantage)">
</button>
<!-- Button: Roll Agi with Disadv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--disadvantage"
title="Roll with disadvantage"
value="/roll 3d6dh1 + @{npc_agi} @{npc_name} Agi (Disadvantage)">
</button>
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Label: Mnd -->
<span class="sheet-col-span-1">Mnd</span>
<!-- Input: Mnd -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_npc_mnd" />
<!-- Button: Roll Mnd -->
<button type="roll"
class="sheet-col-span-1 sheet-button"
title="Roll"
value="/roll 2d6 + @{npc_mnd} @{npc_name} Mnd">
</button>
<!-- Button: Roll Mnd with Adv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--advantage"
title="Roll with advantage"
value="/roll 3d6k2 + @{npc_mnd} @{npc_name} Mnd (Advantage)">
</button>
<!-- Button: Roll Mnd with Disadv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--disadvantage"
title="Roll with disadvantage"
value="/roll 3d6dh1 + @{npc_mnd} @{npc_name} Mnd (Disadvantage)">
</button>
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Label: End -->
<span class="sheet-col-span-1">End</span>
<!-- Input: End -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_npc_end" />
<!-- Row: Att, Def & Her -->
<!-- Label: Att 1 -->
<span class="sheet-col-span-1">Att 1</span>
<!-- Input: Att 1 -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_npc_att1" />
<!-- Button: Roll Att 1 -->
<button type="roll"
class="sheet-col-span-1 sheet-button"
title="Roll"
value="/roll 2d6 + @{npc_att1} @{npc_name} Att">
</button>
<!-- Button: Roll Att 1 with Adv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--advantage"
title="Roll"
value="/roll 3d6k2 + @{npc_att1} @{npc_name} Att">
</button>
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Label: Att 2 -->
<span class="sheet-col-span-1">Att 2</span>
<!-- Input: Att 2 -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_npc_att2" />
<!-- Button: Roll Att 2 -->
<button type="roll"
class="sheet-col-span-1 sheet-button"
title="Roll"
value="/roll 2d6 + @{npc_att2} @{npc_name} Att">
</button>
<!-- Button: Roll Att 2 with Adv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--advantage"
title="Roll"
value="/roll 3d6k2 + @{npc_att2} @{npc_name} Att">
</button>
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Label: Def -->
<span class="sheet-col-span-1">Def</span>
<!-- Input: Def -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_npc_def" />
<!-- Button: Roll Def -->
<button type="roll"
class="sheet-col-span-1 sheet-button"
title="Roll"
value="/roll 2d6 + @{npc_def} @{npc_name} Def">
</button>
<!-- Button: Roll Def with Adv. -->
<button type="roll"
class="sheet-col-span-1 sheet-button sheet-button--advantage"
title="Roll"
value="/roll 3d6k2 + @{npc_def} @{npc_name} Def">
</button>
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Spacer -->
<div class="sheet-col-span-1"></div>
<!-- Label: Her -->
<span class="sheet-col-span-1">Her</span>
<!-- Input: Her -->
<input type="number"
class="sheet-col-span-1 sheet-w-full"
name="attr_npc_her" />
</div>
</fieldset>
</div>
</div>
</div>
<!-- Roll Template: Text -->
<rolltemplate class="sheet-rolltemplate-text">
{{#title}}
<!-- Header -->
<div class="sheet-rt-header">
<span class="sheet-rt-header__title">{{title}}</span>
{{#subtitle}}
<span class="sheet-rt-header__subtitle">{{subtitle}}</span>
{{/subtitle}}
</div>
{{/title}}
{{^title}}
{{#subtitle}}
<!-- Header -->
<div class="sheet-rt-header">
<span class="sheet-rt-header__title"></span>
<span class="sheet-rt-header__subtitle">{{subtitle}}</span>
</div>
{{/subtitle}}
{{/title}}
<!-- Text -->
{{#text}}
<span class="sheet-rt-text">{{text}}</span>
{{/text}}
</rolltemplate>
<!-- Roll Template: Skill -->
<rolltemplate class="sheet-rolltemplate-skill">
{{#name}}
<!-- Header -->
<div class="sheet-rt-header">
<span class="sheet-rt-header__title">{{name}}</span>
<span class="sheet-rt-header__subtitle">Skill</span>
</div>
{{/name}}
<!-- Focus & Limitation -->
<div class="sheet-rt-grid">
{{#focus}}
<!-- Focus -->
<span class="sheet-rt-grid__item sheet-rt-grid__item--bold sheet-rt-grid__item--1/4">
Focus
</span>
<span class="sheet-rt-grid__item sheet-rt-grid__item--3/4">
{{focus}}
</span>
{{/focus}}
{{#limit}}
<!-- Limitation -->
<span class="sheet-rt-grid__item sheet-rt-grid__item--bold sheet-rt-grid__item--1/4">
Limit.
</span>
<span class="sheet-rt-grid__item sheet-rt-grid__item--3/4">
{{limit}}
</span>
{{/limit}}
</div>
{{#basic}}
<!-- Basic -->
<span class="sheet-rt-subheader">Basic</span>
<span class="sheet-rt-text">{{basic}}</span>
{{/basic}}
{{#is_advanced}}
{{#advanced}}
<!-- Advanced -->
<span class="sheet-rt-subheader">Advanced</span>
<span class="sheet-rt-text">{{advanced}}</span>
{{/advanced}}
{{/is_advanced}}
{{#is_power}}
{{#power}}
<!-- Power -->
<span class="sheet-rt-subheader">Power</span>
<span class="sheet-rt-text">{{power}}</span>
{{/power}}
{{/is_power}}
</rolltemplate>
<!-- Roll Template: Weapon -->
<rolltemplate class="sheet-rolltemplate-weapon">
{{#name}}
<!-- Header -->
<div class="sheet-rt-header">
<span class="sheet-rt-header__title">{{name}}</span>
<span class="sheet-rt-header__subtitle">Weapon</span>
</div>
{{/name}}
{{#att_computed}}
<!-- Att -->
<div class="sheet-rt-grid">
<!-- Headers -->
<span class="sheet-rt-grid__item sheet-rt-grid__item--bold">Fixed</span>
<span class="sheet-rt-grid__item sheet-rt-grid__item--bold">Str</span>
<span class="sheet-rt-grid__item sheet-rt-grid__item--bold">Agi</span>
<span class="sheet-rt-grid__item sheet-rt-grid__item--bold">Mnd</span>
<!-- Values -->
<span class="sheet-rt-grid__item">{{att_fixed}}</span>
<span class="sheet-rt-grid__item">{{att_str}}</span>
<span class="sheet-rt-grid__item">{{att_agi}}</span>
<span class="sheet-rt-grid__item">{{att_mnd}}</span>
</div>
<div class="sheet-rt-separator"></div>
{{/att_computed}}
<!-- Group, Cost & Enc -->
<div class="sheet-rt-grid">
{{#group}}
<span class="sheet-rt-grid__item sheet-rt-grid__item--1/4 sheet-rt-grid__item--bold">Group</span>
<span class="sheet-rt-grid__item sheet-rt-grid__item--3/4">{{group}}</span>
{{/group}}
{{#cost}}
<span class="sheet-rt-grid__item sheet-rt-grid__item--1/4 sheet-rt-grid__item--bold">Cost</span>
<span class="sheet-rt-grid__item sheet-rt-grid__item--3/4">{{cost}}</span>
{{/cost}}
{{#enc}}
<span class="sheet-rt-grid__item sheet-rt-grid__item--1/4 sheet-rt-grid__item--bold">Enc</span>
<span class="sheet-rt-grid__item sheet-rt-grid__item--3/4">{{enc}}</span>
{{/enc}}
</div>
{{#keywords}}
<!-- Keywords -->
<span class="sheet-rt-subheader">Keywords</span>
<span class="sheet-rt-text">{{keywords}}</span>
{{/keywords}}
</rolltemplate>
<!-- Roll Template: Armor -->
<rolltemplate class="sheet-rolltemplate-armor">
{{#name}}
<!-- Header -->
<div class="sheet-rt-header">
<span class="sheet-rt-header__title">{{name}}</span>
<span class="sheet-rt-header__subtitle">Armor</span>
</div>
{{/name}}
{{#def_computed}}
<!-- Def -->
<div class="sheet-rt-grid">
<!-- Headers -->
<span class="sheet-rt-grid__item sheet-rt-grid__item--bold">Fixed</span>
<span class="sheet-rt-grid__item sheet-rt-grid__item--bold">Str</span>
<span class="sheet-rt-grid__item sheet-rt-grid__item--bold">Agi</span>
<span class="sheet-rt-grid__item sheet-rt-grid__item--bold">Mnd</span>
<!-- Values -->
<span class="sheet-rt-grid__item">{{def_fixed}}</span>
<span class="sheet-rt-grid__item">{{def_str}}</span>
<span class="sheet-rt-grid__item">{{def_agi}}</span>
<span class="sheet-rt-grid__item">{{def_mnd}}</span>
</div>
<div class="sheet-rt-separator"></div>
{{/def_computed}}
<!-- AR, Cost & Enc -->
<div class="sheet-rt-grid">
{{#ar}}
<!-- AR -->
<span class="sheet-rt-grid__item sheet-rt-grid__item--1/4 sheet-rt-grid__item--bold">AR</span>
<span class="sheet-rt-grid__item sheet-rt-grid__item--3/4">{{ar}}</span>
{{/ar}}
{{#cost}}
<!-- Cost -->
<span class="sheet-rt-grid__item sheet-rt-grid__item--1/4 sheet-rt-grid__item--bold">Cost</span>
<span class="sheet-rt-grid__item sheet-rt-grid__item--3/4">{{cost}}</span>
{{/cost}}
{{#enc}}
<!-- Enc -->
<span class="sheet-rt-grid__item sheet-rt-grid__item--1/4 sheet-rt-grid__item--bold">Enc</span>
<span class="sheet-rt-grid__item sheet-rt-grid__item--3/4">{{enc}}</span>
{{/enc}}
</div>
{{#keywords}}
<!-- Keywords -->
<span class="sheet-rt-subheader">Keywords</span>
<span class="sheet-rt-text">{{keywords}}</span>
{{/keywords}}
</rolltemplate>
<!-- Roll Template: Item -->
<rolltemplate class="sheet-rolltemplate-item">
{{#name}}
<!-- Header -->
<div class="sheet-rt-header">
<span class="sheet-rt-header__title">{{name}}</span>
<span class="sheet-rt-header__subtitle">Item</span>
</div>
{{/name}}
<!-- Cost & Enc -->
<div class="sheet-rt-grid">
{{#cost}}
<!-- Cost -->
<span class="sheet-rt-grid__item sheet-rt-grid__item--1/4 sheet-rt-grid__item--bold">Cost</span>
<span class="sheet-rt-grid__item sheet-rt-grid__item--3/4">{{cost}}</span>
{{/cost}}
{{#enc}}
<!-- Enc -->
<span class="sheet-rt-grid__item sheet-rt-grid__item--1/4 sheet-rt-grid__item--bold">Enc</span>
<span class="sheet-rt-grid__item sheet-rt-grid__item--3/4">{{enc}}</span>
{{/enc}}
</div>
{{#keywords}}
<!-- Keywords -->
<span class="sheet-rt-subheader">Keywords</span>
<span class="sheet-rt-text">{{keywords}}</span>
{{/keywords}}
</rolltemplate>
<!-- Sheet Worker Script -->
<script type="text/worker">
// Function(s)
var toInt = function(value) {
return (parseInt(value, 10) || 0);
};
var isBlank = function(value) {
return ((value || '').toString().trim().length === 0);
};
// ---------------------------------------------------------------------
// Views
on('clicked:btn_gm_view', function() {
setAttrs({
'curr_view': 'view_gm'
});
});
on('clicked:btn_player_view', function() {
setAttrs({
'curr_view': 'view_player'
});
});
// ---------------------------------------------------------------------
// Navigation
[
'tab_concept',
'tab_skills',
'tab_weapons',
'tab_armor',
'tab_items',
'tab_powers'
].forEach(function(tab) {
on('clicked:' + tab, function() {
setAttrs({
'curr_tab': tab
})
});
});
// ---------------------------------------------------------------------
// Auto-calc: num_skills
on('change:repeating_skills remove:repeating_skills', function(event) {
getSectionIDs('repeating_skills', function(repeatingIds) {
setAttrs({
'num_skills': repeatingIds.length
});
});
});
// Auto-calc: num_weapons
on('change:repeating_weapons remove:repeating_weapons', function(event) {
getSectionIDs('repeating_weapons', function(repeatingIds) {
setAttrs({
'num_weapons': repeatingIds.length
});
});
});
// Auto-calc: num_armor
on('change:repeating_armor remove:repeating_armor', function(event) {
getSectionIDs('repeating_armor', function(repeatingIds) {
setAttrs({
'num_armor': repeatingIds.length
});
});
});
// Auto-calc: num_items
on('change:repeating_items remove:repeating_items', function(event) {
getSectionIDs('repeating_items', function(repeatingIds) {
setAttrs({
'num_items': repeatingIds.length
});
});
});
// Auto-calc: str_computed = str + str_mod
on('change:str change:str_mod', function(event) {
getAttrs(['str', 'str_mod'], function(attrs) {
var str_computed = toInt(attrs['str']) + toInt(attrs['str_mod']);
setAttrs({
'str_computed': str_computed
});
});
});
// Auto-calc: agi_computed = agi + agi_mod
on('change:agi change:agi_mod', function(event) {
getAttrs(['agi', 'agi_mod'], function(attrs) {
var agi_computed = toInt(attrs['agi']) + toInt(attrs['agi_mod']);
setAttrs({
'agi_computed': agi_computed
});
});
});
// Auto-calc: mnd_computed = mnd + mnd_mod
on('change:mnd change:mnd_mod', function(event) {
getAttrs(['mnd', 'mnd_mod'], function(attrs) {
var mnd_computed = toInt(attrs['mnd']) + toInt(attrs['mnd_mod']);
setAttrs({
'mnd_computed': mnd_computed
});
});
});
// Auto-calc: end_max_base = str_computed + agi_computed + 3
// Auto-calc: end_max = end_max_base + end_max_mod
on('change:str_computed change:agi_computed change:end_max_mod', function(event) {
getAttrs(['str_computed', 'agi_computed', 'end_max_mod'], function(attrs) {
var end_max_base =
toInt(attrs['str_computed'])
+ toInt(attrs['agi_computed'])
+ 3;
var end_max_mod = toInt(attrs['end_max_mod']);
var end_max = (end_max_base + end_max_mod);
setAttrs({
'end_max_base': end_max_base,
'end_max': end_max
});
});
});
// Auto-calc: her_max_base = Lowest Stat + 1, minimum 1
// Auto-calc: her_max = her_max_base + her_max_mod
on('change:str_computed change:agi_computed change:mnd_computed change:her_max_mod', function(event) {
getAttrs(['str_computed', 'agi_computed', 'mnd_computed', 'her_max_mod'], function(attrs) {
var her_max_base = Math.min.apply(null, [
toInt(attrs['str_computed']) + 1,
toInt(attrs['agi_computed']) + 1,
toInt(attrs['mnd_computed']) + 1]);
var her_max_mod = toInt(attrs['her_max_mod']);
var her_max = (her_max_base + her_max_mod);
setAttrs({
'her_max_base': Math.max(her_max_base, 1),
'her_max': her_max
});
});
});
// Auto-calc: skill_is_advanced_computed
on('change:repeating_skills:skill_is_advanced', function(event) {
getAttrs(['repeating_skills_skill_is_advanced'], function(attrs) {
var skill_is_advanced_computed =
((attrs['repeating_skills_skill_is_advanced'] || '').toString() === 'true')?
'true' : '';
setAttrs({
'repeating_skills_skill_is_advanced_computed': skill_is_advanced_computed
});
});
});
// Auto-calc: skill_is_power_computed
on('change:repeating_skills:skill_is_power', function(event) {
getAttrs(['repeating_skills_skill_is_power'], function(attrs) {
var skill_is_power_computed =
((attrs['repeating_skills_skill_is_power'] || '').toString() === 'true')?
'true' : '';
setAttrs({
'repeating_skills_skill_is_power_computed': skill_is_power_computed
});
});
});
// Auto-calc: weapon_att_computed
// Auto-calc: armor_def_computed
var calcWeaponAttComputed = function(
str, agi, mnd,
weaponAttFixed,
weaponAttStr,
weaponAttAgi,
weaponAttMnd) {
var attValues = [];
if (!isBlank(weaponAttFixed)) {
attValues.push(toInt(weaponAttFixed));
}
if (!isBlank(weaponAttStr)) {
attValues.push(str + toInt(weaponAttStr));
}
if (!isBlank(weaponAttAgi)) {
attValues.push(agi + toInt(weaponAttAgi));
}
if (!isBlank(weaponAttMnd)) {
attValues.push(mnd + toInt(weaponAttMnd));
}
if (attValues.length === 0) {
attValues.push(0);
}
var weaponAttComputed = Math.max.apply(null, attValues);
return weaponAttComputed;
};
var calcArmorDefComputed = function(
str, agi, mnd,
armorDefFixed,
armorDefStr,
armorDefAgi,
armorDefMnd) {
var defValues = [];
if (!isBlank(armorDefFixed)) {
defValues.push(toInt(armorDefFixed));
}
if (!isBlank(armorDefStr)) {
defValues.push(str + toInt(armorDefStr));
}
if (!isBlank(armorDefAgi)) {
defValues.push(agi + toInt(armorDefAgi));
}
if (!isBlank(armorDefMnd)) {
defValues.push(mnd + toInt(armorDefMnd));
}
if (defValues.length === 0) {
defValues.push(0);
}
var armorDefComputed = Math.max.apply(null, defValues);
return armorDefComputed;
};
on('change:str_computed change:agi_computed change:mnd_computed', function(event) {
// Retrieve all repeating row IDs for weapons and armor...
getSectionIDs('repeating_weapons', function(weaponIds) {
getSectionIDs('repeating_armor', function(armorIds) {
// Consider player stats.
var attrsToGet = ['str_computed', 'agi_computed', 'mnd_computed'];
// Consider all relevant weapon field values.
for (var i = 0; i < weaponIds.length; i++) {
var currAttrPrefix = 'repeating_weapons_' + weaponIds[i] + '_';
attrsToGet.push(currAttrPrefix + 'weapon_att_fixed');
attrsToGet.push(currAttrPrefix + 'weapon_att_str');
attrsToGet.push(currAttrPrefix + 'weapon_att_agi');
attrsToGet.push(currAttrPrefix + 'weapon_att_mnd');
}
// Consider all relevant armor field values.
for (var i = 0; i < armorIds.length; i++) {
var currAttrPrefix = 'repeating_armor_' + armorIds[i] + '_';
attrsToGet.push(currAttrPrefix + 'armor_def_fixed');
attrsToGet.push(currAttrPrefix + 'armor_def_str');
attrsToGet.push(currAttrPrefix + 'armor_def_agi');
attrsToGet.push(currAttrPrefix + 'armor_def_mnd');
}
// Get all attributes together...
getAttrs(attrsToGet, function(attrs) {
// Parse player stats
var str_computed = toInt(attrs['str_computed']);
var agi_computed = toInt(attrs['agi_computed']);
var mnd_computed = toInt(attrs['mnd_computed']);
var attrsToSet = {};
// Compute map of computed values to set.
// -- weapon_att_computed
for (var i = 0; i < weaponIds.length; i++) {
var currAttrPrefix = 'repeating_weapons_' + weaponIds[i] + '_';
attrsToSet[currAttrPrefix + 'weapon_att_computed'] =
calcWeaponAttComputed(
str_computed, agi_computed, mnd_computed,
attrs[currAttrPrefix + 'weapon_att_fixed'],
attrs[currAttrPrefix + 'weapon_att_str'],
attrs[currAttrPrefix + 'weapon_att_agi'],
attrs[currAttrPrefix + 'weapon_att_mnd']);
}
// -- armor_def_computed
for (var i = 0; i < armorIds.length; i++) {
var currAttrPrefix = 'repeating_armor_' + armorIds[i] + '_';
attrsToSet[currAttrPrefix + 'armor_def_computed'] =
calcArmorDefComputed(
str_computed, agi_computed, mnd_computed,
attrs[currAttrPrefix + 'armor_def_fixed'],
attrs[currAttrPrefix + 'armor_def_str'],
attrs[currAttrPrefix + 'armor_def_agi'],
attrs[currAttrPrefix + 'armor_def_mnd']);
}
// Completion.
setAttrs(attrsToSet);
});
});
});
});
on('change:repeating_weapons:weapon_att_fixed '
+ 'change:repeating_weapons:weapon_att_str '
+ 'change:repeating_weapons:weapon_att_agi '
+ 'change:repeating_weapons:weapon_att_mnd',
function(event) {
getAttrs([
'str_computed', 'agi_computed', 'mnd_computed',
'repeating_weapons_weapon_att_fixed',
'repeating_weapons_weapon_att_str',
'repeating_weapons_weapon_att_agi',
'repeating_weapons_weapon_att_mnd'],
function(attrs) {
setAttrs({
'repeating_weapons_weapon_att_computed':
calcWeaponAttComputed(
toInt(attrs['str_computed']),
toInt(attrs['agi_computed']),
toInt(attrs['mnd_computed']),
attrs['repeating_weapons_weapon_att_fixed'],
attrs['repeating_weapons_weapon_att_str'],
attrs['repeating_weapons_weapon_att_agi'],
attrs['repeating_weapons_weapon_att_mnd'])
});
});
});
on('change:repeating_armor:armor_def_fixed '
+ 'change:repeating_armor:armor_def_str '
+ 'change:repeating_armor:armor_def_agi '
+ 'change:repeating_armor:armor_def_mnd',
function(event) {
getAttrs([
'str_computed', 'agi_computed', 'mnd_computed',
'repeating_armor_armor_def_fixed',
'repeating_armor_armor_def_str',
'repeating_armor_armor_def_agi',
'repeating_armor_armor_def_mnd'],
function(attrs) {
setAttrs({
'repeating_armor_armor_def_computed':
calcArmorDefComputed(
toInt(attrs['str_computed']),
toInt(attrs['agi_computed']),
toInt(attrs['mnd_computed']),
attrs['repeating_armor_armor_def_fixed'],
attrs['repeating_armor_armor_def_str'],
attrs['repeating_armor_armor_def_agi'],
attrs['repeating_armor_armor_def_mnd'])
});
});
});
// Auto-calc: movement
on('change:agi_computed', function(event) {
getAttrs(['agi_computed'], function(attrs) {
var movement = 10 + toInt(attrs['agi_computed']);
setAttrs({
'movement': movement
});
});
});
// Auto-calc: enc_total
on('change:repeating_weapons:weapon_enc remove:repeating_weapons '
+ 'change:repeating_armor:armor_enc remove:repeating_armor '
+ 'change:repeating_items:item_enc remove:repeating_items',
function(event) {
var enc_total = 0;
// Retrieve all repeating row IDs for weapons, armor and items...
getSectionIDs('repeating_weapons', function(weaponIds) {
getSectionIDs('repeating_armor', function(armorIds) {
getSectionIDs('repeating_items', function(itemIds) {
var attrsToGet = [];
// Consider all relevant weapon field values.
for (var i = 0; i < weaponIds.length; i++) {
var currAttrPrefix = 'repeating_weapons_' + weaponIds[i] + '_';
attrsToGet.push(currAttrPrefix + 'weapon_enc');
}
// Consider all relevant armor field values.
for (var i = 0; i < armorIds.length; i++) {
var currAttrPrefix = 'repeating_armor_' + armorIds[i] + '_';
attrsToGet.push(currAttrPrefix + 'armor_enc');
}
// Consider all relevant item field values.
for (var i = 0; i < itemIds.length; i++) {
var currAttrPrefix = 'repeating_items_' + itemIds[i] + '_';
attrsToGet.push(currAttrPrefix + 'item_enc');
}
// Get all attributes together...
getAttrs(attrsToGet, function(attrs) {
// Compute the sum of encumbrance values.
var enc_total = 0;
for (var key in attrs) {
enc_total += toInt(attrs[key]);
}
// Completion.
setAttrs({
'enc_total': enc_total
});
});
});
});
});
});
// Auto-calc: enc_threshold = str_computed
// Auto-calc: enc_threshold_max = str_computed + 2
on('change:str_computed', function(event) {
getAttrs(['str_computed'], function(attrs) {
setAttrs({
'enc_threshold': toInt(attrs['str_computed']),
'enc_threshold_max': toInt(attrs['str_computed']) + 2
});
});
});
// Auto-calc: enc_is_encumbered = (enc_total > enc_threshold)
// Auto-calc: enc_is_max_capacity = (enc_total == enc_threshold_max)
// Auto-calc: enc_is_over_capacity = (enc_total > enc_threshold_max)
// Auto-calc: enc_status
on('change:enc_total change:enc_threshold change:enc_threshold_max', function(event) {
getAttrs(['enc_total', 'enc_threshold', 'enc_threshold_max'], function(attrs) {
var enc_total = toInt(attrs['enc_total']);
var enc_threshold = toInt(attrs['enc_threshold']);
var enc_threshold_max = toInt(attrs['enc_threshold_max']);
var enc_is_encumbered = (enc_total > enc_threshold)? 'true': 'false';
var enc_is_max_capacity = (enc_total === enc_threshold_max)? 'true': 'false';
var enc_is_over_capacity = (enc_total > enc_threshold_max)? 'true': 'false';
var enc_status = '';
if (enc_is_over_capacity === 'true') enc_status = 'over_capacity';
else if (enc_is_max_capacity === 'true') enc_status = 'max_capacity';
else if (enc_is_encumbered === 'true') enc_status = 'encumbered';
setAttrs({
'enc_is_encumbered': enc_is_encumbered,
'enc_is_max_capacity': enc_is_max_capacity,
'enc_is_over_capacity': enc_is_over_capacity,
'enc_status': enc_status
});
});
});
// Auto-calc: npc_move = npc_agi + 10
on('change:repeating_npc:npc_agi', function(event) {
getAttrs(['repeating_npc_npc_agi'], function(attrs) {
setAttrs({
'repeating_npc_npc_move': toInt(attrs['repeating_npc_npc_agi']) + 10
});
});
});
</script>