Files
roll20-character-sheets-tester/The One Ring 2e/sheet.html
T
2022-01-24 23:54:33 +01:00

2016 lines
114 KiB
HTML

<input type="hidden" name="attr_version" value="02-01-00" />
<input type="hidden" class="sheet-tabstoggle" name="attr_sheetTab" />
<input type="checkbox" name="attr_parsedrolls" value="1" class="hidden config-parsed-rolls" hidden readonly />
<div class="sheet-pc">
<div id="content">
<div id="character">
<h1 data-i18n="general">General</h1>
<div id="character-nested">
<div class="onecol">
<label data-i18n="character-name">Name</label><input type="text" name="attr_character_name">
</div>
<div class="twocols">
<label data-i18n="culture">Heroic Culture</label><input type="text" name="attr_culture">
<label data-i18n="calling">Calling</label><input type="text" name="attr_calling">
<label data-i18n="standard-of-living">Living standard</label><input type="text"
name="attr_standard_of_living">
<label data-i18n="shadow-weakness">Shadow Weakness</label><input type="text"
name="attr_shadow_weakness">
<label data-i18n="patron">Patron</label><input type="text" name="attr_patron">
<label data-i18n="age">Age</label><input type="text" name="attr_age">
</div>
<div class="onecol">
<label data-i18n="cultural-blessing">Cultural Blessing</label><input type="text"
name="attr_cultural_blessing">
<label data-i18n="distinctive-features">Dist. Features</label><input type="text"
name="attr_distinctive_features" />
<label data-i18n="flaws">Flaws</label><input type="text" name="attr_flaws">
</div>
</div>
</div>
<div id="virtues">
<h2 data-i18n="virtues">Virtues</h2>
<div>
<span>
<button type="roll" class="table-rolls" value="@{wisdom_roll}" name="roll_wisdomcheck"></button>
<button type="action" class="parsed-rolls" name="act_wisdom" id="roll_wisdom"></button>
<input type="checkbox" name="attr_wisdom_favoured">
<label data-i18n="wisdom" data-i18n-title="wisdom-description">Wisdom</label>
</span>
<span class="diamond-small-red"><span><input name="attr_wisdom" value="0" type="number" min=1
max=6></span></span>
</div>
<textarea name="attr_virtues" />
</div>
<div id="rewards">
<h2 data-i18n="rewards">Rewards</h2>
<div>
<span>
<button type="roll" class="table-rolls" value="@{valour_roll}" name="roll_valourcheck"></button>
<button type="action" class="parsed-rolls" name="act_valour" id="roll_valour"></button>
<input type="checkbox" name="attr_valour_favoured">
<label data-i18n="valour" data-i18n-title="valour-description">Valour</label>
</span>
<span class="diamond-small-red"><span><input name="attr_valour" value="0" type="number" min=1
max=6></span></span></span>
</div>
<textarea name="attr_rewards" />
</div>
<div id="gear">
<h2 data-i18n="gear">Gear</h2>
<textarea name="attr_travellinggear" />
</div>
<div id="experience">
<h2 data-i18n="experience" data-i18n-title="experience-description">Experience</h2>
<div id="experience-nested">
<span class="diamond-small">
<span><input name="attr_adventurepoints" value="0" type="number"></span></span>
<span class="diamond-small">
<span><input name="attr_skillpoints" value="0" type="number"></span></span>
<span class="diamond-small">
<span><input name="attr_fellowship" value="0" type="number"></span></span>
<span><label data-i18n="adventure-points">Adv. Points</label></span>
<span><label data-i18n="skill-points">Skill Points</label></span>
<span><label data-i18n="fellowship-pool">Fellowship</label></span>
<span class="diamond-small">
<span><input name="attr_totaladventurepoints" value="0" type="number"></span></span>
<span class="diamond-small">
<span><input name="attr_totalskillpoints" value="0" type="number"></span></span>
<span class="diamond-small">
<span><input name="attr_treasure" value="0" type="number"></span></span>
<span><label data-i18n="adventure-points-total">Adv. Total</label></span>
<span><label data-i18n="skill-points-total">Skill Total</label></span>
<span><label data-i18n="treasure-rating">Treasure<br />Rating</label></span>
</div>
</div>
<div id="strength">
<h1 data-i18n="strength" data-i18n-title="strength-description">Strength</h1>
<div id="attribute-strength" class="attribute">
<div id="strength-row1" class="attribute-row1">
<label data-i18n="rating" class="right">Rating</label>
<span class="diamond-small">
<span><input class="" name="attr_strength" value="0" type="number"></span></span>
<span></span>
<span class="diamond-small">
<span><input class="" name="attr_endurance" value="0" type="number"></span></span>
<label data-i18n="endurance-short" data-i18n-title="endurance" class="left">Endur.</label>
</div>
<div id="strength-row2" class="attribute-row2">
<label data-i18n="tn-strength" data-i18n-title="target-number" class="right">TN</label>
<span class="diamond-red center">
<span><input class="strong" name="attr_strengthtn" value="0" type="number"></span></span>
<span></span>
<span class="diamond-red">
<span><input class="strong" name="attr_currentendurance" value="0" type="number"></span></span>
<label data-i18n="current-endurance" data-i18n-title="current-endurance" class="left">Current
Endurance</label>
<span></span>
</div>
<div id="strength-row3" class="attribute-row3">
<label data-i18n="load" class="right">Load</label>
<span class="diamond-small">
<span><input name="attr_load" value="0" type="number" readonly="readonly"></span></span>
<div class="center">
<span class="diamond-small">
<span><input name="attr_treasureload" value="0" type="number"></span></span>
<label data-i18n="treasure" data-i18n-title="treasure-load" class="center">Treasure</label>
</div>
<span class="diamond-small">
<span><input name="attr_fatigue" value="0" type="number"></span></span>
<label data-i18n="fatigue" class="left">Fatigue</label>
</div>
</div>
</div>
<div id="heart">
<h1 data-i18n="heart" data-i18n-title="heart-description">Heart</h1>
<div id="attribute-heart" class="attribute">
<div id="heart-row1" class="attribute-row1">
<label data-i18n="rating" class="right">Rating</label>
<span class="diamond-small">
<span><input name="attr_heart" value="0" type="number"></span></span>
<span></span>
<span class="diamond-small">
<span><input class="" name="attr_hope" value="0" type="number"></span></span>
<label data-i18n="hope" class="left">Hope</label>
</div>
<div id="heart-row2" class="attribute-row2">
<label data-i18n="tn-heart" class="right">TN</label>
<span class="diamond-red">
<span><input class="strong" name="attr_hearttn" value="0" type="number"></span></span>
<span></span>
<span class="diamond-red">
<span><input class="strong" name="attr_currenthope" value="0" type="number"></span></span>
<label data-i18n="current-hope" class="left">Current Hope</label>
</div>
<div id="heart-row3" class="attribute-row3">
<label data-i18n="shadow" class="right">Shadow</label>
<span class="diamond-small">
<span><input name="attr_shadow" value="0" type="number"></span></span>
<div></div>
<span class="diamond-small">
<span><input name="attr_shadowscar" value="0" type="number"></span></span>
<label data-i18n="scars" class="left">Scars</label>
</div>
</div>
</div>
<div id="wits">
<h1 data-i18n="wits" data-i18n-title="wits-description">Wits</h1>
<div id="attribute-wits" class="attribute">
<div id="wits-row1" class="attribute-row1">
<label data-i18n="rating" class="right">Rating</label>
<span class="diamond-small">
<span><input class="" name="attr_wits" value="0" type="number"></span></span>
<span></span>
<span class="diamond-small">
<span><input name="attr_parry" value="0" type="number"></span></span>
<label data-i18n="parry" class="left">Parry</label>
</div>
<div id="wits-row2" class="attribute-row2">
<label data-i18n="tn-wits" data-i18n-title="target-number" class="right">TN</label>
<span class="diamond-red center">
<span><input class="strong" name="attr_witstn" value="0" type="number"></span></span>
<span></span>
<span class="diamond-red">
<span><input class="strong" name="attr_totalparry" value="0" type="number"
readonly="readonly"></span></span>
<label data-i18n="total-parry" data-i18n-title="total-parry" class="left">Total Parry</label>
<span></span>
</div>
<div id="wits-row3" class="attribute-row3">
<div class="right">
<label><input type="checkbox" name="attr_shieldparry_active" value=1
checked="checked">Shield</label>
</div>
<span class="diamond-small">
<span><input name="attr_shieldparry" value="0" type="number"></span></span>
<div class="center">
<span class="diamond-small">
<span><input name="attr_otherparry" value="0" type="number"></span></span>
<label class="center"><input type="checkbox" name="attr_otherparry_active" value=1
checked="checked">Other</label>
</div>
<span class="diamond-small">
<span><input name="attr_stanceparry" value="0" type="number"></span></span>
<div class="left">
<label><input type="checkbox" name="attr_stanceparry_active" value=1
checked="checked">Stance</label>
</div>
</div>
</div>
</div>
<div id="conditions">
<h2>Conditions / Modifiers</h2>
<div id="conditions-nested">
<label><input name="attr_favorill" type="radio" value="{1t[feat]}" checked="checked">Normal</label>
<label><input name="attr_favorill" type="radio" value="{2t[feat]}kh1">Favoured</label>
<label><input name="attr_favorill" type="radio" value="{2t[feat]}kl1">Ill Fav.</label>
<label><input name="attr_weary" type="checkbox" value=1>Weary</label>
<label><input name="attr_miserable" type="checkbox" value=1>Miserable</label>
<label><input name="attr_wounded" type="checkbox" value=1>Wounded</label>
</div>
<label>Injury<input name="attr_injury" type="text"></label>
<br />
<br />
<div class="center">
<label>Parsed rolls</label>
<div class="sheet-hover-info" data-i18n="parsedroll-description">When enabled the dice rolls will be
parsed and calculated, with output displayed in a rolltemplate. This removes the need for roll
tables. </div>
<span class="toggle">
<input type="checkbox" name="attr_parsedrolls" value="1" checked="checked"
id="config_parsedrolls" />
&nbsp;
<input type="checkbox" name="attr_parsedrolls" value="0" id="config_tablerolls" />
</span>
<label>Table rolls</label>
<br />
<div class="sheet-hover-info" data-i18n="tableroll-description">When enabled the dice rolls will be
using preconfigured rollable tables according to instructions for The One Ring 1st Edition, with
output displayed in a rolltemplate.</div>
</div>
<br />
<button type="action" name="act_notestoggle" data-i18n="notes">Notes</button>
</div>
<div id="combat">
<h1 class="center" data-i18n="combat">Combat</h1>
<div class="sheet-row">
<input type="hidden" name="attr_axes_roll1" />
<button type="roll" class="table-rolls" name="roll_axescheck1" value="@{axes_roll1}"></button>
<input type="hidden" name="attr_axes_roll2" />
<button type="roll" class="table-rolls crosshair" name="roll_axescheck2" value="@{axes_roll2}"></button>
<span class="parsed-rolls">
<button type="action" name="act_axes" id="roll_axes" class="parsed-rolls"
title="Use this button when you have a Parry Rating that you can enter manually."></button>
<button type="action" name="act_axes_target" id="roll_axes_target" class="parsed-rolls crosshair"
title="Use this button when you have an adversary token to target. "></button>
</span>
&nbsp;
<!-- <button type="action" class="parsed-rolls" name="act_axes" id="roll_axes"></button> -->
<label data-i18n="axes">Axes</label>
<div class="sheet-hover-info" data-i18n="axes-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_axes" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_axes" value="1" /><span></span>
<input type="radio" name="attr_axes" value="2" /><span></span>
<input type="radio" name="attr_axes" value="3" /><span></span>
<input type="radio" name="attr_axes" value="4" /><span></span>
<input type="radio" name="attr_axes" value="5" /><span></span>
<input type="radio" name="attr_axes" value="6" /><span></span>
</div>
</div>
<div class="sheet-row">
<input type="hidden" name="attr_bows_roll1" />
<button type="roll" class="table-rolls" name="roll_bowscheck1" value="@{bows_roll1}"></button>
<input type="hidden" name="attr_bows_roll2" />
<button type="roll" class="table-rolls crosshair" name="roll_bowscheck2" value="@{bows_roll2}"></button>
<span class="parsed-rolls">
<button type="action" name="act_bows" id="roll_bows" class="parsed-rolls"
title="Use this button when you have a Parry Rating that you can enter manually."></button>
<button type="action" name="act_bows_target" id="roll_bows_target" class="parsed-rolls crosshair"
title="Use this button when you have an adversary token to target. "></button>
</span>
&nbsp;
<!-- <button type="action" class="parsed-rolls" name="act_bows" id="roll_bows"></button> -->
<label data-i18n="bows">Bows</label>
<div class="sheet-hover-info" data-i18n="bows-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_bows" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_bows" value="1" /><span></span>
<input type="radio" name="attr_bows" value="2" /><span></span>
<input type="radio" name="attr_bows" value="3" /><span></span>
<input type="radio" name="attr_bows" value="4" /><span></span>
<input type="radio" name="attr_bows" value="5" /><span></span>
<input type="radio" name="attr_bows" value="6" /><span></span>
</div>
</div>
<div class="sheet-row">
<input type="hidden" name="attr_spears_roll1" />
<button type="roll" class="table-rolls" name="roll_spearscheck1" value="@{spears_roll1}"></button>
<input type="hidden" name="attr_spears_roll2" />
<button type="roll" class="table-rolls crosshair" name="roll_spearscheck2"
value="@{spears_roll2}"></button>
<span class="parsed-rolls">
<button type="action" name="act_spears" id="roll_spears" class="parsed-rolls"
title="Use this button when you have a Parry Rating that you can enter manually."></button>
<button type="action" name="act_spears_target" id="roll_spears_target"
class="parsed-rolls crosshair"
title="Use this button when you have an adversary token to target. "></button>
</span>
&nbsp;
<!-- <button type="action" class="parsed-rolls" name="act_spears" id="roll_spears"></button> -->
<label data-i18n="spears">Spears</label>
<div class="sheet-hover-info" data-i18n="spears-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_spears" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_spears" value="1" /><span></span>
<input type="radio" name="attr_spears" value="2" /><span></span>
<input type="radio" name="attr_spears" value="3" /><span></span>
<input type="radio" name="attr_spears" value="4" /><span></span>
<input type="radio" name="attr_spears" value="5" /><span></span>
<input type="radio" name="attr_spears" value="6" /><span></span>
</div>
</div>
<div class="sheet-row">
<input type="hidden" name="attr_swords_roll1" />
<button type="roll" class="table-rolls" name="roll_swordscheck1" value="@{swords_roll1}"></button>
<input type="hidden" name="attr_swords_roll2" />
<button type="roll" class="table-rolls crosshair" name="roll_swordscheck2"
value="@{swords_roll2}"></button>
<span class="parsed-rolls">
<button type="action" name="act_swords" id="roll_swords" class="parsed-rolls"
title="Use this button when you have a Parry Rating that you can enter manually."></button>
<button type="action" name="act_swords_target" id="roll_swords_target"
class="parsed-rolls crosshair"
title="Use this button when you have an adversary token to target. "></button>
</span>
&nbsp;
<!-- <button type="action" class="parsed-rolls" name="act_swords" id="roll_swords"></button> -->
<label data-i18n="swords">Swords</label>
<div class="sheet-hover-info" data-i18n="swords-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_swords" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_swords" value="1" /><span></span>
<input type="radio" name="attr_swords" value="2" /><span></span>
<input type="radio" name="attr_swords" value="3" /><span></span>
<input type="radio" name="attr_swords" value="4" /><span></span>
<input type="radio" name="attr_swords" value="5" /><span></span>
<input type="radio" name="attr_swords" value="6" /><span></span>
</div>
</div>
<div class="center sheet-row">
<label>Stance</label>
</div>
<div class="center sheet-row">
<label><input name="attr_stance" type="radio" value="1"> Forw.</label>
<label><input name="attr_stance" type="radio" value="2" checked="checked"> Open</label>
<label><input name="attr_stance" type="radio" value="3"> Def.</label>
<label><input name="attr_stance" type="radio" value="4"> Rear</label>
</div>
<div class="sheet-row">
<div class="center">
<label data-i18n="stance-attack-modifier"
data-i18n-title="stance-attack-modifier-description">Attack
Mod.:</label><input name="attr_stanceattackbonus" value="0" type="number" readonly>
<label><input name="attr_stanceattack_active" type="checkbox" value="1">Stance Damage:</label><input
name="attr_stancedamagebonus" value="1" type="number">
</div>
</div>
</div>
<div id="skill-strength">
<h1>&nbsp;</h1>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{awe_roll}" name="roll_awecheck"></button>
<button type="action" class="parsed-rolls" name="act_awe" id="roll_awe"></button>
<input type="checkbox" name="attr_awe_favoured">
<label data-i18n="awe">Awe</label>
<div class="sheet-hover-info" data-i18n="awe-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_awe" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_awe" value="1" /><span></span>
<input type="radio" name="attr_awe" value="2" /><span></span>
<input type="radio" name="attr_awe" value="3" /><span></span>
<input type="radio" name="attr_awe" value="4" /><span></span>
<input type="radio" name="attr_awe" value="5" /><span></span>
<input type="radio" name="attr_awe" value="6" /><span></span>
</div>
</div>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{athletics_roll}" name="roll_athleticscheck"></button>
<button type="action" class="parsed-rolls" name="act_athletics" id="roll_athletics"></button>
<input type="checkbox" name="attr_athletics_favoured">
<label data-i18n="athletics">Athletics</label>
<div class="sheet-hover-info" data-i18n="athletics-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_athletics" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_athletics" value="1" /><span></span>
<input type="radio" name="attr_athletics" value="2" /><span></span>
<input type="radio" name="attr_athletics" value="3" /><span></span>
<input type="radio" name="attr_athletics" value="4" /><span></span>
<input type="radio" name="attr_athletics" value="5" /><span></span>
<input type="radio" name="attr_athletics" value="6" /><span></span>
</div>
</div>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{awareness_roll}" name="roll_awarenesscheck"></button>
<button type="action" class="parsed-rolls" name="act_awareness" id="roll_awareness"></button>
<input type="checkbox" name="attr_awareness_favoured">
<label data-i18n="awareness">Awareness</label>
<div class="sheet-hover-info" data-i18n="awareness-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_awareness" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_awareness" value="1" /><span></span>
<input type="radio" name="attr_awareness" value="2" /><span></span>
<input type="radio" name="attr_awareness" value="3" /><span></span>
<input type="radio" name="attr_awareness" value="4" /><span></span>
<input type="radio" name="attr_awareness" value="5" /><span></span>
<input type="radio" name="attr_awareness" value="6" /><span></span>
</div>
</div>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{hunting_roll}" name="roll_huntingcheck"></button>
<button type="action" class="parsed-rolls" name="act_hunting" id="roll_hunting"></button>
<input type="checkbox" name="attr_hunting_favoured">
<label data-i18n="hunting">Hunting</label>
<div class="sheet-hover-info" data-i18n="hunting-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_hunting" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_hunting" value="1" /><span></span>
<input type="radio" name="attr_hunting" value="2" /><span></span>
<input type="radio" name="attr_hunting" value="3" /><span></span>
<input type="radio" name="attr_hunting" value="4" /><span></span>
<input type="radio" name="attr_hunting" value="5" /><span></span>
<input type="radio" name="attr_hunting" value="6" /><span></span>
</div>
</div>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{song_roll}" name="roll_songcheck"></button>
<button type="action" class="parsed-rolls" name="act_song" id="roll_song"></button>
<input type="checkbox" name="attr_song_favoured">
<label data-i18n="song">Song</label>
<div class="sheet-hover-info" data-i18n="song-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_song" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_song" value="1" /><span></span>
<input type="radio" name="attr_song" value="2" /><span></span>
<input type="radio" name="attr_song" value="3" /><span></span>
<input type="radio" name="attr_song" value="4" /><span></span>
<input type="radio" name="attr_song" value="5" /><span></span>
<input type="radio" name="attr_song" value="6" /><span></span>
</div>
</div>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{craft_roll}" name="roll_craftcheck"></button>
<button type="action" class="parsed-rolls" name="act_craft" id="roll_craft"></button>
<input type="checkbox" name="attr_craft_favoured">
<label data-i18n="craft">Craft</label>
<div class="sheet-hover-info" data-i18n="craft-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_craft" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_craft" value="1" /><span></span>
<input type="radio" name="attr_craft" value="2" /><span></span>
<input type="radio" name="attr_craft" value="3" /><span></span>
<input type="radio" name="attr_craft" value="4" /><span></span>
<input type="radio" name="attr_craft" value="5" /><span></span>
<input type="radio" name="attr_craft" value="6" /><span></span>
</div>
</div>
</div>
<div id="skill-heart">
<h1 class="center">Skills</h1>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{enhearten_roll}" name="roll_enheartencheck"></button>
<button type="action" class="parsed-rolls" name="act_enhearten" id="roll_enhearten"></button>
<input type="checkbox" name="attr_enhearten_favoured">
<label data-i18n="enhearten">Enhearten</label>
<div class="sheet-hover-info" data-i18n="enhearten-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_enhearten" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_enhearten" value="1" /><span></span>
<input type="radio" name="attr_enhearten" value="2" /><span></span>
<input type="radio" name="attr_enhearten" value="3" /><span></span>
<input type="radio" name="attr_enhearten" value="4" /><span></span>
<input type="radio" name="attr_enhearten" value="5" /><span></span>
<input type="radio" name="attr_enhearten" value="6" /><span></span>
</div>
</div>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{travel_roll}" name="roll_travelcheck"></button>
<button type="action" class="parsed-rolls" name="act_travel" id="roll_travel"></button>
<input type="checkbox" name="attr_travel_favoured">
<label data-i18n="travel">Travel</label>
<div class="sheet-hover-info" data-i18n="travel-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_travel" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_travel" value="1" /><span></span>
<input type="radio" name="attr_travel" value="2" /><span></span>
<input type="radio" name="attr_travel" value="3" /><span></span>
<input type="radio" name="attr_travel" value="4" /><span></span>
<input type="radio" name="attr_travel" value="5" /><span></span>
<input type="radio" name="attr_travel" value="6" /><span></span>
</div>
</div>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{insight_roll}" name="roll_insightcheck"></button>
<button type="action" class="parsed-rolls" name="act_insight" id="roll_insight"></button>
<input type="checkbox" name="attr_insight_favoured">
<label data-i18n="insight">Insight</label>
<div class="sheet-hover-info" data-i18n="insight-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_insight" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_insight" value="1" /><span></span>
<input type="radio" name="attr_insight" value="2" /><span></span>
<input type="radio" name="attr_insight" value="3" /><span></span>
<input type="radio" name="attr_insight" value="4" /><span></span>
<input type="radio" name="attr_insight" value="5" /><span></span>
<input type="radio" name="attr_insight" value="6" /><span></span>
</div>
</div>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{healing_roll}" name="roll_healingcheck"></button>
<button type="action" class="parsed-rolls" name="act_healing" id="roll_healing"></button>
<input type="checkbox" name="attr_healing_favoured">
<label data-i18n="healing">Healing</label>
<div class="sheet-hover-info" data-i18n="healing-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_healing" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_healing" value="1" /><span></span>
<input type="radio" name="attr_healing" value="2" /><span></span>
<input type="radio" name="attr_healing" value="3" /><span></span>
<input type="radio" name="attr_healing" value="4" /><span></span>
<input type="radio" name="attr_healing" value="5" /><span></span>
<input type="radio" name="attr_healing" value="6" /><span></span>
</div>
</div>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{courtesy_roll}" name="roll_courtesycheck"></button>
<button type="action" class="parsed-rolls" name="act_courtesy" id="roll_courtesy"></button>
<input type="checkbox" name="attr_courtesy_favoured">
<label data-i18n="courtesy">Courtesy</label>
<div class="sheet-hover-info" data-i18n="courtesy-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_courtesy" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_courtesy" value="1" /><span></span>
<input type="radio" name="attr_courtesy" value="2" /><span></span>
<input type="radio" name="attr_courtesy" value="3" /><span></span>
<input type="radio" name="attr_courtesy" value="4" /><span></span>
<input type="radio" name="attr_courtesy" value="5" /><span></span>
<input type="radio" name="attr_courtesy" value="6" /><span></span>
</div>
</div>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{battle_roll}" name="roll_battlecheck"></button>
<button type="action" class="parsed-rolls" name="act_battle" id="roll_battle"></button>
<input type="checkbox" name="attr_battle_favoured">
<label data-i18n="battle">Battle</label>
<div class="sheet-hover-info" data-i18n="battle-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_battle" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_battle" value="1" /><span></span>
<input type="radio" name="attr_battle" value="2" /><span></span>
<input type="radio" name="attr_battle" value="3" /><span></span>
<input type="radio" name="attr_battle" value="4" /><span></span>
<input type="radio" name="attr_battle" value="5" /><span></span>
<input type="radio" name="attr_battle" value="6" /><span></span>
</div>
</div>
</div>
<div id="skill-wits">
<h1>&nbsp;</h1>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{persuade_roll}" name="roll_persuadecheck"></button>
<button type="action" class="parsed-rolls" name="act_persuade" id="roll_persuade"></button>
<input type="checkbox" name="attr_persuade_favoured">
<label data-i18n="persuade">Persuade</label>
<div class="sheet-hover-info" data-i18n="persuade-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_persuade" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_persuade" value="1" /><span></span>
<input type="radio" name="attr_persuade" value="2" /><span></span>
<input type="radio" name="attr_persuade" value="3" /><span></span>
<input type="radio" name="attr_persuade" value="4" /><span></span>
<input type="radio" name="attr_persuade" value="5" /><span></span>
<input type="radio" name="attr_persuade" value="6" /><span></span>
</div>
</div>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{stealth_roll}" name="roll_stealthcheck"></button>
<button type="action" class="parsed-rolls" name="act_stealth" id="roll_stealth"></button>
<input type="checkbox" name="attr_stealth_favoured">
<label data-i18n="stealth">Stealth</label>
<div class="sheet-hover-info" data-i18n="stealth-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_stealth" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_stealth" value="1" /><span></span>
<input type="radio" name="attr_stealth" value="2" /><span></span>
<input type="radio" name="attr_stealth" value="3" /><span></span>
<input type="radio" name="attr_stealth" value="4" /><span></span>
<input type="radio" name="attr_stealth" value="5" /><span></span>
<input type="radio" name="attr_stealth" value="6" /><span></span>
</div>
</div>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{scan_roll}" name="roll_scancheck"></button>
<button type="action" class="parsed-rolls" name="act_scan" id="roll_scan"></button>
<input type="checkbox" name="attr_scan_favoured">
<label data-i18n="scan">Scan</label>
<div class="sheet-hover-info" data-i18n="scan-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_scan" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_scan" value="1" /><span></span>
<input type="radio" name="attr_scan" value="2" /><span></span>
<input type="radio" name="attr_scan" value="3" /><span></span>
<input type="radio" name="attr_scan" value="4" /><span></span>
<input type="radio" name="attr_scan" value="5" /><span></span>
<input type="radio" name="attr_scan" value="6" /><span></span>
</div>
</div>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{explore_roll}" name="roll_explorecheck"></button>
<button type="action" class="parsed-rolls" name="act_explore" id="roll_explore"></button>
<input type="checkbox" name="attr_explore_favoured">
<label data-i18n="explore">Explore</label>
<div class="sheet-hover-info" data-i18n="explore-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_explore" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_explore" value="1" /><span></span>
<input type="radio" name="attr_explore" value="2" /><span></span>
<input type="radio" name="attr_explore" value="3" /><span></span>
<input type="radio" name="attr_explore" value="4" /><span></span>
<input type="radio" name="attr_explore" value="5" /><span></span>
<input type="radio" name="attr_explore" value="6" /><span></span>
</div>
</div>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{riddle_roll}" name="roll_riddlecheck"></button>
<button type="action" class="parsed-rolls" name="act_riddle" id="roll_riddle"></button>
<input type="checkbox" name="attr_riddle_favoured">
<label data-i18n="riddle">Riddle</label>
<div class="sheet-hover-info" data-i18n="riddle-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_riddle" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_riddle" value="1" /><span></span>
<input type="radio" name="attr_riddle" value="2" /><span></span>
<input type="radio" name="attr_riddle" value="3" /><span></span>
<input type="radio" name="attr_riddle" value="4" /><span></span>
<input type="radio" name="attr_riddle" value="5" /><span></span>
<input type="radio" name="attr_riddle" value="6" /><span></span>
</div>
</div>
<div class=sheet-row>
<button type="roll" class="table-rolls" value="@{lore_roll}" name="roll_lorecheck"></button>
<button type="action" class="parsed-rolls" name="act_lore" id="roll_lore"></button>
<input type="checkbox" name="attr_lore_favoured">
<label data-i18n="lore">Lore</label>
<div class="sheet-hover-info" data-i18n="lore-description"></div>
<div class="sheet-dots">
<input type="radio" name="attr_lore" value="0" checked="checked" /><span></span>
<input type="radio" name="attr_lore" value="1" /><span></span>
<input type="radio" name="attr_lore" value="2" /><span></span>
<input type="radio" name="attr_lore" value="3" /><span></span>
<input type="radio" name="attr_lore" value="4" /><span></span>
<input type="radio" name="attr_lore" value="5" /><span></span>
<input type="radio" name="attr_lore" value="6" /><span></span>
</div>
</div>
</div>
<div id="war-gear">
<!-- <h2>War Gear</h2> -->
<div id="war-gear-nested">
<span />
<h2>Weapon</h2>
<label>Type</label>
<label class="center">Damage</label>
<label class="center">Injury</label>
<label class="center">Load</label>
<label class="center" title="Fell: Add 2 to the Injury rating of the selected weapon">F</label>
<label class="center" title="Grievious: Add 1 to the damage rating of the weapon">G</label>
<label class="center"
title="Keen: Attack rolls made with a Keen weapon score a Piercing Blow also on a result of 9 on the Feat die">K</label>
<label>Notes</label>
<span class="table-rolls" />
<span class="parsed-rolls">
<button type="action" name="act_weapon_1" id="roll_weapon1" class="parsed-rolls"
title="Use this button when you have a Parry Rating that you can enter manually."></button>
<button type="action" name="act_weapon_1_target" id="roll_weapon1_target"
class="parsed-rolls crosshair"
title="Use this button when you have an adversary token to target. "></button>
&nbsp;
</span>
<input name="attr_weapon_skill_name_1" type="text"></input>
<select name="attr_weapon_combat_prof_1">
<option value="" selected default></option>
<option value="axes">Axes</option>
<option value="bows">Bows</option>
<option value="spears">Spears</option>
<option value="swords">Swords</option>
</select>
<input name="attr_weapon_damage_1" value="0" class="center number" type="number">
<input name="attr_weapon_injury_1" value="0" class="center number" type="number">
<input name="attr_weapon_load_1" value="0" class="center number" type="number">
<input type="checkbox" class="center" value="1" name="attr_weapon_fell_1">
<input type="checkbox" class="center" value="1" name="attr_weapon_grievous_1">
<input type="checkbox" class="center" value="1" name="attr_weapon_keen_1">
<input name="attr_weapon_note_1" type="text">
<span class="table-rolls" />
<span class="parsed-rolls">
<button type="action" name="act_weapon_2" id="roll_weapon2" class="parsed-rolls"
title="Use this button when you have a Parry Rating that you can enter manually."></button>
<button type="action" name="act_weapon_2_target" id="roll_weapon2_target"
class="parsed-rolls crosshair"
title="Use this button when you have an adversary token to target. "></button>
&nbsp;
</span>
<input name="attr_weapon_skill_name_2" type="text">
<select name="attr_weapon_combat_prof_2">
<option value="" selected default></option>
<option value="axes">Axes</option>
<option value="bows">Bows</option>
<option value="spears">Spears</option>
<option value="swords">Swords</option>
</select>
<input name="attr_weapon_damage_2" value="0" class="center number" type="number">
<input name="attr_weapon_injury_2" value="0" class="center number" type="number">
<input name="attr_weapon_load_2" value="0" class="center number" type="number">
<input type="checkbox" class="center" name="attr_weapon_fell_2">
<input type="checkbox" class="center" name="attr_weapon_grievous_2">
<input type="checkbox" class="center" name="attr_weapon_keen_2">
<input name="attr_weapon_note_2" type="text">
<span class="table-rolls" />
<span class="parsed-rolls">
<button type="action" name="act_weapon_3" id="roll_weapon3" class="parsed-rolls"
title="Use this button when you have a Parry Rating that you can enter manually."></button>
<button type="action" name="act_weapon_3_target" id="roll_weapon3_target"
class="parsed-rolls crosshair"
title="Use this button when you have an adversary token to target. "></button>
&nbsp;
</span>
<input name="attr_weapon_skill_name_3" type="text">
<select name="attr_weapon_combat_prof_3">
<option value="" selected default></option>
<option value="axes">Axes</option>
<option value="bows">Bows</option>
<option value="spears">Spears</option>
<option value="swords">Swords</option>
</select>
<input name="attr_weapon_damage_3" value="0" class="center number" type="number">
<input name="attr_weapon_injury_3" value="0" class="center number" type="number">
<input name="attr_weapon_load_3" value="0" class="center number" type="number">
<input type="checkbox" class="center" name="attr_weapon_fell_3">
<input type="checkbox" class="center" name="attr_weapon_grievous_3">
<input type="checkbox" class="center" name="attr_weapon_keen_3">
<input name="attr_weapon_note_3" type="text">
<span class="table-rolls" />
<span class="parsed-rolls">
<button type="action" name="act_weapon_4" id="roll_weapon4" class="parsed-rolls"
title="Use this button when you have a Parry Rating that you can enter manually."></button>
<button type="action" name="act_weapon_4_target" id="roll_weapon4_target"
class="parsed-rolls crosshair"
title="Use this button when you have an adversary token to target. "></button>
&nbsp;
</span>
<input name="attr_weapon_skill_name_4" type="text">
<select name="attr_weapon_combat_prof_4">
<option value="" selected default></option>
<option value="axes">Axes</option>
<option value="bows">Bows</option>
<option value="spears">Spears</option>
<option value="swords">Swords</option>
</select>
<input name="attr_weapon_damage_4" value="0" class="center number" type="number">
<input name="attr_weapon_injury_4" value="0" class="center number" type="number">
<input name="attr_weapon_load_4" value="0" class="center number" type="number">
<input type="checkbox" class="center" name="attr_weapon_fell_4">
<input type="checkbox" class="center" name="attr_weapon_grievous_4">
<input type="checkbox" class="center" name="attr_weapon_keen_4">
<input name="attr_weapon_note_4" type="text">
</div>
</div>
<div id="armour">
<!-- <h2>Armour</h2> -->
<div id="armour-nested">
<span></span>
<h2>Armour</h2>
<label class="center" title="Protection">Prot.</label>
<label class="center">Load</label>
<label class="center">CF</label>
<div class="sheet-hover-info" data-i18n="close-fitting-description"></div>
<label class="center">CM</label>
<div class="sheet-hover-info" data-i18n="cunning-make-description"></div>
<input type="checkbox" name="attr_armourprot_active" value=1 checked="checked">
<input class="text" type="text" placeholder="Armour" title="Armour" data-i18n-title="armour"
data-i18n-placeholder="armour-placeholder" name="attr_armour">
<input class="center number" type="number" name="attr_armourprot" value="0">
<input class="center number" type="number" name="attr_armourload" value="0">
<input type="checkbox" class="center gridcol4" value="1" name="attr_armourcf"></checkbox>
<input type="checkbox" class="center gridcol5" value="1" name="attr_armourcm"></checkbox>
<input type="checkbox" name="attr_helmprot_active" value=1 checked="checked">
<input class="text" type="text" placeholder="Helm" title="Helm" data-i18n-title="helm"
data-i18n-placeholder="helm-placeholder" name="attr_helm">
<input class="center number" type="number" name="attr_helmprot" value="0">
<input class="center number" type="number" name="attr_helmload" value="0">
<input type="checkbox" class="center gridcol4" value="1" name="attr_helmetcf"></checkbox>
<input type="checkbox" class="center gridcol5" value="1" name="attr_helmetcm"></checkbox>
<input type="checkbox" name="attr_otherprot_active" value=1 checked="checked">
<input type="text" class="text" name="attr_otherprot_name" placeholder="Other"
title="Other modifiers for Protection" data-i18n-title="Other-protection"
data-i18n-placeholder="other-placeholder">
<input class="center number" type="number" name="attr_otherprot" value="0">
<span></span>
<span></span>
<span></span>
<span></span>
<label>Shield</label>
<label class="center">Parry</label>
<label class="center">Load</label>
<label class="center">RI</label>
<div class="sheet-hover-info" data-i18n="reinforced-description"></div>
<label class="center">CM</label>
<div class="sheet-hover-info" data-i18n="cunning-make-description"></div>
<input type="checkbox" name="attr_shieldparry_active" value="1" checked="checked">
<input class="text" type="text" placeholder="Shield" data-i18n-title="shield"
data-i18n-placeholder="shield-placeholder" name="attr_shield">
<input class="center number" type="number" name="attr_shieldparry" value="0">
<input class="center number" type="number" name="attr_shieldload" value="0">
<input type="checkbox" class="center gridcol4" value="1" name="attr_shieldreinf"></checkbox>
<input type="checkbox" class="center gridcol5" value="1" name="attr_shieldcm"></checkbox>
</div>
</div>
<div id="mount">
<h2 class="center">Mount</h2>
<div id="mount-nested">
<!-- <label>Quality</label> -->
<label class="center">Name</label>
<label class="center">Vigour</label>
<label class="center">Treasure</label>
<input class="text" type="text" name="attr_mount">
<!-- <input class="center number" type="number" name="attr_mountquality" value="0"> -->
<input class="center number" type="number" name="attr_mountvigour" value="0">
<input class="center number" type="number" name="attr_mounttreasure" value="0">
</div>
</div>
<div id="protection">
<!-- <h1>Protection</h1> -->
<div id="protection-nested">
<br />
<span class="diamond-red">
<span><input class="strong" name="attr_protection" value="0" type="number"
readonly="readonly"></span>
</span>
<span>
<button type="roll" class="table-rolls" name="roll_protectioncheck"
value="@{protection_roll}"></button>
<button type="action" class="parsed-rolls" name="act_protection" id="roll_protection"></button>
&nbsp;<input type="checkbox" name="attr_protection_favoured" />
<label class="center">Protection</label>
</span>
<span class="diamond-small">
<span><input name="attr_stanceprot" value="0" type="number"></span></span>
<label class="center"><input type="checkbox" name="attr_stanceprot_active" value=1
checked="checked" />Stance</label>
</div>
</div>
<input type="hidden" class="sheet-notestoggle" name="attr_notesactive" />
<div id="notes">
<h1>NOTES</h1>
<textarea name="attr_notes" />
</div>
</div>
</div>
<div class="sheet-adversary">
<div class="adversary-header">
<h1 class="left" data-i18n="character-name">Name</h1>
<h1 data-i18n="attribute-level">Attribute Level</h1>
<div class="adversary-level">
<span class="diamond-red">
<span><input class="strong center" type="number" name="attr_attribute-level" value="0" /></span>
</span>
</div>
<input type="text" name="attr_name" value="" />
<label data-i18n="distinctive-features">Distinctive Features</label><span />
<input type="text" name="attr_distinctive-features" />
<div class="left">
<label>Parsed rolls</label>
<div class="sheet-hover-info" data-i18n="parsedroll-description">When enabled the dice rolls will be
parsed and calculated, with output displayed in a rolltemplate. This removes the need for roll
tables. </div>
<span class="toggle">
<input type="checkbox" name="attr_parsedrolls" value="1" checked="checked" id="config_parsedrolls" />
&nbsp;
<input type="checkbox" name="attr_parsedrolls" value="0" id="config_tablerolls" />
</span>
<label>Table rolls</label>
<br />
<div class="sheet-hover-info" data-i18n="tableroll-description">When enabled the dice rolls will be
using preconfigured rollable tables according to instructions for The One Ring 1st Edition.</div>
</div>
<div class="center">
<span class="toggle">
<label><input name="attr_favorill" type="checkbox" value="{1t[feat]}" checked="checked">Normal</label>
<label><input name="attr_favorill" type="checkbox" value="{2t[feat]}kh1">Favoured</label>
<label><input name="attr_favorill" type="checkbox" value="{2t[feat]}kl1">Ill Fav.</label>
</span>
</div>
</div>
<div class="adversary-attributes">
<span />
<h1 data-i18n="endurance">Endurance</h1>
<h1 data-i18n="might">Might</h1>
<!--<h1 data-i18n="hate">Hate/Resolve</h1>-->
<select name="attr_hateresolve" class="h1">
<option value="1">Hate</option>
<option value="2">Resolve</option>
</select>
<h1 data-i18n="parry">Parry</h1>
<h1 data-i18n="armour">Armour</h1>
<span />
<span />
<span class="diamond-red">
<span><input class="strong" type="number" name="attr_currentendurance" /></span>
</span>
<span class="diamond-red">
<span><input class="strong" type="number" name="attr_might" /></span>
</span>
<span class="diamond-red">
<span><input class="strong" type="number" name="attr_hate" /></span>
</span>
<span class="diamond-red">
<span><input class="strong" type="number" name="attr_parry" /></span>
</span>
<span class="diamond-red">
<span><input class="strong" type="number" name="attr_armourprot" /></span>
</span>
<span />
<span />
<span />
<span />
<span />
<span />
<button type="roll" class="table-rolls"
value="/me rolls protection against ?{Injury|16}.\n/roll 1t[lm-feat] + @{armourprot}t[normal]"
name="armourcheck"></button>
<button type="action" class="parsed-rolls" name="act_protection" id="roll_protection"></button>
<span />
</div>
<div class="adversary-combat-proficiencies">
<h1 data-i18n-title="combat-proficiency" title="combat-proficiency">Combat Proficiency</h1>
<label class="center" data-i18n-title="weapon-rating" title="dmg">Rating</label>
<label class="center" data-i18n-title="weapon-damage" title="dmg">Damage</label>
<label class="center" data-i18n-title="weapon-injury" title="inj">Injury</label>
<label class="left" data-i18n-title="special-damage" title="special-damage">Special damage</label>
<span>
<!--<input type="hidden" name="attr_adv_weapon1_roll1" />
<button type="roll" class="table-rolls" name="roll_adv_weapon1_roll1_check" value="@{adv_adv_weapon1_roll1}"></button> -->
<button type="roll" class="table-rolls"
value="/me attacks against parry ?{Parry|0}.\n/roll 1t[lm-feat] + [[(@{weapon_rating_1}+?{Bonus Dice|0})]]t[normal]"
name="roll_weapon1"></button>
<!-- <input type="hidden" name="attr_adv_weapon1_roll2" />
<button type="roll" class="table-rolls crosshair" name="roll_adv_weapon1_roll2_check"
value="@{adv_weapon1_roll2}"></button> -->
<button type="roll" class="table-rolls crosshair"
value="/me attacks @{target|name} against parry @{target|totalparry}.\n/roll 1t[lm-feat] + [[(@{weapon_rating_1}+?{Bonus Dice|0}+@{target|stanceattackbonus})]]t[normal]"
name="roll_weapon1_target"></button>
<span class="parsed-rolls">
<button type="action" name="act_adv_weapon1" id="roll_adv_weapon1" class="parsed-rolls"
title="Use this button when you have a Parry Rating that you can enter manually."></button>
<button type="action" name="act_adv_weapon1_target" id="roll_adv_weapon1_target"
class="parsed-rolls crosshair"
title="Use this button when you have an adversary token to target. "></button>
</span>
<input name="attr_weapon_skill_name_1" type="text">
</span>
<input name="attr_weapon_rating_1" value="0" class="number" type="number">
<input name="attr_weapon_damage_1" value="0" class="number" type="number">
<input name="attr_weapon_injury_1" value="0" class="number" type="number">
<input name="attr_weapon_special_damage_1" type="text">
<span>
<!--<input type="hidden" name="attr_adv_weapon2_roll1" />
<button type="roll" class="table-rolls" name="roll_adv_weapon2_roll1_check" value="@{adv_adv_weapon2_roll1}"></button> -->
<button type="roll" class="table-rolls"
value="/me attacks against parry ?{Parry|0}.\n/roll 1t[lm-feat] + [[(@{weapon_rating_2}+?{Bonus Dice|0})]]t[normal]"
name="roll_weapon2"></button>
<!--<input type="hidden" name="attr_adv_weapon2_roll2" />
<button type="roll" class="table-rolls crosshair" name="roll_adv_weapon2_roll2_check"
value="@{adv_weapon2_roll2}"></button>-->
<button type="roll" class="table-rolls crosshair"
value="/me attacks @{target|name} against parry @{target|totalparry}.\n/roll 1t[lm-feat] + [[(@{weapon_rating_2}+?{Bonus Dice|0}+@{target|stanceattackbonus})]]t[normal]"
name="roll_weapon2_target"></button>
<span class="parsed-rolls">
<button type="action" name="act_adv_weapon2" id="roll_adv_weapon2" class="parsed-rolls"
title="Use this button when you have a Parry Rating that you can enter manually."></button>
<button type="action" name="act_adv_weapon2_target" id="roll_adv_weapon2_target"
class="parsed-rolls crosshair"
title="Use this button when you have an adversary token to target. "></button>
</span>
<input name="attr_weapon_skill_name_2" type="text">
</span>
<input name="attr_weapon_rating_2" value="0" class="number" type="number">
<input name="attr_weapon_damage_2" value="0" class="number" type="number">
<input name="attr_weapon_injury_2" value="0" class="number" type="number">
<input name="attr_weapon_special_damage_2" type="text">
</div>
<div class="adversary-fell-abilities">
<h1 data-i18n-title="fell-ability" title="fell-ability">Fell Ability</h1>
<label class="empf-black left" data-i18n-title="fell-ability-description"
title="fell-ability-description">Description</label>
</div>
<fieldset class="repeating_fell-abilities">
<div class="adversary-fell-abilities">
<input name="attr_fell_ability" type="text" /><textarea name="attr_fell_ability_desc" type="text" />
</div>
</fieldset>
<div class="adversary-notes">
<h2>Notes</h2>
<div class="autoExpand">
<textarea name="attr_notes">
</div>
</div>
</div>
<div class="center">
<button type="action" name="act_isPC" data-i18n="sheet-type-Player-Character">Player Character</button>
<button type="action" name="act_isAdversary" data-i18n="sheet-type-Adversary">Adversary</button>
<br />
<h6>Version <span name="attr_version"></span></h6>
</div>
<div style="display: none;">
<input name="attr_wearytype">
<input name="attr_awe_fav">
<input name="attr_athletics_fav">
<input name="attr_awareness_fav">
<input name="attr_hunting_fav">
<input name="attr_song_fav">
<input name="attr_craft_fav">
<input name="attr_enhearten_fav">
<input name="attr_travel_fav">
<input name="attr_insight_fav">
<input name="attr_healing_fav">
<input name="attr_courtesy_fav">
<input name="attr_battle_fav">
<input name="attr_persuade_fav">
<input name="attr_stealth_fav">
<input name="attr_scan_fav">
<input name="attr_explore_fav">
<input name="attr_riddle_fav">
<input name="attr_lore_fav">
<input name="attr_valour_fav">
<input name="attr_wisdom_fav">
<input name="attr_awe_roll">
<input name="attr_athletics_roll">
<input name="attr_awareness_roll">
<input name="attr_hunting_roll">
<input name="attr_song_roll">
<input name="attr_craft_roll">
<input name="attr_enhearten_roll">
<input name="attr_travel_roll">
<input name="attr_insight_roll">
<input name="attr_healing_roll">
<input name="attr_courtesy_roll">
<input name="attr_battle_roll">
<input name="attr_persuade_roll">
<input name="attr_stealth_roll">
<input name="attr_scan_roll">
<input name="attr_explore_roll">
<input name="attr_riddle_roll">
<input name="attr_lore_roll">
<input name="attr_valour_roll">
<input name="attr_wisdom_roll">
<input name="attr_protection_roll">
<input name="attr_favourill_id">
</div>
<!-- Sheet Workers -->
<script type="text/worker">
/* number and log handling */
const int = (score, on_error = 0) => parseInt(score) || on_error;
const float = (score, on_error = 0) => parseFloat(score) || on_error;
const clog = (text, title = "", color = "green", style = "font-size:12px; font-weight:normal;", headerstyle = "font-size:13px; font-weight:bold;") => {
let titleStyle = `color:${color}; ${headerstyle} text-decoration:underline;`;
let textStyle = `color:${color}; ${style}`;
let output = `%c${title} %c${text}`;
if (title) {
console.log(output, titleStyle, textStyle);
} else {
output = `%c${text}`;
console.log(output, textStyle);
}
};
// ASYNC ATTRIBUTE METHODS
const asw = (() => {
const setActiveCharacterId = function(charId){
let oldAcid=getActiveCharacterId();
let ev = new CustomEvent("message");
ev.data={"id":"0", "type":"setActiveCharacter", "data":charId};
self.dispatchEvent(ev);
return oldAcid;
};
const promisifyWorker = (worker, parameters) => {
let acid=getActiveCharacterId();
let prevAcid=null;
return new Promise((res,rej)=>{
prevAcid=setActiveCharacterId(acid);
try {if (worker===0) getAttrs(parameters[0]||[],(v)=>res(v));
else if (worker===1) setAttrs(parameters[0]||{}, parameters[1]||{},(v)=>res(v));
else if (worker===2) getSectionIDs(parameters[0]||'',(v)=>res(v));
} catch(err) {rej(console.error(err))}
}).finally(()=>setActiveCharacterId(prevAcid));
}
return {
getAttrs(attrArray) {return promisifyWorker(0, [attrArray])},
setAttrs(attrObj, options) {return promisifyWorker(1, [attrObj, options])},
getSectionIDs(section) {return promisifyWorker(2, [section])},
setActiveCharacterId,
}
})();
// Helper function to grab player input
const getQuery = async (queryText) => {
const rxGrab = /^0\[(.*)\]\s*$/;
let rollBase = `! {{query1=[[ 0[${queryText}] ]]}}`, // just a [[0]] roll with an inline tag
queryRoll = await startRoll(rollBase),
queryResponse = (queryRoll.results.query1.expression.match(rxGrab) || [])[1];
finishRoll(queryRoll.rollId); // you can just let this time out if you want - we're done with it
return queryResponse;
};
// STRING PARSING METHODS FOR ROLLS
const rollEscape = {
chars: { '"': '%quot;', ',': '%comma;', ':': '%colon;', '}': '%rcub;', '{': '%lcub;', },
escape(str) {
str = (typeof(str) === 'object') ? JSON.stringify(str) : (typeof(str) === 'string') ? str : null;
return (str) ? `${str}`.replace(new RegExp(`[${Object.keys(this.chars)}]`, 'g'), (r) => this.chars[r]) : null;
},
unescape(str) {
str = `${str}`.replace(new RegExp(`(${Object.values(this.chars).join('|')})`, 'g'), (r) => Object.entries(this.chars).find(e=>e[1]===r)[0]);
return JSON.parse(str);
}
}
// ROLL FROM ACTION BUTTONS, FUNCTIONS BELOW
const rollFirst = async (char, act, dice, tn, act_fav, rolltype, additional="", lm=false) => {
let outcome = 0,
favId = 1,
featRoll = "1d12",
favouredStr = "",
modifiers = 0,
successdice = 0,
successStr = "",
rollBase = "",
successDegree = 0,
weaponinfo = "",
additionalinfo = "",
additionalStr = "",
parrymod = 0,
parrymodStr = "",
stanceattackmodStr = "";
act = act.charAt(0).toUpperCase() + act.slice(1); // Capitalise the action
act = (act === "Wisdom" || act === "Valour") ? "Shadow test: "+act : act;
clog(`Character name: ${name}, Roll name: ${act}, Target number: ${tn}, Action favoured: ${act_fav}`);
// ATTRIBUTES
const attrs = await asw.getAttrs([
"favorill", "weary", "miserable", "currenthope", "shadow", "shadowscar", "favourill_id",
"stanceattack_active", "stanceattackbonus", "stancedamagebonus"
]);
clog(`Weary: ${attrs.weary}, Miserable: ${attrs.miserable}`);
let wearyStr = (attrs.weary == "on" || attrs.weary == 1) ? "{{weary=Weary}}" : "",
weary = (attrs.weary == "on" || attrs.weary == 1) ? 1 : 0;
miserableStr = (attrs.miserable == "on" || attrs.miserable == 1) ? "{{miserable=Miserable}}" : "",
miserable = (attrs.miserable == "on" || attrs.miserable == 1) ? 1 : 0,
hope = int(attrs.currenthope),
shadow = int(attrs.shadow) + int(attrs.shadowscars),
favourill_id = int(attrs.favourill_id),
stanceAttackActive = int(attrs.stanceattack_active),
stanceAttackBonus = int(attrs.stanceattackbonus),
stanceDamageBonus = int(attrs.stancedamagebonus);
clog(`Weary Str: ${wearyStr}, Miserable Str: ${miserableStr}, Favourill_id: ${favourill_id}, StanceAttackActive: ${stanceAttackActive}, StanceAttackBonus: ${stanceAttackBonus}, StanceDamageBonus: ${stanceDamageBonus}`);
// GET MODIFIER AND FAVOURED HERE
if (rolltype.startsWith("protection") ) {
if ( rolltype.includes("target") ) {
tn = await getQuery(`?{Injury rating|@{target|weapon_injury_1}|@{target|weapon_injury_2}}`);
} else {
tn = await getQuery(`?{Injury rating|14}`);
}
} else if ( rolltype.startsWith("combat") ) {
favId = favourill_id;
stanceattackmodStr = "0"
if ( rolltype.includes("target") ) {
//parrymod = await getQuery(`?{Parry rating|@{target|parry}}`);
if (lm){
parrymodStr = "{{parrymod= [[@{target|totalparry}]]}}";
// we include targets stance modifier
stanceattackmodStr = "@{target|stanceattackbonus}";
} else {
parrymodStr = "{{parrymod= [[@{target|parry}]]}}";
}
} else {
parrymod = await getQuery(`?{Target's Parry|0}`);
parrymodStr = `{{parrymod= [[${parrymod}]]}}`;
}
//tn = int(tn) + int(parrymod);
//clog(`Parry mod adjusted tn: ${tn}`);
//parrymodStr = `{{parrymod=[[${parrymod}]] }}`;
clog(`Parry modifier string: ${parrymodStr}`);
}
// favourill handler
if (rolltype === "custom" ) {
favId = act_fav;
} else if (!rolltype.startsWith("combat")) {
if (act_fav === "1" || act_fav === "on" || favourill_id == 2) {
favId = 2;
} else if (favourill_id == 0) {
favId = 0;
} else {
favId = 1;
}
}
/* deactivate query
if (act_fav === "1" || act_fav === "on" || favourill_id == 2) {
favId = await getQuery(`?{Favoured?| Favoured,2 | Normal,1 | Ill-favoured,0}`);
} else if (favourill_id == 0) {
favId = await getQuery(`?{Favoured?| Ill-favoured,0 | Favoured,2 | Normal,1 }`);
} else {
favId = await getQuery(`?{Favoured?| Normal,1 | Favoured,2 | Ill-favoured,0}`);
}
*/
modifiers = rolltype !== "custom" ? await getQuery(`?{Bonus dice|${stanceAttackBonus}}`) : 0;
// add stance attack modifier
modifiers = int(modifiers);
let modStr = modifiers == 0 ? "" : (modifiers > 0 ? `{{modification=+${modifiers}}}` : `{{modification=${modifiers}}}`);
// FEAT DIE ROLL DATA
//clog(`Favoured test 1: ${!!(favId == 2)}`);
featRoll = favId == 2 ? "{{feat=[[2d12kh1-1]]}}" : ( favId == 0 ? "{{feat=[[2d12kl1-1]]}}" : "{{feat=[[1d12-1]]}}" );
featRoll = favId == -1 ? "{{feat=[[0d12]]}}" : featRoll; // For custom rolls without Feat die, the feat die is 0
//clog(`Favoured string: ${featRoll}`);
favouredStr = favId == 2 ? "{{favoured=Favoured}}" : ( favId == 0 ? "{{favoured=Ill-favoured}}" : "" );
//clog(`Favoured output: ${favouredStr}`);
// REWARDS, KEEN WEAPONS AND CLOSE FITTING ARMOUR
keen = (additional.match(/Keen/g) || []).length;
if( keen > 0 ) { clog("Weapon is keen!"); }
closefit = int((additional.match(/Close fitting/g) || []).length)*2;
let closefitStr = "";
if( closefit > 0 ) {
clog(`Armour is close fitting: ${closefit}`);
closefitStr = `+${closefit}[Close fit]`;
}
// SUCCESS DICE ROLL DATA
successdice = int(dice) + int(modifiers);
successdice = successdice < 0 ? 0 : successdice;
successStr = `[[${successdice}+${stanceattackmodStr}]]d6${closefitStr}`;
// WEAPON INFO & ADDITIONAL INFO
// Weapon info
weaponinfo = additional.match(/weapon='(.*?)';/);
clog(`Weapon info: ${JSON.stringify(weaponinfo)}`);
weaponStr = ( weaponinfo ) ? ` {{weaponinfo=${weaponinfo[1]}}}` : "";
clog(`Weapon info: ${weaponStr}`);
// Additional info
additionalinfo = additional.match(/additional='(.*?)';/);
clog(`Additional info: ${JSON.stringify(additionalinfo)}`);
additionalStr = additionalStr + (( additionalinfo ) ? ` {{additional=${additionalinfo[1]}}}` : "");
clog(`Additional info: ${additionalStr}`);
//LOG
clog(`Character: ${char}, Base dice: ${successdice}, base string ${successStr}, modifiers: ${modifiers}, target: ${tn}, favoured ${featRoll}, skill favoured: ${act_fav}`);
// START ROLL
rollBase = `&{template:tor} {{character-name=${char} }} {{roll-name=${act} }} {{total=[[0]]}} {{diff=[[0]]}} {{greatness=[[0]]}} {{passthroughdata=[[0]]}} {{outcome=[[0]]}} {{successes=[[0]]}} {{target=[[${tn}]] }} ${featRoll} {{r1=[[ ${successStr} ]] }} ${parrymodStr} ${favouredStr} ${wearyStr} ${miserableStr} ${modStr} {{skill-fav=${act_fav}}} ${weaponStr} ${additionalStr} }`;
let rollresult = await startRoll(rollBase),
rollSuccess = int(rollresult.results.r1.result,0),
rollFeat = int(rollresult.results.feat.result,0);
clog(`Roll: ${JSON.stringify(rollresult)}`);
if ( parrymodStr !== "") {
clog(`Parry mod: ${JSON.stringify(rollresult.results.parrymod.result)}`);
}
if (rolltype.startsWith("combat") ) {
clog(`TN before parry modification: ${tn}`);
tn = int(tn) + int(rollresult.results.parrymod.result);
clog(`TN after parry modification: ${tn}`);
}
// FEAT DIE AND MISERABLE
// Outcomes: Failure = 0, Success = 1, Feat success = 2, Piercing blow = 3, Weary failure = -1, Miserable failure = -2
clog(`Roll result results: ${JSON.stringify(rollresult.results)}`);
// Outcome: switch success criteria depending on loremaster or pc roll
if (lm){
clog("Loremaster roll!")
fumble = 11; // gandalf
crit = 0;
} else {
clog("Player roll!")
fumble = 0 // Eye of Sauron
crit = 11;
}
clog(`Crit: ${crit} - Fumble: ${fumble}`);
// weary success dice logic
if (weary === 1) {
// remove the 1, 2, 3, results, still add any closefitting bonus for protection rolls (already done)
// Weary condition affects protections rolls, see discussion here: https://boardgamegeek.com/thread/2031462/protection-tests-when-weary
rollSuccess = (_.reduce(rollresult.results.r1.dice, (memo, num) => { if(num <= 3) {return memo} else {return memo+num} }, 0));
clog(`Weary successes: ${rollSuccess}`);
} else {
clog(`Normal successes: ${rollSuccess}`);
}
// totals
let rollTotal = rollSuccess + rollFeat,
rollDiff = rollTotal - int(tn);
clog(`rollFeat: ${rollFeat}, rollTotal: ${rollTotal}, Target Number: ${tn}, Diff: ${rollDiff}`);
// Miserable logic, if Feat die is 0 (eye) then fail automatically, overrides all of below (adversaries don't get miserable)
if (rollFeat == fumble){
if (lm) {
outcome = 0;
clog(`Adversaries fail on gandalf rune! Outcome: ${outcome}`);
} else if (miserable == 1) {
outcome = -2;
clog(`PC fail on Eye of Sauron and Miserable. Outcome: ${outcome}`);
} else {
clog('PC do not fail on Eye of Sauron if not Miserable!');
}
} else if ( rollFeat == crit ) { // outcome 2 = Feat Success (Gandalf or Eye of Sauron)
outcome = 2;
//rollFeat = 0; // crit success doesnt have a value, also doesnt matter with regards to success since it always succeeds
clog(`Outcome after critical success: ${outcome}`);
} else if (rollTotal >= tn) {
outcome = 1; // normal success
clog(`Outcome after normal success: ${outcome}`);
} else if (lm && weary == 1) {
outcome = -1; // weary failure for PC
clog(`Outcome after weary failure: ${outcome}`);
} else {
outcome = 0; // normal failure
clog(`Outcome: ${outcome}`);
}
// GREATNESS & FEAT DIE
// Test for piercing blow on crit success or 10
outcome = (rolltype === "combat") && (outcome === 1 || outcome === 2) && (rollFeat === crit || rollFeat === 10) ? 3 : outcome;
clog(`Outcome after Piercing: ${outcome}`);
// Piercing blow also at 9 if the weapon used is keen
outcome = rolltype === "combat" && keen > 0 && rollFeat === 9 && (outcome === 1 || outcome === 2) ? 3 : outcome;
clog(`Outcome after Keen: ${outcome}`);
// count number of 6s in success, great or extraordinary success
// Count the number of sixes rolled, to report degree of success
clog(`Roll r1 : ${JSON.stringify(rollresult.results.r1.dice)}`);
successDegree = (outcome === 1 || outcome === 2 || outcome === 3) ? _.reduce(rollresult.results.r1.dice, (memo, num) => { if(num == 6) {return ++memo} else {return memo} }, 0) : 0;
clog(`Calculated degree of success: ${successDegree}`);
// Remove the 11 for Gandalf Rune, if there
rollTotal = rollFeat === 11 ? 0 : rollTotal;
// PASSTHROUGH DATA
// Storing all the passthrough data required for the next roll in an Object helps for larger rolls
//rollresult.results.difference.result = rollDiff;
//rollresult.results.passthroughdata = "This is a test";
//clog(`Roll result results II: ${JSON.stringify(rollresult.results)}`);
//clog(`First roll data: ${JSON.stringify(rollresult)}`);
//clog(`First roll diff: ${JSON.stringify(rollDiff)}`);
//clog(`Roll data: ${rollEscape.escape(rollData)}`);
// Storing all the passthrough data required for the next roll in an Object helps for larger rolls
// CALCULATED ROLL DATA
//let rollData = rollresult.results; // Holding the computed data in an object is a bit cleaner if your rolls get more complex
let rollData = Object.assign(rollresult); // Holding the computed data in an object is a bit cleaner if your rolls get more complex
rollData.total = rollTotal;
rollData.target = tn;
//rollData.diff = rollDiff;
rollData.successes = rollSuccess;
//rollData.favoured = favouredStr;
rollData.outcome = outcome;
rollData.greatness = successDegree;
console.log('Roll data: ' + JSON.stringify(rollData));
//rollData.passthroughdata = "This is a test";
// FINISH ROLL
finishRoll(rollresult.rollId, rollData);
};
// handle sheet types
const buttonlist = ["isPC","isAdversary"];
buttonlist.forEach(button => {
console.log(button);
on(`clicked:${button}`, function() {
console.log("Toggle charsheet: " + button);
setAttrs({
sheetTab: button,
});
});
});
// toggle notes area visibility
on( "clicked:notestoggle", function(){
getAttrs(["notesactive"], function(values){
let state = int(values.notesactive);
let newstate = 1-state; // xor
setAttrs({notesactive:newstate});
console.log("Toggle notes state: " + newstate);
});
});
/*==========================
Conditions / Stance / Load
============================*/
// weary roll table change
on("change:weary sheet:opened", function() {
getAttrs(["weary","sheetTab"], function(values) {
if (values.sheetTab === "isPC"){
let weary = values.weary||0;
if (weary === "on" || weary == 1) {
wearytype = "weary";
}
else {
wearytype = "normal";
}
setAttrs({
wearytype: wearytype,
});
};
});
});
// Calculate Weary condition and check that current endurance is not higher than max endurance
on("change:endurance change:currentendurance change:load change:fatigue sheet:opened", () => {
getAttrs(["endurance", "currentendurance", "weary", "fatigue", "load", "sheetTab"], (values) => {
if (values.sheetTab === "isPC"){
const fatigue = int(values.fatigue),
load = int(values.load),
endurance = int(values.endurance);
let weary = values.weary,
currentendurance = int(values.currentendurance);
clog(`Endurance: ${JSON.stringify(values)}`);
if ( load >= (currentendurance-fatigue) ) { weary = 1; } else { weary = 0}
if ( currentendurance > endurance ) { currentendurance = endurance; }
setAttrs({
weary: weary,
currentendurance: currentendurance,
});
};
});
});
// calc miserable and favourill_id
on("change:currenthope change:shadow change:shadowscars change:favorill sheet:opened", () => {
getAttrs(["currenthope", "hope", "shadow", "shadowscar", "favourill_id", "favorill", "sheetTab" ], (values) => {
if (values.sheetTab ==="isPC"){
const currenthope = int(values.currenthope),
hope = int(values.hope),
shadow = int(values.shadow),
scars = int(values.shadowscar),
favorill = values.favorill,
favourill_id = int(values.favourill_id),
maxshadow = hope - scars;
// miserable
if ( (shadow + scars) >= currenthope ) {
setAttrs({
miserable: 'on',
});
clog(`Set miserable based on shadow score: shadow ${shadow} + scars ${scars} higher than current hope ${currenthope}.`);
} else {
setAttrs({
miserable: 'off',
});
};
// favourill
if ( (shadow + scars) >= hope || favorill === "{2t[feat]}kl1") {
setAttrs({
favourill_id: 0,
favorill : "{2t[feat]}kl1" // to make table rolls consistent
});
clog(`Set illfavoured rolls global state or shadow score: shadow ${shadow} + scars ${scars} higher than maximum hope ${hope}.`);
} else if (favorill === "{1t[feat]}"){
setAttrs({
favourill_id: 1,
});
clog(`Reset normal rolls based on global state.`);
} else if (favorill === "{2t[feat]}kh1"){
setAttrs({
favourill_id: 2,
});
clog(`Reset favoured rolls based on global state.`);
};
} else if (values.sheetTab ==="isAdversary") {
const favorill = values.favorill,
favourill_id = int(values.favourill_id);
if (favorill === "{2t[feat]}kl1"){
setAttrs({
favourill_id: 0,
});
clog(`Set favourill_id to illfavoured.`);
} else if (favorill === "{2t[feat]}kh1"){
setAttrs({
favourill_id: 2,
});
clog(`Set favourill_id to favoured.`);
} else {
setAttrs({
favourill_id: 1,
});
clog(`Reset favourill_id to normal`);
};
};
});
});
// automatic stance toggle of attack damage/bonus, parry (open stance) and protection (defensive)
on( "change:stance sheet:opened", function() {
getAttrs(["stance"], function(values) {
let attr = new Map([
["stanceparry_active", 0],
["stanceprot_active", 0],
["stanceattack_active", 0],
["stanceattackbonus", 0]
]);
if (values.stance === "1"){
console.log("Handle forward stance toggle");
attr.set("stanceattack_active", 1);
attr.set("stanceattackbonus", 1);
} else if (values.stance === "2"){
console.log("Handle open stance toggle");
attr.set("stanceparry_active", 1);
} else if (values.stance === "3"){
console.log("Handle defensive stance toggle");
attr.set("stanceprot_active", 1);
attr.set("stanceattackbonus", -1);
} else if (values.stance === "4"){
console.log("Handle rearward stance toggle");
}
clog(`Attackbonus: ${attr.get("stanceattackbonus")}`);
setAttrs({
stanceparry_active: attr.get("stanceparry_active"),
stanceprot_active: attr.get("stanceprot_active"),
stanceattack_active: attr.get("stanceattack_active"),
stanceattackbonus: attr.get("stanceattackbonus")
})
});
});
// calc total load on change events for weapons, armour and treasure
on( "change:weapon_load_1 change:weapon_load_2 change:weapon_load_3 change:weapon_load_4 change:weapon_load_5 change:weapon_load_6 " +
"change:armourload change:helmload change:shieldload change:treasureload " +
"change:fatigue change:load sheet:opened", function() {
getAttrs(["weapon_load_1","weapon_load_2","weapon_load_3","weapon_load_4","weapon_load_5","weapon_load_6",
"armourload","shieldload","helmload","fatigue","treasureload"], function(values) {
const weaponload1 = int(values.weapon_load_1),
weaponload2 = int(values.weapon_load_2),
weaponload3 = int(values.weapon_load_3),
weaponload4 = int(values.weapon_load_4),
weaponload5 = int(values.weapon_load_5),
weaponload6 = int(values.weapon_load_6),
armourload = int(values.armourload),
shieldload = int(values.shieldload),
helmload = int(values.helmload),
treasureload = int(values.treasureload),
load = armourload + shieldload + helmload + weaponload1 + weaponload2 + weaponload3 + weaponload4 + weaponload5 + weaponload6 + treasureload; // Removed Fatigue, used to calculate vs Current Endurance and Weary condition below.
setAttrs({
load: load,
});
});
});
/*==================
Valour & Wisdom
====================*/
// parsed valour roll
on('clicked:valour', async (ev) => {
clog(`Starting first roll`);
let action = 'valour',
data = await asw.getAttrs(['character_name', 'hearttn', 'valour', 'valour_favoured']),
actdice = data.valour,
actfav = data.valour_favoured;
clog(`First roll: ${JSON.stringify(data)}, Action : ${action}, protection value: ${actdice}`);
await rollFirst(data.character_name, action, actdice, data.hearttn, actfav, "valour");
clog(`Completed first roll`);
});
// parsed wisdom roll
on('clicked:wisdom', async (ev) => {
clog(`Starting first roll`);
let action = 'wisdom',
data = await asw.getAttrs(['character_name', 'witstn', 'wisdom', 'wisdom_favoured']),
actdice = data.wisdom,
actfav = data.wisdom_favoured;
clog(`First roll: ${JSON.stringify(data)}, Action : ${action}, protection value: ${actdice}`);
await rollFirst(data.character_name, action, actdice, data.witstn, actfav, "wisdom");
clog(`Completed first roll`);
});
/*==================
Protection and Parry
====================*/
// calc total protection on change events for the checkboxes and values
on( "change:armourprot_active change:helmprot_active change:otherprot_active change:stanceprot_active " +
"change:armourprot change:helmprot change:otherprot change:stanceprot " +
"change:protection sheet:opened", function() {
getAttrs(["armourprot", "helmprot", "stanceprot", "otherprot",
"armourprot_active", "helmprot_active", "stanceprot_active", "otherprot_active"], function(values) {
let armourprot = (values.armourprot_active == 1) ? int(values.armourprot) : 0;
let helmprot = (values.helmprot_active == 1) ? int(values.helmprot) : 0;
let otherprot = (values.otherprot_active == 1) ? int(values.otherprot) : 0;
let stanceprot = (values.stanceprot_active == 1) ? int(values.stanceprot) : 0;
let protectiontotal = armourprot + helmprot + otherprot + stanceprot;
setAttrs({
protection: protectiontotal,
});
console.log("Updated protection to " + protectiontotal);
});
});
// calc total parry on change events for the check boxes and values
on( "change:shieldparry_active change:otherparry_active change:stanceparry_active " +
"change:parry change:shieldparry change:otherparry change:stanceparry " +
"change:totalparry sheet:opened", function() {
getAttrs(["parry", "shieldparry", "stanceparry", "otherparry",
"shieldparry_active", "stanceparry_active", "otherparry_active"], function(values) {
let parry = int(values.parry);
let shieldparry = (values.shieldparry_active == 1) ? int(values.shieldparry) : 0;
let stanceparry = (values.stanceparry_active == 1) ? int(values.stanceparry) : 0;
let otherparry = (values.otherparry_active == 1) ? int(values.otherparry) : 0;
let parrytotal = parry + shieldparry + stanceparry + otherparry;
setAttrs({
totalparry: parrytotal,
});
console.log("Updated total parry to " + parrytotal
+ " - parry: " + parry + " - shieldparry: " + shieldparry
+ " - stanceparry: " + stanceparry + " - otherparry: " + otherparry);
});
});
// parsed protection rolls
on('clicked:protection', async (ev) => {
clog(`Starting first roll`);
let action = (ev.htmlAttributes.name).slice(4),
data = await asw.getAttrs(['character_name', action, 'protection', 'armourcf', 'armourcm', 'helmetcf', 'helmetcm', 'sheetTab', 'protection_favoured']),
actdice = int(data.protection),
actfav = data.protection_favoured,
lm = data.sheetTab ==="isAdversary" ? true : false;
let additionalStr = "";
additionalStr = additionalStr + ((data.armourcf == "1") ? "Close fitting armour, " : "");
additionalStr = additionalStr + ((data.helmetcf == "1") ? "Close fitting helm, " : "");
additionalStr = additionalStr + ((data.armourcm == "1") ? "Cunning made armour, " : "");
additionalStr = additionalStr + ((data.helmetcm == "1") ? "Cunning made helm, " : "");
additionalStr = additionalStr.slice(0,-2);
clog(`First roll: ${JSON.stringify(data)}, Action : ${action}, protection value: ${actdice}, Additional: ${additionalStr}, Favoured: ${actfav}`);
await rollFirst(data.character_name, action, actdice, "0", actfav, "protection", `additional='${additionalStr}';`, lm);
clog(`Completed first roll`);
});
// adapt protection table roll
on("change:protection_favoured change:favourill_id sheet:opened", function() {
getAttrs(["protection_favoured","favourill_id"], function(values) {
// get attribute favoured state, 0 if unset
let faved = values["protection_favoured"]||0;
// convert checked state to 1
let favattr = (faved == 0) ? 0 : 1;
// get global favoured/illfavoured state, "normal" if unset
let favourill = int(values.favourill_id)-1; // shift value to -1/0/+1 and use this later to calc
// favoured / illfavoured states can negate each other
// 2*favoured stays a simple favoured roll
let favourill_result = favattr + favourill;
// derive resulting roll expression. we calculate the complete expression at this central location
// to make easy maintenance later when this needs to be changed
let favourill_roll = "{1t[feat]}";
if (favourill_result >= 1){
favourill_roll = "{2t[feat]}kh1";
} else if (favourill_result <= -1) {
favourill_roll = "{2t[feat]}kl1";
}
clog(`Protection favourill: ${favourill_result}`);
let roll =
`/me rolls for Protection against Injury TN.\n/roll ${favourill_roll} + (@{protection}+?{Bonus Dice|0})t[@{wearytype}]`;
setAttrs({
["protection_roll"]: roll,
});
});
});
/*==================
Skills
====================*/
// table rolls skills
// This sheet worker will derive the correct normal / favoured / illfavoured rolls based on the
// global favoured status and the attribute specific favoured status
let attrmap = new Map([
["strength", ["awe","athletics", "awareness", "hunting", "song", "craft"]],
["heart", ["enhearten", "travel", "insight", "healing", "courtesy", "battle","valour"]],
["wits", ["persuade", "stealth", "scan", "explore", "riddle", "lore","wisdom"]]
]);
attrmap.forEach((skillList, attr, attrmap) => {
let attrcapitalized = attr.replace(/^\w/, (c) => c.toUpperCase()); // first letter
skillList.forEach(skill => {
let skillfav = `${skill}_favoured`;
let skillcapitalized = skill.replace(/^\w/, (c) => c.toUpperCase()); // first letter
on(`change:${skillfav} change:favorill sheet:opened`, function() {
getAttrs([`${skillfav}`,"favorill"], function(values) {
// get attribute favoured state, 0 if unset
let faved = values[`${skillfav}`]||0;
// convert checked state to 1
let favattr = (faved == 0) ? 0 : 1;
// get global favoured/illfavoured state, "normal" if unset
let favorill = values.favorill ||"{1t[feat]}";
// favoured / illfavoured states can negate each other
// 2*favoured stays a simple favoured roll
let favorill_result = favattr;
if (favorill === "{2t[feat]}kh1"){
favorill_result = favorill_result + 1;
} else if (favorill === "{2t[feat]}kl1"){
favorill_result = favorill_result - 1;
}
// derive resulting roll expression. we calculate the complete expression at this central location
// to make easy maintenance later when this needs to be changed
let favorill_roll = "{1t[feat]}";
if (favorill_result >= 1){
favorill_roll = "{2t[feat]}kh1";
} else if (favorill_result <= -1) {
favorill_roll = "{2t[feat]}kl1";
}
let roll =
`/me rolls for ${skillcapitalized} against ${attrcapitalized} TN (@{${attr}tn}).\n`
+ `/roll ${favorill_roll} + (@{${skill}}+?{Bonus Dice|0})t[@{wearytype}] `;
setAttrs({
[`${skill}_roll`]: roll,
});
});
});
});
});
// parsed strength based skill rolls
on('clicked:awe clicked:athletics clicked:awareness clicked:hunting clicked:song clicked:craft', async (ev) => {
clog(`Starting first roll`);
let action = (ev.htmlAttributes.name).slice(4),
data = await asw.getAttrs(['character_name', 'strengthtn', action, `${action}_favoured`]),
actdice = data[action],
act_fav = data[`${action}_favoured`];
clog(`First roll: ${JSON.stringify(data)}, Action : ${action}, Action value: ${actdice}, Action favoured value: ${act_fav}`);
await rollFirst(data.character_name, action, actdice, data.strengthtn, act_fav, "skill");
clog(`Completed first roll`);
});
// parsed heart based skill rolls
on('clicked:enhearten clicked:travel clicked:insight clicked:healing clicked:courtesy clicked:battle', async (ev) => {
clog(`Starting first roll`);
let action = (ev.htmlAttributes.name).slice(4),
data = await asw.getAttrs(['character_name', 'hearttn', action, `${action}_favoured`]),
actdice = data[action],
act_fav = data[`${action}_favoured`];
clog(`First roll: ${JSON.stringify(data)}, Action : ${action}, Action value: ${actdice}, Action favoured value: ${act_fav}`);
await rollFirst(data.character_name, action, actdice, data.hearttn, act_fav, "skill");
clog(`Completed first roll`);
});
// parsed wits based skill rolls
on('clicked:persuade clicked:stealth clicked:scan clicked:explore clicked:riddle clicked:lore', async (ev) => {
clog(`Starting first roll`);
let action = (ev.htmlAttributes.name).slice(4),
data = await asw.getAttrs(['character_name', 'witstn', action, `${action}_favoured`]),
actdice = data[action],
act_fav = data[`${action}_favoured`];
clog(`First roll: ${JSON.stringify(data)}, Action : ${action}, Action value: ${actdice}, Action favoured value: ${act_fav}`);
await rollFirst(data.character_name, action, actdice, data.witstn, act_fav, "skill");
clog(`Completed first roll`);
});
/*==================
COMBAT PROFICIENCES
====================*/
// table combat proficiency rolls (to reflect the active stance attack bonus)
const battleattrs = ["axes", "bows", "spears", "swords"];
on(`change:stance sheet:opened`, function() {
getAttrs(["stanceattackbonus"], function(values) {
battleattrs.forEach(battleattr => {
let battleattrcapitalized = battleattr.replace(/^\w/, (c) => c.toUpperCase()); // first letter
let stanceattackbonus = "@{stanceattackbonus} ";
let roll1 =
`/me rolls for ${battleattrcapitalized} against TN [[@{strengthtn}+?{Target's Parry|0}]] (Strength TN + target's parry).\n`
+ `/roll @{favorill} + ([[@{${battleattr}} + ?{Bonus Dice|${stanceattackbonus}}]])t[@{wearytype}]`;
let roll2 =
`/me rolls for ${battleattrcapitalized} against TN [[@{strengthtn}+@{target|totalparry}]] (Strength TN + target's parry).\n`
+ `/roll @{favorill} + ([[@{${battleattr}} + ?{Bonus Dice|${stanceattackbonus}}]])t[@{wearytype}]`;
setAttrs({
[`${battleattr}_roll1`]: roll1,
[`${battleattr}_roll2`]: roll2,
});
});
});
});
// parsed adversary combat proficiency rolls
// act_adv_weapon1_target
on('clicked:adv_weapon1 clicked:adv_weapon1_target clicked:adv_weapon2 clicked:adv_weapon2_target ', async (ev) => {
clog(`Starting first roll`);
let index = (ev.htmlAttributes.name).slice(14).split("_")[0],
target = (ev.htmlAttributes.name).slice(14).split("_")[1] || "",
data = await asw.getAttrs(['character_name', `weapon_skill_name_${index}`,`weapon_rating_${index}`, `weapon_damage_${index}`, `weapon_injury_${index}`, 'favorill', 'favourill_id']),
action = data[`weapon_skill_name_${index}`],
actdice = data[`weapon_rating_${index}`],
damage = data[`weapon_damage_${index}`],
injury = data[`weapon_injury_${index}`],
favorill = data['favorill'] || "{1t[feat]}",
favourill_id = data['favourill_id'];
clog(`Index: ${index}, Target: ${target}, Action: ${action}`);
clog(`First roll: ${JSON.stringify(data)}, Action : ${action}, Action value: ${actdice}`);
await rollFirst(data.character_name, action, actdice, 0, 0, "combat"+target, `weapon='Damage: ${damage}, Injury: ${injury}';`, true);
clog(`Completed first roll`);
});
// parsed combat proficiency rolls
on('clicked:axes clicked:bows clicked:spears clicked:swords clicked:axes_target clicked:bows_target clicked:spears_target clicked:swords_target', async (ev) => {
clog(`Starting first roll`);
let action = (ev.htmlAttributes.name).slice(4).split("_")[0],
target = (ev.htmlAttributes.name).slice(4).split("_")[1] || "",
data = await asw.getAttrs(['character_name', 'strengthtn', action, `${action}_favoured`, 'favorill', 'favourill_id']),
actdice = data[action],
favorill = data['favorill'] || "{1t[feat]}",
favourill_id = data['favourill_id'],
act_fav = data[`${action}_favoured`] || 0;
clog(`Action: ${action}`);
action = action.split("_")[0] || action;
clog(`Target: ${target}`);
if (favorill === "{2t[feat]}kh1"){
act_fav = 1;
} else if (favorill === "{2t[feat]}kl1"){
act_fav = 0;
} else {
act_fav = 0;
}
clog(`First roll: ${JSON.stringify(data)}, Action : ${action}, Action value: ${actdice}, Action favoured value: ${act_fav}`);
await rollFirst(data.character_name, action, actdice, data.strengthtn, act_fav, "combat"+target);
clog(`Completed first roll`);
});
// parsed combat rolls per weapon
on("clicked:weapon_1 clicked:weapon_2 clicked:weapon_3 clicked:weapon_4 clicked:weapon_1_target clicked:weapon_2_target clicked:weapon_3_target clicked:weapon_4_target ", async (ev) => {
let options = (ev.htmlAttributes.name).slice(11),
index = options.split('_')[0],
target = options.split('_')[1] || "";
target = target === "" ? "" : "-"+target;
clog(`Starting first roll: weapon_${index}, target: ${target}`);
let data = await asw.getAttrs([
'character_name', 'strengthtn', `weapon_skill_name_${index}`, `weapon_combat_prof_${index}`, `weapon_damage_${index}`,
`weapon_injury_${index}`, `weapon_note_${index}`, `weapon_fell_${index}`, `weapon_grievous_${index}`, `weapon_keen_${index}`,
'stanceattack_active', 'stanceattackbonus', 'stancedamagebonus',
'axes', 'bows', 'spears', 'swords']),
action = data[`weapon_skill_name_${index}`],
combatprof = data[`weapon_combat_prof_${index}`],
damage = data[`weapon_damage_${index}`],
injury = data[`weapon_injury_${index}`],
note = data[`weapon_note_${index}`],
keen = int(data[`weapon_keen_${index}`],0) === 0 ? "" : "Keen, ",
fell = int(data[`weapon_fell_${index}`],0) === 0 ? "" : "Fell, ",
grievous = int(data[`weapon_grievous_${index}`],0) === 0 ? "" : "Grievous, ",
actdice = int(data[`${combatprof}`]),
stanceattack_active = int(data['stanceattack_active']),
stanceattackbonus = int(data['stanceattackbonus']),
stancedamagebonus = int(data['stancedamagebonus']);
damage = (stanceattack_active == 1) ? `${damage} + ${stancedamagebonus}` : damage;
clog(`First roll: ${JSON.stringify(data)}, Action: ${action}, Dice: ${actdice}, Keen: ${keen}, tn: ${data.strengthtn}`);
await rollFirst(data.character_name, action, actdice, data.strengthtn, 0, "combat"+target, `weapon='${keen}${fell}${grievous}Damage: ${damage}, Injury: ${injury}'; additional='Notes: ${note}';`);
clog(`Completed first roll: weapon_${index}`);
});
/*==================
Migration scripts.
====================*/
on("sheet:opened", function() {
getAttrs(["build", "version", "sheettab"], function(v) {
const build = int(v.build);
var attrs = {};
console.log("Current version: " + v.version);
// get attribute updates for each version until the sheet has completed all steps
// NOTE: to maintain backwards compatibility with sheets predating the version attribute, all steps will be performed for new sheets
if (build < 1) {
// Version 01.00.00
console.log("Migration 01.00.00")
attrs["build"] = 1;
if (v.sheettab === "isPC"){
getAttrs(["treaure"], function(values){
let treaure = int(values.treaure);
attrs["treasure"] = treaure;
});
}
}
/*
* if (build < 2) {
* attrs["build"] = 2;
* }
*/
if (Object.keys(attrs).length) {
setAttrs(attrs);
}
});
});
</script>
<rolltemplate class="sheet-rolltemplate-standard">
<div class="sheet=pc">
<div class="sheet-main">{{skill}}</div>
{{#rollTotal() favorill 1}}
<div class="sheet-main">stand {{standard}}</div>
{{/rollTotal() favorill 1}}
{{#rollTotal() favorill 2}}
<div class="sheet-main">fav {{fav}}</div>
{{/rollTotal() favorill 2}}
{{#rollTotal() favorill 3}}
<div class="sheet-main">ill {{ill}}</div>
{{/rollTotal() favorill 3}}
</div>
</rolltemplate>
<rolltemplate class="sheet-rolltemplate-tor">
<div class="sheet-container sheet-color-{{color}}">
<div class="sheet-header">
{{#character-name}}<div class="sheet-title sheet-text-center">{{character-name}}</div>{{/character-name}}
{{#roll-name}}<div class="sheet-subtitle sheet-text-center">{{roll-name}}</div>{{/roll-name}}
</div>
<div class="sheet-content">
<div class="sheet-full-col sheet-center sheet-die-title sheet-target-number">Target Number</div>
<div class="sheet-full-col sheet-center sheet-die-result sheet-target-number">
<span class="sheet-rotated-box"><span class="sheet-die-result">{{computed::target}}</span></span>
</div>
<div class="sheet-half-col sheet-die-title sheet-feat-label">Feat Die</div>
<div class="sheet-half-col sheet-die-title sheet-success-label">Success<br /> Dice</div>
{{#rollWasCrit() feat}}
<div class="sheet-half-col sheet-die-result sheet-feat-die">
<span class="sheet-rotated-box sheet-fullcrit">{{feat}}</span><span class="sheet-gandalf"></span>
</div>
{{/rollWasCrit() feat}}
{{#rollWasFumble() feat}}
<div class="sheet-half-col sheet-die-result sheet-feat-die">
<span class="sheet-rotated-box sheet-fullfail">{{feat}}</span><span class="sheet-eye"></span>
</div>
{{/rollWasFumble() feat}}
{{#rollBetween() feat 1 10}}
<div class="sheet-half-col sheet-die-result sheet-feat-die">
<span class="sheet-rotated-box">{{feat}}</span>
</div>
{{/rollBetween() feat 1 10}}{{^feat}}
<div class="sheet-half-col sheet-die-result sheet-feat-die"><span class="sheet-rotated-box"><span>-</span></span></div>
{{/feat}}
<div class="sheet-half-col sheet-die-result sheet-success-die"><span class="sheet-rotated-box">{{r1}}</span></div>
<div class="sheet-half-col sheet-die-comment sheet-favoured">
{{#favoured}}{{favoured}}{{/favoured}}
</div>
<div class="sheet-half-col sheet-die-comment sheet-modification">
{{#modification}}Bonus {{modification}}{{/modification}}
</div>
<div class="sheet-half-col sheet-die-comment sheet-favoured sheet-red">
{{#miserable}}{{miserable}}{{/miserable}}
</div>
<div class="sheet-half-col sheet-die-comment sheet-weary sheet-red">
{{#weary}}{{weary}}{{/weary}}
</div>
<div class="sheet-full-col sheet-center sheet-die-result sheet-roll-total"><span class="sheet-rotated-box">{{computed::total}}</span>
</div>
<div class="sheet-full-col sheet-center sheet-die-title sheet-roll-total">Total</div>
<!-- <div class="full-col center die-result roll-diff"><span class="rotated-box">{{computed::diff}}</span></div>
<div class="full-col center die-title roll-diff">Diff</div> -->
<div class="sheet-full-col sheet-center sheet-roll-outcome">
<div class="sheet-center sheet-die-title">
{{#rollLess() computed::outcome 1}}
{{#rollTotal() computed::outcome -2}}Miserable&nbsp;&nbsp;{{/rollTotal() computed::outcome -2}}
{{#rollTotal() computed::outcome -1}}Weary&nbsp;&nbsp;{{/rollTotal() computed::outcome -1}}
Failure!
{{/rollLess() computed::outcome 1}}
{{#rollBetween() computed::outcome 1 3}}
{{#rollTotal() computed::greatness 1}}Great&nbsp;&nbsp;({{computed::greatness}})&nbsp;
{{/rollTotal() computed::greatness 1}}
{{#rollGreater() computed::greatness 1}}Extraordinary&nbsp;&nbsp;({{computed::greatness}})&nbsp;
{{/rollGreater() computed::greatness 1}}
{{#rollTotal() computed::outcome 2}}Feat&nbsp;&nbsp;{{/rollTotal() computed::outcome 2}}
{{#rollBetween() computed::outcome 1 2}}Success!{{/rollBetween() computed::outcome 1 2}}
{{#rollTotal() computed::outcome 3}}Piercing&nbsp;&nbsp;Blow!{{/rollTotal() computed::outcome 3}}
{{/rollBetween() computed::outcome 1 3}}
</div>
</div>
</div>
<div class="sheet-footer">
{{#weaponinfo}}
<div class="sheet-full-col sheet-center sheet-additional">
<div class="sheet-center">
{{weaponinfo}}
</div>
</div>
{{/weaponinfo}}
{{#additional}}
<div class="sheet-full-col sheet-center sheet-additional">
<div class="sheet-center">
{{additional}}
</div>
</div>
{{/additional}}
</div>
</div>
</rolltemplate>