Files
2025-04-18 14:50:47 -06:00

4681 lines
302 KiB
HTML

<button name="act_k-network-call" hidden="" type="action">
</button>
<input name="attr_row_stored_attributes" value="" type="hidden" title="@{row_stored_attributes}"/>
<input name="attr_row_row" value="" type="hidden" title="@{row_row}"/>
<input class="vaesen-modal-control" name="attr_row_edit_state" id="vaesen-modal" value="1" hidden="" type="checkbox" title="@{row_edit_state}"/>
<div class="border__line__spiral vaesen-modal row-edit-container">
<div class="scroll-container"><span class="edit-header" name="attr_row_modal_header" data-i18n-dynamic="" title="@{row_modal_header}"></span>
<input class="display-control" name="attr_row_section" value="relationships" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-relationships">
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="character name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="describe the relationship"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_details" title="@{row_details}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_details" type="text" title="@{row_details}"></textarea>
</div>
</div>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="advantages" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-advantages">
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="description"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_description" title="@{row_description}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_description" type="text" title="@{row_description}"></textarea>
</div>
</div>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="equipment" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-equipment">
<div class="notched notched--labelled grid-span-all bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="bonus"></span>
<input class="input-label__input" name="attr_row_bonus" type="number" title="@{row_bonus}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="availability"></span>
<input class="input-label__input" name="attr_row_availability" type="number" title="@{row_availability}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="skill"></span>
<select class="input-label__input" name="attr_row_skill_1" title="@{row_skill_1}">
<option value="" data-i18n="select one" selected="">
</option>
<option value="agility" data-i18n="agility">
</option>
<option value="close_combat" data-i18n="close combat">
</option>
<option value="force" data-i18n="force">
</option>
<option value="medicine" data-i18n="medicine">
</option>
<option value="ranged_combat" data-i18n="ranged combat">
</option>
<option value="stealth" data-i18n="stealth">
</option>
<option value="investigation" data-i18n="investigation">
</option>
<option value="learning" data-i18n="learning">
</option>
<option value="vigilance" data-i18n="vigilance">
</option>
<option value="inspiration" data-i18n="inspiration">
</option>
<option value="manipulation" data-i18n="manipulation">
</option>
<option value="observation" data-i18n="observation">
</option>
</select>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="skill"></span>
<select class="input-label__input" name="attr_row_skill_2" title="@{row_skill_2}">
<option value="" data-i18n="select one" selected="">
</option>
<option value="agility" data-i18n="agility">
</option>
<option value="close_combat" data-i18n="close combat">
</option>
<option value="force" data-i18n="force">
</option>
<option value="medicine" data-i18n="medicine">
</option>
<option value="ranged_combat" data-i18n="ranged combat">
</option>
<option value="stealth" data-i18n="stealth">
</option>
<option value="investigation" data-i18n="investigation">
</option>
<option value="learning" data-i18n="learning">
</option>
<option value="vigilance" data-i18n="vigilance">
</option>
<option value="inspiration" data-i18n="inspiration">
</option>
<option value="manipulation" data-i18n="manipulation">
</option>
<option value="observation" data-i18n="observation">
</option>
</select>
</label>
</div>
</div>
<div class="notched notched--labelled grid-span-all bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="effect"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_effect" title="@{row_effect}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_effect" type="text" title="@{row_effect}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled grid-span-all bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="description"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_description" title="@{row_description}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_description" type="text" title="@{row_description}"></textarea>
</div>
</div>
</div>
</div>
<label class="notched bordered header grid-span-all">
<div class="notch-container"><span class="input-label__text capitalize" data-i18n="magic item"></span>
<div class="notched-checkbox input-label__input">
<input name="attr_row_is_magic_item" value="1" type="checkbox" title="@{row_is_magic_item}"/>
</div>
</div>
</label>
<input class="display-control" name="attr_row_is_magic_item" value="1" hidden="" type="checkbox" title="@{row_is_magic_item}"/>
<div class="controlled-display magic-item-section">
<div class="notched notched--labelled grid-span-all bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="risk"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_risk" title="@{row_risk}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_risk" type="text" title="@{row_risk}"></textarea>
</div>
</div>
</div>
</div>
<label class="notched bordered header grid-span-all">
<div class="notch-container"><span class="input-label__text capitalize" data-i18n="magic"></span>
<div class="notched notch-input input-label__input bordered">
<div class="notch-container">
<input name="attr_row_magic" type="number" title="@{row_magic}"/>
</div>
</div>
</div>
</label>
</div>
</div>
<input class="display-control" name="attr_row_section" value="facilities" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-facilities facilities-edit">
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="description"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_description" title="@{row_description}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_description" type="text" title="@{row_description}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="function"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_function" title="@{row_function}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_function" type="text" title="@{row_function}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="asset"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_asset" title="@{row_asset}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_asset" type="text" title="@{row_asset}"></textarea>
</div>
</div>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="discovered-facilities" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-discovered-facilities facilities-edit">
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="description"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_description" title="@{row_description}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_description" type="text" title="@{row_description}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="function"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_function" title="@{row_function}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_function" type="text" title="@{row_function}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="asset"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_asset" title="@{row_asset}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_asset" type="text" title="@{row_asset}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="discovery"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_discovery" title="@{row_discovery}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_discovery" type="text" title="@{row_discovery}"></textarea>
</div>
</div>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="contacts" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-contacts facilities-edit">
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="description"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_description" title="@{row_description}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_description" type="text" title="@{row_description}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="function"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_function" title="@{row_function}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_function" type="text" title="@{row_function}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="asset"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_asset" title="@{row_asset}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_asset" type="text" title="@{row_asset}"></textarea>
</div>
</div>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="personnel" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-personnel facilities-edit">
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="description"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_description" title="@{row_description}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_description" type="text" title="@{row_description}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="function"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_function" title="@{row_function}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_function" type="text" title="@{row_function}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="asset"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_asset" title="@{row_asset}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_asset" type="text" title="@{row_asset}"></textarea>
</div>
</div>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="insights" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-insights">
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="description"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_description" title="@{row_description}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_description" type="text" title="@{row_description}"></textarea>
</div>
</div>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="mementos" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-mementos">
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="description"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_description" title="@{row_description}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_description" type="text" title="@{row_description}"></textarea>
</div>
</div>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="talents" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-talents">
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="description"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_description" title="@{row_description}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_description" type="text" title="@{row_description}"></textarea>
</div>
</div>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="weapons" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-weapons">
<div class="notched notched--labelled bordered" style="grid-area:name;">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered" style="grid-area:skill;">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="skill"></span>
<select class="input-label__input" name="attr_row_skill" title="@{row_skill}">
<option value="" data-i18n="select one" selected="">
</option>
<option value="agility" data-i18n="agility">
</option>
<option value="close_combat" data-i18n="close combat">
</option>
<option value="force" data-i18n="force">
</option>
<option value="medicine" data-i18n="medicine">
</option>
<option value="ranged_combat" data-i18n="ranged combat">
</option>
<option value="stealth" data-i18n="stealth">
</option>
<option value="investigation" data-i18n="investigation">
</option>
<option value="learning" data-i18n="learning">
</option>
<option value="vigilance" data-i18n="vigilance">
</option>
<option value="inspiration" data-i18n="inspiration">
</option>
<option value="manipulation" data-i18n="manipulation">
</option>
<option value="observation" data-i18n="observation">
</option>
</select>
</label>
</div>
</div>
<div class="notched notched--labelled bordered" style="grid-area:availability;">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="availability"></span>
<input class="input-label__input" name="attr_row_availability" type="number" title="@{row_availability}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered" style="grid-area:damage;">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="damage"></span>
<input class="input-label__input" name="attr_row_damage" type="number" title="@{row_damage}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered" style="grid-area:range;">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="range"></span>
<input class="input-label__input" name="attr_row_range" type="text" title="@{row_range}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered" style="grid-area:bonus;">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="bonus"></span>
<input class="input-label__input" name="attr_row_bonus" type="number" title="@{row_bonus}"/>
</label>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="magical-powers" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-magical-powers">
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="description"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_description" title="@{row_description}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_description" type="text" title="@{row_description}"></textarea>
</div>
</div>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="magic-items" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-magic-items">
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="effect"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_effect" title="@{row_effect}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_effect" type="text" title="@{row_effect}"></textarea>
</div>
</div>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="conditions" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-conditions">
<div class="notched-checkbox">
<input name="attr_row_affected" value="1" type="checkbox" title="@{row_affected}"/>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled notched-label--number effect-input bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="effect"></span>
<input class="input-label__input" name="attr_row_effect" type="number" title="@{row_effect}"/>
</label>
</div>
</div>
<div class="notched notched--labelled grid-span-all bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="description"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_description" title="@{row_description}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_description" type="text" title="@{row_description}"></textarea>
</div>
</div>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="attacks" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-attacks">
<div class="notched notched--labelled bordered" style="grid-area:name;">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered" style="grid-area:damage;">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="damage"></span>
<input class="input-label__input" name="attr_row_damage" type="number" title="@{row_damage}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered" style="grid-area:range;">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="range"></span>
<input class="input-label__input" name="attr_row_range" type="text" title="@{row_range}"/>
</label>
</div>
</div>
<div class="notched notched--labelled grid-span-all bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="effect"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_description" title="@{row_description}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_description" type="text" title="@{row_description}"></textarea>
</div>
</div>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="facilities" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-facilities facilities-edit">
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="description"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_description" title="@{row_description}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_description" type="text" title="@{row_description}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="function"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_function" title="@{row_function}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_function" type="text" title="@{row_function}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="asset"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_asset" title="@{row_asset}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_asset" type="text" title="@{row_asset}"></textarea>
</div>
</div>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="discovered-facilities" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-discovered-facilities facilities-edit">
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="description"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_description" title="@{row_description}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_description" type="text" title="@{row_description}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="function"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_function" title="@{row_function}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_function" type="text" title="@{row_function}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="asset"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_asset" title="@{row_asset}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_asset" type="text" title="@{row_asset}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="discovery"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_discovery" title="@{row_discovery}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_discovery" type="text" title="@{row_discovery}"></textarea>
</div>
</div>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="contacts" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-contacts facilities-edit">
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="description"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_description" title="@{row_description}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_description" type="text" title="@{row_description}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="function"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_function" title="@{row_function}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_function" type="text" title="@{row_function}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="asset"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_asset" title="@{row_asset}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_asset" type="text" title="@{row_asset}"></textarea>
</div>
</div>
</div>
</div>
</div>
<input class="display-control" name="attr_row_section" value="personnel" hidden="" type="checkbox" title="@{row_section}"/>
<div class="controlled-display edit-section-personnel facilities-edit">
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_row_name" type="text" title="@{row_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="description"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_description" title="@{row_description}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_description" type="text" title="@{row_description}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="function"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_function" title="@{row_function}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_function" type="text" title="@{row_function}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="asset"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_row_asset" title="@{row_asset}"></span>
<textarea class="adaptive--text__textarea" name="attr_row_asset" type="text" title="@{row_asset}"></textarea>
</div>
</div>
</div>
</div>
</div>
<button class="material-icons" name="act_row-save" data-i18n-title="Save changes" type="action">save
</button>
<button class="material-icons" name="act_row-close" data-i18n-title="Discard changes" type="action">close
</button>
</div>
</div>
<button name="act_push" hidden="" type="action">
</button><!-- Inserted fonts:"Galdeano" --><!-- Inserted fonts:"Marcellus+SC" --><!-- Inserted fonts:"Sorts+Mill+Goudy" --><img class="token-overlay" name="attr_character_token" data-i18n-alt="character token" title="@{character_token}"/>
<div class="compendium-drop-target vaesen animals nonplayer_characters">
<input name="attr_drop_name" accept="Name" value="" type="hidden" title="@{drop_name}"/>
<input name="attr_drop_data" accept="data" value="" type="hidden" title="@{drop_data}"/><!-- sectionName:vaesen -->
<input name="attr_vaesen_tab" value="nav-tabs-vaesen--settings" type="hidden" title="@{vaesen_tab}"/>
<div class="tabs tabs--vaesen">
<nav class="tabs__header tabs--vaesen__header">
<ul class="tabs__nav-list">
<li class="tabs__nav-item">
<button class="tabs__button tabs--vaesen__button tabs--vaesen__button--settings vaesen-nav vaesen-nav--settings material-icons" name="act_nav-tabs-vaesen--settings" data-container-button="vaesen" data-button="settings" type="action" data-container-tab="vaesen" data-tab="settings">settings
</button>
</li>
<li class="tabs__nav-item">
<button class="tabs__button tabs--vaesen__button tabs--vaesen__button--pc vaesen-nav vaesen-nav--pc material-icons" name="act_nav-tabs-vaesen--pc" data-container-button="vaesen" data-button="pc" type="action" data-container-tab="vaesen" data-tab="pc">person
</button>
</li>
<li class="tabs__nav-item">
<button class="tabs__button tabs--vaesen__button tabs--vaesen__button--hq vaesen-nav vaesen-nav--hq material-icons" name="act_nav-tabs-vaesen--hq" data-container-button="vaesen" data-button="hq" type="action" data-container-tab="vaesen" data-tab="hq">home
</button>
</li>
<li class="tabs__nav-item">
<button class="tabs__button tabs--vaesen__button tabs--vaesen__button--vaesen vaesen-nav vaesen-nav--vaesen material-icons" name="act_nav-tabs-vaesen--vaesen" data-container-button="vaesen" data-button="vaesen" type="action" data-container-tab="vaesen" data-tab="vaesen">person
</button>
</li>
<li class="tabs__nav-item">
<button class="tabs__button tabs--vaesen__button tabs--vaesen__button--npc vaesen-nav vaesen-nav--npc material-icons" name="act_nav-tabs-vaesen--npc" data-container-button="vaesen" data-button="npc" type="action" data-container-tab="vaesen" data-tab="npc">person
</button>
</li>
<li class="tabs__nav-item">
<button class="tabs__button tabs--vaesen__button tabs--vaesen__button--animal vaesen-nav vaesen-nav--animal material-icons" name="act_nav-tabs-vaesen--animal" data-container-button="vaesen" data-button="animal" type="action" data-container-tab="vaesen" data-tab="animal">pets
</button>
</li>
</ul>
</nav>
<div class="tabs__body tabs--vaesen__body">
<div class="tabs__container tabs--vaesen__container tabs--vaesen__container--settings" data-container-tab="vaesen" data-tab="settings">
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="sheet type"></span>
<select class="input-label__input" name="attr_sheet_type" title="@{sheet_type}">
<option value="pc" data-i18n="PC">
</option>
<option value="hq" data-i18n="HQ">
</option>
<option value="vaesen" data-i18n="vaesen">
</option>
<option value="animal" data-i18n="animal">
</option>
<option value="npc" data-i18n="NPC">
</option>
</select>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="whisper rolls to gm"></span>
<select class="input-label__input" name="attr_whisper" title="@{whisper}">
<option value=" " data-i18n="never" selected="">
</option>
<option value="/w gm " data-i18n="always">
</option>
</select>
</label>
</div>
</div>
</div>
<div class="tabs__container tabs--vaesen__container tabs--vaesen__container--pc" data-container-tab="vaesen" data-tab="pc">
<section class="border__line__spiral character-section flex-wrap" data-i18n-aria-label="character info">
<div class="notched notched--labelled flex-span-all bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_character_name" type="text" title="@{character_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="age/age group"></span>
<input class="input-label__input" name="attr_age" type="text" title="@{age}"/>
</label>
</div>
</div>
<div class="notched notched--labelled grid-span-3 bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="archetype"></span>
<input class="input-label__input" name="attr_archetype" type="text" title="@{archetype}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="motivation"></span>
<input class="input-label__input" name="attr_motivation" type="text" title="@{motivation}"/>
</label>
</div>
</div>
<div class="notched notched--labelled flex-span-all bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="trauma"></span>
<input class="input-label__input" name="attr_trauma" type="text" title="@{trauma}"/>
</label>
</div>
</div>
<div class="notched notched--labelled flex-span-all bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="dark secret"></span>
<input class="input-label__input" name="attr_dark_secret" type="text" title="@{dark_secret}"/>
</label>
</div>
</div>
<section class="relationship-section flex-span-all" aria-labelledby="relationship-header">
<h3 data-i18n="relationships" id="relationship-header"></h3>
<div class="notched bordered">
<div class="notch-container">
<div class="repeating-container">
<div class="fieldset-headers">
<h4 data-i18n="name"></h4>
<h4 data-i18n="details"></h4>
</div>
<button class="repcontrol-button repcontrol-button--add" name="act_create-relationships" type="action">
</button><span class="complex-section" hidden=""></span>
<fieldset class="repeating_relationships">
<input class="collapse edit-button" name="attr_edit_row" value="1" type="checkbox" title="@{repeating_relationships_$X_edit_row}"/>
<input name="attr_name" value="" data-i18n-placeholder="character name" type="text" title="@{repeating_relationships_$X_name}"/>
<div class="adaptive adaptive--text description"><span class="adaptive--text__span" name="attr_details" title="@{repeating_relationships_$X_details}"></span>
<textarea class="adaptive--text__textarea" name="attr_details" data-i18n-placeholder="describe the relationship" title="@{repeating_relationships_$X_details}"></textarea>
</div>
</fieldset>
</div>
</div>
</div>
</section>
</section>
<section class="nested-pc-grid">
<section class="border__line__cross headed-section attribute-section" aria-labelledby="attribute-header">
<div class="notched header bordered">
<div class="notch-container">
<h3 data-i18n="attributes"></h3>
</div>
</div>
<div class="content">
<div class="alternating-container">
<div class="flex-box justify-space-between attribute-row">
<button class="capitalize roller" name="roll_physique" data-i18n="physique" value="@{physique_action}" type="roll">
</button>
<button name="act_physique-action" hidden="" type="action">
</button>
<input name="attr_physique_action" type="hidden" title="@{physique_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_physique" type="number" title="@{physique}"/>
</div>
</div>
</div>
<div class="flex-box justify-space-between attribute-row">
<button class="capitalize roller" name="roll_precision" data-i18n="precision" value="@{precision_action}" type="roll">
</button>
<button name="act_precision-action" hidden="" type="action">
</button>
<input name="attr_precision_action" type="hidden" title="@{precision_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_precision" type="number" title="@{precision}"/>
</div>
</div>
</div>
<div class="flex-box justify-space-between attribute-row">
<button class="capitalize roller" name="roll_logic" data-i18n="logic" value="@{logic_action}" type="roll">
</button>
<button name="act_logic-action" hidden="" type="action">
</button>
<input name="attr_logic_action" type="hidden" title="@{logic_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_logic" type="number" title="@{logic}"/>
</div>
</div>
</div>
<div class="flex-box justify-space-between attribute-row">
<button class="capitalize roller" name="roll_empathy" data-i18n="empathy" value="@{empathy_action}" type="roll">
</button>
<button name="act_empathy-action" hidden="" type="action">
</button>
<input name="attr_empathy_action" type="hidden" title="@{empathy_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_empathy" type="number" title="@{empathy}"/>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="border__line__cross headed-section resource-section" aria-labelledby="resource-header">
<div class="notched header bordered">
<div class="notch-container">
<button class="h3 roller" name="roll_resources" role="header" aria-level="3" data-i18n="resources" id="resource-header" value="@{resources_action}" type="roll">
</button>
<button name="act_resources-action" hidden="" type="action">
</button>
<input name="attr_resources_action" type="hidden" title="@{resources_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_resources" type="number" title="@{resources}"/>
</div>
</div>
</div>
</div>
<div class="content">
<div class="experience-container">
<h4 data-i18n="experience"></h4>
<div class="custom-fill-left half-gap experience-checks">
<div class="notched-checkbox">
<input name="attr_experience" value="1" type="checkbox" title="@{experience}"/>
</div>
<div class="notched-checkbox">
<input name="attr_experience" value="2" type="checkbox" title="@{experience}"/>
</div>
<div class="notched-checkbox">
<input name="attr_experience" value="3" type="checkbox" title="@{experience}"/>
</div>
<div class="notched-checkbox">
<input name="attr_experience" value="4" type="checkbox" title="@{experience}"/>
</div>
<div class="notched-checkbox">
<input name="attr_experience" value="5" type="checkbox" title="@{experience}"/>
</div>
<div class="notched-checkbox">
<input name="attr_experience" value="6" type="checkbox" title="@{experience}"/>
</div>
<div class="notched-checkbox">
<input name="attr_experience" value="7" type="checkbox" title="@{experience}"/>
</div>
<div class="notched-checkbox">
<input name="attr_experience" value="8" type="checkbox" title="@{experience}"/>
</div>
<div class="notched-checkbox">
<input name="attr_experience" value="9" type="checkbox" title="@{experience}"/>
</div>
<div class="notched-checkbox">
<input name="attr_experience" value="10" type="checkbox" title="@{experience}"/>
</div>
</div>
</div>
</div>
</section>
</section>
<section class="border__line__cross headed-section condition-container" aria-labelledby="condition-header">
<div class="notched header bordered">
<div class="notch-container">
<h3 data-i18n="conditions" id="condition-header"></h3>
</div>
</div>
<div class="content">
<input name="attr_physical_max" value="4" type="hidden" title="@{physical|max}"/>
<input name="attr_mental_max" value="4" type="hidden" title="@{mental|max}"/>
<div class="alternating-container">
<label class="condition-line">
<h4 data-i18n="physical"></h4><span class="capitalize" data-i18n="exhausted"></span>
<div class="notched-checkbox">
<input name="attr_physical_1" value="1" type="checkbox" title="@{physical_1}"/>
</div>
</label>
<label class="condition-line"><span class="capitalize" data-i18n="battered"></span>
<div class="notched-checkbox">
<input name="attr_physical_2" value="1" type="checkbox" title="@{physical_2}"/>
</div>
</label>
<label class="condition-line"><span class="capitalize" data-i18n="wounded"></span>
<div class="notched-checkbox">
<input name="attr_physical_3" value="1" type="checkbox" title="@{physical_3}"/>
</div>
</label>
<label class="condition-line"><span class="capitalize" data-i18n="broken"></span>
<div class="notched-checkbox">
<input name="attr_physical_4" value="1" type="checkbox" title="@{physical_4}"/>
</div>
</label>
<label class="condition-line">
<h4 data-i18n="mental"></h4><span class="capitalize" data-i18n="angry"></span>
<div class="notched-checkbox">
<input name="attr_mental_1" value="1" type="checkbox" title="@{mental_1}"/>
</div>
</label>
<label class="condition-line"><span class="capitalize" data-i18n="frightened"></span>
<div class="notched-checkbox">
<input name="attr_mental_2" value="1" type="checkbox" title="@{mental_2}"/>
</div>
</label>
<label class="condition-line"><span class="capitalize" data-i18n="hopeless"></span>
<div class="notched-checkbox">
<input name="attr_mental_3" value="1" type="checkbox" title="@{mental_3}"/>
</div>
</label>
<label class="condition-line"><span class="capitalize" data-i18n="broken"></span>
<div class="notched-checkbox">
<input name="attr_mental_4" value="1" type="checkbox" title="@{mental_4}"/>
</div>
</label>
</div>
</div>
</section>
<section class="border__line__cross headed-section skill-container" aria-labelledby="skill-header">
<div class="notched header bordered">
<div class="notch-container">
<h3 data-i18n="skills" id="skill-header"></h3>
</div>
</div>
<div class="content">
<div class="alternating-container skill-layout">
<div class="grid-span-all">
<button class="capitalize roller" name="roll_agility" data-i18n="agility (physique)" value="@{agility_action}" type="roll">
</button>
<button name="act_agility-action" hidden="" type="action">
</button>
<input name="attr_agility_action" type="hidden" title="@{agility_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_agility" type="number" title="@{agility}"/>
</div>
</div>
</div>
<div class="grid-span-all">
<button class="capitalize roller" name="roll_close_combat" data-i18n="close combat (physique)" value="@{close_combat_action}" type="roll">
</button>
<button name="act_close-combat-action" hidden="" type="action">
</button>
<input name="attr_close_combat_action" type="hidden" title="@{close_combat_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_close_combat" type="number" title="@{close_combat}"/>
</div>
</div>
</div>
<div class="grid-span-all">
<button class="capitalize roller" name="roll_force" data-i18n="force (physique)" value="@{force_action}" type="roll">
</button>
<button name="act_force-action" hidden="" type="action">
</button>
<input name="attr_force_action" type="hidden" title="@{force_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_force" type="number" title="@{force}"/>
</div>
</div>
</div>
<div class="grid-span-all">
<button class="capitalize roller" name="roll_medicine" data-i18n="medicine (precision)" value="@{medicine_action}" type="roll">
</button>
<button name="act_medicine-action" hidden="" type="action">
</button>
<input name="attr_medicine_action" type="hidden" title="@{medicine_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_medicine" type="number" title="@{medicine}"/>
</div>
</div>
</div>
<div class="grid-span-all">
<button class="capitalize roller" name="roll_ranged_combat" data-i18n="ranged combat (precision)" value="@{ranged_combat_action}" type="roll">
</button>
<button name="act_ranged-combat-action" hidden="" type="action">
</button>
<input name="attr_ranged_combat_action" type="hidden" title="@{ranged_combat_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_ranged_combat" type="number" title="@{ranged_combat}"/>
</div>
</div>
</div>
<div class="grid-span-all">
<button class="capitalize roller" name="roll_stealth" data-i18n="stealth (precision)" value="@{stealth_action}" type="roll">
</button>
<button name="act_stealth-action" hidden="" type="action">
</button>
<input name="attr_stealth_action" type="hidden" title="@{stealth_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_stealth" type="number" title="@{stealth}"/>
</div>
</div>
</div>
<div class="grid-span-all">
<button class="capitalize roller" name="roll_investigation" data-i18n="investigation (logic)" value="@{investigation_action}" type="roll">
</button>
<button name="act_investigation-action" hidden="" type="action">
</button>
<input name="attr_investigation_action" type="hidden" title="@{investigation_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_investigation" type="number" title="@{investigation}"/>
</div>
</div>
</div>
<div class="grid-span-all">
<button class="capitalize roller" name="roll_learning" data-i18n="learning (logic)" value="@{learning_action}" type="roll">
</button>
<button name="act_learning-action" hidden="" type="action">
</button>
<input name="attr_learning_action" type="hidden" title="@{learning_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_learning" type="number" title="@{learning}"/>
</div>
</div>
</div>
<div class="grid-span-all">
<button class="capitalize roller" name="roll_vigilance" data-i18n="vigilance (logic)" value="@{vigilance_action}" type="roll">
</button>
<button name="act_vigilance-action" hidden="" type="action">
</button>
<input name="attr_vigilance_action" type="hidden" title="@{vigilance_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_vigilance" type="number" title="@{vigilance}"/>
</div>
</div>
</div>
<div class="grid-span-all">
<button class="capitalize roller" name="roll_inspiration" data-i18n="inspiration (empathy)" value="@{inspiration_action}" type="roll">
</button>
<button name="act_inspiration-action" hidden="" type="action">
</button>
<input name="attr_inspiration_action" type="hidden" title="@{inspiration_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_inspiration" type="number" title="@{inspiration}"/>
</div>
</div>
</div>
<div class="grid-span-all">
<button class="capitalize roller" name="roll_manipulation" data-i18n="manipulation (empathy)" value="@{manipulation_action}" type="roll">
</button>
<button name="act_manipulation-action" hidden="" type="action">
</button>
<input name="attr_manipulation_action" type="hidden" title="@{manipulation_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_manipulation" type="number" title="@{manipulation}"/>
</div>
</div>
</div>
<div class="grid-span-all">
<button class="capitalize roller" name="roll_observation" data-i18n="observation (empathy)" value="@{observation_action}" type="roll">
</button>
<button name="act_observation-action" hidden="" type="action">
</button>
<input name="attr_observation_action" type="hidden" title="@{observation_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_observation" type="number" title="@{observation}"/>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="border__line__cross headed-section equipment-container" aria-labelledby="equipment-header">
<div class="notched header bordered">
<div class="notch-container">
<h3 data-i18n="equipment" id="equipment-header"></h3>
</div>
</div>
<div class="content">
<div class="notched bordered">
<div class="notch-container">
<div class="repeating-container">
<button class="repcontrol-button repcontrol-button--add" name="act_create-equipment" type="action">
</button><span class="complex-section" hidden=""></span>
<fieldset class="repeating_equipment">
<input class="collapse edit-button" name="attr_edit_row" value="1" type="checkbox" title="@{repeating_equipment_$X_edit_row}"/>
<input name="attr_name" value="" type="hidden" title="@{repeating_equipment_$X_name}"/>
<input name="attr_description" value="" type="hidden" title="@{repeating_equipment_$X_description}"/>
<input name="attr_bonus" value="" type="hidden" title="@{repeating_equipment_$X_bonus}"/>
<input name="attr_skill_1" value="" type="hidden" title="@{repeating_equipment_$X_skill_1}"/>
<input name="attr_skill_2" value="" type="hidden" title="@{repeating_equipment_$X_skill_2}"/>
<input name="attr_effect" value="" type="hidden" title="@{repeating_equipment_$X_effect}"/>
<input name="attr_availability" value="" type="hidden" title="@{repeating_equipment_$X_availability}"/>
<input name="attr_is_magic_item" value="" type="hidden" title="@{repeating_equipment_$X_is_magic_item}"/>
<input name="attr_risk" value="" type="hidden" title="@{repeating_equipment_$X_risk}"/>
<input name="attr_magic" value="" type="hidden" title="@{repeating_equipment_$X_magic}"/>
<input class="display-control" name="attr_show_roll" value="1" hidden="" type="checkbox" title="@{repeating_equipment_$X_show_roll}"/>
<button class="material-icons roll-button controlled-display roller" name="roll_roll" value="@{action}" type="roll">casino
</button>
<button name="act_action" hidden="" type="action">
</button>
<input name="attr_action" type="hidden" title="@{repeating_equipment_$X_action}"/>
<label class="summary flex-box">
<input class="summary__arrow" name="attr_expand" value="1" type="checkbox" title="@{repeating_equipment_$X_expand}"/><span name="attr_name" title="@{repeating_equipment_$X_name}"></span><span class="right-align" name="attr_bonus" title="@{repeating_equipment_$X_bonus}"></span>
</label>
<input class="slide-down-control" name="attr_expand" value="1" hidden="" type="checkbox" title="@{repeating_equipment_$X_expand}"/>
<div class="controlled-display grid-span-all"><span class="description" name="attr_description" title="@{repeating_equipment_$X_description}"></span>
</div>
<input class="slide-down-control" name="attr_expand" value="1" hidden="" type="checkbox" title="@{repeating_equipment_$X_expand}"/>
<div class="controlled-display grid-span-all"><span class="description" name="attr_effect" title="@{repeating_equipment_$X_effect}"></span>
</div>
<input class="display-control" name="attr_is_magic_item" value="1" hidden="" type="checkbox" title="@{repeating_equipment_$X_is_magic_item}"/>
<div class="controlled-display display-contents">
<input class="slide-down-control" name="attr_expand" value="1" hidden="" type="checkbox" title="@{repeating_equipment_$X_expand}"/>
<div class="controlled-display display-contents">
<input class="display-control--non-zero" name="attr_risk" value="" type="hidden" title="@{repeating_equipment_$X_risk}"/>
<div class="controlled-display grid-span-all flex-box tiny-gap"><span class="bold capitalize" data-i18n="risk"></span><span class="description" name="attr_risk" title="@{repeating_equipment_$X_risk}"></span>
</div>
</div>
</div>
<input class="display-control" name="attr_is_magic_item" value="1" hidden="" type="checkbox" title="@{repeating_equipment_$X_is_magic_item}"/>
<div class="controlled-display grid-span-all display-contents">
<input class="slide-down-control" name="attr_expand" value="1" hidden="" type="checkbox" title="@{repeating_equipment_$X_expand}"/>
<div class="controlled-display grid-span-all display-contents">
<input class="display-control--non-zero" name="attr_magic" value="" type="hidden" title="@{repeating_equipment_$X_magic}"/>
<button class="flex-box controlled-display tiny-gap grid-span-all roller" name="roll_magic" value="@{magic_action}" type="roll"><span class="bold capitalize" data-i18n="magic"></span><span name="attr_magic" title="@{repeating_equipment_$X_magic}"></span>
</button>
<button name="act_magic-action" hidden="" type="action">
</button>
<input name="attr_magic_action" type="hidden" title="@{repeating_equipment_$X_magic_action}"/>
</div>
</div>
</fieldset>
</div>
</div>
</div>
<section class="armor-container" aria-labelled-by="armor-header">
<h3 data-i18n="armor" id="armor-header"></h3><span class="capitalize text-7" data-i18n="protection"></span><span class="capitalize text-7" data-i18n="agility"></span>
<button class="material-icons roller" name="roll_armor" value="@{armor_action}" type="roll">casino
</button>
<button name="act_armor-action" hidden="" type="action">
</button>
<input name="attr_armor_action" type="hidden" title="@{armor_action}"/>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_armor_name" type="text" title="@{armor_name}"/>
</div>
</div>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_armor_protection" type="number" title="@{armor_protection}"/>
</div>
</div>
<div class="notched notch-input bordered">
<div class="notch-container">
<input name="attr_armor_penalty" type="number" title="@{armor_penalty}"/>
</div>
</div>
</section>
<section class="weapon-container" aria-labelled-by="weapon-header">
<h3 data-i18n="weapons" id="weapon-header"></h3>
<div class="notched bordered">
<div class="notch-container">
<div class="repeating-container">
<div class="repeat-header"><span class="damage capitalize text-7" data-i18n="damage"></span><span class="range capitalize text-7" data-i18n="range"></span><span class="bonus capitalize text-7" data-i18n="bonus"></span></div>
<button class="repcontrol-button repcontrol-button--add" name="act_create-weapons" type="action">
</button><span class="complex-section" hidden=""></span>
<fieldset class="repeating_weapons">
<input class="collapse edit-button" name="attr_edit_row" value="1" type="checkbox" title="@{repeating_weapons_$X_edit_row}"/>
<button class="roller" name="roll_roll" value="@{action}" type="roll">
<input name="attr_name" value="" type="hidden" title="@{repeating_weapons_$X_name}"/>
<input name="attr_damage" value="" type="hidden" title="@{repeating_weapons_$X_damage}"/>
<input name="attr_bonus" value="" type="hidden" title="@{repeating_weapons_$X_bonus}"/>
<input name="attr_range" value="0" type="hidden" title="@{repeating_weapons_$X_range}"/>
<input name="attr_availability" value="" type="hidden" title="@{repeating_weapons_$X_availability}"/>
<input name="attr_skill" value="" type="hidden" title="@{repeating_weapons_$X_skill}"/><span name="attr_name" title="@{repeating_weapons_$X_name}"></span><span class="damage" name="attr_damage" title="@{repeating_weapons_$X_damage}"></span><span class="range" name="attr_range" title="@{repeating_weapons_$X_range}"></span><span class="bonus" name="attr_bonus" title="@{repeating_weapons_$X_bonus}"></span>
</button>
<button name="act_action" hidden="" type="action">
</button>
<input name="attr_action" type="hidden" title="@{repeating_weapons_$X_action}"/>
</fieldset>
</div>
</div>
</div>
</section>
<section class="memento-container" aria-labelled-by="memento-header">
<h3 data-i18n="mementos" id="memento-header"></h3>
<div class="notched bordered">
<div class="notch-container">
<div class="repeating-container">
<button class="repcontrol-button repcontrol-button--add" name="act_create-mementos" type="action">
</button><span class="complex-section" hidden=""></span>
<fieldset class="repeating_mementos">
<input class="collapse edit-button" name="attr_edit_row" value="1" type="checkbox" title="@{repeating_mementos_$X_edit_row}"/>
<button class="material-icons roll-button" name="roll_roll" value="@{template_start} {{description=@{description}}}" type="roll">
</button>
<label class="summary flex-box">
<input class="summary__arrow" name="attr_expand" value="1" type="checkbox" title="@{repeating_mementos_$X_expand}"/><span name="attr_name" title="@{repeating_mementos_$X_name}"></span>
</label>
<input class="slide-down-control" name="attr_expand" value="1" hidden="" type="checkbox" title="@{repeating_mementos_$X_expand}"/>
<div class="controlled-display grid-span-all"><span class="description" name="attr_description" title="@{repeating_mementos_$X_description}"></span>
</div>
</fieldset>
</div>
</div>
</div>
</section>
</div>
</section>
<section class="border__line__cross headed-section talent-container" aria-labelledby="talent-header">
<div class="notched header bordered">
<div class="notch-container">
<h3 data-i18n="talents" id="talent-header"></h3>
</div>
</div>
<div class="content">
<div class="notched bordered">
<div class="notch-container">
<div class="repeating-container">
<button class="repcontrol-button repcontrol-button--add" name="act_create-talents" type="action">
</button><span class="complex-section" hidden=""></span>
<fieldset class="repeating_talents">
<input class="collapse edit-button" name="attr_edit_row" value="1" type="checkbox" title="@{repeating_talents_$X_edit_row}"/>
<button class="material-icons roll-button" name="roll_roll" value="@{template_start} {{title=@{name}}} {{description=@{description}}}" type="roll">chat
</button>
<input name="attr_name" value="" type="hidden" title="@{repeating_talents_$X_name}"/>
<input name="attr_description" value="" type="hidden" title="@{repeating_talents_$X_description}"/>
<label class="summary flex-box">
<input class="summary__arrow" name="attr_expand" value="1" type="checkbox" title="@{repeating_talents_$X_expand}"/><span name="attr_name" title="@{repeating_talents_$X_name}"></span>
</label>
<input class="slide-down-control" name="attr_expand" value="1" hidden="" type="checkbox" title="@{repeating_talents_$X_expand}"/>
<div class="controlled-display"><span class="description" name="attr_description" title="@{repeating_talents_$X_description}"></span>
</div>
</fieldset>
</div>
</div>
</div>
</div>
</section>
<section class="border__line__cross headed-section insight-container" aria-labelledby="insight-header">
<div class="notched header bordered">
<div class="notch-container">
<h3 data-i18n="Insights" id="insight-header"></h3>
</div>
</div>
<div class="content">
<div class="notched bordered">
<div class="notch-container">
<div class="repeating-container">
<button class="repcontrol-button repcontrol-button--add" name="act_create-insights" type="action">
</button><span class="complex-section" hidden=""></span>
<fieldset class="repeating_insights">
<input class="collapse edit-button" name="attr_edit_row" value="1" type="checkbox" title="@{repeating_insights_$X_edit_row}"/>
<button class="material-icons roll-button" name="roll_roll" value="@{template_start} {{title=@{name}}} {{description=@{description}}}" type="roll">chat
</button>
<input name="attr_name" value="" type="hidden" title="@{repeating_insights_$X_name}"/>
<input name="attr_description" value="" type="hidden" title="@{repeating_insights_$X_description}"/>
<label class="summary flex-box">
<input class="summary__arrow" name="attr_expand" value="1" type="checkbox" title="@{repeating_insights_$X_expand}"/><span name="attr_name" title="@{repeating_insights_$X_name}"></span>
</label>
<input class="slide-down-control" name="attr_expand" value="1" hidden="" type="checkbox" title="@{repeating_insights_$X_expand}"/>
<div class="controlled-display"><span class="description" name="attr_description" title="@{repeating_insights_$X_description}"></span>
</div>
</fieldset>
</div>
</div>
</div>
</div>
</section>
<section class="border__line__cross headed-section advantage-container" aria-labelledby="advantage-header">
<div class="notched header bordered">
<div class="notch-container">
<h3 data-i18n="advantages" id="advantage-header"></h3>
</div>
</div>
<div class="content">
<div class="notched bordered">
<div class="notch-container">
<div class="repeating-container">
<button class="repcontrol-button repcontrol-button--add" name="act_create-advantages" type="action">
</button><span class="complex-section" hidden=""></span>
<fieldset class="repeating_advantages">
<input class="collapse edit-button" name="attr_edit_row" value="1" type="checkbox" title="@{repeating_advantages_$X_edit_row}"/>
<div class="notched-checkbox used">
<input name="attr_used" value="1" type="checkbox" title="@{repeating_advantages_$X_used}"/>
</div>
<button class="material-icons roll-button" name="roll_roll" value="@{template_start} {{title=@{name}}} {{description=@{description}}}" type="roll">chat
</button>
<input name="attr_name" value="" type="hidden" title="@{repeating_advantages_$X_name}"/>
<input name="attr_description" value="" type="hidden" title="@{repeating_advantages_$X_description}"/>
<label class="summary flex-box">
<input class="summary__arrow" name="attr_expand" value="1" type="checkbox" title="@{repeating_advantages_$X_expand}"/><span name="attr_name" title="@{repeating_advantages_$X_name}"></span>
</label>
<input class="slide-down-control" name="attr_expand" value="1" hidden="" type="checkbox" title="@{repeating_advantages_$X_expand}"/>
<div class="controlled-display"><span class="description" name="attr_description" title="@{repeating_advantages_$X_description}"></span>
</div>
</fieldset>
</div>
</div>
</div>
</div>
</section>
</div>
<div class="tabs__container tabs--vaesen__container tabs--vaesen__container--hq" data-container-tab="vaesen" data-tab="hq">
<section class="border__line__spiral hq-section" data-i18n-aria-label="headquarters info">
<div class="notched notched--labelled flex-span-all bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="name"></span>
<input class="input-label__input" name="attr_character_name" type="text" title="@{character_name}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="type of building"></span>
<input class="input-label__input" name="attr_type_of_building" type="text" title="@{type_of_building}"/>
</label>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="location"></span>
<input class="input-label__input" name="attr_location" type="text" title="@{location}"/>
</label>
</div>
</div>
<div class="notched header bordered">
<div class="notch-container">
<h3 class="text-3" data-i18n="development points"></h3>
<div class="notched notch-input bordered">
<div class="notch-container">
<input type="number" name="attr_development_points" title="@{development_points}"/>
</div>
</div>
</div>
</div>
</section>
<section class="border__line__cross headed-section history-section" aria-labelledby="history-header">
<div class="content">
<h3 data-i18n="history" id="history-header"></h3>
<div class="notched bordered">
<div class="notch-container">
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_history" title="@{history}"></span>
<textarea class="adaptive--text__textarea" name="attr_history" title="@{history}"></textarea>
</div>
</div>
</div>
</div>
</section>
<section class="border__line__spiral upgrade-section grid-span-all" aria-labelledby="upgrade-header">
<div class="notched header grid-span-all bordered">
<div class="notch-container">
<h3 class="text-3" data-i18n="upgrades" id="upgrade-header"></h3>
</div>
</div>
<div class="repeating-container">
<h4 class="grid-span-all" data-i18n="facilities"></h4>
<button class="repcontrol-button repcontrol-button--add" name="act_create-facilities" type="action">
</button><span class="complex-section" hidden=""></span>
<fieldset class="repeating_facilities">
<input class="collapse edit-button" name="attr_edit_row" value="1" type="checkbox" title="@{repeating_facilities_$X_edit_row}"/>
<div class="notch-container">
<div class="summary-wrapper">
<label class="flex-box summary">
<input class="summary__arrow" name="attr_expand" value="1" type="checkbox" title="@{repeating_facilities_$X_expand}"/>
<h5><span name="attr_name" title="@{repeating_facilities_$X_name}"></span>
</h5>
</label>
<input class="slide-down-control" name="attr_expand" value="1" hidden="" type="checkbox" title="@{repeating_facilities_$X_expand}"/>
<div class="controlled-display"><span class="description item-description" name="attr_description" title="@{repeating_facilities_$X_description}"></span>
</div>
</div>
<div class="input-label stacked hq-display-container"><span class="hq-display-line" name="attr_function" title="@{repeating_facilities_$X_function}"></span><span class="input-label__text description" data-i18n="function"></span>
</div>
<div class="input-label stacked hq-display-container"><span class="hq-display-line" name="attr_effect" title="@{repeating_facilities_$X_effect}"></span><span class="input-label__text description" data-i18n="effect"></span>
</div>
</div>
</fieldset>
</div>
<div class="repeating-container">
<h4 class="grid-span-all" data-i18n="discovered facilities"></h4>
<button class="repcontrol-button repcontrol-button--add" name="act_create-discovered-facilities" type="action">
</button><span class="complex-section" hidden=""></span>
<fieldset class="repeating_discovered-facilities">
<input class="collapse edit-button" name="attr_edit_row" value="1" type="checkbox" title="@{repeating_discovered-facilities_$X_edit_row}"/>
<div class="notch-container">
<div class="summary-wrapper">
<label class="flex-box summary">
<input class="summary__arrow" name="attr_expand" value="1" type="checkbox" title="@{repeating_discovered-facilities_$X_expand}"/>
<h5><span name="attr_name" title="@{repeating_discovered-facilities_$X_name}"></span>
</h5>
</label>
<input class="slide-down-control" name="attr_expand" value="1" hidden="" type="checkbox" title="@{repeating_discovered-facilities_$X_expand}"/>
<div class="controlled-display"><span class="description item-description" name="attr_description" title="@{repeating_discovered-facilities_$X_description}"></span>
</div>
</div>
<div class="input-label stacked hq-display-container"><span class="hq-display-line" name="attr_function" title="@{repeating_discovered-facilities_$X_function}"></span><span class="input-label__text description" data-i18n="function"></span>
</div>
<div class="input-label stacked hq-display-container"><span class="hq-display-line" name="attr_effect" title="@{repeating_discovered-facilities_$X_effect}"></span><span class="input-label__text description" data-i18n="effect"></span>
</div>
<div class="input-label stacked hq-display-container"><span class="hq-display-line" name="attr_discovery" title="@{repeating_discovered-facilities_$X_discovery}"></span><span class="input-label__text description" data-i18n="discovery"></span>
</div>
</div>
</fieldset>
</div>
<div class="repeating-container">
<h4 class="grid-span-all" data-i18n="contacts"></h4>
<button class="repcontrol-button repcontrol-button--add" name="act_create-contacts" type="action">
</button><span class="complex-section" hidden=""></span>
<fieldset class="repeating_contacts">
<input class="collapse edit-button" name="attr_edit_row" value="1" type="checkbox" title="@{repeating_contacts_$X_edit_row}"/>
<div class="notch-container">
<div class="summary-wrapper">
<label class="flex-box summary">
<input class="summary__arrow" name="attr_expand" value="1" type="checkbox" title="@{repeating_contacts_$X_expand}"/>
<h5><span name="attr_name" title="@{repeating_contacts_$X_name}"></span>
</h5>
</label>
<input class="slide-down-control" name="attr_expand" value="1" hidden="" type="checkbox" title="@{repeating_contacts_$X_expand}"/>
<div class="controlled-display"><span class="description item-description" name="attr_description" title="@{repeating_contacts_$X_description}"></span>
</div>
</div>
<div class="input-label stacked hq-display-container"><span class="hq-display-line" name="attr_function" title="@{repeating_contacts_$X_function}"></span><span class="input-label__text description" data-i18n="function"></span>
</div>
<div class="input-label stacked hq-display-container"><span class="hq-display-line" name="attr_effect" title="@{repeating_contacts_$X_effect}"></span><span class="input-label__text description" data-i18n="effect"></span>
</div>
</div>
</fieldset>
</div>
<div class="repeating-container">
<h4 class="grid-span-all" data-i18n="personnel"></h4>
<button class="repcontrol-button repcontrol-button--add" name="act_create-personnel" type="action">
</button><span class="complex-section" hidden=""></span>
<fieldset class="repeating_personnel">
<input class="collapse edit-button" name="attr_edit_row" value="1" type="checkbox" title="@{repeating_personnel_$X_edit_row}"/>
<div class="notch-container">
<div class="summary-wrapper">
<label class="flex-box summary">
<input class="summary__arrow" name="attr_expand" value="1" type="checkbox" title="@{repeating_personnel_$X_expand}"/>
<h5><span name="attr_name" title="@{repeating_personnel_$X_name}"></span>
</h5>
</label>
<input class="slide-down-control" name="attr_expand" value="1" hidden="" type="checkbox" title="@{repeating_personnel_$X_expand}"/>
<div class="controlled-display"><span class="description item-description" name="attr_description" title="@{repeating_personnel_$X_description}"></span>
</div>
</div>
<div class="input-label stacked hq-display-container"><span class="hq-display-line" name="attr_function" title="@{repeating_personnel_$X_function}"></span><span class="input-label__text description" data-i18n="function"></span>
</div>
<div class="input-label stacked hq-display-container"><span class="hq-display-line" name="attr_effect" title="@{repeating_personnel_$X_effect}"></span><span class="input-label__text description" data-i18n="effect"></span>
</div>
</div>
</fieldset>
</div>
</section>
</div>
<div class="tabs__container tabs--vaesen__container tabs--vaesen__container--vaesen flex-wrap normal-gap collapse-container" data-container-tab="vaesen" data-tab="vaesen">
<input class="collapse" name="attr_vaesen_collapse" value="1" type="checkbox" title="@{vaesen_collapse}"/>
<div class="notched header bordered">
<div class="notch-container">
<input class="text-3" name="attr_character_name" type="text" title="@{character_name}"/>
</div>
</div>
<div class="flex-box text-container">
<div class="notched notched--labelled ritual bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="ritual"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_ritual" title="@{ritual}"></span>
<textarea class="adaptive--text__textarea" name="attr_ritual" type="text" title="@{ritual}"></textarea>
</div>
</div>
</div>
</div>
<div class="notched notched--labelled secret bordered">
<div class="notch-container">
<div class="input-label stacked"><span data-i18n="secret"></span>
<div class="adaptive adaptive--text"><span class="adaptive--text__span" name="attr_secret" title="@{secret}"></span>
<textarea class="adaptive--text__textarea" name="attr_secret" type="text" title="@{secret}"></textarea>
</div>
</div>
</div>
</div>
</div>
<div class="border__line__cross headed-section npc-characteristic-section">
<div class="content flex-box flex-wrap half-gap justify-space-around">
<h3 class="text-5 flex-span-all" data-i18n="characteristics"></h3>
<div class="notched notched--labelled notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="might" name="roll_might" value="@{might_action}" type="roll">
</button>
<input class="input-label__input" name="attr_might" type="number" title="@{might}"/>
</div>
<button name="act_might-action" hidden="" type="action">
</button>
<input name="attr_might_action" type="hidden" title="@{might_action}"/>
</div>
</div>
<div class="notched notched--labelled notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="body control" name="roll_body_control" value="@{body_control_action}" type="roll">
</button>
<input class="input-label__input" name="attr_body_control" type="number" title="@{body_control}"/>
</div>
<button name="act_body-control-action" hidden="" type="action">
</button>
<input name="attr_body_control_action" type="hidden" title="@{body_control_action}"/>
</div>
</div>
<div class="notched notched--labelled notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="magic" name="roll_magic" value="@{magic_action}" type="roll">
</button>
<input class="input-label__input" name="attr_magic" type="number" title="@{magic}"/>
</div>
<button name="act_magic-action" hidden="" type="action">
</button>
<input name="attr_magic_action" type="hidden" title="@{magic_action}"/>
</div>
</div>
<div class="notched notched-label--number notched--labelled bordered fear bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="fear"></span>
<div class="flex-box tiny-gap">
<input name="attr_fear" type="number" title="@{fear}"/>
<input class="skill-collapse" name="attr_vaesen_collapse" value="1" hidden="" type="checkbox" title="@{vaesen_collapse}"/>
<input class="skill-display-control" name="attr_constant_fear" value="" type="hidden" title="@{constant_fear}"/><span class="slash controlled-skill">/</span>
<input class="skill-display-control" name="attr_constant_fear" value="" type="hidden" title="@{constant_fear}"/>
<input class="controlled-skill" name="attr_constant_fear" type="number" title="@{constant_fear}"/>
</div>
</label>
</div>
</div>
</div>
</div>
<section class="border__line__cross headed-section magical-powers-container" aria-labelledby="magic-power-header">
<div class="content repeating-container tiny-gap">
<h3 class="grid-span-all" data-i18n="magical powers" id="magic-power-header"></h3>
<button class="repcontrol-button repcontrol-button--add" name="act_create-magical-powers" type="action">
</button><span class="complex-section" hidden=""></span>
<fieldset class="repeating_magical-powers">
<input class="collapse edit-button" name="attr_edit_row" value="1" type="checkbox" title="@{repeating_magical-powers_$X_edit_row}"/>
<input name="attr_name" value="" type="hidden" title="@{repeating_magical-powers_$X_name}"/>
<input name="attr_description" value="" type="hidden" title="@{repeating_magical-powers_$X_description}"/><span name="attr_name" title="@{repeating_magical-powers_$X_name}"></span><span class="description" name="attr_description" title="@{repeating_magical-powers_$X_description}"></span>
</fieldset>
</div>
</section>
<input class="magic-items-control" name="attr_vaesen_collapse" value="1" hidden="" type="checkbox" title="@{vaesen_collapse}"/>
<section class="border__line__cross headed-section magic-items-container controlled-display" aria-labelledby="magic-items-header">
<div class="content repeating-container tiny-gap">
<h3 class="grid-span-all" data-i18n="magic items" id="magic-items-header"></h3>
<div class="grid-span-all section-labels"><span data-i18n="item"></span><span data-i18n="power"></span></div>
<button class="repcontrol-button repcontrol-button--add" name="act_create-magic-items" type="action">
</button><span class="complex-section" hidden=""></span>
<fieldset class="repeating_magic-items">
<input class="collapse edit-button" name="attr_edit_row" value="1" type="checkbox" title="@{repeating_magic-items_$X_edit_row}"/>
<input name="attr_name" value="" type="hidden" title="@{repeating_magic-items_$X_name}"/>
<input name="attr_effect" value="" type="hidden" title="@{repeating_magic-items_$X_effect}"/><span name="attr_name" title="@{repeating_magic-items_$X_name}"></span><span class="description" name="attr_effect" title="@{repeating_magic-items_$X_effect}"></span>
</fieldset>
</div>
</section>
<section class="border__line__cross headed-section vaesen-condition-container" aria-labelledby="vaesen-condition-header">
<div class="content repeating-container tiny-gap">
<h3 class="grid-span-all" data-i18n="conditions" id="vaesen-condition-header"></h3>
<button class="repcontrol-button repcontrol-button--add" name="act_create-conditions" type="action">
</button><span class="complex-section" hidden=""></span>
<fieldset class="repeating_conditions">
<input class="collapse edit-button" name="attr_edit_row" value="1" type="checkbox" title="@{repeating_conditions_$X_edit_row}"/>
<input name="attr_name" value="" type="hidden" title="@{repeating_conditions_$X_name}"/>
<input name="attr_effect" value="" type="hidden" title="@{repeating_conditions_$X_effect}"/>
<div class="notched-checkbox">
<input name="attr_affected" value="1" type="checkbox" title="@{repeating_conditions_$X_affected}"/>
</div><span class="inline-display"><span name="attr_name" title="@{repeating_conditions_$X_name}"></span>
<input class="display-control--non-zero" name="attr_effect" value="" type="hidden" title="@{repeating_conditions_$X_effect}"/>
<div class="display-contents controlled-display">
<input class="plus-control" name="attr_effect" value="" type="hidden" title="@{repeating_conditions_$X_effect}"/><span class="controlled-plus" name="attr_effect" title="@{repeating_conditions_$X_effect}"></span>
</div><span class="description" name="attr_description" title="@{repeating_conditions_$X_description}"></span></span>
</fieldset>
</div>
</section>
<section class="border__line__cross headed-section vaesen-combat-container" aria-labelledby="vaesen-combat-header">
<div class="content repeating-container tiny-gap">
<h3 class="grid-span-all" data-i18n="combat" id="vaesen-combat-header"></h3>
<div class="section-labels"><span class="capitalize" data-i18n="attack"></span><span class="capitalize" data-i18n="damage"></span><span class="capitalize" data-i18n="range"></span></div>
<button class="repcontrol-button repcontrol-button--add" name="act_create-attacks" type="action">
</button><span class="complex-section" hidden=""></span>
<fieldset class="repeating_attacks">
<input class="collapse edit-button" name="attr_edit_row" value="1" type="checkbox" title="@{repeating_attacks_$X_edit_row}"/>
<input class="collapse hider" name="attr_collapse" value="1" type="checkbox" title="@{repeating_attacks_$X_collapse}" checked="checked"/>
<input name="attr_name" value="" type="hidden" title="@{repeating_attacks_$X_name}"/>
<input name="attr_damage" value="" type="hidden" title="@{repeating_attacks_$X_damage}"/>
<input name="attr_description" value="" type="hidden" title="@{repeating_attacks_$X_description}"/>
<input name="attr_range" value="0" type="hidden" title="@{repeating_attacks_$X_range}"/>
<button class="roller" name="roll_roll" value="@{action}" type="roll"><span name="attr_name" title="@{repeating_attacks_$X_name}"></span><span class="damage" name="attr_damage" title="@{repeating_attacks_$X_damage}"></span><span class="range" name="attr_range" title="@{repeating_attacks_$X_range}"></span>
</button>
<button name="act_action" hidden="" type="action">
</button>
<input name="attr_action" type="hidden" title="@{repeating_attacks_$X_action}"/><span class="description expanded" name="attr_description" title="@{repeating_attacks_$X_description}"></span>
</fieldset>
</div>
</section>
</div>
<div class="tabs__container tabs--vaesen__container tabs--vaesen__container--npc" data-container-tab="vaesen" data-tab="npc">
<div class="flex-box flex-wrap half-gap">
<div class="notched header flex-span-all bordered">
<div class="notch-container">
<input class="text-3" name="attr_character_name" type="text" title="@{character_name}"/>
</div>
</div>
<div class="flex-box flex-wrap half-gap justify-space-around">
<h3 class="text-5 flex-span-all" data-i18n="attributes"></h3>
<div class="notched notched--labelled notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="physique" name="roll_physique" value="@{physique_action}" type="roll">
</button>
<input class="input-label__input" name="attr_physique" type="number" title="@{physique}"/>
</div>
<button name="act_physique-action" hidden="" type="action">
</button>
<input name="attr_physique_action" type="hidden" title="@{physique_action}"/>
</div>
</div>
<div class="notched notched--labelled notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="precision" name="roll_precision" value="@{precision_action}" type="roll">
</button>
<input class="input-label__input" name="attr_precision" type="number" title="@{precision}"/>
</div>
<button name="act_precision-action" hidden="" type="action">
</button>
<input name="attr_precision_action" type="hidden" title="@{precision_action}"/>
</div>
</div>
<div class="notched notched--labelled notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="logic" name="roll_logic" value="@{logic_action}" type="roll">
</button>
<input class="input-label__input" name="attr_logic" type="number" title="@{logic}"/>
</div>
<button name="act_logic-action" hidden="" type="action">
</button>
<input name="attr_logic_action" type="hidden" title="@{logic_action}"/>
</div>
</div>
<div class="notched notched--labelled notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="empathy" name="roll_empathy" value="@{empathy_action}" type="roll">
</button>
<input class="input-label__input" name="attr_empathy" type="number" title="@{empathy}"/>
</div>
<button name="act_empathy-action" hidden="" type="action">
</button>
<input name="attr_empathy_action" type="hidden" title="@{empathy_action}"/>
</div>
</div>
</div>
<div class="flex-box flex-wrap half-gap justify-space-around">
<h3 class="text-5 flex-span-all" data-i18n="toughness"></h3>
<div class="notched notched-label--number notched--labelled bordered fear bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="physical"></span>
<div class="flex-box tiny-gap">
<input name="attr_physical" type="number" title="@{physical}"/><span class="slash">/</span>
<input name="attr_physical_max" type="number" title="@{physical|max}"/>
</div>
</label>
</div>
</div>
<div class="notched notched-label--number notched--labelled bordered fear bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="mental"></span>
<div class="flex-box tiny-gap">
<input name="attr_mental" type="number" title="@{mental}"/><span class="slash">/</span>
<input name="attr_mental_max" type="number" title="@{mental|max}"/>
</div>
</label>
</div>
</div>
</div>
<div class="npc-skill-container flex-wrap half-gap collapse-container">
<input class="collapse skill-collapse" name="attr_skill_collapse" value="1" type="checkbox" title="@{skill_collapse}"/>
<h3 class="text-5 flex-span-all" data-i18n="skills"></h3>
<input class="skill-display-control" name="attr_agility" value="" type="hidden" title="@{agility}"/>
<div class="notched notched--labelled controlled-skill notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="agility (physique)" name="roll_agility" value="@{agility_action}" type="roll">
</button>
<input class="input-label__input" name="attr_agility" type="number" title="@{agility}"/>
</div>
<button name="act_agility-action" hidden="" type="action">
</button>
<input name="attr_agility_action" type="hidden" title="@{agility_action}"/>
</div>
</div>
<input class="skill-display-control" name="attr_close_combat" value="" type="hidden" title="@{close_combat}"/>
<div class="notched notched--labelled controlled-skill notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="close combat (physique)" name="roll_close_combat" value="@{close_combat_action}" type="roll">
</button>
<input class="input-label__input" name="attr_close_combat" type="number" title="@{close_combat}"/>
</div>
<button name="act_close-combat-action" hidden="" type="action">
</button>
<input name="attr_close_combat_action" type="hidden" title="@{close_combat_action}"/>
</div>
</div>
<input class="skill-display-control" name="attr_force" value="" type="hidden" title="@{force}"/>
<div class="notched notched--labelled controlled-skill notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="force (physique)" name="roll_force" value="@{force_action}" type="roll">
</button>
<input class="input-label__input" name="attr_force" type="number" title="@{force}"/>
</div>
<button name="act_force-action" hidden="" type="action">
</button>
<input name="attr_force_action" type="hidden" title="@{force_action}"/>
</div>
</div>
<input class="skill-display-control" name="attr_medicine" value="" type="hidden" title="@{medicine}"/>
<div class="notched notched--labelled controlled-skill notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="medicine (precision)" name="roll_medicine" value="@{medicine_action}" type="roll">
</button>
<input class="input-label__input" name="attr_medicine" type="number" title="@{medicine}"/>
</div>
<button name="act_medicine-action" hidden="" type="action">
</button>
<input name="attr_medicine_action" type="hidden" title="@{medicine_action}"/>
</div>
</div>
<input class="skill-display-control" name="attr_ranged_combat" value="" type="hidden" title="@{ranged_combat}"/>
<div class="notched notched--labelled controlled-skill notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="ranged combat (precision)" name="roll_ranged_combat" value="@{ranged_combat_action}" type="roll">
</button>
<input class="input-label__input" name="attr_ranged_combat" type="number" title="@{ranged_combat}"/>
</div>
<button name="act_ranged-combat-action" hidden="" type="action">
</button>
<input name="attr_ranged_combat_action" type="hidden" title="@{ranged_combat_action}"/>
</div>
</div>
<input class="skill-display-control" name="attr_stealth" value="" type="hidden" title="@{stealth}"/>
<div class="notched notched--labelled controlled-skill notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="stealth (precision)" name="roll_stealth" value="@{stealth_action}" type="roll">
</button>
<input class="input-label__input" name="attr_stealth" type="number" title="@{stealth}"/>
</div>
<button name="act_stealth-action" hidden="" type="action">
</button>
<input name="attr_stealth_action" type="hidden" title="@{stealth_action}"/>
</div>
</div>
<input class="skill-display-control" name="attr_investigation" value="" type="hidden" title="@{investigation}"/>
<div class="notched notched--labelled controlled-skill notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="investigation (logic)" name="roll_investigation" value="@{investigation_action}" type="roll">
</button>
<input class="input-label__input" name="attr_investigation" type="number" title="@{investigation}"/>
</div>
<button name="act_investigation-action" hidden="" type="action">
</button>
<input name="attr_investigation_action" type="hidden" title="@{investigation_action}"/>
</div>
</div>
<input class="skill-display-control" name="attr_learning" value="" type="hidden" title="@{learning}"/>
<div class="notched notched--labelled controlled-skill notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="learning (logic)" name="roll_learning" value="@{learning_action}" type="roll">
</button>
<input class="input-label__input" name="attr_learning" type="number" title="@{learning}"/>
</div>
<button name="act_learning-action" hidden="" type="action">
</button>
<input name="attr_learning_action" type="hidden" title="@{learning_action}"/>
</div>
</div>
<input class="skill-display-control" name="attr_vigilance" value="" type="hidden" title="@{vigilance}"/>
<div class="notched notched--labelled controlled-skill notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="vigilance (logic)" name="roll_vigilance" value="@{vigilance_action}" type="roll">
</button>
<input class="input-label__input" name="attr_vigilance" type="number" title="@{vigilance}"/>
</div>
<button name="act_vigilance-action" hidden="" type="action">
</button>
<input name="attr_vigilance_action" type="hidden" title="@{vigilance_action}"/>
</div>
</div>
<input class="skill-display-control" name="attr_inspiration" value="" type="hidden" title="@{inspiration}"/>
<div class="notched notched--labelled controlled-skill notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="inspiration (empathy)" name="roll_inspiration" value="@{inspiration_action}" type="roll">
</button>
<input class="input-label__input" name="attr_inspiration" type="number" title="@{inspiration}"/>
</div>
<button name="act_inspiration-action" hidden="" type="action">
</button>
<input name="attr_inspiration_action" type="hidden" title="@{inspiration_action}"/>
</div>
</div>
<input class="skill-display-control" name="attr_manipulation" value="" type="hidden" title="@{manipulation}"/>
<div class="notched notched--labelled controlled-skill notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="manipulation (empathy)" name="roll_manipulation" value="@{manipulation_action}" type="roll">
</button>
<input class="input-label__input" name="attr_manipulation" type="number" title="@{manipulation}"/>
</div>
<button name="act_manipulation-action" hidden="" type="action">
</button>
<input name="attr_manipulation_action" type="hidden" title="@{manipulation_action}"/>
</div>
</div>
<input class="skill-display-control" name="attr_observation" value="" type="hidden" title="@{observation}"/>
<div class="notched notched--labelled controlled-skill notched-label--number bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="observation (empathy)" name="roll_observation" value="@{observation_action}" type="roll">
</button>
<input class="input-label__input" name="attr_observation" type="number" title="@{observation}"/>
</div>
<button name="act_observation-action" hidden="" type="action">
</button>
<input name="attr_observation_action" type="hidden" title="@{observation_action}"/>
</div>
</div>
</div>
</div>
</div>
<div class="tabs__container tabs--vaesen__container tabs--vaesen__container--animal" data-container-tab="vaesen" data-tab="animal">
<div class="notched header flex-span-all bordered">
<div class="notch-container">
<input name="attr_character_name" type="text" title="@{character_name}"/>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="might" name="roll_might" value="@{might_action}" type="roll">
</button>
<input class="input-label__input" name="attr_might" type="number" title="@{might}"/>
</div>
<button name="act_might-action" hidden="" type="action">
</button>
<input name="attr_might_action" type="hidden" title="@{might_action}"/>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" data-i18n="body control" name="roll_body_control" value="@{body_control_action}" type="roll">
</button>
<input class="input-label__input" name="attr_body_control" type="number" title="@{body_control}"/>
</div>
<button name="act_body-control-action" hidden="" type="action">
</button>
<input name="attr_body_control_action" type="hidden" title="@{body_control_action}"/>
</div>
</div>
<div class="flex-box flex-wrap half-gap justify-space-around">
<div class="notched notched-label--number notched--labelled bordered fear bordered">
<div class="notch-container">
<label class="input-label stacked"><span class="input-label__text" data-i18n="toughness"></span>
<div class="flex-box tiny-gap">
<input name="attr_toughness" type="number" title="@{toughness}"/><span class="slash">/</span>
<input name="attr_toughness_max" type="number" title="@{toughness|max}"/>
</div>
</label>
</div>
</div>
</div>
<div class="notched notched--labelled bordered">
<div class="notch-container">
<div class="input-label input-label--button stacked">
<button class="roller" name="roll_damage" data-i18n="damage" value="@{damage_action}" type="roll">
</button>
<input class="input-label__input" name="attr_damage" type="number" title="@{damage}"/>
</div>
<button name="act_damage-action" hidden="" type="action">
</button>
<input name="attr_damage_action" type="hidden" title="@{damage_action}"/>
</div>
</div>
</div>
</div>
</div>
</div>
<rolltemplate class="sheet-rolltemplate-vaesen">
<div class="template vaesen">
<div class="border__line__cross headed-section">
<div class="notched header bordered">
<div class="notch-container">
<div class="header-stack">{{#title}}
<h3>{{title}}</h3>{{/title}}{{^title}}{{#skill}}
<h3>{{skill}}</h3>{{/skill}}{{/title}}
<div class="flex-box justify-space-between">{{#character_name}}{{#character_id}}
<h7 class="character_name">[{{character_name}}](http://journal.roll20.net/character/{{character_id}})</h7>{{/character_id}}{{^character_id}}
<h7 class="character_name">{{character_name}}</h7>{{/character_id}}{{/character_name}}{{#title}}{{#skill}}<span class="red-header">({{skill}})</span>{{/skill}}{{/title}}{{^title}}{{#ability}}<span class="red-header">({{ability}})</span>{{/ability}}{{/title}}
</div>
</div>
</div>
</div>
<div class="content">{{#successes}}
<div class="notched results bordered">
<div class="notch-container"><span class="red-header" data-i18n="successes"></span>{{computed::successes}}
</div>
</div>{{/successes}}{{#base_1}}
<div class="notched results dice bordered">
<div class="notch-container">
<div class="base">{{#rollTotal() base_1 1}}<span class="dice-1">{{base_1}}</span>{{/rollTotal() base_1 1}}{{#rollTotal() base_1 2}}<span class="dice-2">{{base_1}}</span>{{/rollTotal() base_1 2}}{{#rollTotal() base_1 3}}<span class="dice-3">{{base_1}}</span>{{/rollTotal() base_1 3}}{{#rollTotal() base_1 4}}<span class="dice-4">{{base_1}}</span>{{/rollTotal() base_1 4}}{{#rollTotal() base_1 5}}<span class="dice-5">{{base_1}}</span>{{/rollTotal() base_1 5}}{{#rollTotal() base_1 6}}<span class="dice-6">{{base_1}}</span>{{/rollTotal() base_1 6}}{{#rollTotal() base_2 1}}<span class="dice-1">{{base_2}}</span>{{/rollTotal() base_2 1}}{{#rollTotal() base_2 2}}<span class="dice-2">{{base_2}}</span>{{/rollTotal() base_2 2}}{{#rollTotal() base_2 3}}<span class="dice-3">{{base_2}}</span>{{/rollTotal() base_2 3}}{{#rollTotal() base_2 4}}<span class="dice-4">{{base_2}}</span>{{/rollTotal() base_2 4}}{{#rollTotal() base_2 5}}<span class="dice-5">{{base_2}}</span>{{/rollTotal() base_2 5}}{{#rollTotal() base_2 6}}<span class="dice-6">{{base_2}}</span>{{/rollTotal() base_2 6}}{{#rollTotal() base_3 1}}<span class="dice-1">{{base_3}}</span>{{/rollTotal() base_3 1}}{{#rollTotal() base_3 2}}<span class="dice-2">{{base_3}}</span>{{/rollTotal() base_3 2}}{{#rollTotal() base_3 3}}<span class="dice-3">{{base_3}}</span>{{/rollTotal() base_3 3}}{{#rollTotal() base_3 4}}<span class="dice-4">{{base_3}}</span>{{/rollTotal() base_3 4}}{{#rollTotal() base_3 5}}<span class="dice-5">{{base_3}}</span>{{/rollTotal() base_3 5}}{{#rollTotal() base_3 6}}<span class="dice-6">{{base_3}}</span>{{/rollTotal() base_3 6}}{{#rollTotal() base_4 1}}<span class="dice-1">{{base_4}}</span>{{/rollTotal() base_4 1}}{{#rollTotal() base_4 2}}<span class="dice-2">{{base_4}}</span>{{/rollTotal() base_4 2}}{{#rollTotal() base_4 3}}<span class="dice-3">{{base_4}}</span>{{/rollTotal() base_4 3}}{{#rollTotal() base_4 4}}<span class="dice-4">{{base_4}}</span>{{/rollTotal() base_4 4}}{{#rollTotal() base_4 5}}<span class="dice-5">{{base_4}}</span>{{/rollTotal() base_4 5}}{{#rollTotal() base_4 6}}<span class="dice-6">{{base_4}}</span>{{/rollTotal() base_4 6}}{{#rollTotal() base_5 1}}<span class="dice-1">{{base_5}}</span>{{/rollTotal() base_5 1}}{{#rollTotal() base_5 2}}<span class="dice-2">{{base_5}}</span>{{/rollTotal() base_5 2}}{{#rollTotal() base_5 3}}<span class="dice-3">{{base_5}}</span>{{/rollTotal() base_5 3}}{{#rollTotal() base_5 4}}<span class="dice-4">{{base_5}}</span>{{/rollTotal() base_5 4}}{{#rollTotal() base_5 5}}<span class="dice-5">{{base_5}}</span>{{/rollTotal() base_5 5}}{{#rollTotal() base_5 6}}<span class="dice-6">{{base_5}}</span>{{/rollTotal() base_5 6}}{{#rollTotal() base_6 1}}<span class="dice-1">{{base_6}}</span>{{/rollTotal() base_6 1}}{{#rollTotal() base_6 2}}<span class="dice-2">{{base_6}}</span>{{/rollTotal() base_6 2}}{{#rollTotal() base_6 3}}<span class="dice-3">{{base_6}}</span>{{/rollTotal() base_6 3}}{{#rollTotal() base_6 4}}<span class="dice-4">{{base_6}}</span>{{/rollTotal() base_6 4}}{{#rollTotal() base_6 5}}<span class="dice-5">{{base_6}}</span>{{/rollTotal() base_6 5}}{{#rollTotal() base_6 6}}<span class="dice-6">{{base_6}}</span>{{/rollTotal() base_6 6}}{{#rollTotal() base_7 1}}<span class="dice-1">{{base_7}}</span>{{/rollTotal() base_7 1}}{{#rollTotal() base_7 2}}<span class="dice-2">{{base_7}}</span>{{/rollTotal() base_7 2}}{{#rollTotal() base_7 3}}<span class="dice-3">{{base_7}}</span>{{/rollTotal() base_7 3}}{{#rollTotal() base_7 4}}<span class="dice-4">{{base_7}}</span>{{/rollTotal() base_7 4}}{{#rollTotal() base_7 5}}<span class="dice-5">{{base_7}}</span>{{/rollTotal() base_7 5}}{{#rollTotal() base_7 6}}<span class="dice-6">{{base_7}}</span>{{/rollTotal() base_7 6}}{{#rollTotal() base_8 1}}<span class="dice-1">{{base_8}}</span>{{/rollTotal() base_8 1}}{{#rollTotal() base_8 2}}<span class="dice-2">{{base_8}}</span>{{/rollTotal() base_8 2}}{{#rollTotal() base_8 3}}<span class="dice-3">{{base_8}}</span>{{/rollTotal() base_8 3}}{{#rollTotal() base_8 4}}<span class="dice-4">{{base_8}}</span>{{/rollTotal() base_8 4}}{{#rollTotal() base_8 5}}<span class="dice-5">{{base_8}}</span>{{/rollTotal() base_8 5}}{{#rollTotal() base_8 6}}<span class="dice-6">{{base_8}}</span>{{/rollTotal() base_8 6}}{{#rollTotal() base_9 1}}<span class="dice-1">{{base_9}}</span>{{/rollTotal() base_9 1}}{{#rollTotal() base_9 2}}<span class="dice-2">{{base_9}}</span>{{/rollTotal() base_9 2}}{{#rollTotal() base_9 3}}<span class="dice-3">{{base_9}}</span>{{/rollTotal() base_9 3}}{{#rollTotal() base_9 4}}<span class="dice-4">{{base_9}}</span>{{/rollTotal() base_9 4}}{{#rollTotal() base_9 5}}<span class="dice-5">{{base_9}}</span>{{/rollTotal() base_9 5}}{{#rollTotal() base_9 6}}<span class="dice-6">{{base_9}}</span>{{/rollTotal() base_9 6}}{{#rollTotal() base_10 1}}<span class="dice-1">{{base_10}}</span>{{/rollTotal() base_10 1}}{{#rollTotal() base_10 2}}<span class="dice-2">{{base_10}}</span>{{/rollTotal() base_10 2}}{{#rollTotal() base_10 3}}<span class="dice-3">{{base_10}}</span>{{/rollTotal() base_10 3}}{{#rollTotal() base_10 4}}<span class="dice-4">{{base_10}}</span>{{/rollTotal() base_10 4}}{{#rollTotal() base_10 5}}<span class="dice-5">{{base_10}}</span>{{/rollTotal() base_10 5}}{{#rollTotal() base_10 6}}<span class="dice-6">{{base_10}}</span>{{/rollTotal() base_10 6}}{{#rollTotal() base_11 1}}<span class="dice-1">{{base_11}}</span>{{/rollTotal() base_11 1}}{{#rollTotal() base_11 2}}<span class="dice-2">{{base_11}}</span>{{/rollTotal() base_11 2}}{{#rollTotal() base_11 3}}<span class="dice-3">{{base_11}}</span>{{/rollTotal() base_11 3}}{{#rollTotal() base_11 4}}<span class="dice-4">{{base_11}}</span>{{/rollTotal() base_11 4}}{{#rollTotal() base_11 5}}<span class="dice-5">{{base_11}}</span>{{/rollTotal() base_11 5}}{{#rollTotal() base_11 6}}<span class="dice-6">{{base_11}}</span>{{/rollTotal() base_11 6}}{{#rollTotal() base_12 1}}<span class="dice-1">{{base_12}}</span>{{/rollTotal() base_12 1}}{{#rollTotal() base_12 2}}<span class="dice-2">{{base_12}}</span>{{/rollTotal() base_12 2}}{{#rollTotal() base_12 3}}<span class="dice-3">{{base_12}}</span>{{/rollTotal() base_12 3}}{{#rollTotal() base_12 4}}<span class="dice-4">{{base_12}}</span>{{/rollTotal() base_12 4}}{{#rollTotal() base_12 5}}<span class="dice-5">{{base_12}}</span>{{/rollTotal() base_12 5}}{{#rollTotal() base_12 6}}<span class="dice-6">{{base_12}}</span>{{/rollTotal() base_12 6}}{{#rollTotal() base_13 1}}<span class="dice-1">{{base_13}}</span>{{/rollTotal() base_13 1}}{{#rollTotal() base_13 2}}<span class="dice-2">{{base_13}}</span>{{/rollTotal() base_13 2}}{{#rollTotal() base_13 3}}<span class="dice-3">{{base_13}}</span>{{/rollTotal() base_13 3}}{{#rollTotal() base_13 4}}<span class="dice-4">{{base_13}}</span>{{/rollTotal() base_13 4}}{{#rollTotal() base_13 5}}<span class="dice-5">{{base_13}}</span>{{/rollTotal() base_13 5}}{{#rollTotal() base_13 6}}<span class="dice-6">{{base_13}}</span>{{/rollTotal() base_13 6}}{{#rollTotal() base_14 1}}<span class="dice-1">{{base_14}}</span>{{/rollTotal() base_14 1}}{{#rollTotal() base_14 2}}<span class="dice-2">{{base_14}}</span>{{/rollTotal() base_14 2}}{{#rollTotal() base_14 3}}<span class="dice-3">{{base_14}}</span>{{/rollTotal() base_14 3}}{{#rollTotal() base_14 4}}<span class="dice-4">{{base_14}}</span>{{/rollTotal() base_14 4}}{{#rollTotal() base_14 5}}<span class="dice-5">{{base_14}}</span>{{/rollTotal() base_14 5}}{{#rollTotal() base_14 6}}<span class="dice-6">{{base_14}}</span>{{/rollTotal() base_14 6}}{{#rollTotal() base_15 1}}<span class="dice-1">{{base_15}}</span>{{/rollTotal() base_15 1}}{{#rollTotal() base_15 2}}<span class="dice-2">{{base_15}}</span>{{/rollTotal() base_15 2}}{{#rollTotal() base_15 3}}<span class="dice-3">{{base_15}}</span>{{/rollTotal() base_15 3}}{{#rollTotal() base_15 4}}<span class="dice-4">{{base_15}}</span>{{/rollTotal() base_15 4}}{{#rollTotal() base_15 5}}<span class="dice-5">{{base_15}}</span>{{/rollTotal() base_15 5}}{{#rollTotal() base_15 6}}<span class="dice-6">{{base_15}}</span>{{/rollTotal() base_15 6}}{{#rollTotal() base_16 1}}<span class="dice-1">{{base_16}}</span>{{/rollTotal() base_16 1}}{{#rollTotal() base_16 2}}<span class="dice-2">{{base_16}}</span>{{/rollTotal() base_16 2}}{{#rollTotal() base_16 3}}<span class="dice-3">{{base_16}}</span>{{/rollTotal() base_16 3}}{{#rollTotal() base_16 4}}<span class="dice-4">{{base_16}}</span>{{/rollTotal() base_16 4}}{{#rollTotal() base_16 5}}<span class="dice-5">{{base_16}}</span>{{/rollTotal() base_16 5}}{{#rollTotal() base_16 6}}<span class="dice-6">{{base_16}}</span>{{/rollTotal() base_16 6}}{{#rollTotal() base_17 1}}<span class="dice-1">{{base_17}}</span>{{/rollTotal() base_17 1}}{{#rollTotal() base_17 2}}<span class="dice-2">{{base_17}}</span>{{/rollTotal() base_17 2}}{{#rollTotal() base_17 3}}<span class="dice-3">{{base_17}}</span>{{/rollTotal() base_17 3}}{{#rollTotal() base_17 4}}<span class="dice-4">{{base_17}}</span>{{/rollTotal() base_17 4}}{{#rollTotal() base_17 5}}<span class="dice-5">{{base_17}}</span>{{/rollTotal() base_17 5}}{{#rollTotal() base_17 6}}<span class="dice-6">{{base_17}}</span>{{/rollTotal() base_17 6}}{{#rollTotal() base_18 1}}<span class="dice-1">{{base_18}}</span>{{/rollTotal() base_18 1}}{{#rollTotal() base_18 2}}<span class="dice-2">{{base_18}}</span>{{/rollTotal() base_18 2}}{{#rollTotal() base_18 3}}<span class="dice-3">{{base_18}}</span>{{/rollTotal() base_18 3}}{{#rollTotal() base_18 4}}<span class="dice-4">{{base_18}}</span>{{/rollTotal() base_18 4}}{{#rollTotal() base_18 5}}<span class="dice-5">{{base_18}}</span>{{/rollTotal() base_18 5}}{{#rollTotal() base_18 6}}<span class="dice-6">{{base_18}}</span>{{/rollTotal() base_18 6}}{{#rollTotal() base_19 1}}<span class="dice-1">{{base_19}}</span>{{/rollTotal() base_19 1}}{{#rollTotal() base_19 2}}<span class="dice-2">{{base_19}}</span>{{/rollTotal() base_19 2}}{{#rollTotal() base_19 3}}<span class="dice-3">{{base_19}}</span>{{/rollTotal() base_19 3}}{{#rollTotal() base_19 4}}<span class="dice-4">{{base_19}}</span>{{/rollTotal() base_19 4}}{{#rollTotal() base_19 5}}<span class="dice-5">{{base_19}}</span>{{/rollTotal() base_19 5}}{{#rollTotal() base_19 6}}<span class="dice-6">{{base_19}}</span>{{/rollTotal() base_19 6}}{{#rollTotal() base_20 1}}<span class="dice-1">{{base_20}}</span>{{/rollTotal() base_20 1}}{{#rollTotal() base_20 2}}<span class="dice-2">{{base_20}}</span>{{/rollTotal() base_20 2}}{{#rollTotal() base_20 3}}<span class="dice-3">{{base_20}}</span>{{/rollTotal() base_20 3}}{{#rollTotal() base_20 4}}<span class="dice-4">{{base_20}}</span>{{/rollTotal() base_20 4}}{{#rollTotal() base_20 5}}<span class="dice-5">{{base_20}}</span>{{/rollTotal() base_20 5}}{{#rollTotal() base_20 6}}<span class="dice-6">{{base_20}}</span>{{/rollTotal() base_20 6}}{{#rollTotal() base_21 1}}<span class="dice-1">{{base_21}}</span>{{/rollTotal() base_21 1}}{{#rollTotal() base_21 2}}<span class="dice-2">{{base_21}}</span>{{/rollTotal() base_21 2}}{{#rollTotal() base_21 3}}<span class="dice-3">{{base_21}}</span>{{/rollTotal() base_21 3}}{{#rollTotal() base_21 4}}<span class="dice-4">{{base_21}}</span>{{/rollTotal() base_21 4}}{{#rollTotal() base_21 5}}<span class="dice-5">{{base_21}}</span>{{/rollTotal() base_21 5}}{{#rollTotal() base_21 6}}<span class="dice-6">{{base_21}}</span>{{/rollTotal() base_21 6}}{{#rollTotal() base_22 1}}<span class="dice-1">{{base_22}}</span>{{/rollTotal() base_22 1}}{{#rollTotal() base_22 2}}<span class="dice-2">{{base_22}}</span>{{/rollTotal() base_22 2}}{{#rollTotal() base_22 3}}<span class="dice-3">{{base_22}}</span>{{/rollTotal() base_22 3}}{{#rollTotal() base_22 4}}<span class="dice-4">{{base_22}}</span>{{/rollTotal() base_22 4}}{{#rollTotal() base_22 5}}<span class="dice-5">{{base_22}}</span>{{/rollTotal() base_22 5}}{{#rollTotal() base_22 6}}<span class="dice-6">{{base_22}}</span>{{/rollTotal() base_22 6}}{{#rollTotal() base_23 1}}<span class="dice-1">{{base_23}}</span>{{/rollTotal() base_23 1}}{{#rollTotal() base_23 2}}<span class="dice-2">{{base_23}}</span>{{/rollTotal() base_23 2}}{{#rollTotal() base_23 3}}<span class="dice-3">{{base_23}}</span>{{/rollTotal() base_23 3}}{{#rollTotal() base_23 4}}<span class="dice-4">{{base_23}}</span>{{/rollTotal() base_23 4}}{{#rollTotal() base_23 5}}<span class="dice-5">{{base_23}}</span>{{/rollTotal() base_23 5}}{{#rollTotal() base_23 6}}<span class="dice-6">{{base_23}}</span>{{/rollTotal() base_23 6}}{{#rollTotal() base_24 1}}<span class="dice-1">{{base_24}}</span>{{/rollTotal() base_24 1}}{{#rollTotal() base_24 2}}<span class="dice-2">{{base_24}}</span>{{/rollTotal() base_24 2}}{{#rollTotal() base_24 3}}<span class="dice-3">{{base_24}}</span>{{/rollTotal() base_24 3}}{{#rollTotal() base_24 4}}<span class="dice-4">{{base_24}}</span>{{/rollTotal() base_24 4}}{{#rollTotal() base_24 5}}<span class="dice-5">{{base_24}}</span>{{/rollTotal() base_24 5}}{{#rollTotal() base_24 6}}<span class="dice-6">{{base_24}}</span>{{/rollTotal() base_24 6}}{{#rollTotal() base_25 1}}<span class="dice-1">{{base_25}}</span>{{/rollTotal() base_25 1}}{{#rollTotal() base_25 2}}<span class="dice-2">{{base_25}}</span>{{/rollTotal() base_25 2}}{{#rollTotal() base_25 3}}<span class="dice-3">{{base_25}}</span>{{/rollTotal() base_25 3}}{{#rollTotal() base_25 4}}<span class="dice-4">{{base_25}}</span>{{/rollTotal() base_25 4}}{{#rollTotal() base_25 5}}<span class="dice-5">{{base_25}}</span>{{/rollTotal() base_25 5}}{{#rollTotal() base_25 6}}<span class="dice-6">{{base_25}}</span>{{/rollTotal() base_25 6}}{{#rollTotal() base_26 1}}<span class="dice-1">{{base_26}}</span>{{/rollTotal() base_26 1}}{{#rollTotal() base_26 2}}<span class="dice-2">{{base_26}}</span>{{/rollTotal() base_26 2}}{{#rollTotal() base_26 3}}<span class="dice-3">{{base_26}}</span>{{/rollTotal() base_26 3}}{{#rollTotal() base_26 4}}<span class="dice-4">{{base_26}}</span>{{/rollTotal() base_26 4}}{{#rollTotal() base_26 5}}<span class="dice-5">{{base_26}}</span>{{/rollTotal() base_26 5}}{{#rollTotal() base_26 6}}<span class="dice-6">{{base_26}}</span>{{/rollTotal() base_26 6}}{{#rollTotal() base_27 1}}<span class="dice-1">{{base_27}}</span>{{/rollTotal() base_27 1}}{{#rollTotal() base_27 2}}<span class="dice-2">{{base_27}}</span>{{/rollTotal() base_27 2}}{{#rollTotal() base_27 3}}<span class="dice-3">{{base_27}}</span>{{/rollTotal() base_27 3}}{{#rollTotal() base_27 4}}<span class="dice-4">{{base_27}}</span>{{/rollTotal() base_27 4}}{{#rollTotal() base_27 5}}<span class="dice-5">{{base_27}}</span>{{/rollTotal() base_27 5}}{{#rollTotal() base_27 6}}<span class="dice-6">{{base_27}}</span>{{/rollTotal() base_27 6}}{{#rollTotal() base_28 1}}<span class="dice-1">{{base_28}}</span>{{/rollTotal() base_28 1}}{{#rollTotal() base_28 2}}<span class="dice-2">{{base_28}}</span>{{/rollTotal() base_28 2}}{{#rollTotal() base_28 3}}<span class="dice-3">{{base_28}}</span>{{/rollTotal() base_28 3}}{{#rollTotal() base_28 4}}<span class="dice-4">{{base_28}}</span>{{/rollTotal() base_28 4}}{{#rollTotal() base_28 5}}<span class="dice-5">{{base_28}}</span>{{/rollTotal() base_28 5}}{{#rollTotal() base_28 6}}<span class="dice-6">{{base_28}}</span>{{/rollTotal() base_28 6}}{{#rollTotal() base_29 1}}<span class="dice-1">{{base_29}}</span>{{/rollTotal() base_29 1}}{{#rollTotal() base_29 2}}<span class="dice-2">{{base_29}}</span>{{/rollTotal() base_29 2}}{{#rollTotal() base_29 3}}<span class="dice-3">{{base_29}}</span>{{/rollTotal() base_29 3}}{{#rollTotal() base_29 4}}<span class="dice-4">{{base_29}}</span>{{/rollTotal() base_29 4}}{{#rollTotal() base_29 5}}<span class="dice-5">{{base_29}}</span>{{/rollTotal() base_29 5}}{{#rollTotal() base_29 6}}<span class="dice-6">{{base_29}}</span>{{/rollTotal() base_29 6}}
</div>{{#no_dice}}
<h3 data-i18n="no dice to roll"></h3>{{/no_dice}}
</div>
</div>{{/base_1}}{{#damage}}
<div class="notched results bordered">
<div class="notch-container"><span class="red-header" data-i18n="base damage"></span><span>{{damage}}</span>
</div>
</div>{{/damage}}{{#roll}}
<div class="notched results bordered">
<div class="notch-container">{{#^rollTotal() computed::roll_label 0}}<span class="red-header computed-label computed-control">{{computed::roll_label}}</span>{{/^rollTotal() computed::roll_label 0}}{{#roll_label}}<span class="red-header hide-if-computed">{{roll_label}}</span>{{/roll_label}}{{^roll_label}}
<h5 data-i18n="roll"></h5>{{/roll_label}}<span>{{roll}}</span>
</div>
</div>{{/roll}}{{#range}}
<div class="notched results bordered">
<div class="notch-container"><span class="red-header" data-i18n="range"></span><span>{{range}}</span>
</div>
</div>{{/range}}{{#comment}}
<div class="notched results plain textarea bordered">
<div class="notch-container"><span>{{comment}}</span>
</div>
</div>{{/comment}}{{#description}}<span class="red-header" data-i18n="description"></span>
<div class="notched results plain textarea bordered">
<div class="notch-container"><span>{{description}}</span>
</div>
</div>{{/description}}{{#character_name}}{{#^rollTotal() computed::push_through 0}}{{#base_1}}
<div class="push-container flex-box justify-center">{{#push_label}}[{{push_label}}](~{{character_name}}|push||{{computed::push_through}}){{/push_label}}{{^push_label}}[push](~{{character_name}}|push||{{computed::push_through}}){{/push_label}}
</div>{{/base_1}}{{/^rollTotal() computed::push_through 0}}{{/character_name}}
</div>
</div>
</div>
</rolltemplate>
<input name="attr_template_start" value="@{whisper}&{template:vaesen} {{character_name=@{character_name}}} {{character_id=@{character_id}}}" type="hidden" title="@{template_start}"/>
<script type="text/worker">//# sourceURL=vaesen.js
const k = (function(){
const kFuncs = {};
const cascades = {"attr_character_name":{"name":"character_name","type":"text","defaultValue":"","affects":[],"triggeredFuncs":["setActionCalls"],"listenerFunc":"accessSheet","listener":"change:character_name"},"act_k-network-call":{"name":"k-network-call","type":"action","triggeredFuncs":["kReceive"],"affects":[],"addFuncs":[],"listener":"clicked:k-network-call","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_row_stored_attributes":{"name":"row_stored_attributes","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_stored_attributes","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_row_row":{"name":"row_row","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_row","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_row_edit_state":{"name":"row_edit_state","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_edit_state","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_row_modal_header":{"name":"row_modal_header","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_modal_header","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_row_section":{"name":"row_section","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_section","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_row_name":{"name":"row_name","type":"text","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_row_details":{"name":"row_details","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_details","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_row_description":{"name":"row_description","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_description","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_row_bonus":{"name":"row_bonus","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_bonus","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_row_availability":{"name":"row_availability","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_availability","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_row_skill_1":{"name":"row_skill_1","type":"select","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_skill_1","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_row_skill_2":{"name":"row_skill_2","type":"select","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_skill_2","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_row_effect":{"name":"row_effect","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_effect","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_row_is_magic_item":{"name":"row_is_magic_item","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_is_magic_item","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_row_risk":{"name":"row_risk","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_risk","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_row_magic":{"name":"row_magic","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_magic","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_row_function":{"name":"row_function","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_function","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_row_asset":{"name":"row_asset","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_asset","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_row_discovery":{"name":"row_discovery","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_discovery","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_row_skill":{"name":"row_skill","type":"select","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_skill","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_row_damage":{"name":"row_damage","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_damage","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_row_range":{"name":"row_range","type":"text","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_range","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_row_affected":{"name":"row_affected","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:row_affected","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_row-save":{"name":"row-save","type":"action","triggeredFuncs":["saveSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:row-save","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_row-close":{"name":"row-close","type":"action","triggeredFuncs":["cancelSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:row-close","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_push":{"name":"push","type":"action","triggeredFuncs":["pushRoll"],"affects":[],"addFuncs":[],"listener":"clicked:push","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_character_token":{"name":"character_token","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:character_token","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_drop_name":{"name":"drop_name","type":"hidden","triggeredFuncs":["handleCompendiumDrop"],"affects":[],"addFuncs":[],"listener":"change:drop_name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_drop_data":{"name":"drop_data","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:drop_data","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_vaesen_tab":{"name":"vaesen_tab","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:vaesen_tab","listenerFunc":"accessSheet","defaultValue":"nav-tabs-vaesen--settings","calculation":"","initialFunc":"","formula":""},"act_nav-tabs-vaesen--settings":{"name":"nav-tabs-vaesen--settings","type":"action","triggeredFuncs":["kSwitchTab","toggleNavButton"],"affects":[],"addFuncs":[],"listener":"clicked:nav-tabs-vaesen--settings","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_nav-tabs-vaesen--pc":{"name":"nav-tabs-vaesen--pc","type":"action","triggeredFuncs":["kSwitchTab","toggleNavButton"],"affects":[],"addFuncs":[],"listener":"clicked:nav-tabs-vaesen--pc","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_nav-tabs-vaesen--hq":{"name":"nav-tabs-vaesen--hq","type":"action","triggeredFuncs":["kSwitchTab","toggleNavButton"],"affects":[],"addFuncs":[],"listener":"clicked:nav-tabs-vaesen--hq","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_nav-tabs-vaesen--vaesen":{"name":"nav-tabs-vaesen--vaesen","type":"action","triggeredFuncs":["kSwitchTab","toggleNavButton"],"affects":[],"addFuncs":[],"listener":"clicked:nav-tabs-vaesen--vaesen","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_nav-tabs-vaesen--npc":{"name":"nav-tabs-vaesen--npc","type":"action","triggeredFuncs":["kSwitchTab","toggleNavButton"],"affects":[],"addFuncs":[],"listener":"clicked:nav-tabs-vaesen--npc","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_nav-tabs-vaesen--animal":{"name":"nav-tabs-vaesen--animal","type":"action","triggeredFuncs":["kSwitchTab","toggleNavButton"],"affects":[],"addFuncs":[],"listener":"clicked:nav-tabs-vaesen--animal","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_sheet_type":{"name":"sheet_type","type":"select","triggeredFuncs":["toggleNavButton","initPunch"],"affects":[],"addFuncs":[],"listener":"change:sheet_type","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_whisper":{"name":"whisper","type":"select","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:whisper","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_age":{"name":"age","type":"text","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:age","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_archetype":{"name":"archetype","type":"text","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:archetype","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_motivation":{"name":"motivation","type":"text","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:motivation","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_trauma":{"name":"trauma","type":"text","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:trauma","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_dark_secret":{"name":"dark_secret","type":"text","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:dark_secret","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_create-relationships":{"name":"create-relationships","type":"action","triggeredFuncs":["createSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:create-relationships","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_relationships_$x_edit_row":{"name":"repeating_relationships_$x_edit_row","type":"checkbox","triggeredFuncs":["updateSectionEdits"],"affects":[],"addFuncs":[],"listener":"change:repeating_relationships:edit_row","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_relationships_$x_name":{"name":"repeating_relationships_$x_name","type":"text","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_relationships:name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_relationships_$x_details":{"name":"repeating_relationships_$x_details","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_relationships:details","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_physique-action":{"name":"physique-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:physique-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","title":"^{physique}"},"attr_physique_action":{"name":"physique_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:physique_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_physique":{"name":"physique","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:physique","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_precision-action":{"name":"precision-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:precision-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","title":"^{precision}"},"attr_precision_action":{"name":"precision_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:precision_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_precision":{"name":"precision","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:precision","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_logic-action":{"name":"logic-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:logic-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","title":"^{logic}"},"attr_logic_action":{"name":"logic_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:logic_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_logic":{"name":"logic","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:logic","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_empathy-action":{"name":"empathy-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:empathy-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","title":"^{empathy}"},"attr_empathy_action":{"name":"empathy_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:empathy_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_empathy":{"name":"empathy","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:empathy","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_resources-action":{"name":"resources-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:resources-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","title":"^{resources}"},"attr_resources_action":{"name":"resources_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:resources_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_resources":{"name":"resources","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:resources","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_experience":{"name":"experience","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:experience","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_physical_max":{"name":"physical_max","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:physical_max","listenerFunc":"accessSheet","defaultValue":4,"calculation":"","initialFunc":"","formula":""},"attr_mental_max":{"name":"mental_max","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:mental_max","listenerFunc":"accessSheet","defaultValue":4,"calculation":"","initialFunc":"","formula":""},"attr_physical_1":{"name":"physical_1","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:physical_1","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_physical_2":{"name":"physical_2","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:physical_2","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_physical_3":{"name":"physical_3","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:physical_3","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_physical_4":{"name":"physical_4","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:physical_4","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_mental_1":{"name":"mental_1","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:mental_1","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_mental_2":{"name":"mental_2","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:mental_2","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_mental_3":{"name":"mental_3","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:mental_3","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_mental_4":{"name":"mental_4","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:mental_4","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_agility-action":{"name":"agility-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:agility-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","ability":"physique"},"attr_agility_action":{"name":"agility_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:agility_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_agility":{"name":"agility","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:agility","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_close-combat-action":{"name":"close-combat-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:close-combat-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","ability":"physique"},"attr_close_combat_action":{"name":"close_combat_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:close_combat_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_close_combat":{"name":"close_combat","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:close_combat","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_force-action":{"name":"force-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:force-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","ability":"physique"},"attr_force_action":{"name":"force_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:force_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_force":{"name":"force","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:force","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_medicine-action":{"name":"medicine-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:medicine-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","ability":"precision"},"attr_medicine_action":{"name":"medicine_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:medicine_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_medicine":{"name":"medicine","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:medicine","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_ranged-combat-action":{"name":"ranged-combat-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:ranged-combat-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","ability":"precision"},"attr_ranged_combat_action":{"name":"ranged_combat_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:ranged_combat_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_ranged_combat":{"name":"ranged_combat","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:ranged_combat","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_stealth-action":{"name":"stealth-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:stealth-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","ability":"precision"},"attr_stealth_action":{"name":"stealth_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:stealth_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_stealth":{"name":"stealth","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:stealth","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_investigation-action":{"name":"investigation-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:investigation-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","ability":"logic"},"attr_investigation_action":{"name":"investigation_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:investigation_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_investigation":{"name":"investigation","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:investigation","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_learning-action":{"name":"learning-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:learning-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","ability":"logic"},"attr_learning_action":{"name":"learning_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:learning_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_learning":{"name":"learning","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:learning","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_vigilance-action":{"name":"vigilance-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:vigilance-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","ability":"logic"},"attr_vigilance_action":{"name":"vigilance_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:vigilance_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_vigilance":{"name":"vigilance","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:vigilance","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_inspiration-action":{"name":"inspiration-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:inspiration-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","ability":"empathy"},"attr_inspiration_action":{"name":"inspiration_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:inspiration_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_inspiration":{"name":"inspiration","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:inspiration","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_manipulation-action":{"name":"manipulation-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:manipulation-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","ability":"empathy"},"attr_manipulation_action":{"name":"manipulation_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:manipulation_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_manipulation":{"name":"manipulation","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:manipulation","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_observation-action":{"name":"observation-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:observation-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","ability":"empathy"},"attr_observation_action":{"name":"observation_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:observation_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_observation":{"name":"observation","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:observation","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_create-equipment":{"name":"create-equipment","type":"action","triggeredFuncs":["createSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:create-equipment","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_equipment_$x_edit_row":{"name":"repeating_equipment_$x_edit_row","type":"checkbox","triggeredFuncs":["updateSectionEdits"],"affects":[],"addFuncs":[],"listener":"change:repeating_equipment:edit_row","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_equipment_$x_name":{"name":"repeating_equipment_$x_name","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_equipment:name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_equipment_$x_description":{"name":"repeating_equipment_$x_description","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_equipment:description","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_equipment_$x_bonus":{"name":"repeating_equipment_$x_bonus","type":"hidden","triggeredFuncs":[],"affects":["repeating_equipment_$x_show_roll"],"addFuncs":[],"listener":"change:repeating_equipment:bonus","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_equipment_$x_skill_1":{"name":"repeating_equipment_$x_skill_1","type":"hidden","triggeredFuncs":[],"affects":["repeating_equipment_$x_show_roll"],"addFuncs":[],"listener":"change:repeating_equipment:skill_1","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_equipment_$x_skill_2":{"name":"repeating_equipment_$x_skill_2","type":"hidden","triggeredFuncs":[],"affects":["repeating_equipment_$x_show_roll"],"addFuncs":[],"listener":"change:repeating_equipment:skill_2","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_equipment_$x_effect":{"name":"repeating_equipment_$x_effect","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_equipment:effect","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_equipment_$x_availability":{"name":"repeating_equipment_$x_availability","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_equipment:availability","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_equipment_$x_is_magic_item":{"name":"repeating_equipment_$x_is_magic_item","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_equipment:is_magic_item","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_equipment_$x_risk":{"name":"repeating_equipment_$x_risk","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_equipment:risk","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_equipment_$x_magic":{"name":"repeating_equipment_$x_magic","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_equipment:magic","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_equipment_$x_show_roll":{"name":"repeating_equipment_$x_show_roll","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_equipment:show_roll","listenerFunc":"accessSheet","defaultValue":0,"calculation":"decideShowRoll","initialFunc":"","formula":""},"act_repeating_equipment_$x_action":{"name":"repeating_equipment_$x_action","type":"action","triggeredFuncs":["rollEquipment"],"affects":[],"addFuncs":[],"listener":"clicked:repeating_equipment:action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_equipment_$x_action":{"name":"repeating_equipment_$x_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_equipment:action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_equipment_$x_expand":{"name":"repeating_equipment_$x_expand","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_equipment:expand","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_repeating_equipment_$x_magic-action":{"name":"repeating_equipment_$x_magic-action","type":"action","triggeredFuncs":["rollMagic"],"affects":[],"addFuncs":[],"listener":"clicked:repeating_equipment:magic-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_equipment_$x_magic_action":{"name":"repeating_equipment_$x_magic_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_equipment:magic_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_armor-action":{"name":"armor-action","type":"action","triggeredFuncs":["rollArmor"],"affects":[],"addFuncs":[],"listener":"clicked:armor-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_armor_action":{"name":"armor_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:armor_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_armor_name":{"name":"armor_name","type":"text","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:armor_name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_armor_protection":{"name":"armor_protection","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:armor_protection","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_armor_penalty":{"name":"armor_penalty","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:armor_penalty","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_create-weapons":{"name":"create-weapons","type":"action","triggeredFuncs":["createSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:create-weapons","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_weapons_$x_edit_row":{"name":"repeating_weapons_$x_edit_row","type":"checkbox","triggeredFuncs":["updateSectionEdits"],"affects":[],"addFuncs":[],"listener":"change:repeating_weapons:edit_row","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_weapons_$x_name":{"name":"repeating_weapons_$x_name","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_weapons:name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_weapons_$x_damage":{"name":"repeating_weapons_$x_damage","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_weapons:damage","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_weapons_$x_bonus":{"name":"repeating_weapons_$x_bonus","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_weapons:bonus","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_weapons_$x_range":{"name":"repeating_weapons_$x_range","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_weapons:range","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_weapons_$x_availability":{"name":"repeating_weapons_$x_availability","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_weapons:availability","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_weapons_$x_skill":{"name":"repeating_weapons_$x_skill","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_weapons:skill","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_repeating_weapons_$x_action":{"name":"repeating_weapons_$x_action","type":"action","triggeredFuncs":["rollAttack"],"affects":[],"addFuncs":[],"listener":"clicked:repeating_weapons:action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_weapons_$x_action":{"name":"repeating_weapons_$x_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_weapons:action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_create-mementos":{"name":"create-mementos","type":"action","triggeredFuncs":["createSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:create-mementos","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_mementos_$x_edit_row":{"name":"repeating_mementos_$x_edit_row","type":"checkbox","triggeredFuncs":["updateSectionEdits"],"affects":[],"addFuncs":[],"listener":"change:repeating_mementos:edit_row","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_mementos_$x_expand":{"name":"repeating_mementos_$x_expand","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_mementos:expand","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_mementos_$x_name":{"name":"repeating_mementos_$x_name","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_mementos:name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_mementos_$x_description":{"name":"repeating_mementos_$x_description","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_mementos:description","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_create-talents":{"name":"create-talents","type":"action","triggeredFuncs":["createSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:create-talents","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_talents_$x_edit_row":{"name":"repeating_talents_$x_edit_row","type":"checkbox","triggeredFuncs":["updateSectionEdits"],"affects":[],"addFuncs":[],"listener":"change:repeating_talents:edit_row","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_talents_$x_name":{"name":"repeating_talents_$x_name","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_talents:name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_talents_$x_description":{"name":"repeating_talents_$x_description","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_talents:description","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_talents_$x_expand":{"name":"repeating_talents_$x_expand","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_talents:expand","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_create-insights":{"name":"create-insights","type":"action","triggeredFuncs":["createSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:create-insights","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_insights_$x_edit_row":{"name":"repeating_insights_$x_edit_row","type":"checkbox","triggeredFuncs":["updateSectionEdits"],"affects":[],"addFuncs":[],"listener":"change:repeating_insights:edit_row","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_insights_$x_name":{"name":"repeating_insights_$x_name","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_insights:name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_insights_$x_description":{"name":"repeating_insights_$x_description","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_insights:description","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_insights_$x_expand":{"name":"repeating_insights_$x_expand","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_insights:expand","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_create-advantages":{"name":"create-advantages","type":"action","triggeredFuncs":["createSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:create-advantages","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_advantages_$x_edit_row":{"name":"repeating_advantages_$x_edit_row","type":"checkbox","triggeredFuncs":["updateSectionEdits"],"affects":[],"addFuncs":[],"listener":"change:repeating_advantages:edit_row","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_advantages_$x_used":{"name":"repeating_advantages_$x_used","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_advantages:used","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_advantages_$x_name":{"name":"repeating_advantages_$x_name","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_advantages:name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_advantages_$x_description":{"name":"repeating_advantages_$x_description","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_advantages:description","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_advantages_$x_expand":{"name":"repeating_advantages_$x_expand","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_advantages:expand","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_type_of_building":{"name":"type_of_building","type":"text","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:type_of_building","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_location":{"name":"location","type":"text","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:location","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_development_points":{"name":"development_points","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:development_points","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_history":{"name":"history","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:history","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_create-facilities":{"name":"create-facilities","type":"action","triggeredFuncs":["createSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:create-facilities","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_facilities_$x_edit_row":{"name":"repeating_facilities_$x_edit_row","type":"checkbox","triggeredFuncs":["updateSectionEdits"],"affects":[],"addFuncs":[],"listener":"change:repeating_facilities:edit_row","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_facilities_$x_expand":{"name":"repeating_facilities_$x_expand","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_facilities:expand","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_facilities_$x_name":{"name":"repeating_facilities_$x_name","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_facilities:name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_facilities_$x_description":{"name":"repeating_facilities_$x_description","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_facilities:description","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_facilities_$x_function":{"name":"repeating_facilities_$x_function","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_facilities:function","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_facilities_$x_effect":{"name":"repeating_facilities_$x_effect","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_facilities:effect","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_create-discovered-facilities":{"name":"create-discovered-facilities","type":"action","triggeredFuncs":["createSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:create-discovered-facilities","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_discovered-facilities_$x_edit_row":{"name":"repeating_discovered-facilities_$x_edit_row","type":"checkbox","triggeredFuncs":["updateSectionEdits"],"affects":[],"addFuncs":[],"listener":"change:repeating_discovered-facilities:edit_row","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_discovered-facilities_$x_expand":{"name":"repeating_discovered-facilities_$x_expand","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_discovered-facilities:expand","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_discovered-facilities_$x_name":{"name":"repeating_discovered-facilities_$x_name","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_discovered-facilities:name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_discovered-facilities_$x_description":{"name":"repeating_discovered-facilities_$x_description","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_discovered-facilities:description","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_discovered-facilities_$x_function":{"name":"repeating_discovered-facilities_$x_function","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_discovered-facilities:function","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_discovered-facilities_$x_effect":{"name":"repeating_discovered-facilities_$x_effect","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_discovered-facilities:effect","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_discovered-facilities_$x_discovery":{"name":"repeating_discovered-facilities_$x_discovery","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_discovered-facilities:discovery","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_create-contacts":{"name":"create-contacts","type":"action","triggeredFuncs":["createSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:create-contacts","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_contacts_$x_edit_row":{"name":"repeating_contacts_$x_edit_row","type":"checkbox","triggeredFuncs":["updateSectionEdits"],"affects":[],"addFuncs":[],"listener":"change:repeating_contacts:edit_row","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_contacts_$x_expand":{"name":"repeating_contacts_$x_expand","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_contacts:expand","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_contacts_$x_name":{"name":"repeating_contacts_$x_name","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_contacts:name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_contacts_$x_description":{"name":"repeating_contacts_$x_description","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_contacts:description","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_contacts_$x_function":{"name":"repeating_contacts_$x_function","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_contacts:function","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_contacts_$x_effect":{"name":"repeating_contacts_$x_effect","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_contacts:effect","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_create-personnel":{"name":"create-personnel","type":"action","triggeredFuncs":["createSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:create-personnel","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_personnel_$x_edit_row":{"name":"repeating_personnel_$x_edit_row","type":"checkbox","triggeredFuncs":["updateSectionEdits"],"affects":[],"addFuncs":[],"listener":"change:repeating_personnel:edit_row","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_personnel_$x_expand":{"name":"repeating_personnel_$x_expand","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_personnel:expand","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_personnel_$x_name":{"name":"repeating_personnel_$x_name","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_personnel:name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_personnel_$x_description":{"name":"repeating_personnel_$x_description","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_personnel:description","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_personnel_$x_function":{"name":"repeating_personnel_$x_function","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_personnel:function","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_personnel_$x_effect":{"name":"repeating_personnel_$x_effect","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_personnel:effect","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_vaesen_collapse":{"name":"vaesen_collapse","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:vaesen_collapse","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_ritual":{"name":"ritual","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:ritual","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_secret":{"name":"secret","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:secret","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_might":{"name":"might","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:might","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_might-action":{"name":"might-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:might-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","title":"^{might}"},"attr_might_action":{"name":"might_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:might_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_body_control":{"name":"body_control","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:body_control","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_body-control-action":{"name":"body-control-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:body-control-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","title":"^{body control}"},"attr_body_control_action":{"name":"body_control_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:body_control_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_magic":{"name":"magic","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:magic","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_magic-action":{"name":"magic-action","type":"action","triggeredFuncs":["rollPool"],"affects":[],"addFuncs":[],"listener":"clicked:magic-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":"","title":"^{magic}"},"attr_magic_action":{"name":"magic_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:magic_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_fear":{"name":"fear","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:fear","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_constant_fear":{"name":"constant_fear","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:constant_fear","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_create-magical-powers":{"name":"create-magical-powers","type":"action","triggeredFuncs":["createSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:create-magical-powers","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_magical-powers_$x_edit_row":{"name":"repeating_magical-powers_$x_edit_row","type":"checkbox","triggeredFuncs":["updateSectionEdits"],"affects":[],"addFuncs":[],"listener":"change:repeating_magical-powers:edit_row","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_magical-powers_$x_name":{"name":"repeating_magical-powers_$x_name","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_magical-powers:name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_magical-powers_$x_description":{"name":"repeating_magical-powers_$x_description","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_magical-powers:description","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_create-magic-items":{"name":"create-magic-items","type":"action","triggeredFuncs":["createSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:create-magic-items","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_magic-items_$x_edit_row":{"name":"repeating_magic-items_$x_edit_row","type":"checkbox","triggeredFuncs":["updateSectionEdits"],"affects":[],"addFuncs":[],"listener":"change:repeating_magic-items:edit_row","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_magic-items_$x_name":{"name":"repeating_magic-items_$x_name","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_magic-items:name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_magic-items_$x_effect":{"name":"repeating_magic-items_$x_effect","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_magic-items:effect","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_create-conditions":{"name":"create-conditions","type":"action","triggeredFuncs":["createSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:create-conditions","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_conditions_$x_edit_row":{"name":"repeating_conditions_$x_edit_row","type":"checkbox","triggeredFuncs":["updateSectionEdits"],"affects":[],"addFuncs":[],"listener":"change:repeating_conditions:edit_row","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_conditions_$x_name":{"name":"repeating_conditions_$x_name","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_conditions:name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_conditions_$x_effect":{"name":"repeating_conditions_$x_effect","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_conditions:effect","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_conditions_$x_affected":{"name":"repeating_conditions_$x_affected","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_conditions:affected","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_conditions_$x_description":{"name":"repeating_conditions_$x_description","type":"span","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_conditions:description","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"act_create-attacks":{"name":"create-attacks","type":"action","triggeredFuncs":["createSectionEdits"],"affects":[],"addFuncs":[],"listener":"clicked:create-attacks","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_attacks_$x_edit_row":{"name":"repeating_attacks_$x_edit_row","type":"checkbox","triggeredFuncs":["updateSectionEdits"],"affects":[],"addFuncs":[],"listener":"change:repeating_attacks:edit_row","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_attacks_$x_collapse":{"name":"repeating_attacks_$x_collapse","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_attacks:collapse","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_repeating_attacks_$x_name":{"name":"repeating_attacks_$x_name","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_attacks:name","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_attacks_$x_damage":{"name":"repeating_attacks_$x_damage","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_attacks:damage","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_attacks_$x_description":{"name":"repeating_attacks_$x_description","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_attacks:description","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_attacks_$x_range":{"name":"repeating_attacks_$x_range","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_attacks:range","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_repeating_attacks_$x_action":{"name":"repeating_attacks_$x_action","type":"action","triggeredFuncs":["rollAttack"],"affects":[],"addFuncs":[],"listener":"clicked:repeating_attacks:action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_repeating_attacks_$x_action":{"name":"repeating_attacks_$x_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:repeating_attacks:action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_physical":{"name":"physical","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:physical","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_mental":{"name":"mental","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:mental","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_skill_collapse":{"name":"skill_collapse","type":"checkbox","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:skill_collapse","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_toughness":{"name":"toughness","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:toughness","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_toughness_max":{"name":"toughness_max","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:toughness_max","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"attr_damage":{"name":"damage","type":"number","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:damage","listenerFunc":"accessSheet","defaultValue":0,"calculation":"","initialFunc":"","formula":""},"act_damage-action":{"name":"damage-action","type":"action","triggeredFuncs":["rollAnimalDamage"],"affects":[],"addFuncs":[],"listener":"clicked:damage-action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_damage_action":{"name":"damage_action","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:damage_action","listenerFunc":"accessSheet","defaultValue":"","calculation":"","initialFunc":"","formula":""},"attr_template_start":{"name":"template_start","type":"hidden","triggeredFuncs":[],"affects":[],"addFuncs":[],"listener":"change:template_start","listenerFunc":"accessSheet","defaultValue":"@{whisper}&{template:vaesen} {{character_name=@{character_name}}} {{character_id=@{character_id}}}","calculation":"","initialFunc":"","formula":""}};
kFuncs.cascades = cascades;
const repeatingSectionDetails = [{"section":"repeating_relationships","fields":["edit_row","name","details"]},{"section":"repeating_equipment","fields":["edit_row","name","description","bonus","skill_1","skill_2","effect","availability","is_magic_item","risk","magic","show_roll","action","expand","magic_action"]},{"section":"repeating_weapons","fields":["edit_row","name","damage","bonus","range","availability","skill","action"]},{"section":"repeating_mementos","fields":["edit_row","expand","name","description"]},{"section":"repeating_talents","fields":["edit_row","name","description","expand"]},{"section":"repeating_insights","fields":["edit_row","name","description","expand"]},{"section":"repeating_advantages","fields":["edit_row","used","name","description","expand"]},{"section":"repeating_facilities","fields":["edit_row","expand","name","description","function","effect"]},{"section":"repeating_discovered-facilities","fields":["edit_row","expand","name","description","function","effect","discovery"]},{"section":"repeating_contacts","fields":["edit_row","expand","name","description","function","effect"]},{"section":"repeating_personnel","fields":["edit_row","expand","name","description","function","effect"]},{"section":"repeating_magical-powers","fields":["edit_row","name","description"]},{"section":"repeating_magic-items","fields":["edit_row","name","effect"]},{"section":"repeating_conditions","fields":["edit_row","name","effect","affected","description"]},{"section":"repeating_attacks","fields":["edit_row","collapse","name","damage","description","range","action"]}];
kFuncs.repeatingSectionDetails = repeatingSectionDetails;
const persistentTabs = ["vaesen_tab"];
kFuncs.persistentTabs = persistentTabs;
/**
* The K-scaffold provides several variables to allow your scripts to tap into its information flow.
* @namespace Sheetworkers.Variables
*/
/**
* This stores the name of your sheet for use in the logging functions {@link log} and {@link debug}. Accessible by `k.sheetName`
* @memberof Variables
* @var
* @type {string}
*/
let sheetName = 'kScaffold Powered Sheet';
kFuncs.sheetName = sheetName;
/**
* This stores the version of your sheet for use in the logging functions{@link log} and {@link debug}. It is also stored in the sheet_version attribute on your character sheet. Accessible via `k.version`
* @memberof Variables
* @var
* @type {number}
*/
let version = 0;
kFuncs.version = version;
/**
* A boolean flag that tells the script whether to enable or disable {@link debug} calls. If the version of the sheet is `0`, or an attribute named `debug_mode` is found on opening this is set to true for your entire session. Otherwise, it remains false.
* @memberof Variables
* @var
* @type {boolean}
*/
let debugMode = false;
kFuncs.debugMode = debugMode;
/**
* A boolean flag that tells the script whether to output verbose logs of what is being done or not when {@link debugMode} is enabled.
* @memberof Variables
* @var
* @type {boolean}
*/
let verboseMode = false;
kFuncs.verboseMode = verboseMode;
const funcs = {};
kFuncs.funcs = funcs;
const updateHandlers = {};
const openHandlers = {};
const initialSetups = {};
const allHandlers = {};
const addFuncs = {};
const kscaffoldJSVersion = '2.7.1';
const kscaffoldPUGVersion = '2.7.0';
/**
* Defines the rollstring that rolls made using k.startRoll begin with. Defaults to "&{template:default}".
* @memberof Variables
* @var
* @type {string}
*/
let defaultRollStart = '&{template:default}';
kFuncs.defaultRollStart = defaultRollStart;/*jshint esversion: 11, laxcomma:true, eqeqeq:true*/
/*jshint -W014,-W084,-W030,-W033*/
/**
* These are utility functions that are not directly related to Roll20 systems. They provide easy methods for everything from processing text and numbers to querying the user for input.
* @namespace Sheetworkers.Utilities
* @alias Utilities
*/
/**
* Replaces problem characters to use a string as a regex
* @memberof Utilities
* @param {string} text - The text to replace characters in
* @returns {string}
* @example
* const textForRegex = k.sanitizeForRegex('.some thing[with characters]');
* console.log(textForRegex);// => "\.some thing\[with characters\]"
*/
const sanitizeForRegex = function(text){
return text.replace(/\.|\||\(|\)|\[|\]|\-|\+|\?|\/|\{|\}|\^|\$|\*/g,'\\$&');
};
kFuncs.sanitizeForRegex = sanitizeForRegex;
/**
* Converts a value to a number, it\'s default value, or `0` if no default value passed.
* @memberof Utilities
* @param {string|number} val - Value to convert to a number
* @param {number} def - The default value, uses 0 if not passed
* @returns {number|undefined}
* @example
* const num = k.value('100');
* console.log(num);// => 100
*/
const value = function(val,def){
const convertVal = +val;
if(def !== undefined && isNaN(def)){
throw(`K-scaffold Error: invalid default for value(). Default: ${def}`);
}
return convertVal === 0 ?
convertVal :
(+val||def||0);
};
kFuncs.value = value;
/**
* Extracts the section (e.g. `repeating_equipment`), rowID (e.g `-;lkj098J:LKj`), and field name (e.g. `bulk`) from a repeating attribute name.
* @memberof Utilities
* @param {string} string - The string to parse
* @returns {array} - Array of matches. Index 0: the section name, e.g. repeating_equipment | Index 1:the row ID | index 2: The name of the attribute
* @returns {string[]}
* @example
* //Extract info from a full repeating name
* const [section,rowID,attrName] = k.parseRepeatName('repeating_equipment_-8908asdflkjZlkj23_name');
* console.log(section);// => "repeating_equipment"
* console.log(rowID);// => "-8908asdflkjZlkj23"
* console.log(attrName);// => "name"
*
* //Extract info from just a row name
* const [section,rowID,attrName] = k.parseRepeatName('repeating_equipment_-8908asdflkjZlkj23');
* console.log(section);// => "repeating_equipment"
* console.log(rowID);// => "-8908asdflkjZlkj23"
* console.log(attrName);// => undefined
*/
const parseRepeatName = function(string){
let match = string.match(/(repeating_[^_]+)_([^_]+)(?:_(.+))?/);
match.shift();
return match;
};
kFuncs.parseRepeatName = parseRepeatName;
/**
* Parses out the components of a trigger name similar to [parseRepeatName](#parserepeatname). Aliases: parseClickTrigger.
*
* Aliases: `k.parseClickTrigger`
* @memberof Utilities
* @param {string} string The triggerName property of the
* @returns {array} - For a repeating button named `repeating_equipment_-LKJhpoi98;lj_roll`, the array will be `['repeating_equipment','-LKJhpoi98;lj','roll']`. For a non repeating button named `roll`, the array will be `[undefined,undefined,'roll']`
* @returns {string[]}
* @example
* //Parse a non repeating trigger
* const [section,rowID,attrName] = k.parseTriggerName('clicked:some-button');
* console.log(section);// => undefined
* console.log(rowID);// => undefined
* console.log(attrName);// => "some-button"
*
* //Parse a repeating trigger
* const [section,rowID,attrName] = k.parseTriggerName('clicked:repeating_attack_-234lkjpd8fu8usadf_some-button');
* console.log(section);// => "repeating_attack"
* console.log(rowID);// => "-234lkjpd8fu8usadf"
* console.log(attrName);// => "some-button"
*
* //Parse a repeating name
* const [section,rowID,attrName] = k.parseTriggerName('repeating_attack_-234lkjpd8fu8usadf_some-button');
* console.log(section);// => "repeating_attack"
* console.log(rowID);// => "-234lkjpd8fu8usadf"
* console.log(attrName);// => "some-button"
*/
const parseTriggerName = function(string){
let match = string.replace(/^clicked:/,'').match(/(?:(repeating_[^_]+)_([^_]+)_)?(.+)/);
match.shift();
return match;
};
kFuncs.parseTriggerName = parseTriggerName;
const parseClickTrigger = parseTriggerName;
kFuncs.parseClickTrigger = parseClickTrigger;
/**
* Parses out the attribute name from the htmlattribute name.
* @memberof Utilities
* @param {string} string - The triggerName property of the [event](https://wiki.roll20.net/Sheet_Worker_Scripts#eventInfo_Object).
* @returns {string}
* @example
* //Parse a name
* const attrName = k.parseHtmlName('attr_attribute_1');
* console.log(attrName);// => "attribute_1"
*/
const parseHTMLName = function(string){
let match = string.match(/(?:attr|act|roll)_(.+)/);
match.shift();
return match[0];
};
kFuncs.parseHTMLName = parseHTMLName;
/**
* Capitalize each word in a string
* @memberof Utilities
* @param {string} string - The string to capitalize
* @returns {string}
* @example
* const capitalized = k.capitalize('a word');
* console.log(capitalized);// => "A Word"
*/
const capitalize = function(string){
return string.replace(/(?:^|\s+|\/)[a-z]/ig,(letter)=>letter.toUpperCase());
};
kFuncs.capitalize = capitalize;
/**
* Extracts a roll query result for use in later functions. Must be awaited as per [startRoll documentation](https://wiki.roll20.net/Sheet_Worker_Scripts#Roll_Parsing.28NEW.29). Stolen from [Oosh\'s Adventures with Startroll thread](https://app.roll20.net/forum/post/10346883/adventures-with-startroll).
* @memberof Utilities
* @param {string} query - The query should be just the text as the `?{` and `}` at the start/end of the query are added by the function.
* @returns {Promise} - Resolves to the selected value from the roll query
* @example
* const rollFunction = async function(){
* //Get the result of a choose from list query
* const queryResult = await extractQueryResult('Prompt Text Here|Option 1|Option 2');
* console.log(queryResult);//=> "Option 1" or "Option 2" depending on what the user selects
*
* //Get free form input from the user
* const freeResult = await extractQueryResult('Prompt Text Here');
* consoel.log(freeResult);// => Whatever the user entered
* }
*/
const extractQueryResult = async function(query){
const rollObj = {
query:`[[0[response=?{${query}}]]]`
};
let {roll} = await _startRoll(rollObj,'!');
roll.finish();
return roll.results.query.expression.replace(/^.+?response=|\]$/g,'');
};
kFuncs.extractQueryResult = extractQueryResult;
/**
* Simulates a query for ensuring that async/await works correctly in the sheetworker environment when doing conditional startRolls. E.g. if you have an if/else and only one of the conditions results in `startRoll` being called (and thus an `await`), the sheetworker environment would normally crash. Awaiting this in the condition that does not actually need to call `startRoll` will keep the environment in sync.
* @memberof Utilities
* @param {string|number} [value] - The value to return. Optional.
* @returns {Promise} - Resolves to the value passed to the function
* @example
* const rollFunction = async function(){
* //Get the result of a choose from list query
* const queryResult = await pseudoQuery('a value');
* console.log(queryResult);//=> "a value"
* }
*/
const pseudoQuery = async function(value){
const rollObj = {
query:`[[0[response=${value}]]]`
};
let {roll} = await _startRoll(rollObj,'!');
roll.finish();
return roll.results.query.expression.replace(/^.+?response=|\]$/g,'');
};
kFuncs.pseudoQuery = pseudoQuery;
/**
* An alias for console.log.
* @memberof Utilities
* @param {any} msg - The message can be a straight string, an object, or an array. If it is an object or array, the object will be broken down so that each key is used as a label to output followed by the value of that key. If the value of the key is an object or array, it will be output via `console.table`.
*/
const log = function(msg){
if(typeof msg === 'string'){
console.log(`%c${kFuncs.sheetName} log| ${msg}`,"background-color:#159ccf");
}else if(typeof msg === 'object'){
Object.keys(msg).forEach((m)=>{
if(typeof msg[m] === 'string'){
console.log(`%c${kFuncs.sheetName} log| ${m}: ${msg[m]}`,"background-color:#159ccf");
}else{
console.log(`%c${kFuncs.sheetName} log| ${typeof msg[m]} ${m}`,"background-color:#159ccf");
console.table(msg[m]);
}
});
}
};
kFuncs.log = log;
/**
* Alias for console.log that only triggers when debug mode is enabled or when the sheet\'s version is `0`. Useful for entering test logs that will not pollute the console on the live sheet.
* @memberof Utilities
* @param {any} msg - 'See {@link k.log}
* @param {boolean} force - Pass as a truthy value to force the debug output to be output to the console regardless of debug mode.
* @returns {void}
*/
const debug = function(msg,force){
if(!kFuncs.debugMode && !force && kFuncs.version > 0) return;
if(typeof msg === 'string'){
console.warn(`%c${kFuncs.sheetName} DEBUG| ${msg}`,"background-color:tan;color:red;");
}else if(typeof msg === 'object'){
Object.keys(msg).forEach((m)=>{
if(typeof msg[m] === 'string'){
console.warn(`%c${kFuncs.sheetName} DEBUG| ${m}: ${msg[m]}`,"background-color:tan;color:red;");
}else{
console.warn(`%c${kFuncs.sheetName} DEBUG| ${typeof msg[m]} ${m}`,"background-color:tan;color:red;font-weight:bold;");
console.table(msg[m]);
}
});
}
};
kFuncs.debug = debug;
/**
* Orders the section id arrays for all sections in the `sections` object to match the repOrder attribute.
* @memberof Utilities
* @param {attributesProxy} attributes - The attributes object that must have a value for the reporder for each section.
* @param {object[]} sections - Object containing the IDs for the repeating sections, indexed by repeating section name.
*/
const orderSections = function(attributes,sections,casc){
Object.keys(sections).forEach((section)=>{
attributes.attributes[`_reporder_${section}`] = commaArray(attributes[`_reporder_${section}`]);
sections[section] = orderSection(attributes.attributes[`_reporder_${section}`],sections[section],attributes,section,casc);
});
};
kFuncs.orderSections = orderSections;
/**
* Orders a single ID array.
* @memberof Utilities
* @param {string[]} repOrder - Array of IDs in the order they are in on the sheet.
* @param {string[]} IDs - Array of IDs to be ordered. Aka the default ID Array passed to the getSectionIDs callback
* @param {AttributesProxy} [attributes] - The Kscaffold attributes object
* @param {string} [section] - the name of the section being ordered. If section and attributes are passed, will return an ordered array that does not include IDs for rows that do not exist.
* @param {object} [casc] - the object describing the default state of the sheet.
* @returns {string[]} - The ordered id array
*/
const orderSection = function(repOrder,IDs=[], attributes, section,casc){
const idArr = [...repOrder.filter(v => v),...IDs.filter(id => !repOrder.includes(id.toLowerCase()))]
.filter(id => {
const testAttr = Object.keys(casc).find(a => a.toLowerCase().startsWith(`attr_${section}_${id}`));
const testName = testAttr?.replace(/attr_/,'');
const idName = testName?.replace(/\$x/,id);
return (!section && !casc) ||
(
idName &&
(
attributes.attributes.hasOwnProperty(idName) ||
attributes.updates.hasOwnProperty(idName)
)
);
});
return idArr;
};
kFuncs.orderSection = orderSection;
/**
* Splits a comma delimited string into an array
* @memberof Utilities
* @param {string} string - The string to split.
* @returns {array} - The string segments of the comma delimited list.
*/
const commaArray = function(string=''){
return string.toLowerCase().split(/\s*,\s*/);
};
kFuncs.commaArray = commaArray;
// Roll escape functions for passing data in action button calls. Base64 encodes/decodes the data.
const RE = {
chars: {
'"': '%quot;',
',': '%comma;',
':': '%colon;',
'}': '%rcub;',
'{': '%lcub;',
},
escape(data) {
return typeof data === 'object' ?
`KDATA${btoa(JSON.stringify(data))}` :
`KSTRING${btoa(data)}`;
},
unescape(string) {
const isData = typeof string === 'string' &&
(
string.startsWith('KDATA') ||
string.startsWith('KSTRING')
);
return isData ?
(
string.startsWith('KDATA') ?
JSON.parse(atob(string.replace(/^KDATA/,''))) :
atob(string.replace(/^KSTRING/,''))
) :
string;
}
};
/**
* Encodes data in Base64. This is useful for passing roll information to action buttons called from roll buttons.
* @function
* @param {string|object|any[]} data - The data that you want to Base64 encode
* @returns {string} - The encoded data
* @memberof! Utilities
*/
const escape = RE.escape;
/**
* Decodes Base64 encoded strings that were created by the K-scaffold
* @function
* @param {string|object|any[]} string - The string of encoded data to decode. If this is not a string, or is not a string that was encoded by the K-scaffold, it will be returned as is.
* @returns {string|object|any[]}
* @memberof! Utilities
*/
const unescape = RE.unescape;
Object.assign(kFuncs,{escape,unescape});
/**
* Parses a macro so that it is reduced to the final values of all attributes contained in the macro. Will drill down up to 99 levels deep. If the string was not parseable, string will be returned with as much parsed as possible.
* @memberof Utilities
* @param {string} mutStr - The string macro to parse
* @param {AttributesProxy} attributes - The K-scaffold Attributes Proxy
* @param {Object} sections - The K-scaffold sections object
* @returns {string} - The string with all attributes replaced by their values (if possible).
*/
const parseMacro = (str,attributes,sections) => {
let iter = 0;
let mutStr = str;
while(mutStr.match(/@{.+?}/) && iter < 99){
mutStr = mutStr.replace(/@{(.+?)}/g,(match,name) => {
name = name.replace(/\|/,'_');
return attributes[name] !== null && attributes[name] !== undefined ?
attributes[name] :
`@(${name})`;
})
iter++;
}
mutStr = mutStr.replace(/@\((.+?)\)/g,'@{$1}');
return mutStr;
}
kFuncs.parseMacro = parseMacro;
/**
* Sends data to another character sheet to cause a change on that sheet. WARNING, this function should not be used in response to an attribute change to avoid spamming the chat with api messages.
*
* ![k.send.gif](/k-scaffold/k.send.gif)
* @memberof Utilities
* @param {string} characterName - The character to connect to
* @param {string} funcName - Name of the function to call similar to function name used in {@link callFunc}.
* @param {...any} args - The arguments to pass to the function call no the other sheet. These are passed after the normal destructure object for a K-scaffold function call.
* @example
* //Function that is called by the source sheet
* const dispatchPartner = async function({trigger,attributes,sections,casc}){
* const partnerName = await (
* attributes.partner_name ?
* k.pseudoQuery(attributes.partner_name) :
* k.extractQueryResult('Partner name')
* );
* attributes.partner_name = partnerName;
* //passing the attributes of the source sheet
* k.send(partnerName,'receivePartner',attributes);
* attributes.set();
* };
* k.registerFuncs({dispatchPartner});
*
* //Function called on target sheet. Partner is the attributes from the source sheet
* const receivePartner = function({trigger,attributes,sections,casc},partner){
* attributes.from_partner = partner.for_partner;
* attributes.partner_name = partner.character_name;
* };
* k.registerFuncs({receivePartner });
*/
const send = async function(characterName,funcName,...args){
const data = RE.escape({
funcName,
args
});
const roll = await startRoll(`!@{${characterName}|character_name}%{${characterName}|k-network-call||${data}}&{noerror}`);
finishRoll(roll.rollId);
};
kFuncs.send = send;
const kReceive = function({trigger,attributes,sections,casc}) {
const data = trigger.rollData;
callFunc(data.funcName,{attributes,sections,casc},...data.args);
};
funcs.kReceive = kReceive;/*jshint esversion: 11, laxcomma:true, eqeqeq:true*/
/*jshint -W014,-W084,-W030,-W033*/
/**
* Detailed descriptions of the arguments that are passed to functions registered with the K-scaffold.
* @namespace Sheetworkers.Function Arguments
*/
/**
* An object that stores the rowID information for each repeating section on the sheet.
* @name sections
* @memberof Function Arguments
* @var
* @property {string[]} repeating_section_name - The row IDs of a given repeating section. The repeating section name is used **with** the `repeating_` prefix (e.g. `sections['repeating_weapons']`).
*/
/**
* Object that stores the default trigger information for all attributes. Indexed by attribute, button name, or fieldset name prefixed with `attr_`, `act_`, or `fieldset_` respectively.
* @name casc
* @memberof Function Arguments
* @var
*/
/**
* Object describing the attribute that is currently being worked on. In addition to the properties described here, the properties from the Roll20 event will also be present if the attribute was the original event. Additional properties may be present if you specified them when creating the input for the attribute.
* @name trigger
* @memberof Function Arguments
* @var
* @property {string} name - The full name of the attribute.
* @property {string[]} triggeredFuncs - Array of function names that will be called when this attribute is worked on.
* @property {string} calculation - The name of the function that is used to calculate the value of this attribute.
* @property {string} formula - The macro syntax formula to use to calculate this attributes value.
* @property {string[]} affects - Array of attribute names that this attribute might affect.
* @property {string[]} addFuncs - Functions that are called when the add row button is clicked for a customControlFieldset.
* @property {string} listener - What function was used to listen for changes to this attribute. Unless you have decided to implement your own event handling, this should always be `"accessSheet"`.
* @property {string} type - What type of thing this trigger is for (e.g. number, action).
*/
//# Attribute Obj Proxy handler
/**
* A representation of the sheet's attributes. This is a proxy for the actual object and will keep track of original values and updates that have been applied. Calling an attribute directly on the attributes value will return it's current value coerced into a number if it is numeric. Setting a property on the attributes object will add it the list of updates which will be applied the next time the `set()` method is called on attributes.
* @name attributes
* @memberof Function Arguments
* @var
* @property {object} attributes - The raw original data of the character sheet.
* @property {object} updates - The raw data that will be saved to the character sheet once all operations have been completed.
* @property {function} set - Method to apply changes to the character sheet. This is called automatically at the end of the scaffold's event handling. Needs to be called manually if inside an asynchronous function, such as when using the startRoll sheetworker (or any of the scaffold aliases for startRoll). The method uses object destructuring syntax for the arguments it takes.
* @property {boolean} [set.vocal=false] - Whether the set is done silently or not. Should almost always be left at false. `attributes.set({vocal:true})`
* @property {function} [set.callback] - Callback function to be invoked once the setAttrs is complete. `attributes.set({callback(){/*do a thing}})`
* @property {any} attribute_name - Name of any attribute whose data from the character sheet you want to access. Will only return a value if the attribute was defined using the scaffold's pug mixins (e.g. +input). If the value of the attribute is numerical (e.g. `"5"`), it will be returned as a number. You can also apply changes by simply assigning a value to an attribute name (e.g. `attributes.character_name = 'New Character'`).
* @property {object} repOrders - Object showing the ordered arrays for the _reporder_ attributes for each repeating section. Indexed by repeating section name
* @property {object[]} repeating_section_name - Name of a repeating section whose data you want to access (e.g. `attributes.repeating_weapons`). The data will be returned as an array with objects describing each row in the order they are on the sheet. Objects are indexed by rowID as well. Mutating array methods are replaced by the `sort` and `move` methods. Non mutating array methods can be used as normal.
* @property {string} repeating_section_name._section - the name of the repeating section. Used internally by the scaffold. Readonly.
* @property {function} move - Method for reordering rows.
* @property {number|string} move.startingPosition - the row id or position index for the row you want to move.
* @property {number} move.destination - The position in the section where you want the row to be moved to. If the position is greater than the length of the section, the row will be moved to the last position. If the position is negative, it will be moved to the start of the section.
* @property {boolean} [move.silent=false] - Whether the reordering should trigger setSectionOrder or not.
* @property {function} sort - Alias for the default Array.sort method. Functions as the default sort method, but has an optional second argument.
* @property {function} sort.callback - The function to use for determining the sort order. See the [Array.sort documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) for details.
* @property {boolean} [sort.silent=false] - Whether to apply the sort to the display of the repeating section.
* @property {function} create - Method for creating a new row in a repeating section. Arguments for this method can be in any order. A row will not actually be created unless data is assigned to at least one attribute of the row, either at creation or later. Returns the object representing the new row.
* @property {string} [create.custom] - Custom text that replaces the starting characters of the rowID
* @property {object} [create.data] - what to set the attribute values of the row to. If not provided, the row object will be created, but no row will be created on the sheet until data is specified.
* @property {object} repeating_section_name.rowID_or_Index - Returns the object describing a row in a repeating section specified by row ID or indexed position. (e.g. `attributes.repeating_weapons[0]` returns the data for the first row in the weapons section)
* * @property {object} repeating_section_name.rowID_or_Index._id - The id of the row. Readonly.
* * @property {object} repeating_section_name.rowID_or_Index._section - The repeating section the row belongs to. Readonly.
* @property {any} repeating_section_name.rowID_or_Index.attribute_name - functions as an attribute_name call on the base attributes object. (e.g. `attributes['repeating_weapons_-jJ2soils_name']` is equivalent to `attributes.repeating_weapons['-jJ2soils'].name`).
* @type {object}
*/
const createAttrProxy = function(attrs,sections,casc){
//creates a proxy for the attributes object so that values can be worked with more easily.
const getCascObj = function(event){
const eventName = event.triggerName || event.sourceAttribute;
let typePrefix = eventName.startsWith('clicked:') ?
'act_' :
event.removedInfo ?
'fieldset_' :
'attr_';
let cascName = `${typePrefix}${eventName.replace(/(?:removed?|clicked):/,'')}`;
let cascObj = casc[cascName];
if(kFuncs.verboseMode){
debug({[cascName]:cascObj});
}
if(event && cascObj){
Object.assign(cascObj,event);
if(event.originalRollId){
cascObj.rollData = RE.unescape(event.originalRollId);
}
}
return cascObj || {};
};
const triggerFunctions = function(obj){
if(obj.triggeredFuncs && obj.triggeredFuncs.length){
if(kFuncs.verboseMode){
debug(`triggering functions for ${obj.name}`);
}
obj.triggeredFuncs && obj.triggeredFuncs.forEach(func=>funcs[func] ?
funcs[func]({trigger:obj,attributes,sections,casc}) :
debug(`!!!Warning!!! no function named ${func} found. Triggered function not called for ${obj.name}`,true));
}
};
const initialFunction = function(obj){
if(obj.initialFunc){
if(kFuncs.verboseMode){
debug(`initial functions for ${obj.name}`);
}
funcs[obj.initialFunc] ?
funcs[obj.initialFunc]({trigger:obj,attributes,sections}) :
debug(`!!!Warning!!! no function named ${obj.initialFunc} found. Initial function not called for ${obj.name}`,true);
}
};
const alwaysFunctions = function(trigger){
Object.values(allHandlers).forEach((handler)=>{
handler({trigger,attributes,sections,casc});
});
};
const processChange = function({event,trigger}){
if(event && !trigger){
debug(`${event.sourceAttribute} change detected. No trigger found`);
return;
}
if(!attributes || !sections || !casc){
debug(`!!! Insufficient arguments || attributes > ${!!attributes} | sections > ${!!sections} | casc > ${!!casc} !!!`);
return;
}
if(kFuncs.verboseMode){
debug({trigger});
}
if(event){
if(Array.isArray(trigger.affects)){
attributes.queue.push(...trigger.affects);
}
alwaysFunctions(trigger,attributes,sections,casc);//Functions that should be run for all events.
initialFunction(trigger,attributes,sections,casc);//functions that should only be run if the attribute was the thing changed by the user
}
if(trigger){
triggerFunctions(trigger,attributes,sections,casc);
if(!event){
// Handle autocalc formula
if(trigger.formula){
attributes[trigger.name] = parseKFormula({trigger,attributes,sections,casc});
}
// handle calculation of element
if(
trigger.calculation &&
funcs[trigger.calculation]
){
attributes[trigger.name] = funcs[trigger.calculation]({trigger,attributes,sections,casc});
}else if(trigger.calculation && !funcs[trigger.calculation]){
debug(`K-Scaffold Error: No function named ${trigger.calculation} found`);
}
}
}
attributes.set();
};
const attrTarget = {
updates:{},
attributes:{...attrs},
repOrders:{},
queue: [],
casc:{},
alwaysFunctions,
processChange,
triggerFunctions,
initialFunction,
getCascObj
};
const repeatObjects = {};
const repeatTargetObjects = {};
const repeatHandler = {
get:function(obj,prop){
const row = `${obj._section}_${obj._id}`;
if(prop === '_isProxy'){
return true;
}
if(prop === 'toJSON'){
return () => {
return Object.keys(obj).reduce((o,k) => {
o[k] = attributes[`${row}_${k}`];
return o;
},{_id: obj._id,_section: obj._section});
}
}
return obj[prop];
},
set: function(obj,prop,value){
if(prop === '_id' || prop === '_section'){
throw new Error(`!!!Warning: cannot change the id or section of a repeating object!!!`);
}else if( prop === '_index'){
throw new Error(`!!!Warning: Cannot reorder sections by setting the _index. Sort the repeating array or use k.setSectionOrder!!!`);
}
const fullRef = `${obj._section}_${obj._id}_${prop}`;
attributes[fullRef] = value;
obj[prop] = value;
}
};
const repeatArrHandler = {
get(arr,prop){
if(prop === '_isProxy'){
return true;
}
if(
prop === 'fill' ||
prop === 'shift' ||
prop === 'pop' ||
prop === 'unshift' ||
prop === 'splice'
){
throw new Error(`The ${prop} method is not allowed on section arrays`);
}
if(prop === 'create'){
return function(){
const argArray = [...arguments];
const custom = argArray.find(e => typeof e === 'string');
const data = argArray.find(e => typeof e === 'object' && !Array.isArray(e));
const row = _generateRowID(arr._section,sections,custom);
const id = row.replace(/repeating_[^_]+_/,'');
arr[id] = createRepeatObj(arr._section,id);
arr.push(arr[id]);
if(data){
Object.entries(data).forEach(([key,value]) => {
if(arr[id].hasOwnProperty(key)){
arr[id][key] = value;
}else{
debug(`!!!Warning: no input exists in ${obj._section} for the attribute "${key}"!!!`);
}
});
}
return arr[id];
}
}
if(prop === 'move'){
return function(){
const ref = arguments[0];
const targ = arguments[1];
const vocal = !arguments[2]
// TODO: add protection for missing arguments
let id;
let index;
if(sections[arr._section].includes(ref)){
id = ref;
index = sections[arr._section].indexOf(id);
}else if(!Number.isNaN(ref)){
index = ref;
id = sections[arr._section][index];
}
if(
!Number.isNaN(index) &&
id &&
!Number.isNaN(targ)
){
const obj = arr.splice(index,1);
arr.splice(targ,0,obj);
sections[arr._section].splice(index,1);
sections[arr._section].splice(targ,0,id);
if(vocal){
_setSectionOrder(arr._section,sections[arr._section]);
}
}
}
}
if(prop === 'sort'){
return function(){
const callback = arguments[0];
const vocal = !arguments[1];
sections[arr._section].sort((a,b) => {
const aObj = arr[a];
const bObj = arr[b];
const sortResult = callback(aObj,bObj);
return sortResult;
});
arr.sort((a,b) => {
const aIndex = sections[arr._section].indexOf(a._id);
const bIndex = sections[arr._section].indexOf(b._id);
return aIndex - bIndex;
});
// if not a silent sort, then apply the reordered section to the sheet via setSectionOrder
if(vocal){
_setSectionOrder(arr._section,sections[arr._section]);
}
return arr;
}
}
if(arr[prop] || Number.isNaN(prop)){
return Reflect.get(...arguments);
}
if(sections[arr._section].includes(prop)){
arr[prop] = createRepeatObj(arr._section,prop);
arr.push(arr[prop]);
return arr[prop];
}
},
set(obj,prop,value){
if(prop === 'section'){
throw new Error('!!!Warning: Section property of a repeating section is readonly!!!')
}
},
deleteProperty(arr,prop){
if(
!prop.startsWith('_') &&
arr[prop] &&
arr[prop]._isProxy
){
let id;
let index;
if(typeof prop === 'string' && prop.startsWith('-')){
id = prop;
index = sections[arr._section].indexOf(id);
}else{
index = prop;
id = arr[index]._id;
}
delete arr[id];
arr.splice(index,1);
sections[section].splice(index,1);
const row = `${arr._section}_${id}`;
removeRepeatingRow(row);
}
}
};
const createRepeatObj = (prop,id) => {
const row = `${prop}_${id}`;
const fields = repeatingSectionDetails.find(o => o.section === prop).fields;
const retObj = fields.reduce((o,field) => {
o[field] = attributes[`${row}_${field}`];
return o;
},{_id:id,_section: prop})
repeatTargetObjects[prop] = repeatTargetObjects[prop] || {};
repeatTargetObjects[prop][id] = retObj;
return new Proxy(retObj,repeatHandler);
}
const attrHandler = {
get:function(obj,prop){//gets the most value of the attribute.
if(prop === '_isProxy'){
return true;
}
if(prop === 'toJSON'){
return () => ({...obj.attributes,...obj.updates});
}else if(prop === 'set'){
return function(){
let {callback,vocal} = arguments[0] ? arguments[0] : {};
if(sections && casc && attributes.queue.length){
const triggerName = attributes.queue.shift();
const trigger = getCascObj({sourceAttribute:triggerName});
processChange({trigger,attributes,sections,casc});
}else{
if(kFuncs.verboseMode){
debug({updates:obj.updates});
}
const trueCallback = Object.keys(obj.repOrders).length ?
function(){
Object.entries(obj.repOrders).forEach(([section,order])=>{
_setSectionOrder(section,order)
});
callback && callback();
}:
callback;
Object.keys(obj.updates).forEach((key)=>obj.attributes[key] = obj.updates[key]);
const update = obj.updates;
obj.updates = {};
set(update,vocal,trueCallback);
}
}
}else if(/^repeating_[^_]+$/.test(prop)){
// if it's been lazy loaded, use it
if(!repeatObjects[prop]){
// otherwise lazy load it
const baseArr = [];
baseArr._section = prop;
repeatObjects[prop] = new Proxy(sections[prop].reduce((arr,id,i) => {
const rowObj = createRepeatObj(prop,id,i);
arr.push(rowObj);
arr[id] = rowObj;
return arr;
},baseArr),repeatArrHandler);
}
return repeatObjects[prop];
}else if(Object.keys(obj).some(key=>key===prop)){
return Reflect.get(...arguments)
}else{
let retValue;
switch(true){
case obj.repOrders.hasOwnProperty(prop):
retValue = obj.repOrders[prop];
break;
case obj.updates.hasOwnProperty(prop):
retValue = obj.updates[prop];
break;
default:
retValue = obj.attributes[prop];
break;
}
let cascRef = `attr_${prop.replace(/(repeating_[^_]+_)[^_]+/,'$1\$X')}`.toLowerCase();
let numRetVal = +retValue;
if(!Number.isNaN(numRetVal) && retValue !== ''){
retValue = numRetVal;
}else if(cascades[cascRef] && (typeof cascades[cascRef].defaultValue === 'number' || cascades[cascRef].type === 'number')){
retValue = cascades[cascRef].defaultValue;
}
return retValue;
}
},
set:function(obj,prop,value){
//Sets the value. Also verifies that the value is a valid attribute value
//e.g. not undefined, null, or NaN
if(value || value===0 || value===''){
if(/reporder/.test(prop)){
let section = prop.replace(/_reporder_/,'');
obj.repOrders[section] = value;
}else if(`${obj.attributes}` !== `${value}` ||
(obj.updates[prop] && `${obj.updates}` !== `${value}`)
){
if(sections && casc){
const trigger = getCascObj({sourceAttribute:prop});
if(Array.isArray(trigger.affects)){
attributes.queue.push(...trigger.affects);
}
}
const repRx = /^(repeating_[^_]+)_([^_]+)_(.+)$/;
if(repRx.test(prop)){
const [,section,rowID,field] = prop.match(repRx);
if(repeatObjects[section]){
repeatObjects[section][rowID] = repeatObjects[section][rowID] || createRepeatObj(section,rowID);
repeatTargetObjects[section][rowID][field] = value;
}
}
obj.updates[prop] = value;
}
}else{
debug(`!!!Warning: Attempted to set ${prop} to an invalid value:${value}; value not stored!!!`);
}
return true;
},
deleteProperty(obj,prop){
//removes the property from the original attributes, updates, and the reporders
Object.keys(obj).forEach((key)=>{
delete obj[key][prop.toLowerCase()];
});
}
};
const attributes = new Proxy(attrTarget,attrHandler);
return attributes;
};
/**
* Function that registers a function for being called via the funcs object. Returns true if the function was successfully registered, and false if it could not be registered for any reason.
* @memberof Utilities
* @param {object} funcObj - Object with keys that are names to register functions under and values that are functions.
* @param {object} optionsObj - Object that contains options to use for this registration.
* @param {string[]} optionsObj.type - Array that contains the types of specialized functions that apply to the functions being registered. Valid types are `"opener"`, `"updater"`, and `"default"`. `"default"` is always used, and never needs to be passed.
* @returns {boolean} - True if the registration succeeded, false if it failed.
* @example
* //Basic Registration
* const myFunc = function({trigger,attributes,sections,casc}){};
* k.registerFuncs({myFunc});
*
* //Register a function to run on sheet open
* const openFunc = function({trigger,attributes,sections,casc}){};
* k.registerFuncs({openFunc},{type:['opener']})
*
* //Register a function to run on all events
* const allFunc = function({trigger,attributes,sections,casc}){};
* k.registerFuncs({allFunc},{type:['all']})
*/
const registerFuncs = function(funcObj,optionsObj = {}){
if(typeof funcObj !== 'object' || typeof optionsObj !== 'object'){
debug(`!!!! K-scaffold error: Improper arguments to register functions !!!!`);
return false;
}
const typeArr = optionsObj.type ? ['default',...optionsObj.type] : ['default'];
const typeSwitch = {
'opener':openHandlers,
'updater':updateHandlers,
'new':initialSetups,
'all':allHandlers,
'default':funcs
};
let setState;
Object.entries(funcObj).map(([prop,value])=>{
typeArr.forEach((type)=>{
if(typeSwitch[type][prop]){
debug(`!!! Duplicate function name for ${prop} as ${type}!!!`);
setState = false;
}else if(typeof value === 'function'){
typeSwitch[type][prop] = value;
setState = setState !== false ? true : false;
}else{
debug(`!!! K-scaffold error: Function registration requires a function. Invalid value to register as ${type} !!!`);
setState = false;
}
});
});
return setState;
};
kFuncs.registerFuncs = registerFuncs;
/**
* Function that sets up the action calls used in the roller mixin.
* @memberof Sheetworkers
* @param {object} attributes - The attribute values of the character
* @param {object[]} sections - All the repeating section IDs
*/
const setActionCalls = function({attributes,sections}){
actionAttributes.forEach((base)=>{
let [section,,field] = k.parseTriggerName(base);
let fieldAction = field.replace(/_/g,'-');
if(section){
sections[section].forEach((id)=>{
attributes[`${section}_${id}_${field}`] = `%{${attributes.character_name}|${section}_${id}_${fieldAction}}`;
});
}else{
attributes[`${field}`] = `%{${attributes.character_name}|${fieldAction}}`;
}
});
};
funcs.setActionCalls = setActionCalls;
kFuncs.setActionCalls = setActionCalls;
/**
* Function that reduces Roll20 macro syntax formulas down to their calculated value.
* @memberof Sheetworkers
* @param {object} attributes - The attribute values of the character
* @param {object[]} sections - All the repeating section IDs
*/
const parseKFormula = ({trigger,attributes,sections,casc}) => {
const [baseSection,rowID,attrName] = parseTriggerName(trigger.name);
const repeatBlockRx = baseSection ?
/(@{repeating_.+?_\$X_.+?})/g :
/={([^)]*repeating_[^_]+[^)]*)}=/g;
let mutFormula = trigger.formula;
mutFormula = mutFormula.replace(repeatBlockRx,(match,repeatMacro) => {
const [section] = repeatMacro.match(/repeating_[^_]+/);
const idArray = baseSection ?
[rowID] :
sections[section];
return idArray.map(id => {
return `(${repeatMacro.replace(/repeating_[^_]+?_[^_]+?_([^}]+)/g,`${section}_${id}_$1`)})`;
}).join(
trigger.type === 'number' ?
' + ' :
''
);
});
mutFormula = parseMacro(mutFormula,attributes)
.replace(/@{.+?}/g,'0');
const mathKeys = ['floor','ceil','round','abs'];
mathKeys.forEach(func => mutFormula = mutFormula.replace(new RegExp(`${func}\\(`,'g'),`Math.${func}(`));
const mathRx = new RegExp(`Math\\.(?:${mathKeys.join('|')})`,'g');
let noAlphaStr = mutFormula
.replace(mathRx,'');
return trigger.type !== 'text' ?
(
!noAlphaStr.match(/[a-z]/i) ?
eval(mutFormula) :
undefined
) :
mutFormula;
};
funcs.parseKFormula = parseKFormula;
kFuncs.parseKFormula = parseKFormula;
/**
* Function to call a function previously registered to the funcs object. May not be used that much in actual sheets, but very useful when writing unit tests for your sheet. Either returns the function or null if no function exists.
* @memberof Sheetworkers
* @param {string} funcName - The name of the function to invoke.
* @param {...any} args - The arguments to call the function with.
* @returns {function|null}
* @example
* //Call myFunc with two arguments
* k.callFunc('myFunc','an argument','another argument');
*/
const callFunc = function(funcName,...args){
if(funcs[funcName]){
if(kFuncs.verboseMode){
debug(`calling ${funcName}`);
}
return funcs[funcName](...args);
}else{
debug(`Invalid function name: ${funcName}`);
return null;
}
};
kFuncs.callFunc = callFunc;/**@namespace Sheetworkers */
/*jshint esversion: 11, laxcomma:true, eqeqeq:true*/
/*jshint -W014,-W084,-W030,-W033*/
//Sheet Updaters and styling functions
/**
* Function that calls the K-scaffold's update and sheet initialization routines.
*/
const updateSheet = function(){
log('updating sheet');
getAllAttrs({props:['debug_mode',...baseGet],callback:(attributes,sections,casc)=>{
kFuncs.debugMode = kFuncs.debugMode || !!attributes.debug_mode;
if(kFuncs.verboseMode){
debug({sheet_version:attributes.sheet_version});
}
if(!attributes.sheet_version){
Object.entries(initialSetups).forEach(([funcName,handler])=>{
if(typeof funcs[funcName] === 'function'){
if(kFuncs.verboseMode){
debug(`running ${funcName}`);
}
funcs[funcName]({attributes,sections,casc});
}else{
if(kFuncs.verboseMode){
debug(`!!!Warning!!! no function named ${funcName} found. Initial sheet setup not performed.`);
}
}
});
}else{
Object.entries(updateHandlers).forEach(([ver,handler])=>{
if(attributes.sheet_version < +ver){
handler({attributes,sections,casc});
}
});
}
if(kFuncs.verboseMode){
debug({openHandlers});
}
Object.entries(openHandlers).forEach(([funcName,func])=>{
if(typeof funcs[funcName] === 'function'){
if(kFuncs.verboseMode){
debug(`running ${funcName}`);
}
funcs[funcName]({attributes,sections,casc});
}else{
if(kFuncs.verboseMode){
debug(`!!!Warning!!! no function named ${funcName} found. Sheet open handling not performed.`);
}
}
});
setActionCalls({attributes,sections});
attributes.sheet_version = kFuncs.version;
log(`Sheet Update applied. Current Sheet Version ${kFuncs.version}`);
attributes.set();
log('Sheet ready for use');
}});
};
kFuncs.updateSheet = updateSheet;
const initialSetup = function(attributes,sections){
if(kFuncs.verboseMode){
debug('Initial sheet setup');
}
};
/**
* This is the default listener function for attributes that the K-Scaffold uses. It utilizes the `triggerFuncs`, `listenerFunc`, `calculation`, and `affects` properties of the K-scaffold trigger object (see the Pug section of the scaffold for more details).
* @memberof Sheetworkers
* @param {Roll20Event} event - The Roll20 event object
* @returns {void}
* @example
* //Call from an attribute change
* on('change:an_attribute',k.accessSheet);
*/
const accessSheet = function(event){
if(kFuncs.verboseMode){
debug({funcs:Object.keys(funcs)});
debug({event});
}
getAllAttrs({callback:(attributes,sections,casc)=>{
let trigger = attributes.getCascObj(event,casc);
attributes.processChange({event,trigger,attributes,sections,casc});
}});
};
funcs.accessSheet = accessSheet;/*jshint esversion: 11, laxcomma:true, eqeqeq:true*/
/*jshint -W014,-W084,-W030,-W033*/
/*
Cascade Expansion functions
*/
//Expands the repeating section templates in cascades to reflect the rows actually available
const expandCascade = function(cascade,sections){
return _.keys(cascade).reduce((memo,key)=>{//iterate through cascades and replace references to repeating attributes with correct row ids.
if(/^(?:act|attr)_repeating_/.test(key)){//If the attribute is a repeating attribute, do special logic
expandRepeating(memo,key,cascade,sections);
}else if(key){//for non repeating attributes do this logic
expandNormal(memo,key,cascade,sections);
}
return memo;
},{});
};
kFuncs.expandCascade = (sections) => expandCascade(cascades,sections);
const expandRepeating = function(memo,key,cascade,sections){
key.replace(/((?:attr|act)_)(repeating_[^_]+)_[^_]+?_(.+)/,(match,type,section,field)=>{
(sections[section]||[]).forEach((id)=>{
memo[`${type}${section}_${id}_${field}`]=_.clone(cascade[key]);//clone the details so that each row's attributes have correct ids
memo[`${type}${section}_${id}_${field}`].name = `${section}_${id}_${field}`;
if(key.startsWith('attr_')){
memo[`${type}${section}_${id}_${field}`].affects = memo[`${type}${section}_${id}_${field}`].affects.reduce((m,affected)=>{
if(affected.startsWith(section)){//otherwise if the affected attribute is in the same section, simply set the affected attribute to have the same row id.
m.push(applyID(affected,id));
}else if(/repeating/.test(affected)){//If the affected attribute isn't in the same repeating section but is still a repeating attribute, add all the rows of that section
addAllRows(affected,m,sections);
}else{//otherwise the affected attribute is a non repeating attribute. Simply add it to the computed affected array
m.push(affected);
}
return m;
},[]);
}
});
});
};
const applyID = function(affected,id){
return affected.replace(/(repeating_[^_]+_)[^_]+(.+)/,`$1${id}$2`);
};
const expandNormal = function(memo,key,cascade,sections){
memo[key] = _.clone(cascade[key]);
if(key.startsWith('attr_')){
memo[key].affects = memo[key].affects || [];
memo[key].affects = memo[key].affects.reduce((m,a)=>{
if(/^repeating/.test(a)){
addAllRows(a,m,sections);
}else{
m.push(a);
}
return m;
},[]);
}
};
const addAllRows = function(affected,memo,sections){
affected.replace(/(repeating_[^_]+?)_[^_]+?_(.+)/,(match,section,field)=>{
sections[section].forEach(id=>memo.push(`${section}_${id}_${field}`));
});
};/*jshint esversion: 11, laxcomma:true, eqeqeq:true*/
/*jshint -W014,-W084,-W030,-W033*/
/**
* These are functions that provide K-scaffold aliases for the basic Roll20 sheetworker functions. These functions also provide many additional features on top of the standard Roll20 sheetworkers.
* @namespace Sheetworkers.Sheetworker Aliases
*/
/**
* Alias for [setSectionOrder()](https://wiki.roll20.net/Sheet_Worker_Scripts#setSectionOrder.28.3CRepeating_Section_Name.3E.2C_.3CSection_Array.3E.2C_.3CCallback.3E.29) that allows you to use the section name in either `repeating_section` or `section` formats. Note that the Roll20 sheetworker [setSectionOrder](https://wiki.roll20.net/Sheet_Worker_Scripts#setSectionOrder.28.3CRepeating_Section_Name.3E.2C_.3CSection_Array.3E.2C_.3CCallback.3E.29) currently causes some display issues on sheets.
* @memberof Sheetworker Aliases
* @name setSectionOrder
* @param {string} section - The name of the section, with or without `repeating_`
* @param {string[]} order - Array of ids describing the desired order of the section.
* @returns {void}
* @example
* //Set the order of a repeating_weapon section
* k.setSectionOrder('repeating_equipment',['id1','id2','id3']);
* //Can also specify the section name without the repeating_ prefix
* k.setSectionOrder('equipment',['id1','id2','id3']);
*/
const _setSectionOrder = function(section,order){
let trueSection = section.replace(/repeating_/,'');
setSectionOrder(trueSection,order);
};
// deprecation warning added to setSectionOrder
kFuncs.setSectionOrder = (section,order) => {
debug('###Deprecation: It is recommended to use the "move" method of the nested section info feature of the attributes object instead of setSectionOrder');
_setSectionOrder(section,order);
};
/**
* Alias for [removeRepeatingRow](https://wiki.roll20.net/Sheet_Worker_Scripts#removeRepeatingRow.28_RowID_.29) that also removes the row from the current object of attribute values and array of section IDs to ensure that erroneous updates are not issued.
* @memberof Sheetworker Aliases
* @name removeRepeatingRow
* @param {string} row - The row id to be removed
* @param {attributesProxy} attributes - The attribute values currently in memory
* @param {object} sections - Object that contains arrays of all the IDs in sections on the sheet indexed by repeating name.
* @returns {void}
* @example
* //Remove a repeating Row
* k.getAllAttrs({
* callback:(attributes,sections)=>{
* const rowID = sections.repeating_equipment[0];
* k.removeRepeatingRow(`repeating_equipment_${rowID}`,attributes,sections);
* console.log(sections.repeating_equipment); // => rowID no longer exists in the array.
* console.log(attributes[`repeating_equipment_${rowID}_name`]); // => undefined
* }
* })
*/
const _removeRepeatingRow = function(row,attributes,sections){
Object.keys(attributes.attributes).forEach((key)=>{
if(key.startsWith(row)){
delete attributes[key];
}
});
let [,section,rowID] = row.match(/(repeating_[^_]+)_(.+)/,'');
sections[section] = sections[section].filter((id)=>id!==rowID);
delete attributes[section][rowID];
removeRepeatingRow(row);
};
kFuncs.removeRepeatingRow = _removeRepeatingRow;
/**
* Alias for [getAttrs()](https://wiki.roll20.net/Sheet_Worker_Scripts#getAttrs.28attributeNameArray.2C_callback.29) that converts the default object of attribute values into an {@link attributesProxy} and passes that back to the callback function.
* @memberof Sheetworker Aliases
* @name getAttrs
* @param {string[]} [props=baseGet] - Array of attribute names to get the value of. Defaults to {@link baseGet} if not passed.
* @param {function(attributesProxy)} callback - The function to call after the attribute values have been gotten. An {@link attributesProxy} is passed to the callback.
* @example
* //Gets the attributes named in props.
* k.getAttrs({
* props:['attribute_1','attribute_2'],
* callback:(attributes)=>{
* //Work with the attributes as you would in a normal getAttrs, or use the superpowers of the K-scaffold attributes object like so:
* attributes.attribute_1 = 'new value';
* attributes.set();
* }
* })
*/
const _getAttrs = function({props=baseGet,callback}){
getAttrs(props,(values)=>{
const attributes = createAttrProxy(values);
callback(attributes);
});
};
kFuncs.getAttrs = _getAttrs;
/**
* Alias for [getAttrs()](https://wiki.roll20.net/Sheet_Worker_Scripts#getAttrs.28attributeNameArray.2C_callback.29) and [getSectionIDs](https://wiki.roll20.net/Sheet_Worker_Scripts#getSectionIDs.28section_name.2Ccallback.29) that combines the actions of both sheetworker functions and converts the default object of attribute values into an {@link attributesProxy}. Also gets the details on how to handle all attributes from the master {@link cascades} object and.
* @memberof Sheetworker Aliases
* @param {Object} args
* @param {string[]} [args.props=baseGet] - Array of attribute names to get the value of. Defaults to {@link baseGet} if not passed.
* @param {repeatingSectionDetails} sectionDetails - Array of details about a section to get the IDs for and attributes that need to be gotten.
* @param {function(attributesProxy,sectionObj,expandedCascade):void} args.callback - The function to call after the attribute values have been gotten. An {@link attributesProxy} is passed to the callback along with a {@link sectionObj} and {@link expandedCascade}.
* @example
* //Get every K-scaffold linked attribute on the sheet
* k.getAllAttrs({
* callback:(attributes,sections,casc)=>{
* //Work with the attributes as you please.
* attributes.some_attribute = 'a value';
* attributes.set();//Apply our change
* }
* })
*/
const getAllAttrs = function({props=baseGet,sectionDetails=repeatingSectionDetails,callback}){
getSections(sectionDetails,(repeats,sections)=>{
getAttrs([...props,...repeats],(values)=>{
const casc = expandCascade(cascades,sections);
const attributes = createAttrProxy(values,sections,casc);
orderSections(attributes,sections,casc);
callback(attributes,sections,casc);
})
});
};
kFuncs.getAllAttrs = getAllAttrs;
/**
* Alias for [getSectionIDs()](https://wiki.roll20.net/Sheet_Worker_Scripts#getSectionIDs.28section_name.2Ccallback.29) that allows you to iterate through several functions at once. Also assembles an array of repeating attributes to get.
* @memberof Sheetworker Aliases
* @param {object[]} sectionDetails - Array of details about a section to get the IDs for and attributes that need to be gotten.
* @param {string} sectionDetails.section - The full name of the repeating section including the `repeating_` prefix.
* @param {string[]} sectionDetails.fields - Array of field names that need to be gotten from the repeating section
* @param {function(string[],sectionObj)} callback - The function to call once all IDs have been gotten and the array of repating attributes to get has been assembled. The callback is passed the array of repating attributes to get and a {@link sectionObj}.
* @example
* // Get some section details
* const sectionDetails = {
* {section:'repeating_equipment',fields:['name','weight','cost']},
* {section:'repeating_weapon',fields:['name','attack','damage']}
* };
* k.getSections(sectionDetails,(attributeNames,sections)=>{
* console.log(attributeNames);// => Array containing all row specific attribute names
* console.log(sections);// => Object with arrays containing the row ids. Indexed by section name (e.g. repeating_eqiupment)
* })
*/
const getSections = function(sectionDetails,callback){
let queueClone = _.clone(sectionDetails);
const worker = (queue,repeatAttrs=[],sections={})=>{
let detail = queue.shift();
getSectionIDs(detail.section,(IDs)=>{
sections[detail.section] = IDs;
IDs.forEach((id)=>{
detail.fields.forEach((f)=>{
repeatAttrs.push(`${detail.section}_${id}_${f}`);
});
});
repeatAttrs.push(`_reporder_${detail.section}`);
if(queue.length){
worker(queue,repeatAttrs,sections);
}else{
callback(repeatAttrs,sections);
}
});
};
if(!queueClone[0]){
callback([],{});
}else{
worker(queueClone);
}
};
kFuncs.getSections = getSections;
// Sets the attributes while always calling with {silent:true}
// Can be awaited to get the values returned from _setAttrs
/**
* Alias for [setAttrs()](https://wiki.roll20.net/Sheet_Worker_Scripts#setAttrs.28values.2Coptions.2Ccallback.29) that sets silently by default.
* @memberof Sheetworker Aliases
* @alias setAttrs
* @param {object} obj - The object containting attributes to set
* @param {boolean} [vocal=false] - Whether to set silently (default value) or not.
* @param {function()} [callback] - The callback function to invoke after the setting has been completed. No arguments are passed to the callback function.
* @example
* //Set some attributes silently
* k.setAttrs({attribute_1:'new value'})
* //Set some attributes and triggers listeners
* k.setAttrs({attribute_1:'new value',true})
* //Set some attributes and call a callback function
* k.setAttrs({attribute_1:'new value'},null,()=>{
* //Do something after the attribute is set
* })
*/
const set = function(obj,vocal=false,callback){
setAttrs(obj,{silent:!vocal},callback);
};
kFuncs.setAttrs = set;
const generateCustomID = function(string){
if(!string.startsWith('-')){
string = `-${string}`;
}
rowID = generateRowID();
let re = new RegExp(`^.{${string.length}}`);
return `${string}${rowID.replace(re,'')}`;
};
/**
* Alias for generateRowID that adds the new id to the {@link sectionObj}. Also allows for creation of custom IDs that conform to the section ID requirements.
* @memberof Sheetworker Aliases
* @name generateRowID
* @param {sectionObj} sections
* @param {string} [customText] - Custom text to start the ID with. This text should not be longer than the standard repeating section ID format.
* @returns {string} - The created ID
* @example
* k.getAllAttrs({
* callback:(attributes,sections,casc)=>{
* //Create a new row ID
* const rowID = k.generateRowID('repeating_equipment',sections);
* console.log(rowID);// => repeating_equipment_-p8rg908ug0suzz
* //Create a custom row ID
* const customID = k.generateRowID('repeating_equipment',sections,'custom');
* console.log(customID);// => repeating_equipment_-custom98uadj89kj
* }
* });
*/
const _generateRowID = function(section,sections,customText){
let rowID = customText ?
generateCustomID(customText) :
generateRowID();
section = section.match(/^repeating_[^_]+$/) ?
section :
`repeating_${section}`;
sections[section] = sections[section] || [];
sections[section].push(rowID);
return `${section}_${rowID}`;
};
kFuncs.generateRowID = (section,sections,customText) => {
debug('###Deprecation: It is recommended to use the "create" method of the nested section info feature of the attributes object instead of k.generateRowID');
return _generateRowID(section,sections,customText);
};
/**
* An alias for [Roll20's getTranslationByKey](https://wiki.roll20.net/Sheet_Worker_Scripts#getTranslationByKey.28.5Bkey.5D.29) that also supports data-i18n-vars syntax replacement and returns the translation key if no value is found instead of `false`.
* @memberof Sheetworker Aliases
* @name getTranslationByKey
* @param {string} key - The translation key to look up.
* @param {string[]} [variables = []] - An array of variable values to replace variable indexes with.
* @returns {string}
*/
const _getTranslationByKey = (key,variables = []) => {
let translate = getTranslationByKey(key) || key;
console.warn('getTranslationByKey',getTranslationByKey(key));
console.warn('translate:',translate);
variables.forEach((v,i) => {
translate = translate.replace(new RegExp(`\\{\\{${i}\\}\\}`,'g'),v);
});
return translate;
}
kFuncs.getTranslationByKey = _getTranslationByKey;
/**
* Assembles the roll string from the roll object
* @param {object} rollObj - object describing the roll
* @param {string} [rollStart = '@{template_start}'] - The string to start the roll with.
* @returns {string}
*/
const assembleRoll = (rollObj,rollStart = kFuncs.defaultRollStart) => {
return Object.entries(rollObj).reduce((str,[field,content])=>{
return str += ` {{${field}=${content ?? ''}}}`;
},`${rollStart}`);
};
/**
* @typedef {Object} kRoll
* @property {Object} roll - The roll object returned by [Roll20's startRoll](https://wiki.roll20.net/Custom_Roll_Parsing#Sheetworker_Functions).
* @property {Function} roll.finish - Finishes the associated roll passing it the computeObj and rollId.
* @property {Object} computeObj - object for storing manipulations to the roll. Assign manipulations to this, DO NOT reassign it to a new object.
*/
/**
*
* @param {object} rollObj - Object specifying the fields to pass to the rolltemplate. Object keys are field names. Object values are the field values.
* @param {string} [startString = '@{template_start}'] - Text that should be prepended to the roll string that results from rollObj.
* @returns {kRoll}
*/
const _startRoll = async (rollObj,startString) => {
const rollString = assembleRoll(rollObj,startString);
const roll = await startRoll(rollString);
const computeObj = {};
roll.finish = () => {
finishRoll(roll.rollId,computeObj);
};
return {roll, computeObj};
};
kFuncs.startRoll = _startRoll;/*jshint esversion: 11, laxcomma:true, eqeqeq:true*/
/*jshint -W014,-W084,-W030,-W033*/
const listeners = {};
/**
* The array of attribute names that the k-scaffold gets by default. Does not incude repeating attributes.
* @memberof Variables
* @var
* @type {array}
*/
const baseGet = Object.entries(cascades).reduce((memo,[attrName,detailObj])=>{
if(!/repeating/.test(attrName) && detailObj.type !== 'action'){
memo.push(detailObj.name);
}
if(detailObj.listener){
listeners[detailObj.listener] = detailObj.listenerFunc;
}
return memo;
},[]);
kFuncs.baseGet = baseGet;
const registerEventHandlers = function(){
on('sheet:opened',updateSheet);
if(kFuncs.verboseMode){
debug({funcKeys:Object.keys(funcs),funcs});
}
//Roll20 change and click listeners
Object.entries(listeners).forEach(([event,funcName])=>{
if(funcs[funcName]){
on(event,funcs[funcName]);
}else{
debug(`!!!Warning!!! no function named ${funcName} found. No listener created for ${event}`,true);
}
});
log(`kScaffold Loaded`);
};
setTimeout(registerEventHandlers,0);//Delay the execution of event registration to ensure all event properties are present.
/**
* Function to add a repeating section when the add button of a customControlFieldset or inlineFieldset is clicked.
* @memberof Sheetworkers
* @param {object} event - The R20 event object
*/
const addItem = function(event){
let [,,section] = parseClickTrigger(event.triggerName);
section = section.replace(/add-/,'');
getAllAttrs({
callback:(attributes,sections,casc) => {
let row = _generateRowID(section,sections);
attributes[`${row}_name`] = '';
setActionCalls({attributes,sections});
const trigger = cascades[`fieldset_repeating_${section}`];
if(trigger){
if(trigger.addFuncs){
trigger.addFuncs.forEach((funcName) => {
if(funcs[funcName]){
funcs[funcName]({attributes,sections,casc,trigger,newRow:row});
}
});
}
if(Array.isArray(trigger.affects)){
attributes.queue.push(...trigger.affects);
}
}
attributes.set({attributes,sections,casc});
}
});
};
funcs.addItem = addItem;/**
* The default tab navigation function of the K-scaffold. Courtesy of Riernar. It will add `k-active-tab` to the active tab-container and `k-active-button` to the active button. You can either write your own CSS to control display of these, or use the default CSS included in `scaffold/_k.scss`. Note that `k-active-button` has no default CSS as it is assumed that you will want to style the active button to match your system.
* @memberof Sheetworkers
* @param {Object} trigger - The trigger object
* @param {object} attributes - The attribute values of the character
*/
const kSwitchTab = function ({ trigger, attributes }) {
const [container, tab] = (
trigger.name.match(/nav-tabs-(.+)--(.+)/) ||
[]
).slice(1);
$20(`[data-container-tab="${container}"]`).removeClass('k-active-tab');
$20(`[data-container-tab="${container}"][data-tab="${tab}"]`).addClass('k-active-tab');
$20(`[data-container-button="${container}"]`).removeClass('k-active-button');
$20(`[data-container-button="${container}"][data-button="${tab}"]`).addClass('k-active-button');
const tabInputName = `${container.replace(/\-/g,'_')}_tab`;
if(persistentTabs.indexOf(tabInputName) > -1){
attributes[tabInputName] = trigger.name;
}
}
registerFuncs({ kSwitchTab });
/**
* Sets persistent tabs to their last active state
* @memberof Sheetworkers
* @param {object} attributes - The attribute values of the character
*/
const kTabOnOpen = function({trigger,attributes,sections,casc}){
if(typeof persistentTabs === 'undefined') return;
persistentTabs.forEach((tabInput) => {
const pseudoTrigger = {name:attributes[tabInput]};
kSwitchTab({trigger:pseudoTrigger, attributes});
});
};
registerFuncs({ kTabOnOpen },{type:['opener']});
return kFuncs;
}());
const actionAttributes = ["physique_action","precision_action","logic_action","empathy_action","resources_action","agility_action","close_combat_action","force_action","medicine_action","ranged_combat_action","stealth_action","investigation_action","learning_action","vigilance_action","inspiration_action","manipulation_action","observation_action","repeating_equipment_$X_action","repeating_equipment_$X_magic_action","armor_action","repeating_weapons_$X_action","might_action","body_control_action","magic_action","repeating_attacks_$X_action","damage_action"];const itemCategories = ["Talents","Armor","Equipment","NPCs","Weapons","Magic-Items","Attacks","Magical-Powers","Conditions"];const specialCategories = {};const maxAttr = [];const sectionLookup = {};const skills = {"agility":"physique","close combat":"physique","force":"physique","medicine":"precision","ranged combat":"precision","stealth":"precision","investigation":"logic","learning":"logic","vigilance":"logic","inspiration":"empathy","manipulation":"empathy","observation":"empathy"};k.version = 0;
k.defaultRollStart = '@{template_start} {{successes=[[0[computed value]]]}} {{push_label=^{push}}} {{push_through=[[0[computed value]]]}}';
const npcRollStart = '@{template_start} {{successes=[[0[computed value]]]}}';
const physMent = {
physique: 'physical',
'precision': 'physical',
logic: 'mental',
empathy: 'mental'
};
const conditions = {
physical:['exhausted','battered','wounded'],
mental:['angry','frightened','hopeless']
};
/**
* Assembles and encodes the push data.
* @param {object} results - The results details
* @param {object} rollObj - The object detailing the roll that was sent.
*/
const assemblePushData = (results,rollObj) => {
let addlStress = 1;
const pushObj = Object.entries(rollObj).reduce((memo,[key,val]) => {
if(/(?:base|stress)_/.test(key)){
memo[key] = results[key].result === 6 ?
'[[6]]' :
`[[${results[key].expression}]]`;
if(/stress/.test(key)){
addlStress++;
}
}else if(
key !== 'successes' &&
key !== 'panic' &&
key !== 'push_through'
){
memo[key] = val
}
return memo;
},{});
pushObj[`stress_${addlStress}`] = '[[1d6]]';
const pushString = k.escape(pushObj);
k.debug({pushString});
return pushString;
};/**
* Assembles the roll string from the roll object
* @param {object} rollObj - object describing the roll
* @param {string} [rollStart = '@{template_start}'] - The string to start the roll with.
* @returns {string}
*/
const assembleRoll = (rollObj,rollStart = '@{template_start} {{successes=[[0[computed value]]]}} {{messed_up=[[0[computed value]]]}} {{push_label=^{push}}} {{push_through=[[0[computed value]]]}}') => {
return Object.entries(rollObj).reduce((str,[field,content])=>{
return str += content ?
` {{${field}=${content}}}` :
'';
},`${rollStart}`);
};/**
* Calculates how many dice to roll based on skill, attribute, and stress.
* @param {string} attrName - The reference to the attribute including section and rowID for repeating attribute
* @param {string} skillName - The name of the skill to roll
* @param {attributeProxy} attributes - The attributes object provided by the K-scaffold
* @returns {object}
*/
const calcDice = async ({attrName,skillName,attributes,sections,dieType = 'base',innateBonus=0}) => {
const skillDice = (attributes[skillName.replace(/ /g,'_')] || 0);
const attrDice = attributes[attrName] || 0;
const bonusDice = (+( await k.extractQueryResult(`${k.getTranslationByKey('roll bonus query')}|0`) ) || 0) + (+innateBonus || 0);
const conditionRef = physMent[attrName || skillName];
let injuryPenalty = 0;
if(attributes.sheet_type === 'vaesen'){
injuryPenalty = sections.repeating_conditions.reduce((tot,id) => {
const row = `repeating_conditions_${id}`;
tot += attributes[`${row}_effect`] * attributes[`${row}_affected`];
return tot;
},0);
}else if(attributes.sheet_type === 'npc'){
injuryPenalty = attributes[conditionRef] * -1;
}else if(skillName !== 'resources'){
injuryPenalty = [1,2,3].reduce((tot,n) => {
const pen = +attributes[`${conditionRef}_${n}`] || 0
tot -= pen;
return tot;
},0);
}
let baseDice = dieType === 'base' ?
(( attrDice) + (skillDice) + bonusDice + injuryPenalty) :
0;
if(baseDice <= 0){
baseDice = 1;
}
const totalDice = (num,typ) =>
[...Array(num).keys()].reduce((obj,n) => {
obj[`${typ}_${n+1}`] = '[[1d6]]';
return obj;
},{});
const baseObj = totalDice(baseDice,'base');
if(Object.keys(baseObj).length){
return {
...baseObj
};
}else{
return {no_dice:true}
}
}/**
* Executes the roll. Uses a callback if any computations are required.
* @param {object} rollObj - Object describing the roll fields to be used
* @param {object} attributes - The character attributes
* @param {object[]} sections - The sections array
* @returns {Promise<object[]>} - Resolves to array with index 0 being the roll results object and index 1 being the computeObj with success/panics precalculated.
*/
const executeRoll = async ({rollObj,customString,attributes,sections}) => {
if(attributes.sheet_type === 'npc'){
customString = npcRollStart;
}
const {roll,computeObj} = await k.startRoll(rollObj,customString);
calcSuccess(roll.results,rollObj,computeObj);
return [roll, computeObj];
};/**
* Processes the push information and constructs the roll to be pushed.
* @param {object} trigger - The trigger that caused the function to be called
* @param {object} attributes - The attribute values of the character
* @param {object[]} sections - All the repeating section IDs
* @param {object} casc - Expanded cascade object
*/
const pushRoll = async function({trigger,attributes,sections,casc}){
if(!trigger.originalRollId) return;
k.debug('pushing');
const pushData = k.unescape(trigger.originalRollId);
const [roll,computeObj] = await executeRoll({rollObj:pushData,customString:'@{template_start} {{successes=[[0[computed value]]]}}',attributes,sections});
roll.finish();
const conditionFamily = physMent[pushData.ability];
if(conditionFamily){
const availableConditions = conditions[conditionFamily]
.filter((c,i) => !attributes[`${conditionFamily}_${i}`])
.map((c,i) => `${k.capitalize(k.getTranslationByKey(c))},${i+1}`);
availableConditions.push(`${k.capitalize(k.getTranslationByKey('broken'))},4`);
const query = k.getTranslationByKey('wound query');
const newWound = await k.extractQueryResult(`${query}|${availableConditions.join('|')}`);
attributes[`${conditionFamily}_${newWound}`] = 1;
}else{
await k.pseudoQuery();
}
attributes.set();
};
k.registerFuncs({pushRoll});/**
* calculates the number of successes in a roll result
* @param {object} results - The results object.
* @returns
*/
const calcSuccess = (results = {},rollObj,computeObj) => {
const successPanic = Object.entries(results).reduce((memo,[key,obj]) => {
if(/(?:base|stress)_/.test(key)){
if(obj.result === 6){
memo.successes++;
}
}
return memo;
},{successes:0,messed_up:0});
if(rollObj.ability){
successPanic.push_through = assemblePushData(results,rollObj);
}
Object.assign(computeObj,successPanic);
};const d66Roll = async (extraText = '') => {
const {
rollId: tableID,
results
} = await startRoll(`!{{table=[[[[1d6]][[1d6]]]]}} ${extraText}`);
finishRoll(tableID);
return results;
}// Roll functions will go here
/**
* Rolls a pool of dice for a skill
* @param {object} trigger - The trigger that caused the function to be called
* @param {object} attributes - The attribute values of the character
* @param {object[]} sections - All the repeating section IDs
* @param {object} casc - Expanded cascade object
* @param {object} message - arguments sent via k.send.
* @param {object} message.source - specific trigger specified by the remote call
* @param {object} message.bonusDice - additional dice that should be used
* @param {object} message.baseObj - modifications to the rollObj.
*/
const rollPool = async function({trigger,attributes,sections},message = {}){
const {source,baseObj} = message;
let {bonusDice = 0} = message;
trigger = source || trigger;
const passedData = trigger?.originalRollId ?
k.unescape(trigger.originalRollId) :
{};
const skill = trigger.name.replace(/-action/,'').replace(/-/g,' ');
if(trigger.bonusDice){
bonusDice+= trigger.bonusDice;
}
if(skill === 'agility'){
bonusDice -= Math.abs(attributes.armor_penalty);
}
const rollObj = await calcDice({skillName: skill,attrName: trigger.ability,attributes,sections,innateBonus: bonusDice});
if(trigger.ability){
rollObj.ability = trigger.ability;
rollObj.skill = skill;
}
if(trigger.title){
rollObj.title = trigger.title;
}
Object.assign(rollObj,trigger.staticRoll);
Object.assign(rollObj,baseObj);
Object.assign(rollObj,passedData);
const [roll,computeObj] = await executeRoll({rollObj,attributes,sections});
roll.finish();
};
k.registerFuncs({rollPool});
/*jshint esversion: 11, laxcomma:true, eqeqeq:true*/
/*jshint -W014,-W084,-W030,-W033*/
const handleCompendiumDrop = function({attributes,sections,casc}){
clearDropAttributes();
let data = parseDropData(attributes.drop_data,attributes,sections,casc);
if(!data) return;
k.debug({data});
compendiumLookup({
origBlock:data,
attributes,sections,casc,
callback:async (lookupObj)=>{
k.debug({'threat data':data});
await processDropData({data:lookupObj,attributes,sections,casc});
k.debug('Drop processing complete');
// Ensure that dropped values don't get reset by other calculations
const updateKeys = Object.keys(lookupObj);
const iterateQueue = [...attributes.queue];
iterateQueue.forEach((q,i) =>{
if(updateKeys.includes(`data-cs-${q}`)){
const qI = attributes.queue.indexOf(q);
attributes.queue.splice(qI,1);
}
});
attributes.sheet_version = k.version;
k.setActionCalls({attributes,sections});
attributes.set();
}
});
};
k.registerFuncs({handleCompendiumDrop});
const parseDropData = function(drop_data,attributes,sections,casc){
k.debug('parsing drop data');
k.debug({drop_data:`"${drop_data}"`});
try{
let data = JSON.parse(drop_data);
data.Name = attributes.drop_name;
data = Object.entries(data)
.reduce((memo,[key,val])=>{
if(val){
if(typeof val === 'string' && val.startsWith('[{')){
val = JSON.parse(val);
}
memo[key] = val;
}
return memo;
},{});
return processSpecialCategories(data,attributes,sections,casc);
}catch(err){
k.debug({'Invalid Drop Data! Drop aborted. Error:':err,drop_data},true);
return false;
}
};
const clearSheet = function(attributes,sections,casc){
Object.entries(sections).forEach(([section,idArray])=>{
idArray.forEach((id)=>{
k.removeRepeatingRow(`${section}_${id}`,attributes,sections);
});
});
Object.keys(attributes.attributes).forEach((attr)=>{
if(casc[`attr_${attr}`] && !/^(?:custom_)?bar_\d$/.test(attr)){
attributes[attr] = casc[`attr_${attr}`].hasOwnProperty('defaultValue') ?
casc[`attr_${attr}`].defaultValue :
'';
}
})
};
const clearDropAttributes = function(){
k.setAttrs({drop_name:'',drop_data:''});
};
const processDropData = function({data, attributes, sections, casc,section=''}){
section = section ? `${section}_` : '';
const worker = async (queue) => {
let [key,val] = queue.shift();
try{
let setKey = key.replace(/^(?:data-)?cs(?:list)?-/,'');
if(typeof val === 'string' && val.startsWith('[{')){
val = JSON.parse(val);
}
if(!Array.isArray(val) && (key.startsWith('cs-') || key.startsWith('data-cs-'))){
await k.pseudoQuery();
attributes[`${section}${setKey}`] = val;
if(maxAttr.includes(setKey)){
attributes[`${section}${setKey}_max`] = val;
}
}else if(Array.isArray(val) && key.startsWith('data-')){
let lookupKey = key.replace(/data-(?:cs(?:list)?-)?/,'');
if(repeatProcessors[lookupKey]){
k.debug(`processing ${lookupKey}`);
await repeatProcessors[lookupKey](lookupKey,val,attributes,sections,casc);
}else if(key.startsWith('data-cslist-')){
await k.pseudoQuery();
attributes[`${section}${setKey}`] = val.map((o)=>o.name).join(', ');
}else if(key === 'data-content'){
await k.pseudoQuery();
attributes[`${section}description`] = val.reduce((textArr,content)=>{
if(content.heading){
textArr.push(content.heading);
}
if(content.content){
let text = /list/.test(content.type) ? `• ${content.content}` : content.content;
textArr.push(text);
}
return textArr;
},[]).join('\n')
.replace(/\n{2,}/,'\n')
.replace(/\n+$/,'');
}
}
}catch(err){
k.debug({[`Invalid JSON entered for ${key} on ${data.display_name}`]:err,JSON:val});
}
if(queue.length){
return worker(queue);
}else{
return true;
}
};
return worker(Object.entries(data));
};
/**
* Does the basic prepwork for repeating section drops by creating the rowID and grabbing the item to work on. Passes the selected itemObj and the created section details to the callback function
* @param {string} lookupKey
* @param {array} arr
* @param {object} sections
* @param {function} callback
*/
const repeatWorker = async function(lookupKey,arr,sections,casc,callback){
const type = lookupKey.toLowerCase();
const worker = async (queue)=>{
const itemObj = queue.shift();
itemObj['data-cs-collapse'] = 1;
const section = k.generateRowID(type,sections);
addRowToCasc(section,casc);
await callback(itemObj,section);
if(queue.length){
return worker(queue);
}else{
return true;
}
};
return await worker([...arr]);
}
/**
* Adds the cascade objects for the indicated row to the casc object.
* @param {string} section - The row information (repeating section, and rowID)
* @param {object} casc - The cascade object for this particular character
* @param {number|string} [previousValue] - What to set the previous value to
*/
const addRowToCasc = function(section,casc,previousValue){
k.debug(`Adding ${section} to cascades`);
const match = section.match(/(.+?_.+?)_(.+)/);
match.shift();
const [repSection,rowID] = match;
k.debug({repSection,rowID});
Object
.entries(k.cascades)
.forEach(([key,obj]) => {
if(key.startsWith(`attr_${repSection}`)){
const newObj = {...obj};
newObj.name = newObj.name.replace(/\$X/,rowID)
const newKey = key.replace(/\$X/,rowID);
newObj.previousValue = previousValue === undefined ?
newObj.defaultValue :
previousValue;
newObj.affects = newObj.affects.map(a => a.replace(/\$X/,rowID));
casc[newKey] = newObj;
k.debug({[`casc[${newKey}]`]:casc[newKey]});
}
});
};/*jshint esversion: 11, laxcomma:true, eqeqeq:true*/
/*jshint -W014,-W084,-W030,-W033*/
//Initiate a compendium lookup
//Start of the actual compendium lookup functions
//Function to initiate the lookup. Parses the statblock to figure out what needs to be looked up in the compendium, and what attribute should be filtered for based on the category.
//ARGUMENTS
//statblock (object): base object dropped from the compendium
//callback (function): A function that will use the parsed compendium lookup data to finish the drag and drop of the item
//The callback function receives the parsed statblock as an argument
const compendiumLookup = function({queue, callback, origBlock, attributes, sections, casc, pass = 0}) {
pass++;
origBlock = origBlock || queue[0];
queue = queue || [origBlock];
let searchArray = [];
queue.forEach((statblock)=>{
searchArray = itemCategories.reduce((m, type) => {//Construct an array of items to search for.
let searchType = specialCategories[type] || type;
if (statblock[`data-${type}`]){
let searchNames = statblock[`data-${type}`].map((obj) => obj.name || obj['data-cs-name'] || '')
.join('|')
.replace(/\|{2,}/g,'')
.replace(/\|$/,'');
if(searchNames.length > 0){
let searchString = `Category:${searchType} data-cs-name:${searchNames}`;
m.push(searchString);
}
}
return m;
}, searchArray);
k.debug({searchArray});
if(searchArray.length){
lookupBurndown(statblock, searchArray, callback, origBlock, attributes, sections, casc,pass);
}else{
callback(origBlock);
}
});
};
//Actually queries the compendium to get details on the items in each category using the searchArray assembled in compendiumLookup
//ARGUMENTS
//statblock (object): the original object dropped from the compendium
//callback (function): A function that will use the parsed compendium lookup data to finish the drag and drop of the item
//The callback function receives the parsed statblock as an argument
const lookupBurndown = function(statblock, searchArray, callback, origBlock, attributes, sections, casc,pass) {
getCompendiumQuery(searchArray, (dataArr) => {
k.debug({dataArr});
const expansionIDs = dataArr
.reduce( (arr,obj)=>{
arr.push(k.value(obj.data.Expansion));
return arr;
},[])
.sort((a,b) => b - a);
itemCategories.forEach((oCategory) => {
const category = statblock[`data-${oCategory}`] ?
oCategory :
oCategory.toLowerCase();
if (statblock[`data-${category}`]) {
origBlock[`data-${category}`] = statblock[`data-${category}`].map((obj) => {
const fullItem = getItemDetails(obj, dataArr, expansionIDs);
fullItem['data-cs-name'] = fullItem['data-cs-name'] || fullItem.name;
return fullItem;
});
}
});
const queue = additionalLookups(statblock,origBlock);
if(queue.length /*&& pass < 2*/){
compendiumLookup({queue,callback,origBlock, attributes, sections, casc,pass});
}else{
callback(origBlock);
}
});
};
const additionalLookups = function(statblock,origBlock){
return Object.entries(statblock).reduce((memo,[prop,arr])=>{
if(prop.startsWith('data-') && Array.isArray(arr)){
let nestedData = arr.reduce((m,obj)=>{
Object.entries(obj).forEach(([nProp,nVal])=>{
/*commented code shouldn't be needed
if(
nProp.startsWith('data-') &&
typeof nVal === 'string' &&
nVal.startsWith('[{')
){
try{
let jArr = JSON.parse(nVal);
if(Array.isArray(jArr)){
jArr = jArr.map((o)=>{
o.datasource = obj['cs-name'] || obj.Category;
if(!o.datasource){
delete o.datasource;
}
return o;
});
origBlock[nProp] = origBlock[nProp] ?
[...origBlock[nProp],...jArr] :
[...jArr];
m.data[nProp] = jArr;
m.nested = true;
}
}catch(err){
//if the parse failed, do nothing
}
}else */
if(nProp === 'data-features'){
try{
if(typeof nVal === 'string'){
k.debug('string data-feature detected');
nVal = JSON.parse(nVal);
}
nVal.forEach((feature)=>{
if(!origBlock[`data-${feature.category}`] || origBlock[`data-${feature.category}`].every((o)=>o['data-cs-name'].toLowerCase() !== feature.name.toLowerCase())){
m.nested = true;
m.data[`data-${feature.category}`] = m.data[`data-${feature.category}`] || [];
m.data[`data-${feature.category}`].push({'data-cs-name':feature.name});
}
});
}catch(err){
k.debug({[`Invalid data-feature on ${obj['data-cs-name']}`]:err,'data-feature':nVal},true);
}
}
});
return m;
},{data:{},nested:false});
if(nestedData && nestedData.nested){
memo.push(nestedData.data);
}
}
return memo;
},[]);
};
//Finds the compendium item that most precisely matches the needs of the compendium item based on expansion ID and name property.
//If nothing matches based on expansion ID, simply returns the first item with appropriate name property.
//ARGUMENTS
//itemObj (object): the data on the Item to return that is included in the base statblock
//dataArr (array): The compendium items that were returned from getCompendiumQuery
const getItemDetails = function(itemObj, dataArr, expansionIDs) {
let objName = itemObj['data-cs-name'] || itemObj.name;
let compendiumObj;
expansionIDs.find((id) => {
compendiumObj = dataArr.find((dataObj) => k.value(dataObj.data.Expansion) === id &&
dataObj.data['data-cs-name'] === objName);
if (compendiumObj) {
return true;
} else {
return false;
}
});
if (!compendiumObj) { //If we didn't find an object matching the expansion pathways and the object name, just find the first item with a matching name
compendiumObj = dataArr.find((dataObj) =>
dataObj.data['data-cs-name'] === objName);
if (!compendiumObj) { //If there still isn't a matching compendium object, return the original Item
return itemObj;
}
}
Object.keys(compendiumObj.data).forEach((key) => {
itemObj[key] = itemObj[key] || compendiumObj.data[key];
});
return itemObj;
};/**
* Handles dropping of repeating section items that need no special handling. Provided as part of the compendium infrastructure as it is useful for nearly any project and can serve as a template for more specific drop functions.
* @param {string} lookupKey - The section name
* @param {object[]} arr - Array of data to parse
* @param {attributesProxy} attributes - The attributes for the character
* @param {object} sections - The object with keys equal to repeating section names and values of arrays of repeating ids
* @param {object} casc - The cascade object
* @param {array} sectionsToQuery - sections that need further user input before drop completes
*/
const basicDrop = (lookupKey,arr,attributes,sections,casc,sectionsToQuery) => {
return repeatWorker(lookupKey,arr,sections,casc,async (itemObj,section)=>{
await processDropData({data:itemObj,attributes,sections,casc,sectionsToQuery,section});
});
};/**
* Does all the generic handling for NPC type dropped items (e.g. Antagonists in Scion and Threats in TCF)
* @param {object} data - the data received from the drop
* @param {AttributesProxy} attributes - The attributes object from the K-scaffold
* @param {object} sections - The sections object form the k-scaffold
* @param {object} casc - The cascade object form the k-scaffold
*/
const npcHandler = (data,attributes,sections,casc) => {
clearSheet(attributes,sections,casc);
attributes.sheet_type = data?.Category === 'Non-Player Characters' ?
'npc':
data?.Category?.replace(/s$/,'').toLowerCase() || 'pc';
attributes.allow_push = 0;
const tokenObj = {
width:70,
height:70,
};
if(attributes.sheet_type === 'npc'){
attributes.skill_collapse = 1;
data['data-cs-physical_max'] = data['data-cs-physical'];
data['data-cs-mental_max'] = data['data-cs-mental'];
delete data['data-cs-physical'];
delete data['data-cs-mental'];
}else if(attributes.sheet_type === 'vaesen'){
attributes.vaesen_collapse = 1;
}else if(attributes.sheet_type === 'animal'){
data['data-cs-toughness_max'] = data['data-cs-toughness'];
delete data['data-cs-toughness'];
}
setDefaultToken(tokenObj);
k.callFunc('kSwitchTab',{trigger:{name:`nav-tabs-vaesen--${attributes.sheet_type}`},attributes});
toggleNavButton({attributes});
};
/**
* Handles dropping of armor and helmets.
* @param {string} lookupKey - The section name
* @param {object[]} arr - Array of data to parse
* @param {attributesProxy} attributes - The attributes for the character
* @param {object} sections - The object with keys equal to repeating section names and values of arrays of repeating ids
* @param {object} casc - The cascade object
* @param {array} sectionsToQuery - sections that need further user input before drop completes
*/
const armorDrop = async (lookupKey,arr,attributes,sections,casc,sectionsToQuery) => {
const proms = arr.map(async itemObj => {
const prefix = 'armor';
['name','protection','penalty'].forEach(key => {
if(itemObj[`data-cs-${key}`]){
itemObj[`data-cs-${prefix}_${key}`] = itemObj[`data-cs-${key}`];
}
delete itemObj[`data-cs-${key}`];
});
await processDropData({data:itemObj,attributes,sections,casc,sectionsToQuery});
});
await Promise.all(proms);
};const tableDrop = (lookupKey,arr,attributes,sections,casc,sectionsToQuery) => {
const tableTypes = {
'Critical Injuries': rollCriticalTable,
'Walker Attacks': swarmCompendiumAttack
};
const table = arr[0];
if(tableTypes[table.Name]){
tableTypes[table.Name]({attributes,sections,casc});
}
return k.pseudoQuery();
};/**
* Handles dropping of gear repeating section items. Does minimal editing of the gear data to make it valid for the sheet.
* @param {string} lookupKey - The section name
* @param {object[]} arr - Array of data to parse
* @param {attributesProxy} attributes - The attributes for the character
* @param {object} sections - The object with keys equal to repeating section names and values of arrays of repeating ids
* @param {object} casc - The cascade object
* @param {array} sectionsToQuery - sections that need further user input before drop completes
*/
const gearDrop = (lookupKey,arr,attributes,sections,casc,sectionsToQuery) => {
const passedKey = (
attributes.sheet_type === 'vaesen' && lookupKey.match(/magic(\s|-|$)/i)) ?
'magic-items' :
'equipment';
return repeatWorker(passedKey,arr,sections,casc,async (itemObj,section)=>{
const skills = itemObj['data-cs-effect'].match(/[A-Z]{3,}/g) || [];
skills.forEach((skill,n) => {
itemObj[`data-cs-skill_${n}`] = itemObj[`data-cs-skill_${n}`] || skill.toLowerCase().replace(/\s+/g,'_');
});
if(lookupKey.match(/magic/i)){
itemObj['data-cs-is_magic_item'] = 1;
if(itemObj['data-cs-grants_magic']){
itemObj['data-cs-magic'] = itemObj['data-cs-grants_magic'];
delete itemObj['data-cs-grants_magic'];
}
}
await processDropData({data:itemObj,attributes,sections,casc,sectionsToQuery,section});
});
};/**
* Handles dropping of gear repeating section items. Does minimal editing of the gear data to make it valid for the sheet.
* @param {string} lookupKey - The section name
* @param {object[]} arr - Array of data to parse
* @param {attributesProxy} attributes - The attributes for the character
* @param {object} sections - The object with keys equal to repeating section names and values of arrays of repeating ids
* @param {object} casc - The cascade object
* @param {array} sectionsToQuery - sections that need further user input before drop completes
*/
const facilityDrop = (lookupKey,arr,attributes,sections,casc,sectionsToQuery) => {
return repeatWorker(lookupKey,arr,sections,casc,async (itemObj,section)=>{
if(itemObj['data-cs-discovery']){
const rowID = section.replace(/repeating_.+?_/,'');
const idIndex = sections.repeating_facilities.indexOf(rowID);
sections.repeating_facilities.splice(idIndex,1);
section = section.replace(/facilities/,'discovered-facilities');
sections['repeating_discovered-facilities'].push(rowID);
}
await processDropData({data:itemObj,attributes,sections,casc,sectionsToQuery,section});
});
};/**
* Handles dropping of gear repeating section items. Does minimal editing of the gear data to make it valid for the sheet.
* @param {string} lookupKey - The section name
* @param {object[]} arr - Array of data to parse
* @param {attributesProxy} attributes - The attributes for the character
* @param {object} sections - The object with keys equal to repeating section names and values of arrays of repeating ids
* @param {object} casc - The cascade object
* @param {array} sectionsToQuery - sections that need further user input before drop completes
*/
const contactDrop = (lookupKey,arr,attributes,sections,casc,sectionsToQuery) => {
return repeatWorker('contacts',arr,sections,casc,async (itemObj,section)=>{
if(itemObj['data-cs-type'] !== 'contact'){
const rowID = section.replace(/repeating_.+?_/,'');
const idIndex = sections.repeating_contacts.indexOf(rowID);
sections.repeating_contacts.splice(idIndex,1);
section = section.replace(/contacts/,'personnel');
sections['repeating_personnel'].push(rowID);
}
await processDropData({data:itemObj,attributes,sections,casc,sectionsToQuery,section});
});
};/**
* Lookup for what specific drop function to use for a given drop type. Note that the key is the part after `data-` if it is in another compendium item (e)g. in a Monster), or is the same as the Compendium category (minus)anything after a space).
* @var
*/
const repeatProcessors = {
'equipment': gearDrop,
'Equipment': gearDrop,
'magic items': gearDrop,
'Magic Items': gearDrop,
'magic-items': gearDrop,
'Magic-Items': gearDrop,
'magic': gearDrop,
'Magic': gearDrop,
'items of power': gearDrop,
'Items of Power': gearDrop,
'items': gearDrop,
'Items': gearDrop,
'weapons': basicDrop,
'Weapons': basicDrop,
'armor': armorDrop,
'Armor': armorDrop,
'rollable tables': tableDrop,
'Rollable Tables': tableDrop,
'rollable': tableDrop,
'Rollable': tableDrop,
'talents': basicDrop,
'Talents': basicDrop,
Facilities: facilityDrop,
facilities: facilityDrop,
'Contacts and Personnel': contactDrop,
'contacts and personnel': contactDrop,
'Contacts': contactDrop,
'contacts': contactDrop,
Attacks: basicDrop,
attacks: basicDrop,
Conditions: basicDrop,
conditions: basicDrop,
'Magical-Powers': basicDrop,
'magical-powers': basicDrop,
Magical: basicDrop,
magical: basicDrop,
services: gearDrop,
Services: gearDrop,
"services and establishments": gearDrop,
"Services and Establishments": gearDrop
};/**
* Does the system specific handling for specialized drop categories.
* @param {object} data - the data received from the drop
* @param {AttributesProxy} attributes - The attributes object from the K-scaffold
* @param {object} sections - The sections object form the k-scaffold
* @param {object} casc - The cascade object form the k-scaffold
* @returns {object|[]} - The manipulated data object
*/
const processSpecialCategories = (data,attributes,sections,casc) => {
if(!/non-Player|animals|vaesen/i.test(data.Category)){
let category = data.Category.replace(/\s.+/,'');
data = {[`data-${category}`]:[data]};
if(data[`data-${category}`]['data-features']){
data[category]['data-features'].forEach((feature)=>{
let cat = k.capitalize(feature.category);
data[`data-${cat}`] = data[`data-${cat}`] || [];
data[`data-${cat}`].push({name:feature.name});
});
}
}else{
npcHandler(data,attributes,sections,casc);
}
return data;
};
/**
* Sets the display of the nav buttons based on sheet type and current view
* @param {object} trigger - The trigger that caused the function to be called
* @param {object} attributes - The attribute values of the character
* @param {object[]} sections - All the repeating section IDs
* @param {object} casc - Expanded cascade object
*/
const toggleNavButton = function({trigger,attributes,sections,casc}){
$20('.vaesen-nav').addClass('disabled');
if(attributes.vaesen_tab === 'nav-tabs-vaesen--settings'){
$20(`.vaesen-nav--${attributes.sheet_type}`).removeClass('disabled');
}else{
$20('.vaesen-nav--settings').removeClass('disabled');
}
};
k.registerFuncs({toggleNavButton},{type:['opener']});
const openSectionModal = (attributes,casc) => {
attributes.row_edit_state = 1;
resetSectionModal(attributes,casc);
};
const closeSectionModal = (attributes) => {
attributes.row_edit_state = 0;
};
const resetSectionModal = (attributes,casc) => {
(attributes.row_stored_attributes || []).forEach(attr => {
attributes[attr] = casc[`attr_${attr}`]?.defaultValue || '';
})
};
const singular = (text) => {
const singularObj = {
'facilities': 'facility',
'discovered-facilities': 'facility'
};
return singularObj[text] || text.replace(/s$/,'');
}
const basicRowSetup = (attributes,section,row,headerKey = 'new') => {
attributes.row_row = row || `repeating_${section}_${generateRowID()}`;
attributes.row_section = section;
attributes.row_modal_header = `${headerKey} ${singular(section)}`;
attributes.row_stored_attributes = ['row_row','row_modal_header','row_stored_attributes','row_section'];
};
const createSectionEdits = ({attributes,sections,casc,trigger}) => {
openSectionModal(attributes,casc);
const section = trigger.name
.replace(/create-/,'');
basicRowSetup(attributes,section);
const templateAttrs = Object.keys(k.cascades)
.filter(a => a.startsWith(`attr_repeating_${section}`));
templateAttrs.forEach(a => {
const attrName = a.replace(/attr_repeating_.+?_.+?_/,'');
const cascObj = k.cascades[`attr_row_${attrName}`];
if(cascObj){
attributes[`row_${attrName}`] = cascObj.defaultValue;
}
});
};
k.registerFuncs({createSectionEdits});
const updateSectionEdits = ({attributes,sections,casc,trigger}) => {
const [section,id] = k.parseTriggerName(trigger.name);
const row = `${section}_${id}`;
openSectionModal(attributes,casc);
basicRowSetup(attributes,section.replace(/repeating_/,''),row,'update');
const attrFilter = n => n.startsWith(row) && !n.endsWith('edit_row');
const rowAttributes = [...new Set([...Object.keys(attributes.attributes).filter(attrFilter),...Object.keys(attributes.updates).filter(attrFilter)])];
rowAttributes.forEach(attr =>{
const attrName = attr.replace(`${row}_`,'');
attributes[`row_${attrName}`] = attributes[attr];
attributes.row_stored_attributes.push(`row_${attrName}`);
});
};
k.registerFuncs({updateSectionEdits});
const saveSectionEdits = ({attributes,sections,casc,trigger}) => {
const row = attributes.row_row;
const [,section,rowID] = row.match(/(repeating_[^_]+)_([^_]+)/) || [];
if(!sections[section].includes(rowID.toLowerCase())){
sections[section].push(rowID);
}
const rowAttributes = Object.keys(k.cascades)
.filter(a => a.startsWith(`attr_${section}`));
rowAttributes.forEach(a => {
console.log('a',a);
const attrName = a.replace(/attr_repeating_.+?_.+?_/,'');
if(attributes.attributes.hasOwnProperty(`row_${attrName}`) || attributes.updates.hasOwnProperty(`row_${attrName}`)){
attributes[`${row}_${attrName}`] = attributes[`row_${attrName}`] ?? casc[a].defaultValue;
attributes.row_stored_attributes.push(`row_${attrName}`);
}
});
closeSectionModal(attributes);
k.setActionCalls({attributes,sections});
};
k.registerFuncs({saveSectionEdits});
const cancelSectionEdits = ({attributes,sections,casc,trigger}) => {
closeSectionModal(attributes);
};
k.registerFuncs({cancelSectionEdits});
/**
*
* @param {object} trigger - The trigger that caused the function to be called
* @param {object} attributes - The attribute values of the character
* @param {object[]} sections - All the repeating section IDs
* @param {object} casc - Expanded cascade object
*/
const rollAnimalDamage = function({trigger,attributes,sections,casc}){
const passTrigger = {
title: '^{damage}',
name: 'might',
ability: null
};
rollPool({trigger: passTrigger,attributes,sections,casc},{baseObj:{damage:attributes.damage}});
};
k.registerFuncs({rollAnimalDamage});
/**
*
* @param {object} trigger - The trigger that caused the function to be called
* @param {object} attributes - The attribute values of the character
* @param {object[]} sections - All the repeating section IDs
* @param {object} casc - Expanded cascade object
*/
const initPunch = function({trigger,attributes,sections,casc}){
if(attributes.sheet_type !== 'pc' || attributes.repeating_weapons.some(obj => /punch/i.test(obj.name))) return;
const rowObj = attributes.repeating_weapons.create({
name: k.capitalize(k.getTranslationByKey('punch')),
damage: 1,
range: 0,
bonus: 0,
availability: '',
skill: 'force'
});
};
k.registerFuncs({initPunch},{type:['new']});
/**
* controls whether equipment roll buttons should be shown or not
* @param {object} trigger - The trigger that caused the function to be called
* @param {object} attributes - The attribute values of the character
* @param {object[]} sections - All the repeating section IDs
* @param {object} casc - Expanded cascade object
*/
const decideShowRoll = function({trigger,attributes,sections,casc}){
const [section,rowID] = k.parseTriggerName(trigger.name);
const row = `${section}_${rowID}`;
const skill1 = attributes[`${section}_${rowID}_skill_1`];
const skill2 = attributes[`${section}_${rowID}_skill_2`];
const bonus = attributes[`${section}_${rowID}_bonus`];
if((skill1||skill2) && bonus){
return 1;
}
return 0;
};
k.registerFuncs({decideShowRoll});
/**
* Parses armor data for passing to rollPool
* @param {object} trigger - The trigger that caused the function to be called
* @param {object} attributes - The attribute values of the character
* @param {object[]} sections - All the repeating section IDs
* @param {object} casc - Expanded cascade object
*/
const rollArmor = function({trigger,attributes,sections,casc}){
const passTrigger = {
name: 'armor',
title: attributes.armor_name,
bonusDice: attributes.armor_protection
};
rollPool({trigger:passTrigger,attributes,sections,casc});
};
k.registerFuncs({rollArmor});
// @{template_start} {{title=@{name}}} {{effect=@{effect}}} {{description=@{description}}} {{bonus=@{bonus}}}
const rollEquipment = async function({trigger,attributes,sections,casc}){
const [section,rowID] = k.parseTriggerName(trigger.name);
const row = `${section}_${rowID}`;
if(attributes[`${row}_bonus`] && (attributes[`${row}_skill_1`] || attributes[`${row}_skill_2`])){
const both = attributes[`${row}_skill_1`] && attributes[`${row}_skill_2`];
const queryFunc = both ?
'extractQueryResult' :
'pseudoQuery';
const queryText = both ?
`${k.getTranslationByKey('skill query')}|${k.capitalize(k.getTranslationByKey(attributes[`${row}_skill_1`].replace(/_/g,' ')))},${attributes[`${row}_skill_1`]}|${k.capitalize(k.getTranslationByKey(attributes[`${row}_skill_2`].replace(/_/g,' ')))},${attributes[`${row}_skill_2`]}` :
(attributes[`${row}_skill_1`] || attributes[`${row}_skill_2`]);
const skill = await k[queryFunc](queryText);
const passTrigger = {
title: attributes[`${row}_name`],
name: skill,
ability: skills[skill.replace(/_/g,' ')]
};
await rollPool({trigger: passTrigger,attributes,sections,casc},{bonusDice: attributes[`${row}_bonus`],baseObj:{
effect: attributes[`${row}_effect`],
description: attributes[`${row}_description`]
}});
}else{
const rollObj = {
title: attributes[`${row}_name`],
effect: attributes[`${row}_effect`],
description: attributes[`${row}_description`],
bonus: attributes[`${row}_bonus`]
};
const [roll,computeObj] = await executeRoll({rollObj,attributes,sections,customString:'@{template_start}'});
roll.finish();
}
};
k.registerFuncs({rollEquipment});
const rollAttack = function({trigger,attributes,sections,casc}){
const [section,rowID] = k.parseTriggerName(trigger.name);
const row = `${section}_${rowID}`;
let ability;
let skillName;
if(attributes.sheet_type === 'vaesen'){
skillName = 'might';
ability = null;
}else{
ability = skills[attributes[`${row}_skill`].replace(/_/g,' ')];
skillName = attributes[`${row}_skill`];
}
const passTrigger = {
title: attributes[`${row}_name`],
name: skillName,
ability
};
rollPool({trigger: passTrigger,attributes,sections,casc},{bonusDice: attributes[`${row}_bonus`],baseObj:{damage:attributes[`${row}_damage`],range:attributes[`${row}_range`]}});
};
k.registerFuncs({rollAttack});
const rollMagic = function({trigger,attributes,sections,casc}){
const [section,rowID] = k.parseTriggerName(trigger.name);
const row = `${section}_${rowID}`;
const passTrigger = {
title: attributes[`${row}_name`],
name:'magic',
ability: 'magic'
};
rollPool({trigger: passTrigger,attributes,sections,casc},{bonusDice: attributes[`${row}_magic`]});
};
k.registerFuncs({rollMagic});
</script>