Files
2024-06-03 13:15:14 -04:00

3821 lines
251 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<input type="hidden" name="attr_whisper_roll" value="">
<input type="hidden" name="attr_visible_toggle" value="0">
<input type="hidden" name="attr_recalculate" value="1">
<input type="hidden" name="attr_modifier" value="0">
<input type="hidden" name="attr_name_check" class="d20" value="0">
<input type="hidden" name="attr_age_roll" value="0">
<input type="hidden" name="attr_epic" title="Heroic or Epic Power Level" value="0">
<input type="hidden" name="attr_weapon_select" value="?{Attack Size|Light or Unarmed (+0), 0|Typical or Medium hand Arms (+1),1| Heavy or 2-Handed (+2),2|Massive (+3),3|Super-Massive (+4),4}">
<input type="hidden" name="attr_xp_visible" class="toggle-xp" value="0">
<input type="hidden" name="attr_settings_visible" class="toggle-settings" value="0">
<input type="hidden" name="attr_sheet_tab" class="toggle" value="front">
<input type="hidden" name="attr_flipped" class="flipped" value="0">
<div class="settings-show">
<h3>Settings</h3>
<span title="Set to Heroic or Epic">Power Level</span>
<select name="attr_epic" class="noarrow">
<option value="0" selected>Heroic</option>
<option value="1">Epic</option>
</select>
<span title="Show a Sorcery score in Bound Daemons">Sorcery</span>
<input type="hidden" name="attr_sorcery_show" value="0">
<select name="attr_sorcery_show" class="noarrow">
<option value="1">Yes</option>
<option value="0" selected>No</option>
</select>
<span>Body</span>
<select name="attr_settings_body" class="noarrow">
<option value="0">+0</option>
<option value="1" selected>+10</option>
</select>
<span>Vigour</span>
<select name="attr_settings_vigour" class="noarrow">
<option value="0">x1</option>
<option value="1" selected>x2</option>
</select>
<span>Armour</span>
<select name="attr_settings_armour" class="noarrow">
<option value="0">No</option>
<option value="1" selected>Yes</option>
</select>
<span title="Set the minimum Skill Cost, typically 5.">Skill Cost</span>
<input type="number" name="attr_skill_min" value="5">
<span title="Set the maximum number of Lifepath terms (max 7)">Max Terms</span>
<input type="number" name="attr_term_limit" value="6">
<span title="attacks and gear at the bottom">Sheet Flipped</span>
<select name="attr_flip_attacks" class="noarrow">
<option value="0" selected>No</option>
<option value="1">Yes</option>
</select>
</div>
<div class="xp-show">
<div class="xp-awards">
<h3>XP Awards</h3>
<p>Each check gives Glory immediately, and at the end of a session adds to XP.</p>
<input type="checkbox" name="attr_xp1" value="1">
<span>Did we complete a Scenario</span>
<input type="checkbox" name="attr_xp2" value="1">
<span>Did I deny or oppose someone in a position of power?</span>
<input type="checkbox" name="attr_xp3" value="1">
<span>Did I do something heroic, reckless, or notable while facing danger?</span>
<input type="checkbox" name="attr_xp4" value="1">
<span>Did I challenge myself or another in a novel way?</span>
<input type="checkbox" name="attr_xp5" value="1">
<span>Did I spend any Loyalty?</span>
<input type="checkbox" name="attr_xp6" value="1">
<span>Did I experience a Legend Intervention?</span>
<button type="action" name="act_xp_commit">Commit XP (usually at end of session)</button>
</div>
<div class="buying-advances">
<h3>Advances</h3>
<span class="bold">XP:</span>
<input type="number" class="xp" name="attr_xp" value="0">
<!-- <span class="bold" title="Last Advance doesn't show properly when buying a Vagary">Last Advance: </span>
<input type="number" name="attr_last_advance" class="xp-cost" value="0"> -->
<fieldset class="repeating_advances">
<div class="extra-advances">
<select name="attr_skill" class="skill-choices">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<input type="number" name="attr_skill_cost" value="5">
</div>
</fieldset>
<!-- <span class="bold"># Owned: </span>
<input type="number" name="attr_number_advances" class="xp-cost" value="0" readonly> -->
<span class="bold">Total XP Spent: </span>
<input type="number" name="attr_xp_spent" class="xp-cost" value="0" readonly>
</div>
</div>
<div class="buttons">
<input type="hidden" name="attr_heroic_visible" class="toggle-epic" value="1">
<div class="settings">
<button type="action" name="act_settings">&#9881;</button>
</div>
<input type="hidden" name="attr_xp_button_visible" class="xp-button-toggle" value="0">
<div class="xp" title="Show XP Table">
<button type="action" name="act_xp">&#9881;</button>
</div>
<div class="left">
<input type="hidden" name="attr_name_check" class="d20" value="0">
<button type="action" name="act_front" class="front-button">Front</button>
<button type="action" name="act_back" class="back-button">Back</button>
<button type="action" name="act_gm" class="gms-only">GM</button>
<button type="action" name="act_d20" class="nod20 gms">d20</button>
<button type="action" name="act_push" class="nod20">Nd6</button>
</div>
<input type="hidden" class="toggle" name="attr_design_mode" value="design">
<div class="middle red">
<input type="hidden" name="attr_name_check" class="d20" value="0">
<button type="action" name="act_play" title="Click here when you have finished designing your character." class="play">Play Mode</button>
<button type="action" name="act_design" title="Click to return to Design options." class="design">Design Mode</button>
<button type="action" name="act_visibility" class="beware" title="Show or Hide Unknown skills"><span name="attr_visibility_label" value="Show Skills">Show Skills</span></button>
<!-- <button type="action" name="act_xp" class="beware" title="Starting Character Power Level"><span name="attr_xp_label" value="Epic">Epic</span></button> -->
<!--<button type="action" name="act_visibility" class="beware" title="Show or Hide Unknown skills"><span name="attr_visibility_label" value="Hide Skills">Hide Skills</span></button>-->
</div>
<div class="right design blue">
<input type="hidden" name="attr_name_check" class="d20" value="0">
<!-- <button type="action" name="act_npc" class="beware gms-only" title="Randomly roll a single Legend NPC">Quick NPC</button>
<button type="action" name="act_reroll" class="beware" title="start a character by rolling their Legends">Roll Legends</button> -->
<button type="action" name="act_skill_template" class="beware" title="Randomly roll all unselected skills">Roll Skills</button>
<button type="action" name="act_power" class="beware" title="Don't click this till you have selected all skills">Roll Powers</button>
<button type="action" name="act_clear" class="beware" title="delete everything you have added to the sheet!">Clear Sheet</button>
<input type="hidden" name="attr_heroic_visible" class="toggle-epic" value="1">
<button type="action" name="act_epic" class="epic beware" title="Set between heroic and Epic Power level"><span name="attr_epic_label" value="Heroic">Heroic</span></button>
</div>
<div class="right play blue">
<button type="action" name="act_whisper" class="beware" title="Post rolls to Chat or whisper to GM"><span name="attr_whisper_label" value="Rolls to Chat">Rolls to Chat</span></button>
<button type="action" name="act_mod" class="beware" title="Rolls have a modifier or not"><span name="attr_mod_label" value="No Roll Mods">No Roll Mods</span></button>
<button type="action" name="act_clear_mods" title="Clear all modifiers added to skills and stats">Clear Mods</button>
</div>
</div>
<div class="gm">
<div class="gm-intro">
<span class="bold">Sheet Name: </span>
<input type="text" class="gm-name" name="attr_character_name" value="">
<br>
<span>Use this page for rolls and notes, when you don't need a full character sheet.</span>
</div>
<!-- move the rolls into separate blocks -->
<div class="rolls">
<div class="rolls-d20">
<h3>d20 Rolls</h3>
<div class="gm-rolls titles">
<h4>Source</h4>
<h4>Item</h4>
<h4>Score</h4>
<h4>Mod</h4>
<h4>Roll</h4>
</div>
<fieldset class="repeating_d20">
<div class="gm-rolls">
<input type="text" name="attr_source" placeholder="Source" value="" >
<input type="text" name="attr_item" placeholder="Item" value="">
<input type="number" name="attr_score" value="0" >
<input type="hidden" name="attr_score_roll" value="" >
<input type="number" name="attr_mod" class="mod" value="0" >
<button type="roll" name="roll_gmroll" value="@{score_roll}"></button>
</div>
</fieldset>
</div>
<div class="rolls-d6">
<h3>d6 Rolls</h3>
<div class="gm-rolls titles">
<h4>Source</h4>
<h4>Item</h4>
<h4>Number</h4>
<h4>Mod</h4>
<h4>Roll</h4>
</div>
<fieldset class="repeating_d6">
<div class="gm-rolls">
<input type="text" name="attr_source" placeholder="Source" value="" >
<input type="text" name="attr_item" placeholder="Item" value="" >
<input type="number" name="attr_dice" value="0" >
<input type="hidden" name="attr_dice_pages" value="@{whisper_roll}&{template:pages} {{title=@{item} Roll}} {{subtitle=@{source} }} {{dice=[[@{dice}+@{mod}]]}} {{modifier=[[@{Modifier}]]}} {{roll=[[(@{dice}+@{mod}+@{Modifier})d6cs0cf7]]}} " >
<input type="number" name="attr_mod" class="mod" value="0" >
<button type="roll" name="roll_gmroll" value="@{dice_pages}"></button>
</div>
</fieldset>
</div>
</div>
<div class="gm-notes">
<h3>Notes</h3>
<fieldset class="repeating_gmnotes">
<details>
<textarea name="attr_description" placeholder="more detailed note"></textarea>
<summary>
<span title="click to expand description">&#8595;</span>
<input type="text" name="attr_label" value="" placeholder="Name of Note">
</summary>
</details>
</fieldset>
</div>
</div>
<div class="back">
<div class="extras">
<div class="extra-skills">
<h3>XP</h3>
<input type="number" class="xp" name="attr_xp" value="0">
<span class="bold" title="Last Advance doesn't show properly when buying a Vagary">Last Advance: </span>
<input type="number" name="attr_last_advance" class="xp-cost" value="0">
<h3>Advances</h3>
<fieldset class="repeating_advances">
<div class="extra-advances">
<select name="attr_skill" class="skill-choices">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<input type="number" name="attr_skill_cost" value="5">
</div>
</fieldset>
<span class="bold"># Owned: </span>
<input type="number" name="attr_number_advances" class="xp-cost" value="0" readonly>
<span class="bold">Total XP Spent: </span>
<input type="number" name="attr_xp_spent" class="xp-cost" value="0" readonly>
</div>
<div class="notes">
<input type="hidden" class="bio-toggled" name="attr_bio_toggled" value="0">
<div class="concept">
<button type="action" name="act_bio_toggle" class="bio-toggle" title="click to hide or show Bio section">
<h3>Bio (Age: <span name="attr_age">0</span>)</h3>
</button>
<textarea name="attr_concept" title="Concept" placeholder="CONCEPT:"></textarea>
<textarea name="attr_description" title="Description" placeholder="DESCRIPTION:"></textarea>
<div class="careers">
<div class="titles">
<h4>#</h4>
<h4>Legend</h4>
<h4 title="Type of Event: B = Battles, Invaders; L = Legend; P = Personal; T = Turmoil; S = Sorcery.&#10;&#13;Enter codes correctly using these letters and a number, separated by a space - S3 L1, etc.There is no error corection.">Event</h4>
<h4>Outcome</h4>
<h4>Skills</h4>
<h4>Specialty</h4>
</div>
<input type="hidden" name="attr_exit_flag" class="exit-toggle" value="0">
<fieldset class="repeating_careers">
<details class="career">
<summary>
<span name="attr_number" value="0"></span>
<select name="attr_legend" title="legend" class="noarrow">
<option selected>(select)</option>
<option>Adventurer</option>
<option>Brute</option>
<option>Buccaneer</option>
<option>Charlatan</option>
<option>Desperado</option>
<option>Diva</option>
<option>Duellist</option>
<option>Lifegiver</option>
<option>Loremaster</option>
<option>Primeval</option>
<option>Ranger</option>
<option>Scourge</option>
<option>Sellsword</option>
<option>Sorcerer</option>
<option>Tinkerer</option>
<option>Trickster</option>
<option>Undertaker</option>
<option>Wayfarer</option>
<option>Vizier</option>
<option>Warlock</option>
<option>Abomination</option>
<option>Cataphract</option>
<option>Chimera</option>
<option>Dispossessed</option>
<option>Dryad</option>
<option>Scion</option>
<option>Traveller</option>
</select>
<input type="text" name="attr_event" title="Legend Event" placeholder="Roll" class="event" value="">
<input type="text" name="attr_outcome" title="Legend Event Outcome" placeholder="Roll" class="outcome" value="">
<!-- not wide enough. Might do away with this and have a floating entry showing skills have you click the number -->
<!-- <input type="text" name="attr_skills" title="Legend Skills" placeholder="Legend Skills" value=""> -->
<textarea name="attr_skills"></textarea>
<select name="attr_specialty" title="Specialty Skill" class="skill noarrow">
<option selected>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<!-- <input type="number" name="attr_time" class="time" value="0"> -->
<input type="hidden" name="attr_exit_flag" class="exit-toggle" value="0">
</summary>
<div class="legend-desc">
<textarea name="attr_description" title="Lagend Description" placeholder="LEGEND" class="description"></textarea>
<input type="text" name="attr_where" title="Legend Homeland" placeholder="WHERE" class="where" value="">
<textarea name="attr_event1_description" title="Lagend Event" class="event1" placeholder="EVENT"></textarea>
<textarea name="attr_event2_description" title="Lagend Event" class="event2" placeholder="EVENT"></textarea>
<textarea name="attr_event3_description" title="Lagend Event" class="event3" placeholder="EVENT"></textarea>
<textarea name="attr_outcome_description" title="Lagend Event Ouctome" class="outcome" placeholder="OUTCOME"></textarea>
<textarea name="attr_notes" title="Lagend Event" placeholder="NOTES" class="note"></textarea>
</div>
<input type="number" name="attr_years" value="0">
</details>
<input type="hidden" name="attr_sanity" value="0">
</fieldset>
<div class="six-skills">
<h3>Personal Development</h3>
<select name="attr_skill_choice_1" class="skill-choices noarrow">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_2" class="skill-choices noarrow">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_3" class="skill-choices noarrow">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_4" class="skill-choices noarrow">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_5" class="skill-choices noarrow">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_6" class="skill-choices noarrow">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<input type="hidden" name="attr_skill_weird" value="0">
</div>
<!-- add button might be hidden, and replaced with an Exit roll button - which displays the result. -->
</div>
</div>
<div class="concept-toggled">
<button type="action" name="act_bio_toggle" class="bio-toggle" title="click to hide or show Bio section">
<h3>Bio</h3>
</button>
</div>
<div class="scratchpad">
<h3>Personal Notes</h3>
<fieldset class="repeating_notes">
<textarea name="attr_note" class="notes" placeholder="NOTE"></textarea>
</fieldset>
<br>
</div>
</div>
</div>
</div>
<div class="front">
<input type="hidden" class="toggle" name="attr_design_mode" value="design">
<div class="creation-front">
<h3>Lifepath (Age: <span name="attr_age">0</span>)</h3>
<input type="hidden" name="attr_terms" class="terms" value="1">
<button type="action" name="act_exit" class="exit terms" title="Click to Roll a New Term and Increase Age">
<h4>Roll Your Next Legend</h4>
</button>
<div class="careers">
<div class="titles">
<h4>#</h4>
<h4>Legend</h4>
<h4 title="Type of Event: B = Battles, Invaders; L = Legend; P = Personal; T = Turmoil; S = Sorcery.&#10;&#13;Enter codes correctly using these letters and a number, separated by a space - S3 L1, etc.There is no error corection. ">Event</h4>
<h4>Outcome</h4>
<h4>Skills</h4>
<h4>Specialty</h4>
</div>
<input type="hidden" name="attr_exit_flag" class="exit-toggle" value="0">
<fieldset class="repeating_careers">
<details class="career">
<summary>
<span name="attr_number" value="0"></span>
<select name="attr_legend" title="legend" class="noarrow">
<option selected>(select)</option>
<option>Adventurer</option>
<option>Brute</option>
<option>Buccaneer</option>
<option>Charlatan</option>
<option>Desperado</option>
<option>Diva</option>
<option>Duellist</option>
<option>Lifegiver</option>
<option>Loremaster</option>
<option>Primeval</option>
<option>Ranger</option>
<option>Scourge</option>
<option>Sellsword</option>
<option>Sorcerer</option>
<option>Tinkerer</option>
<option>Trickster</option>
<option>Undertaker</option>
<option>Wayfarer</option>
<option>Vizier</option>
<option>Warlock</option>
<option>Abomination</option>
<option>Cataphract</option>
<option>Chimera</option>
<option>Dispossessed</option>
<option>Dryad</option>
<option>Scion</option>
<option>Traveller</option>
</select>
<input type="text" name="attr_event" title="Legend Event" placeholder="Roll" class="event" value="">
<input type="text" name="attr_outcome" title="Legend Event Outcome" placeholder="Roll" class="outcome" value="">
<!-- not wide enough. Might do away with this and have a floating entry showing skills have you click the number -->
<!-- <input type="text" name="attr_skills" title="Legend Skills" placeholder="Legend Skills" value=""> -->
<textarea name="attr_skills"></textarea>
<select name="attr_specialty" title="Specialty Skill" class="skill noarrow">
<option selected>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<!-- <input type="number" name="attr_time" class="time" value="0"> -->
<input type="hidden" name="attr_exit_flag" class="exit-toggle" value="0">
</summary>
<div class="legend-desc">
<textarea name="attr_description" title="Lagend Description" placeholder="LEGEND" class="description"></textarea>
<input type="text" name="attr_where" title="Legend Homeland" placeholder="WHERE" class="where" value="">
<textarea name="attr_event1_description" title="Lagend Event" class="event1" placeholder="EVENT"></textarea>
<textarea name="attr_event2_description" title="Lagend Event" class="event2" placeholder="EVENT"></textarea>
<textarea name="attr_event3_description" title="Lagend Event" class="event3" placeholder="EVENT"></textarea>
<textarea name="attr_outcome_description" title="Lagend Event Ouctome" class="outcome" placeholder="OUTCOME"></textarea>
<textarea name="attr_notes" title="Lagend Event" placeholder="NOTES" class="note"></textarea>
</div>
</details>
</fieldset>
</div>
<!--<input type="text" name="attr_legend_choice_" class="legend-choices" list="legend_list" value="" /> -->
<input type="hidden" name="attr_skill_toggle" class="skill-toggle" value="0">
<div class="six">
<h3>Personal Skill Choices</h3>
<select name="attr_skill_choice_1" class="skill-choices">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_2" class="skill-choices">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_3" class="skill-choices">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_4" class="skill-choices">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_5" class="skill-choices">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_6" class="skill-choices">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
</div>
<div class="eight">
<span class="title">Skills:</span>
<select name="attr_skill_choice_1" class="skill-choices">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_2" class="skill-choices">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_3" class="skill-choices">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_4" class="skill-choices">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_5" class="skill-choices">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_6" class="skill-choices">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_7" class="skill-choices">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<select name="attr_skill_choice_8" class="skill-choices">
<option>(select)</option>
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting">Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
</div>
<!-- <input type="text" name="attr_skill_choice_" class="skill-choices" list="skill_list" value="" /> -->
</div>
<div class="bio">
<span class="bold">Name: </span>
<input type="text" name="attr_character_name" value="">
<div>
<span class="bold">Age: </span>
<input type="number" name="attr_age" value="0">
<span>+</span>
<input type="number" name="attr_days" value="0">
<span>Days</span>
</div>
<div class="wealth">
<span class="bold">Wealth: </span>
<!-- <select name="attr_wealth">
<option selected>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select> -->
<input type="number" name="attr_wealth" value="0">
</div>
<!--<span name="attr_legend_choice_1" class="legend-display" title="Homeland Legend"></span>
<span name="attr_legend_choice_2" class="legend-display" title="Renown Legend"></span>
<span name="attr_legend_choice_3" class="legend-display" title="Lifestyle Legend"></span> -->
</div>
<div class="glory">
<button type="action" name="act_glory-button" class="glory-button" title="click to reduce glory">
<span class="bold">Glory:</span>
</button>
<input type="number" name="attr_glory" value="0">
<button type="action" name="act_power-button" class="glory-button" title="click to reduce Power">
<span class="bold">Power:</span>
</button>
<input type="number" name="attr_power" value="0">
</div>
<div class="attack">
<h3>Attacks</h3>
<div class="attacks">
<h4>Attack</h4>
<h4>Skill</h4>
<h4 title="Skill modifiers">Mod</h4>
<h4 title="Damage either adds to damage or replaces it">Type</h4>
<h4>DMG</h4>
<!-- <h4>Notes</h4> -->
<h4>Roll</h4>
</div>
<fieldset class="repeating_attacks">
<div class="attacks">
<input type="text" class="name" name="attr_name" value="">
<select name="attr_skill" title="Choose the skill for attack rolls.">
<option value="astrology">Astrology</option>
<option value="athletics">Athletics</option>
<option value="battle">Battle</option>
<option value="blather">Blather</option>
<option value="carousing">Carousing</option>
<option value="changeling">Changeling</option>
<option value="contraptions">Contraptions</option>
<option value="daemonology">Daemonology</option>
<option value="etiquette">Etiquette</option>
<option value="fencing">Fencing</option>
<option value="fighting" selected>Fighting</option>
<option value="handiwork">Handiwork</option>
<option value="healing">Healing</option>
<option value="insight">Insight</option>
<option value="invocations">Invocations</option>
<option value="lore">Lore</option>
<option value="might">Might</option>
<option value="parley">Parley</option>
<option value="provoke">Provoke</option>
<option value="reflexes">Reflexes</option>
<option value="scout">Scout</option>
<option value="search">Search</option>
<option value="second_sight">Second Sight</option>
<option value="shooting">Shooting</option>
<option value="spirit">Spirit</option>
<option value="stamina">Stamina</option>
<option value="stealth">Stealth</option>
<option value="theatrics">Theatrics</option>
<option value="trickery">Trickery</option>
<option value="weird">Weird</option>
</select>
<input type="number" name="attr_mod" value="0" title="Does the weapon have a fixed and constant modifier?">
<select name="attr_damage_type" class="type" title="Use + for a damage bonus; use - for a fixed damage like a crossbow">
<option selected>+</option>
<option>-</option>
</select>
<input type="number" name="attr_damage_bonus" value="1">
<!-- <input type="text" name="attr_range" value=""> -->
<input type="hidden" name="attr_score" value="0">
<input type="hidden" name="attr_good" value="0">
<input type="hidden" name="attr_excellent" value="0">
<input type="hidden" name="attr_spectacular" value="0">
<input type="hidden" name="attr_poor" value="0">
<input type="hidden" name="attr_attack_string" value="0">
<button type="roll" class="hidden" name="roll_damage_roll" value="@{whisper_roll}&{template:pages} {{title=@{name} Damage}} {{subtitle=@{character_name} }} {{Damage ([[@{damage} + @{damage_bonus} + ?{Modifier|0}]]d6):=[[(@{damage} + @{damage_bonus} + ?{Modifier})d6cf0cs7]]}}"></button>
<input type="hidden" name="attr_roll_string" value="@{whisper_roll}&{template:pages} {{title=@{name} Attack }} {{subtitle=@{character_name} }} {{Score=**@{score}** (@{attack_string})}} {{modifier=[[@{modifier}]]}} {{roll=[[1d20cs0cf20]]}} {{average=[[@{score}+@{modifier}]]}} {{poor=[[2 * (@{poor}+@{modifier})]]}} {{good=[[floor(@{score}/2+@{modifier}/2)]]}} {{excellent=[[floor(@{score}/4+@{modifier}/4)]]}} {{spectacular=[[floor(@{score}/8+@{modifier}/8)]]}} {{desc=[Damage Roll](~repeating_attacks_damage_roll) }}">
<button type="roll" name="roll_attack" class="unmod" value="@{roll_string}"></button>
<!-- +?{Modifier|0}
-->
</div>
</fieldset>
</div>
<div class="gear">
<h3>Gear</h3>
<div class="gear-stats">
<div class="armour">
<span class="bold">Armour: </span>
<select class="load noarrow" name="attr_load_level">
<option value="0">(select)</option>
<option value="2">Light</option>
<option value="4" selected>Medium</option>
<option value="6">Heavy</option>
</select>
</div>
<div class="gear-item">
<span class="bold">Used: </span>
<input type="hidden" name="attr_load_limit" value="-" readonly>
<input type="number" name="attr_load_special" value="0" readonly>
</div>
<div class="gear-item">
<span class="bold">Carried: </span>
<input type="number" name="attr_carried" value="0" readonly>
</div>
<div class="gear-item">
<span class="bold">Other: </span>
<input type="number" name="attr_other" value="0" readonly>
</div>
</div>
<div class="slots">
<div class="grid-header">
<h4>Special Items</h4>
<h4>Slots</h4>
</div>
<input type="hidden" name="attr_load_hide1" class="load" value="1">
<div class="grid">
<details>
<summary>
<input type="text" name="attr_slot1_name" value="">
<input type="checkbox" name="attr_slot1_load" value="1">
</summary>
<textarea name="attr_slot1_drawback" placeholder="Weakness or Drawback"></textarea>
</details>
</div>
<input type="hidden" name="attr_load_hide2" class="load" value="1">
<div class="grid">
<details>
<summary>
<input type="text" name="attr_slot2_name" value="">
<input type="checkbox" name="attr_slot2_load" value="1">
</summary>
<textarea name="attr_slot2_drawback" placeholder="Weakness or Drawback"></textarea>
</details>
</div>
<input type="hidden" name="attr_load_hide3" class="load" value="1">
<div class="grid">
<details>
<summary>
<input type="text" name="attr_slot3_name" value="">
<input type="checkbox" name="attr_slot3_load" value="1">
</summary>
<textarea name="attr_slot3_drawback" placeholder="Weakness or Drawback"></textarea>
</details>
</div>
<input type="hidden" name="attr_load_hide4" class="load" value="1">
<div class="grid">
<details>
<summary>
<input type="text" name="attr_slot4_name" value="">
<input type="checkbox" name="attr_slot4_load" value="1">
</summary>
<textarea name="attr_slot4_drawback" placeholder="Weakness or Drawback"></textarea>
</details>
</div>
<input type="hidden" name="attr_load_hide5" class="load" value="1">
<div class="grid">
<details>
<summary>
<input type="text" name="attr_slot5_name" value="">
<input type="checkbox" name="attr_slot5_load" value="1">
</summary>
<textarea name="attr_slot5_drawback" placeholder="Weakness or Drawback"></textarea>
</details>
</div>
<input type="hidden" name="attr_load_hide6" class="load" value="1">
<div class="grid">
<details>
<summary>
<input type="text" name="attr_slot6_name" value="">
<input type="checkbox" name="attr_slot6_load" value="1">
</summary>
<textarea name="attr_slot6_drawback" placeholder="Weakness or Drawback"></textarea>
</details>
</div>
<input type="hidden" name="attr_load_hide7" class="load" value="1">
<div class="grid">
<details>
<summary>
<input type="text" name="attr_slot7_name" value="">
<input type="checkbox" name="attr_slot7_load" value="1">
</summary>
<textarea name="attr_slot7_drawback" placeholder="Weakness or Drawback"></textarea>
</details>
</div>
<input type="hidden" name="attr_load_hide8" class="load" value="1">
<div class="grid">
<details>
<summary>
<input type="text" name="attr_slot8_name" value="">
<input type="checkbox" name="attr_slot8_load" value="1">
</summary>
<textarea name="attr_slot8_drawback" placeholder="Weakness or Drawback"></textarea>
</details>
</div>
<input type="hidden" name="attr_load_hide9" class="load" value="1">
<div class="grid">
<details>
<summary>
<input type="text" name="attr_slot9_name" value="">
<input type="checkbox" name="attr_slot9_load" value="1">
</summary>
<textarea name="attr_slot9_drawback" placeholder="Weakness or Drawback"></textarea>
</details>
</div>
<input type="hidden" name="attr_load_hide10" class="load" value="1">
<div class="grid">
<details>
<summary>
<input type="text" name="attr_slot10_name" value="">
<input type="checkbox" name="attr_slot10_load" value="1">
</summary>
<textarea name="attr_slot10_drawback" placeholder="Weakness or Drawback"></textarea>
</details>
</div>
</div>
<div class="cc">
<div class="carried">
<h4>Mundane Items</h4>
<h4>Wt</h4>
<h4>#</h4>
<h4>X</h4>
</div>
<fieldset class="repeating_gear">
<div class="carried">
<input type="text" name="attr_name" value="">
<input type="number" name="attr_load" value="1">
<input type="number" name="attr_count" value="1">
<input type="checkbox" name="attr_checked" value="1" checked>
</div>
</fieldset>
</div>
</div>
<!-- <div class="stuff"> -->
<!--
<div class="passions">
<h3>Passions</h3>
<fieldset class="repeating_passions">
<div class="passion">
<input type="text" name="attr_name" value="" class="passion" placeholder="PASSION">
</div>
</fieldset>
</div>
-->
<div class="stats">
<h3>Stats</h3>
<h4>Name</h4>
<h4 title="Total Advances in that category">+</h4>
<h4>Score</h4>
<h4>G-E-S</h4>
<h4 title="Use this for modifuers that apply to more than one roll.">Mod</h4>
<input type="hidden" name="attr_Charm_toggle" class="toggle" value="1">
<div class="skill">
<button type="action" name="act_charm" class="skill nod20" >Charm</button>
<span class="center">
<span name="attr_Charm_advances" class="number">0</span>
<!-- <span class="number">-</span>
<span name="attr_Charm_max" class="number">0</span> -->
</span>
<span name="attr_Charm" class="number bold">0</span>
<input type="hidden" name="attr_Charm_hidden" value="0">
<span name="attr_Charm_levels" class="number">0-0-0</span>
<input type="number" name="attr_Charm_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_Ferocity_toggle" class="toggle" value="1">
<div class="skill">
<button type="action" name="act_ferocity" class="skill nod20" >Ferocity</button>
<span class="center">
<span name="attr_Ferocity_advances" class="number">0</span>
<!-- <span class="number">-</span>
<span name="attr_Ferocity_max" class="number">0</span> -->
</span>
<span name="attr_Ferocity" class="number bold">0</span>
<input type="hidden" name="attr_Ferocity_hidden" value="0">
<span name="attr_Ferocity_levels" class="number">0-0-0</span>
<input type="number" name="attr_Ferocity_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_Psyche_toggle" class="toggle" value="1">
<div class="skill">
<button type="action" name="act_psyche" class="skill nod20" >Psyche</button>
<span class="center">
<span name="attr_Psyche_advances" class="number">0</span>
<!-- <span class="number">-</span>
<span name="attr_Psyche_max" class="number">0</span> -->
</span>
<span name="attr_Psyche" class="number bold">0</span>
<input type="hidden" name="attr_Psyche_hidden" value="0">
<span name="attr_Psyche_levels" class="number">0-0-0</span>
<input type="number" name="attr_Psyche_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_Savvy_toggle" class="toggle" value="1">
<div class="skill">
<button type="action" name="act_savvy" class="skill nod20" >Savvy</button>
<span class="center">
<span name="attr_Savvy_advances" class="number">0</span>
<!-- <span class="number">-</span>
<span name="attr_Savvy_max" class="number">0</span> -->
</span>
<span name="attr_Savvy" class="number bold">0</span>
<input type="hidden" name="attr_Savvy_hidden" value="0">
<span name="attr_Savvy_levels" class="number">0-0-0</span>
<input type="number" name="attr_Savvy_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_Sharp_toggle" class="toggle" value="1">
<div class="skill">
<button type="action" name="act_sharp" class="skill nod20" >Sharp</button>
<span class="center">
<span name="attr_Sharp_advances" class="number">0</span>
<!-- <span class="number">-</span>
<span name="attr_Sharp_max" class="number">0</span> -->
</span>
<span name="attr_Sharp" class="number bold">0</span>
<input type="hidden" name="attr_Sharp_hidden" value="0">
<span name="attr_Sharp_levels" class="number">0-0-0</span>
<input type="number" name="attr_Sharp_mod" class="number" value="0">
</div>
<div class="skill">
<span class="bold">Totals:</span>
<span name="attr_total_advances" class="number">0</span>
<span name="attr_total_score" class="number">0</span>
</div>
</div>
<div class="derived">
<button type="action" name="act_body" class="recover-title" title="Roll remaining Body to survive.">
<h3>Derived Stats</h3>
</button>
<div class="damage-init">
<input type="hidden" name="attr_damage" value="1">
<button type="roll" name="roll_damage" class="damage nod20" value="@{whisper_roll}&{template:pages} {{title=Damage Roll}} {{subtitle=@{character_name}}} {{[[@{damage} + ?{Attack Size|Light or Unarmed (+0), 0|Typical or Medium hand Arms (+1),1| Heavy or 2-Handed (+2),2|Massive (+3),3|Super-Massive (+4),4} +@{modifier}]]d6 Damage=[[(@{damage} + ?{Attack Size} +@{modifier})d6cf0cs7]]}}" title="Damage Roll with weapon size">
<span class="bold">Damage:</span>
<span name="attr_damage_display" value="1d6cs7cf0" class="damage-roll bold"></span>
</button> <!--
<button type="roll" name="roll_initiative" class="damage nod20" value="@{whisper_roll}&{template:pages} {{title=@{character_name} rolls Initiative}} {{roll=[[1d6+@{initiative}+@{modifier} &{tracker}]]}}" title="roll initiative; select your token first">
<span class="bold">Initiative: <span name="attr_initiative" value="0"></span></span>
</button> -->
<button type="action" name="act_recover" class="nod20 recovery" title="Take a Breather, End of Scene Refresh, or Full Heal">
<span class="bold">Recovery: <span name="attr_recovery" value="0"></span></span>
</button>
</div>
<div class="health">
<button type="action" name="act_vigour-button" class="recover nod20" title="Reduce Vigour">
<h4>Vigour</h4>
</button>
<button type="action" name="act_power-button" class="recover nod20" title="Reduce Power">
<h4>Power</h4>
</button>
<button type="action" name="act_body-button" class="recover nod20" title="Reduce Body">
<h4>Body</h4>
</button>
<div>
<input type="number" name="attr_vigour" class="health-stats" value="0">
<span name="attr_vigour_max">0</span>
</div>
<div>
<input type="number" name="attr_power" class="health-stats" value="0">
<span name="attr_power_max">0</span>
</div>
<div>
<input type="number" name="attr_body" class="health-stats" value="0">
<span name="attr_body_max">0</span>
</div>
</div>
<div class="two-column">
<span class="bold" title="Based on Might and Stamina">Toughness: <span name="attr_toughness" value="0"></span></span>
<span class="bold wide" title="Based on Athletics and Reflexes">Evasion: <span name="attr_evasion" value="0"></span></span>
</div>
<!--
<button type="action" name="act_recover" class="recover nod20 recovery left-button" title="Take a Breather, End of Scene Refresh, or Full Heal">
<span class="left-button bold">Recovery: <span name="attr_recovery" value="0"></span></span>
</button>
<span class="bold inset-1">Move: <span name="attr_move" value="0"></span></span>
<span class="bold inset-2">Load: <span name="attr_load" value="0"></span></span>
-->
</div>
<div class="power">
<h3>Invocations</h3>
<fieldset class="repeating_power">
<input type="text" name="attr_name" value="">
</fieldset>
</div>
<div class="loyalties">
<h3>Loyalty</h3>
<div class="loyalty">
<h4>Target</h4>
<h4>#</h4>
</div>
<fieldset class="repeating_loyalty" >
<div class="loyalty">
<input type="text" name="attr_name" value="">
<input type="number" name="attr_quantity" value="0">
</div>
</fieldset>
</div>
<div class="vagaries">
<h3>Vagaries</h3>
<fieldset class="repeating_vagaries">
<details class="vagary">
<summary>
<input type="text" name="attr_name" value="" placeholder="VAGARY">
<input type="hidden" name="attr_owned" class="toggle" value="1">
<input type="checkbox" name="attr_use" class="toggled" value="1">
</summary>
<div class="details">
<span>Cost: </span>
<input type="number" name="attr_cost" value="10" placeholder="5">
<span>Owned: </span>
<input type="checkbox" name="attr_owned" value="1">
<textarea name="attr_description"></textarea>
</div>
</details>
</fieldset>
</div>
<!-- </div> -->
<div class="demon">
<h3>Bound Daemons</h3>
<input type="hidden" name="attr_sorcery_show" class="toggle" value="0">
<div class="sorcery toggled">
<button type="action" name="act_sorcery" class="skill nod20">Sorcery: <span name="attr_sorcery"></span></button>
<!-- <span>Sorcery: </span> -->
<span>&nbsp;</span>
<span name="attr_sorcery_levels"></span>
</div>
<div class="demon-buttons">
<button type="action" name="act_demonbreather">
<span>Breather</span>
</button>
<button type="action" name="act_demonrecovery">
<span>Recovery</span>
</button>
<button type="action" name="act_demonheal">
<span>Heal</span>
</button>
</div>
<!--need to add a box for binding strength. -->
<fieldset class="repeating_demons">
<hr>
<div class="one-demon">
<details>
<div class="daemon-hidden">
<span class="demon-type-label">Type:</span>
<div class="object">
<select name="attr_type" class="demon-type">
<option selected>(select)</option>
<option>Object</option>
<option>Independent</option>
<option>Contained</option>
<option>Possessor</option>
<option>Passenger</option>
<option>Ephemeral</option>
</select>
<input type="number" name="attr_binding" class="demon-binding" title="Binding Strength Level (Each Level is +/-4)" value="0">
</div>
<span >Desire:</span>
<input type="text" name="attr_desire" placeholder="DESIRE" value="">
<span >Need:</span>
<input type="text" name="attr_need" value="" placeholder="NEED">
<textarea class="a-note" name="attr_notes" title="Enter descriptive notes here" placeholder="ENTER DESCRIPTION"></textarea>
</div>
<summary>
<span class="bold demon" title="click me to show hidden fields" >Name:</span>
<input type="text" name="attr_name" title="The name you use to refer to the daemon" placeholder="NAME" value="">
<div class="demon-stats">
<button type="action" name="act_spirit" class="">
<span class="bold">Spirit</span>
</button>
<input type="number" name="attr_spirit" value="0">
<span class="stats">V/P/B:</span>
<input type="number" name="attr_vigour" title="vigour" value="0">
<input type="number" name="attr_power" title="power" value="0">
<input type="number" name="attr_body" title="body" value="0">
<input type="hidden" name="attr_vigour_max" value="0">
<input type="hidden" name="attr_power_max" value="0">
<input type="hidden" name="attr_body_max" value="0">
<input type="hidden" name="attr_row_id" value="">
<input type="hidden" name="attr_spirit_damage" value="">
<input type="hidden" name="attr_hidden_name" value="">
<button class="hidden" type="roll" name="roll_damage" value="@{whisper_roll}&{template:pages} {{title=@{hidden_name} Damage}} {{subtitle=@{character_name} Daemon}} {{Damage ([[ @{spirit_damage} +@{modifier}]]d6+[[@{spirit_damage} +@{modifier}]]):=[[ [[@{spirit_damage} +@{modifier} ]]d6cf0cs7 + [[@{spirit_damage} +@{modifier}]] ]]}}"></button>
<button class="hidden" type="roll" name="roll_weapon" value="@{whisper_roll}&{template:pages} {{title=@{hidden_name} Weapon}} {{subtitle=@{character_name} Daemon}} {{Damage ([[ @{spirit_damage} + @{weapon_select} +@{modifier}]]d6):=[[ [[@{spirit_damage} + @{weapon_select} +@{modifier} ]]d6cf0cs7 ]]}}"></button>
</div>
<textarea class="abilities" name="attr_abilities" title="Enter abilities here" placeholder="ENTER ABILITIES"></textarea>
</summary>
</details>
</div>
</fieldset>
</div>
<div class="skills">
<h3>Skills</h3>
<h4>Name</h4>
<h4>Stat</h4>
<h4 title="Number of Advances in this Skill. If Red you are exceeding the skill's current maximum.">+</h4>
<h4>Score</h4>
<h4>G-E-S</h4>
<h4 title="Use this for modifuers that apply to more than one roll.">Mod</h4>
<input type="hidden" name="attr_astrology_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_astrology" class="skill nod20">Astrology</button>
<span class="skill-stat center">Psyche</span>
<input type="hidden" name="attr_astrology_exceed_max" class="red" value="0">
<span name="attr_astrology_advances" class="number">0</span>
<span name="attr_astrology" class="number bold">0</span>
<span name="attr_astrology_levels" class="number">0-0-0</span>
<input type="number" name="attr_astrology_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_athletics_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_athletics" class="skill nod20">Athletics</button>
<span class="skill-stat center">Ferocity</span>
<input type="hidden" name="attr_athletics_exceed_max" class="red" value="0">
<span name="attr_athletics_advances" class="number">0</span>
<span name="attr_athletics" class="number bold">0</span>
<span name="attr_athletics_levels" class="number">0-0-0</span>
<input type="number" name="attr_athletics_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_battle_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_battle" class="skill nod20">Battle</button>
<span class="skill-stat center">Savvy</span>
<input type="hidden" name="attr_battle_exceed_max" class="red" value="0">
<span name="attr_battle_advances" class="number">0</span>
<span name="attr_battle" class="number bold">0</span>
<span name="attr_battle_levels" class="number">0-0-0</span>
<input type="number" name="attr_battle_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_blather_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_blather" class="skill nod20">Blather</button>
<span class="skill-stat center">Charm</span>
<input type="hidden" name="attr_blather_exceed_max" class="red" value="0">
<span name="attr_blather_advances" class="number">0</span>
<span name="attr_blather" class="number bold">0</span>
<span name="attr_blather_levels" class="number">0-0-0</span>
<input type="number" name="attr_blather_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_carousing_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_carousing" class="skill nod20">Carousing</button>
<span class="skill-stat center">Charm</span>
<input type="hidden" name="attr_carousing_exceed_max" class="red" value="0">
<span name="attr_carousing_advances" class="number">0</span>
<span name="attr_carousing" class="number bold">0</span>
<span name="attr_carousing_levels" class="number">0-0-0</span>
<input type="number" name="attr_carousing_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_changeling_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_changeling" class="skill nod20">Changeling</button>
<span class="skill-stat center">Ferocity</span>
<input type="hidden" name="attr_changeling_exceed_max" class="red" value="0">
<span name="attr_changeling_advances" class="number">0</span>
<span name="attr_changeling" class="number bold">0</span>
<span name="attr_changeling_levels" class="number">0-0-0</span>
<input type="number" name="attr_changeling_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_contraptions_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_contraptions" class="skill nod20">Contraptions</button>
<span class="skill-stat center">Savvy</span>
<input type="hidden" name="attr_contraptions_exceed_max" class="red" value="0">
<span name="attr_contraptions_advances" class="number">0</span>
<span name="attr_contraptions" class="number bold">0</span>
<span name="attr_contraptions_levels" class="number">0-0-0</span>
<input type="number" name="attr_contraptions_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_daemonology_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_daemonology" class="skill nod20">Daemonology</button>
<span class="skill-stat center">Psyche</span>
<input type="hidden" name="attr_daemonology_exceed_max" class="red" value="0">
<span name="attr_daemonology_advances" class="number">0</span>
<span name="attr_daemonology" class="number bold">0</span>
<span name="attr_daemonology_levels" class="number">0-0-0</span>
<input type="number" name="attr_daemonology_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_etiquette_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_etiquette" class="skill nod20">Etiquette</button>
<span class="skill-stat center">Savvy</span>
<input type="hidden" name="attr_etiquette_exceed_max" class="red" value="0">
<span name="attr_etiquette_advances" class="number">0</span>
<span name="attr_etiquette" class="number bold">0</span>
<span name="attr_etiquette_levels" class="number">0-0-0</span>
<input type="number" name="attr_etiquette_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_fencing_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_fencing" class="skill nod20">Fencing</button>
<span class="skill-stat center">Sharp</span>
<input type="hidden" name="attr_fencing_exceed_max" class="red" value="0">
<span name="attr_fencing_advances" class="number">0</span>
<span name="attr_fencing" class="number bold">0</span>
<span name="attr_fencing_levels" class="number">0-0-0</span>
<input type="number" name="attr_fencing_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_fighting_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_fighting" class="skill nod20">Fighting</button>
<span class="skill-stat center">Ferocity</span>
<input type="hidden" name="attr_fighting_exceed_max" class="red" value="0">
<span name="attr_fighting_advances" class="number">0</span>
<span name="attr_fighting" class="number bold">0</span>
<span name="attr_fighting_levels" class="number">0-0-0</span>
<input type="number" name="attr_fighting_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_handiwork_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_handiwork" class="skill nod20">Handiwork</button>
<span class="skill-stat center">Ferocity</span>
<input type="hidden" name="attr_handiwork_exceed_max" class="red" value="0">
<span name="attr_handiwork_advances" class="number">0</span>
<span name="attr_handiwork" class="number bold">0</span>
<span name="attr_handiwork_levels" class="number">0-0-0</span>
<input type="number" name="attr_handiwork_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_healing_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_healing" class="skill nod20">Healing</button>
<span class="skill-stat center">Savvy</span>
<input type="hidden" name="attr_healing_exceed_max" class="red" value="0">
<span name="attr_healing_advances" class="number">0</span>
<span name="attr_healing" class="number bold">0</span>
<span name="attr_healing_levels" class="number">0-0-0</span>
<input type="number" name="attr_healing_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_insight_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_insight" class="skill nod20">Insight</button>
<span class="skill-stat center">Charm</span>
<input type="hidden" name="attr_insight_exceed_max" class="red" value="0">
<span name="attr_insight_advances" class="number">0</span>
<span name="attr_insight" class="number bold">0</span>
<span name="attr_insight_levels" class="number">0-0-0</span>
<input type="number" name="attr_insight_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_invocations_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_invocations" class="skill nod20">Invocations</button>
<span class="skill-stat center">Psyche</span>
<input type="hidden" name="attr_invocations_exceed_max" class="red" value="0">
<span name="attr_invocations_advances" class="number">0</span>
<span name="attr_invocations" class="number bold">0</span>
<span name="attr_invocations_levels" class="number">0-0-0</span>
<input type="number" name="attr_invocations_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_lore_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_lore" class="skill nod20">Lore</button>
<span class="skill-stat center">Savvy</span>
<input type="hidden" name="attr_lore_exceed_max" class="red" value="0">
<span name="attr_lore_advances" class="number">0</span>
<span name="attr_lore" class="number bold">0</span>
<span name="attr_lore_levels" class="number">0-0-0</span>
<input type="number" name="attr_lore_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_might_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_might" class="skill nod20">Might</button>
<span class="skill-stat center">Ferocity</span>
<input type="hidden" name="attr_might_exceed_max" class="red" value="0">
<span name="attr_might_advances" class="number">0</span>
<span name="attr_might" class="number bold">0</span>
<span name="attr_might_levels" class="number">0-0-0</span>
<input type="number" name="attr_might_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_parley_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_parley" class="skill nod20">Parley</button>
<span class="skill-stat center">Charm</span>
<input type="hidden" name="attr_parley_exceed_max" class="red" value="0">
<span name="attr_parley_advances" class="number">0</span>
<span name="attr_parley" class="number bold">0</span>
<span name="attr_parley_levels" class="number">0-0-0</span>
<input type="number" name="attr_parley_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_provoke_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_provoke" class="skill nod20">Provoke</button>
<span class="skill-stat center">Charm</span>
<input type="hidden" name="attr_provoke_exceed_max" class="red" value="0">
<span name="attr_provoke_advances" class="number">0</span>
<span name="attr_provoke" class="number bold">0</span>
<span name="attr_provoke_levels" class="number">0-0-0</span>
<input type="number" name="attr_provoke_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_reflexes_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_reflexes" class="skill nod20">Reflexes</button>
<span class="skill-stat center">Sharp</span>
<input type="hidden" name="attr_reflexes_exceed_max" class="red" value="0">
<span name="attr_reflexes_advances" class="number">0</span>
<span name="attr_reflexes" class="number bold">0</span>
<span name="attr_reflexes_levels" class="number">0-0-0</span>
<input type="number" name="attr_reflexes_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_scout_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_scout" class="skill nod20">Scout</button>
<span class="skill-stat center">Savvy</span>
<input type="hidden" name="attr_scout_exceed_max" class="red" value="0">
<span name="attr_scout_advances" class="number">0</span>
<span name="attr_scout" class="number bold">0</span>
<span name="attr_scout_levels" class="number">0-0-0</span>
<input type="number" name="attr_scout_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_search_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_search" class="skill nod20">Search</button>
<span class="skill-stat center">Sharp</span>
<input type="hidden" name="attr_search_exceed_max" class="red" value="0">
<span name="attr_search_advances" class="number">0</span>
<span name="attr_search" class="number bold">0</span>
<span name="attr_search_levels" class="number">0-0-0</span>
<input type="number" name="attr_search_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_second_sight_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_second_sight" class="skill nod20">Second Sight</button>
<span class="skill-stat center">Psyche</span>
<input type="hidden" name="attr_second_sight_exceed_max" class="red" value="0">
<span name="attr_second_sight_advances" class="number">0</span>
<span name="attr_second_sight" class="number bold">0</span>
<span name="attr_second_sight_levels" class="number">0-0-0</span>
<input type="number" name="attr_second_sight_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_shooting_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_shooting" class="skill nod20">Shooting</button>
<span class="skill-stat center">Sharp</span>
<input type="hidden" name="attr_shooting_exceed_max" class="red" value="0">
<span name="attr_shooting_advances" class="number">0</span>
<span name="attr_shooting" class="number bold">0</span>
<span name="attr_shooting_levels" class="number">0-0-0</span>
<input type="number" name="attr_shooting_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_spirit_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_spirit" class="skill nod20">Spirit</button>
<span class="skill-stat center">Psyche</span>
<input type="hidden" name="attr_spirit_exceed_max" class="red" value="0">
<span name="attr_spirit_advances" class="number">0</span>
<span name="attr_spirit" class="number bold">0</span>
<span name="attr_spirit_levels" class="number">0-0-0</span>
<input type="number" name="attr_spirit_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_stamina_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_stamina" class="skill nod20">Stamina</button>
<span class="skill-stat center">Ferocity</span>
<input type="hidden" name="attr_stamina_exceed_max" class="red" value="0">
<span name="attr_stamina_advances" class="number">0</span>
<span name="attr_stamina" class="number bold">0</span>
<span name="attr_stamina_levels" class="number">0-0-0</span>
<input type="number" name="attr_stamina_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_stealth_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_stealth" class="skill nod20">Stealth</button>
<span class="skill-stat center">Sharp</span>
<input type="hidden" name="attr_stealth_exceed_max" class="red" value="0">
<span name="attr_stealth_advances" class="number">0</span>
<span name="attr_stealth" class="number bold">0</span>
<span name="attr_stealth_levels" class="number">0-0-0</span>
<input type="number" name="attr_stealth_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_theatrics_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_theatrics" class="skill nod20">Theatrics</button>
<span class="skill-stat center">Charm</span>
<input type="hidden" name="attr_theatrics_exceed_max" class="red" value="0">
<span name="attr_theatrics_advances" class="number">0</span>
<span name="attr_theatrics" class="number bold">0</span>
<span name="attr_theatrics_levels" class="number">0-0-0</span>
<input type="number" name="attr_theatrics_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_trickery_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_trickery" class="skill nod20">Trickery</button>
<span class="skill-stat center">Sharp</span>
<input type="hidden" name="attr_trickery_exceed_max" class="red" value="0">
<span name="attr_trickery_advances" class="number">0</span>
<span name="attr_trickery" class="number bold">0</span>
<span name="attr_trickery_levels" class="number">0-0-0</span>
<input type="number" name="attr_trickery_mod" class="number" value="0">
</div>
<input type="hidden" name="attr_weird_toggle" class="visibility-toggle" value="1">
<div class="skill">
<button type="action" name="act_weird" class="skill nod20">Weird</button>
<span class="skill-stat center">Psyche</span>
<input type="hidden" name="attr_weird_exceed_max" class="red" value="0">
<span name="attr_weird_advances" class="number">0</span>
<span name="attr_weird" class="number bold">0</span>
<span name="attr_weird_levels" class="number">0-0-0</span>
<input type="number" name="attr_weird_mod" class="number" value="0">
</div>
<span name="attr_skill_summary" class="summary" value=""></span>
</div>
<div class="numbers">
<h3>Glory</h3>
<input type="hidden" name="attr_glory_0" class="glory" value="0">
<div class="box">
<input type="hidden" name="attr_glory_0" class="glory" value="0">
<button type="action" name="act_glory_0" class="active">
<span>0</span>
</button>
<input type="hidden" name="attr_glory_1" class="glory" value="0">
<div class="box">
<input type="hidden" name="attr_glory_1" class="glory" value="0">
<button type="action" name="act_glory_1" class="active">
<span>1</span>
</button>
<input type="hidden" name="attr_glory_2" class="glory" value="0">
<div class="box">
<input type="hidden" name="attr_glory_2" class="glory" value="0">
<button type="action" name="act_glory_2" class="active">
<span>2</span>
</button>
<input type="hidden" name="attr_glory_3" class="glory" value="0">
<div class="box">
<input type="hidden" name="attr_glory_3" class="glory" value="0">
<button type="action" name="act_glory_3" class="active">
<span>3</span>
</button>
<input type="hidden" name="attr_glory_4" class="glory" value="0">
<div class="box">
<input type="hidden" name="attr_glory_4" class="glory" value="0">
<button type="action" name="act_glory_4" class="active">
<span>4</span>
</button>
<input type="hidden" name="attr_glory_5" class="glory" value="0">
<div class="box">
<input type="hidden" name="attr_glory_5" class="glory" value="0">
<button type="action" name="act_glory_5" class="active">
<span>5</span>
</button>
<input type="hidden" name="attr_glory_6" class="glory" value="0">
<div class="box">
<input type="hidden" name="attr_glory_6" class="glory" value="0">
<button type="action" name="act_glory_6" class="active">
<span>6</span>
</button>
<input type="hidden" name="attr_glory_7" class="glory" value="0">
<div class="box">
<input type="hidden" name="attr_glory_7" class="glory" value="0">
<button type="action" name="act_glory_7" class="active">
<span>7</span>
</button>
<input type="hidden" name="attr_glory_8" class="glory" value="0">
<div class="box">
<input type="hidden" name="attr_glory_8" class="glory" value="0">
<button type="action" name="act_glory_8" class="active">
<span>8</span>
</button>
<input type="hidden" name="attr_glory_9" class="glory" value="0">
<div class="box">
<input type="hidden" name="attr_glory_9" class="glory" value="0">
<button type="action" name="act_glory_9" class="active">
<span>9</span>
</button>
<input type="hidden" name="attr_glory_10" class="glory" value="0">
<div class="box">
<input type="hidden" name="attr_glory_10" class="glory" value="0">
<button type="action" name="act_glory_10" class="active">
<span>10</span>
</button>
</div>
<hr>
<button type="action" name="act_reset" class="reset" title="Unchecks all boxes; click this after gaining an Advance">
<h3>Reset</h3>
</button>
</div>
</div>
<!-- <input type="number" name="attr_stat1" value="10">
<input type="number" name="attr_stat2" value="5"> -->
<rolltemplate class="sheet-rolltemplate-pages">
<div class="sheet-container sheet-color-{{color}}">
<div class="sheet-header">
{{#title}}<div class="sheet-title">{{title}}</div>{{/title}}
{{#subtitle}}<div class="sheet-subtitle">{{subtitle}}</div>{{/subtitle}}
</div>
<!--
what fields should there be:
d20 roll, score, half score, 1/4 score, 1/8th score (A, G, E, S)
-->
<div class="sheet-content">
{{#allprops() title subtitle desc roll color modifier poor average good excellent spectacular desc damage}}
<div class="sheet-key">{{key}}</div>
<div class="sheet-value">{{value}}</div>
{{/allprops() title subtitle desc roll color modifier poor average good excellent spectacular desc damage}}
</div>
{{#^rollTotal() modifier 0}}
<div class="sheet-content">
<div class="sheet-key">Modifier</div>
<div class="sheet-value">{{modifier}}</div>
</div>
{{/^rollTotal() modifier 0}}
{{#roll}}
<div class="sheet-content">
<div class="sheet-key">Roll</div>
<div class="sheet-value">{{roll}}</div>
</div>
<div class="sheet-center sheet-border">
{{#rollTotal() roll 20}}
{{#rollGreater() roll average}}
**Terrible** (Special)
{{/rollGreater() roll average}}
{{#^rollGreater() roll average}}
**Poor** (0 Victories)
{{/^rollGreater() roll average}}
{{/rollTotal() roll 20}}
{{#^rollTotal() roll 20}}
{{#^rollGreater() roll spectacular}}**Spectacular** (4 Victories){{/^rollGreater() roll spectacular}}
{{#rollGreater() roll spectacular}}
{{#^rollGreater() roll excellent}}**Excellent** (3 Victories){{/^rollGreater() roll excellent}}
{{/rollGreater() roll spectacular}}
{{#rollGreater() roll excellent}}
{{#^rollGreater() roll good}}**Good** (2 Victories){{/^rollGreater() roll good}}
{{/rollGreater() roll excellent}}
{{#rollGreater() roll good}}
{{#^rollGreater() roll average}}**Average** (1 Victory){{/^rollGreater() roll average}}
{{/rollGreater() roll good}}
{{#rollGreater() roll average}}
{{#^rollGreater() roll poor}}**Poor** (0 Victories){{/^rollGreater() roll poor}}
{{#rollGreater() roll poor}}**Terrible** (Special){{/rollGreater() roll poor}}
{{/rollGreater() roll average}}
{{/^rollTotal() roll 20}}
</div>
{{/roll}}
{{#damage}}
<div class="sheet-content">
<div class="sheet-key">Damage</div>
<div class="sheet-value">{{damage}}</div>
</div>
{{/damage}}
{{#desc}}<div class="sheet-desc">{{desc}}</div>{{/desc}}
</div>
</rolltemplate>
<script type="text/worker">
const next_legend = 24;
const skill_template = {
"N/A": [], /* Without this, the skill choice drop down doesn't include the first value - it might like value 0 */
Aloof: ["Invocations", "Reflexes", "Shooting", "Spirit", "Stamina", "Stealth"],
Argumentative: ["Blather", "Carousing", "Fencing", "Fighting", "Provoke", "Reflexes"],
Brawler: ["Carousing", "Fencing", "Might", "Provoke", "Reflexes", "Stamina"],
Brawny: ["Fighting", "Handiwork", "Might", "Provoke", "Stamina", "Athletics"],
Charmer: ["Blather", "Carousing", "Etiquette", "Insight", "Parley", "Provoke"],
Commanding: ["Battle", "Etiquette", "Fighting", "Might", "Parley", "Stamina"],
Compassionate: ["Daemonology", "Healing", "Insight", "Invocations", "Parley", "Spirit"],
Crafty: ["Blather", "Contraptions", "Handiwork", "Lore", "Parley", "Trickery"],
"Know-It-all": ["Carousing", "Daemonology", "Handiwork", "Invocations", "Lore", "Spirit"],
Handy: ["Fighting", "Handiwork", "Reflexes", "Scout", "Shooting", "Might"],
Hunter: ["Athletics", "Might", "Scout", "Shooting", "Stamina", "Search"],
Investigator: ["Fencing", "Insight", "Scout", "Search", "Stealth", "Trickery"],
"Light-fingered": ["Athletics", "Blather", "Reflexes", "Search", "Shooting", "Trickery"],
Nosy: ["Blather", "Insight", "Lore", "Parley", "Provoke", "Search"],
Performer: ["Athletics", "Blather", "Carousing", "Insight", "Parley", "Theatrics"],
Sneaky: ["Athletics", "Carousing", "Parley", "Reflexes", "Stealth", "Trickery"],
Sorcerous: ["Astrology", "Daemonology", "Etiquette", "Invocations", "Parley", "Spirit"],
Spiritual: ["Fencing", "Invocations", "Provoke", "Scout", "Spirit", "Stamina"],
Superstitious: ["Astrology", "Daemonology", "Insight", "Invocations", "Lore", "Spirit"],
Warrior: ["Athletics", "Fencing", "Fighting", "Might", "Shooting", "Stamina"],
};
const calc_score = (score) => Math.floor(score);
const title = word => word.charAt(0).toUpperCase() + word.slice(1);
const xp_cost = l => l+6;
const xp_spent = l => (6 + l + 5)/2 * (l); //(min + max)/2 * steps
const roll =(sides = 6) => Math.floor(Math.random()*sides) +1;
const triangle = n => Math.floor((1+Math.sqrt((8 * n) +1))/2)-1;
const section_name = (section, id, field) => `repeating_${section}_${id}_${field}`;
const int = (score, fallback = 0) => parseInt(score) || fallback;
const seq = (how_many, start = 1) => [ ...Array(how_many).keys() ].map( increment => increment + start);
/* ========== SYSTEM SPECIFIC CONSTANTS ========== */
const skill_base = 8;
const skill_divider = 1;
const high_score = 100;
//const skill_per_advance = 3;
const choose_lifepath = "(select)";
const Ferocity_plus_Psyche = 1; // if use max(Ferocity, Psyche) = 0; add togetehr = 1. Might have this is a hidden attribute, set in the sheet's default settings
// might add a divider for max #advances; currenty 2 but in harsher games might be 3.
/* ========== END SYSTEM SPECIFIC CONSTANTS ========== */
const recovery = ['vigour','power','body',];
const recovery_types = ['breather','recovery','heal',];
var getSectionIDsOrdered = function (sectionName, callback) {
'use strict';
getAttrs([`_reporder_${sectionName}`], function (v) {
getSectionIDs(sectionName, function (id_array) {
let reporder_array = v[`_reporder_${sectionName}`] ? v[`_reporder_${sectionName}`].toLowerCase().split(',') : [],
ids = [...new Set(reporder_array.filter(x => id_array.includes(x)).concat(id_array))];
callback(ids);
});
});
};
/*
returns an array of all the relevant fields in multiple repeating sections.
sections: an object with keys - section name, and vvalues = array of field names.
passions: ['name'],
vagaries: ['name', 'use']
callback generates the fields array.
USAGE:
on('change:some-sections', () => {
const my_sections = {create sections object};
getSectionFields(my_sections, fields => {
// now you have an array of field names
// if you NEED the id in your code, you'll need to get that another way
// could possoble return an object containing fields, and each sections ids.
});
});
*/
const getSectionFields = (sections, callback) => {
const fields = [];
let keys = Object.keys(sections);
const burndown = () => {
let section = keys.shift();
getSectionIDs(`repeating_${section}`, ids => {
ids.forEach(id => sections[section].forEach(field => fields.push(`repeating_${section}_${id}_${field}`)));
if(keys.length) {
burndown();
} else {
callback(fields);
}
});
};
burndown();
};
const getSectionObject = (sections, callback) => {
const fields_object = {};
fields_object.fields = [];
let keys = Object.keys(sections);
const burndown = () => {
let section = keys.shift();
getSectionIDs(`repeating_${section}`, ids => {
fields_object.fields = ids.reduce((m, id) => [...m, ...sections[section].map(field => `repeating_${section}_${id}_${field}`)], fields_object.fields);
fields_object[section] = ids;
if (keys.length) burndown();
else callback(fields_object);
});
};
burndown();
};
const getSectionsOrdered = (sections, callback) => {
'use_strict';
const fields_object = {};
let keys = Object.keys(sections);
const reporders = keys.map(key => `_reporder_repeating_${key}`);
getAttrs(reporders, values => {
const burndown = () => {
let section = keys.shift();
getSectionIDs(`repeating_${section}`, ids => {
let reporder_array = values[`_reporder_repeating_${section}`] ? values[`_reporder_repeating_${section}`].toLowerCase().split(',') : [];
// sort the rows appropriately, and populate data[section] ids.
sorted_ids = [...new Set(reporder_array.filter(x => ids.includes(x)).concat(ids))];
fields_object[section] = sorted_ids;
// add to the fields_object
fields_object.fields = sorted_ids.reduce((m, id) => [...m, ...sections[section].map(field => `repeating_${section}_${id}_${field}`)], fields_object.fields ? fields_object.fields : []);
if (keys.length) burndown();
else callback(fields_object);
});
};
burndown();
});
};
on(seq(10).map(n => `change:slot${n}_load`).join(' '), () => {
getAttrs(seq(10).map(n => `slot${n}_load`), v => {
const sum = Object.values(v).reduce((all, one) => all + +one||0, 0);
setAttrs({
load_special: sum
})
});
});
on(seq(6).map(n => `change:xp${n}`).join(' '), (event) => {
if(event.newValue === '0' || event.sourceType === 'worker') return;
getAttrs(['glory'], v => {
const glory = +v.glory || 0;
setAttrs({glory: glory +1});
});
});
on('clicked:xp_commit', () => {
startRoll("!{{template:pages}}{{ask=![[?{Are You Sure? This will erase XP marks and update XP stat|No,0|Do It!,1}]]}}", (question) => { /*|Entire Character,3*/
const query = question.results.ask.result;
if(query) {
getAttrs([...seq(6).map(n => `xp${n}`), 'xp'], v => {
const sum = Object.values(v).reduce((all, one) => all + +one, 0);
const output = {};
Object.keys(v).forEach(n => {
output[n] = 0;
});
output.xp = sum;
//output.xp_visible = 0;
//output.sheet_tab = 'back';
//output.xp_button_visible = 0;
setAttrs(output, {silent:true});
});
}
});
});
on('change:character_name', () => {
getAttrs(['character_name'], v => {
const my_name = v.character_name;
const output = {};
output.name_check = (my_name.includes('(GM)') || my_name === 'GM') ? '1' : '0';
setAttrs(output);
})
})
const stats = [
"Charm",
"Ferocity",
"Psyche",
"Savvy",
"Sharp",
];
const skills_obj = {
"astrology": {stat: "Psyche", multiple: "0", initiative: "0"},
"athletics": {stat: "Ferocity", multiple: "1", initiative: "1"},
"battle": {stat: "Savvy", multiple: "0", initiative: "0"},
"blather": {stat: "Charm", multiple: "1", initiative: "0"},
"carousing": {stat: "Charm", multiple: "1", initiative: "0"},
"changeling": {stat: "Ferocity", multiple: "0", initiative: "0"},
"contraptions": {stat: "Savvy", multiple: "0", initiative: "0"},
"daemonology": {stat: "Psyche", multiple: "0", initiative: "0"},
"etiquette": {stat: "Savvy", multiple: "0", initiative: "0"},
"fencing": {stat: "Sharp", multiple: "1", initiative: "1"},
"fighting": {stat: "Ferocity", multiple: "1", initiative: "1"},
"handiwork": {stat: "Ferocity", multiple: "1", initiative: "0"},
"healing": {stat: "Savvy", multiple: "0", initiative: "0"},
"insight": {stat: "Charm", multiple: "1", initiative: "1"},
"invocations": {stat: "Psyche", multiple: "0", initiative: "1"},
"lore": {stat: "Savvy", multiple: "1", initiative: "0"},
"might": {stat: "Ferocity", multiple: "1", initiative: "0"},
"parley": {stat: "Charm", multiple: "1", initiative: "0"},
"provoke": {stat: "Charm", multiple: "1", initiative: "0"},
"reflexes": {stat: "Sharp", multiple: "1", initiative: "0"},
"scout": {stat: "Savvy", multiple: "1", initiative: "0"},
"search": {stat: "Sharp", multiple: "1", initiative: "1"},
"second_sight": {stat: "Psyche", multiple: "0", initiative: "0"},
"shooting": {stat: "Sharp", multiple: "1", initiative: "1"},
"spirit": {stat: "Psyche", multiple: "1", initiative: "0"},
"stamina": {stat: "Ferocity", multiple: "1", initiative: "0"},
"stealth": {stat: "Sharp", multiple: "1", initiative: "1"},
"theatrics": {stat: "Charm", multiple: "0", initiative: "0"},
"trickery": {stat: "Sharp", multiple: "1", initiative: "1"},
"weird": {stat: "Psyche", multiple: "0", initiative: "0"},
};
const legends_obj = {
"adventurer": {skill: "Fighting,Invocations,Might,Provoke,Search,Stamina,Shooting,Stealth", description: "A soldier of fortune, a mercenary seeking fame and glory, often out only for themself. Maybe they are frustrated with the strictures of society, or are fleeing some life-changing consequence. Some adventurers have a code of honour and see themselves as champions of those who cant defend themselves. Others respect only strength and have contempt for the weak.", homeland: "(REROLL)", vagary: "Opportunist",
event: "MURDER: You are accused of committing murder or equally serious crime. Did you do it? Was there a good reason? What was the bad reason?,CONSPIRACY: You are a blunt object to be thrown at your enemies And so when you were thrust into intrigues and politics for which you were poorly prepared chaos ensued. You survived by your skill at arms but those around you may not have been so fortunate. ,DOWAGER: Facing an arranged marriage you found a life of adventure attractive. Did you leave behind a broken heart and angry family? Did they arrange for your doom to avoid the marriage?,CHAMPION: You protected those who needed your skills. Were you protecting those who needed you or those who could afford you? Were you breaking the heads of those who deserved it or those who got in your way?,PRIZE: You made a huge prize and lived like a queen. Maybe others helped to gain this prize and then you turned on each other. People came to you to benefit from your fortune. Their polite requests became greedy demands.,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"brute": {skill: "Athletics,Carousing,Fighting,Handiwork,Might,Provoke,Spirit,Stamina", description: "You can perform great feats of strength, smashing things and frightening people. Were you a physical labourer, a berserker, or an almost-human Ogre? Were you a gang bosss enforcer, or a nobles pet strongman, a gentle giant protecting the weak, or part of a travelling freak show?", homeland: "Ogre-kin", vagary: "Mighty Thews",
event: "BERSERKER: Your great strength sometimes got you into trouble. One day you killed someone perhaps defending another and had to flee. Or you were seen as a monster and hunted.,BRAWLER: You lived the rough and tumble life and may have been an enforcer for criminal gangs. Maybe you spent your time in taverns and fights started once you began drinking. ,PERFORMER: You made a living with your strength entertaining crowds or perhaps a specific patron. You werent good with people but you were good with your hands. Did you do something to turn the crowds or your patron against you? ,GENTLE GIANT: You were a respected member of your community and seen as a gentle giant. Perhaps you were the one people turned to in times of trouble. How did it ome to an end?,OGROMYTH: You met another Ogre who claimed to know of the fabled land of giants perhaps your homeland. What happened to her? Were you friends or enemies?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"buccaneer": {skill: "Athletics,Carousing,Fencing,Handiwork,Lore,Parley,Reflexes,Shooting", description: "Youve spent years on the water, whether navigating seas, rivers, or canals. Youre an acrobatic swashbuckler. Were you a pirate, smuggler, explorer, sea monster hunter, or honest merchant captain?", homeland: "Living Sea", vagary: "Daredevil",
event: "SEA MONSTER: Your ship fought a sea monster like a whale or sea serpent. Maybe your captain was driven by a hunger or you sought to protect a settlement. ,SHIPWRECK: Your ship sank in dire situations. Perhaps a storm or attempting a difficult passage. Did you excel in helping crew or save only yourself as others drowned?,PIRATE: Your ship engaged in smuggling or piracy or similar unsavoury activities. Were you an enthusiastic part of this or was it a practice you only learned after the fact? How did affect you?,BOARDEDING: Your ship was boarded by pirates. Did you triumph in fighting alongside crewmates in repelling boarders or did you suffer defeat and save yourself?,CAPTAIN: You were captain of a crew of buccaneers. You had a variety of adventures together and had the opportunity to gain their respect or their enmity.,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"charlatan": {skill: "Blather,Carousing,Insight,Parley,Reflexes,Scout,Theatrics,Trickery", description: "You may be a simple merchant, peddler, or gambler, but your life hides a secret, perhaps one that has caused you to be driven from past communities. Maybe you are a huckster peddling fraudulent wares, a scoundrel who exploits their fellows, or a spy for a higher power. ", homeland: "Derespine", vagary: "All For One",
event: "LIBERTINE: You appreciated the finer things in live and would not be denied them. Were you a dissolute drinker and addict? Were you a scoundrel gambling away the gifts of others? Were you a helpless romantic with a heart of gold but no ability to resist temptation?,HUCKSTER: You were a scoundrel selling fraudulent wares. Maybe you intended to help your prey but you were deceived by your own suppliers. Some of your patrons consider themselves cheated. Maybe you ran a con-game or two…,MERCHANT: You may have set up your own business or worked for another. You practiced your mercantile skills and may have settled down. What went wrong why did it end? ,SPY: You went undercover perhaps to gather information. Who were you working for and who is offended? What did you do to maintain your cover? Were you exposed? Were you rewarded? Were your forced into the job and did you sell out your employer?,ADVOCATE: As a scribe or lawyer your position gave you the opportunity to act as an advisor with the risks that come with it. Did you advocate for the less fortunate or concentrate on lining your pockets or fleece those who could lose a little?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"desperado": {skill: "Carousing,Fencing,Provoke,Reflexes,Scout,Shooting,Stealth,Trickery", description: "You lived on the move, as a bounty hunter, highwayman, road marshal keeping the roads safe, noble sent into exile, or refugee from a conquered nation. You can vanish into the undergrowth, or track people through the wilds and towns.", homeland: "Homeless Exile ((REROLL))", vagary: "Forgotten",
event: "FUGITIVE: You were hunted and spent your time evading your hunters. Perhaps you hailed from a conquered land or were thought guilty of a crime you didnt commit (or did). Perhaps you helped those in dire straits while being hunted or exploited the good nature of others…,BRIGAND: You were a member of a criminal gang who preyed on the rich to feed the poor or maybe just themselves. Your gang remembers you fondly (unless you betrayed them!).,SPY: While being hunted or pursing a bounty you spent too long undercover. Did you commit crimes to blend in or lose yourself for a while? Are there people who the deeds you carried out as your false identity?,DASHING: Some bandits of the highway get a reputation as being dashing and even romantic. There are those who boast about being robbed by you. Did they lie or build up your mystique?,MARSHALL: You gained a reputation for tracking those with a bounty on their heads and were perceived as a law of the wild. Was it a valid reputation? Did you arrest or kill someone who didnt deserve it?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"diva": {skill: "Blather,Carousing,Etiquette,Insight,Parley,Provoke,Spirit,Theatrics", description: "You sway opinions and emotions as long as you keep a patrons attention. An artist or performer who gained celebrity? A wealthy socialite? A rabble-rousing agitator of the common people? A charming seducer and libertine? Or a roguish diplomat sent into trouble spots to solve problems.", homeland: "Lampoon", vagary: "Loose Lips",
event: "AGITATOR: You were a central figure in a movement that unseated people in power and started riots. Was it a peasant movement or war between guilds? Did you use the movement to settle personal scores or even start such movements for selfish reasons,LIBERTINE: A romancer and seeker of the finer things in life. You left a trail of broken hearts in your wake.,FACE: You were the public face of some enterprise or gang. Did you smooth over crimes? Wee you are con artist?,DIPLOMACY: You helped negotiate a settlement between guilds or nobles or nations and the result had the power to harm many people. Did the negotiation go well? Was it derailed by violence or intrigue? ,CELEBRITY: You gained some celebrity from your performances. Some fought over you or used you as a pawn in political games. Did you relish the celebrity or hide your fame?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"duellist": {skill: "Athletics,Etiquette,Fencing,Fighting,Provoke,Reflexes,Stamina,Theatrics", description: "You fought in formal duels or street fights. Were you an upstart street fighter, or trained in a fighting school? Were you drawn to honour, glory, and riches, or just down on your luck? Are you a swashbuckler, or bully and ruffian? Do you champion those in need or just love a good brawl?", homeland: "Mirthrendor", vagary: "Swash",
event: "STREET FIGHTER: You fought on the streets among the common people. Perhaps you defended those who couldnt defend themselves or worked as an enforcer for a gang. Or perhaps you just fought for the love of the duel.,GLADIATOR: You found yourself a gladiator in the slave pits. Did you win fame and fortune? Was you tricked to take part for a specific duel or did you make a life of it? Did you win freedom or make an escape?,VIGILANTE: You sought justice or revenge using your skill at arms. You were forced to live a double life and hide your real identity in your quest. Was it and your actions eventually discovered? Did your quest lead you into actions you are ashamed or proud of?,PARAMOUR: You found yourself engaging in one duel after another for higher ideals. Were you hoodwinking into fighting for a romance who was just using you or were you the only hope of your trapped paramour?,DUELLIST: A scion of a minor aristocratic family or raised up by marriage or wealth. You lived among the aristocracy but had to prove your worth and your sword was ready. Perhaps too ready. ,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"lifegiver": {skill: "Blather,Etiquette,Healing,Insight,Invocations,Provoke,Scout,Spirit", description: "You know how to use the wilds to heal, making concoctions and poultices. Were you a lifegiver, a simple herbalist, a mystic who reveres and seeks to understand nature, a snake oil huckster, or a priest of the wild folk appeasing the Sleeping Gods with offerings for aid?", homeland: "Festivus", vagary: "Blessed",
event: "TORTURER: You used your skills for interrogation and torture. Maybe this was legitimate - like a legal investigation. Maybe you were a member of a violent team out for information. Your ability to heal people after harming them and cause pain without lasting injury was useful.,HUCKSTER: As a physician or herbalist you could make legitimate-sounding concoctions that appeared to do more than they did. Did you struggle for success and sell to the infirm and desperate? Or did you tend to the rich and famous with fanciful treatments until fate caught up with you?,HEALER: As a physician or herbalist you treated the sick and infirm. Did your treatments work? Did you gain the trust of people around you?,DRUID: Those with the power to bring people back from the brink of death are often thought to have gifts of wisdom. Did you exploit this perception or did you resist the fan movement gathering about you?,PATRON: You were a personal healer to someone important (as befitting your skill). Did you keep them fit and healthy r did they die under your scalpel?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"loremaster": {skill: "Blather,Daemonology,Etiquette,Insight,Invocations,Lore,Search,Spirit", description: "A scholar, philosopher, and know-it-all, you have a keenly deductive mind. You investigate mysteries, arbitrate disputes, and make enemies.", homeland: "Infinite Library", vagary: "Revelations",
event: "KNOW IT ALL: You learned or exposed something possibly something you shouldnt know. Maybe you made someone look bad for their incompetence maybe even a superior. ,SCRIBE: You kept the books for a simple construction or small business - or maybe even an entire guild or some aspect of a nation. Did you explore the meaning of the word embezzlement? Or did you discover inaccuracies by your employer and resist pressure to keep it quiet? Are there people who blame you for the result?,INQUISITOR: You were an investigator of crimes and rooting out criminals naturally created enemies. Did you use your position to settle personal scores or punish the wrong victim? Were you a noble incorruptible investigator who made enemies through your code?,CONSPIRACY: You discovered an intrigue involving people in power. Did you expose it or profit personally from keeping your mouth shut? Id you aid the conspiracy?,ARBITER: You helped negotiate a settlement between guilds or nobles or nations and the result had the power to harm many people. Did the negotiation go well? Was it derailed by violence or intrigue?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"primeval": {skill: "Athletics,Fighting,Handiwork,Healing,Scout,Shooting,Stamina,Stealth", description: "There is an uncultured roughness about you. Did you spurn city life to live off the land? Were you marooned in a strange land, surviving by your wits? Were you born among supposedly primitive clansfolk and now explore the decadent wonders of civilisation?", homeland: "Outland Tribe", vagary: "Barbarian",
event: "MAROONED: You were shipwrecked or abandoned for dead and were adopted by tribesfolk. Did you prove yourself one of them or did you show score and leave the first chance you got? ,DECADENCE: You are associated with too many “civilised” ways (or other non-traditional ways or even forbidden ways such as the Cult of the Forbidden God). Did you prove yourself despite this tarnish or were you driven out justly or unjustly?,BLOOD FEUD: You were involved in intrigue and rivalry with another (or a group or family) within your tribe. How did it start? Did you kill someone or were you in the way of someones ambitions? ,WAR!: Your tribe went to war with another tribe. Was it a war of conquest or self-defence? Did your forces win or lose? Did the war cost you your position?,CHIEF: You found yourself in command of your tribe at a time of trouble (or were an important advisor). Were you a good leader and did you overcome these challenges? Does your tribe still exist?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"ranger": {skill: "Athletics,Handiwork,Might,Reflexes,Scout,Search,Shooting,Stealth", description: "You are at home in the wilds and and spent years as a big game hunter, hired assassin, or dashing outlaw.", homeland: "Viand", vagary: "Eagle Eye",
event: "ASSASSIN: You killed someone for vengeance or money. Or were you implicated in a plot to do so? ,OUTLAW: You are declared Outlaw for a serious crime. Did you commit murder or were you framed? Did you do good for villagers and gain their aid? Did you profit over the weak and poor?,HERMIT: You spurned civilisation and lived off the land. Or maybe you were a hunter or trapper? Were you hired by local military as a scout? Were you a guerrilla and freedom fighter?,BIG GAME HUNTER: A town village or steading faced the rampages of a wild beat or monster Did you kill it or drive it off. Were you defeated or did you evade this opportunity? Did you gain a reputation hunting beasts?,CONTEST: Theres a prestigious contest of archery or survival or some other outdoor skill. Did you fair and square? Did you or others cheat? What was the contest over?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"scourge": {skill: "Carousing,Daemonology,Fencing,Invocations,Lore,Second Sight,Spirit,Stealth", description: "Scourges are hunters and investigators, rooting out rogue sorcerors and demons broken out of their bindings. Scourges usually prefer to avoid magic, except for those bindings and wardings used to trap and banish demons and neutralise sorcerers.", homeland: "Crucible", vagary: "Quickening",
event: "AMONG US: You find a rogue daemon trying to blend into society. Was it a Possessor taking someones life? Was it another kind of daemon whose pursuit of their Need caused harm? As a daemon they were just wrong? Did you slay the daemon or did others beat you to the prize or did it get away?,MONSTER: Rogue daemons usually go wild and kill people. Some are monstrous beasts who plague a community or region. Your skills were called in to help hunt such a beast. Did you kill it?,RIVALRY: You served in or trained with a unit of daemon-hunters. You had a rivalry with a fellow hunter. What was this rivalry over and did it come to blows?,WARDING: You protected or attempted to a household or individual from daemonic attacks. Were you successful? ,EXORCISM: A possessed individual was using their position of influence for a malevolent sorcerer. Was the exorcism successful? Did they use their position to oppose you?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"sellsword": {skill: "Battle,Carousing,Fencing,Fighting,Might,Provoke,Shooting,Stamina", description: "A veteran of battle, as a courageous or resourceful soldier. Was your unit victorious or tragically defeated? Did you seize land as a bandit warlord, or save a land from invaders? Have you been a mercenary, an enforcer or champion for an overlord, or tutor for Scions?", homeland: "Fendish", vagary: "Defender",
event: "WARLORD: You were a member or commander of a bandit company. Such companies are hired by nobles to raid and pillage their rivals with deniability. Sometimes they become truly independent and conquer land and become true robber-barons.,MERCENARY: After gaining skill in battle you became a sword-for-hire. Swords for hire cant afford to be choosy over their jobs. Did you maintain a code of honour? ,BATTLE: Your claim to fame is your success (or failure) at a specific battle. Do people remember your exploits well or badly?,CHAMPION: Skilled warriors are often recruited as enforcers by the wealthy. Or as judicial champions who fight duels to defend the law (or those being threatened by those with more power). Some gain fame and fortune.,TUTOR: Skilled warriors often find a lucrative job as a tutor for the scions of nobility or other wealthy types. Or set up their school. Such a position is often accompanied by prestige and power.,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"sorcerer": {skill: "Astrology,Daemonology,Invocations,Lore,Parley,Second Sight,Spirit,Theatrics", description: "Who risks their sanity to summon daemons? Were you seeking wealth and power, aiding others, or avenging some wrong? Were you a respectable sorcerer with a wealthy patron, a truth seeker, a blood mage clinging to old ways, or a rogue who practiced their art in secret?", homeland: "Sanguine", vagary: "Blood Magic",
event: "PITCHFORKS: A mob of locals came for you and your mentor and drove you out of the community but at what cost? Did they suffer from your magical might? Were the pitchforks justified or just superstition and rumours?,DRAWING BOARD: Sorcerers sometimes try to summon daemons into animals and create new life and monstrous beasts. Did you or your mentor conduct such experiments or did you act against such mad science by another sorcerer before their monsters went wild? ,RIVALRY: Another sorcerer apposed your progress or vice-versa. Were they a fellow student or have a separate origin? What was this rivalry over? Was it a healthy rivalry or a blood feud?,SORCERY: You or your mentor were called on by a community for assistance. Or you sought to punish or destroy your enemies. Did your sorcery succeed or backfire? ,MENTOR: You had a powerful mentor or patron. Did something happen to them? What kind of mentor were they a figure of fear or justice? Did you have to choose between them and something else?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"tinkerer": {skill: "Contraptions,Handiwork,Invocations,Lore,Parley,Search,Spirit,Trickery", description: "You are driven to understand how things work, and make fine art, enchanted items, clockwork golems, or Macguyver-esque temporary inventions. Were you unwittingly caught up in a political plot? Did a patron support you until one of your creations backfired?", homeland: "Tournaline (Mettle)", vagary: "Glassmancer",
event: "HERESY: You were exposed to ideas about how the world works - either by your mentor or rival or even your own inquisitive mind. This argument was against the widespread use of daemons. Such heresy attracts enemies.,ANVILPUNK: Your mastery of technology led to the creation of mysterious gadgets like a sword-cane or exploding volcanic glass - even glider wings. Did your inventions prove successful or disastrous?,MASTERWORK: You were known for your fine work on smaller items such as swords and forges or even houses. Was your work responsible for harm? Did your business fail or rise to prominence? Did you gain rivals out to destroy you?,BUILDER: You were involved in a major construction taking years a ship or viaduct or grandiose building like a tomb or palace. Did a collapse lead to death and survivors blaming you for the failures? Did the construction save lives?,PATRON: Successful builders and crafters need patrons. Was yours responsible or corrupt? Did they support your free-thinking or ruthless exploit your creations? Did this position lead into intrigue? Was your patron brought down by enemies?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"trickster": {skill: "Athletics,Blather,Parley,Reflexes,Search,Shooting,Stealth,Trickery", description: "You are skilled at getting in and out of places, hiding and finding things, and dextrous feats of sleight of hand. Were you a pickpocket, cat burglar, or a performing street magician?", homeland: "Sanctuary", vagary: "Gambit",
event: "RED-HANDED: You were caught red-handed in the commission of some crime. Maybe your team-mates left you in the lurch. While serving your time did you make friends or enemies? ,RAT: You were forced to sell others out to stay out of trouble. Force might not have been necessary if they deserved it. Or maybe you were sold out.,BUSKER: You made a living by entertaining people on the streets. Perhaps even as a street magician with sleight of hand. People may have later found their purses and money pouches missing.,CAT: You made a habit of entering other peoples houses. Usually above ground level and leaving better off than you entered.,HEIST: You attempted a major crime with a team and may have made a killing. In more ways than one. Did the heist go bad? Did you steal a big prize and gain a reputation?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"undertaker": {skill: "Athletics,Daemonology,Lore,Reflexes,Search,Spirit,Stealth,Trickery", description: "The land is littered with the ruins of lost settlements, and someone needs to record their discoveries for posterity. And archive the gold and artefacts they constructed. For... er... posterity.", homeland: "Hexlands Near (REROLL)", vagary: "Deflection",
event: "HEXED: A member of your party (maybe you) unleashed a curse in a quest for treasure or the mysteries of a lost land. Were you able to halt the curse and save lives or did a doom come to pass?,CORRUPTION: One of your prizes turned out to spread corruption. Perhaps a possessing daemon which afflicted you or those around you until exorcism. Or perhaps an enchantment with mysterious effects.,DELVER: You went through a lot of team-mates in your quest for mysteries of the deep or the hexlands. Were your teammates hexed or corrupted or maimed? Did you save trapped team-mates?,EXPERT: You were called in to help analyse a mysterious artefact. Did you make a mistake and unleash a horrifying monster? Did your actions avert a disaster?,RICHES: Your prizes allow you to live like a queen for a while and you were sought for your skill at delving and antiquities.,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"wayfarer": {skill: "Astrology,Athletics,Blather,Handiwork,Lore,Parley,Scout,Parley", description: "You have spent years wandering, by land and sea, and learned of the aetheric winds and the skills needed to travel this world safely. Were you charting the unknown in search of conquest, treasure, glory, or knowledge? Or were you an exiled wanderer or rootless vagabond? Your tales of strange lands have power.", homeland: "Fountain", vagary: "Tall Tales",
event: "VAGRANT: You had lost everything and were down on your luck. You lived off the benevolence of others. You might have been a servant or wanderer doing odd jobs.,ODYSSEY: As an explorer you travelled far and wide on an odyssey for some fabled prize like a lost city or island. Perhaps your crew fell upon each other along the way…,STRANGER: You travelled far beyond the known world. You settled for a while but it came to an end. Did you violate local customs or make an enemy. Were you drawn back to the world you knew? What or who did you leave behind?,EXPLORER: You were renowned as a traveller and explorer and were sought as a guide by many ships seeking new lands. Did any of these crews pay a dear price for their trust?,PRIZE: You made a huge prize and lived like a queen. Maybe others helped to gain this prize and then you turned on each other. People came to you to benefit from your fortune. Their polite requests became greedy demands. ,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"vizier": {skill: "Battle,Blather,Etiquette,Fencing,Insight,Lore,Parley,Provoke", description: "You had a position of wealth, power, authority. How did you lose it? A functionary, governing a domain for your ruler. A sheriff or spymaster, involved in intrigues and schemes. A guildmaster or wealthy merchant, administering a commercial empire. A fence, or underworld crime boss.", homeland: "Labyrinth", vagary: "Mysteries",
event: "UNREST: Your actions or those of your superior (or perhaps the actions of enemies) led to unrest in your domain. You were called to put down the unrest violently. Did you resist or accept and did this cause the loss of your position?,CONSPIRACY: A vizier always answers to another. You discovered a plot against your superior were recruited into it. Did you side with conspiracy (perhaps for good reason) or defend your superior?,INTRIGUE: You find yourself in competition with rivals for your superiors favour. Did you gain or lose favour? Did your domain suffer in your quest for favour? Did you stand by your principles and lose status due to it? ,SAFEGUARD: You were charged with looking after an important personage. Perhaps supervising a wedding or prisoner exchange. Or raising a powerful ward. Did something happen to them? Did you look the other way in exchange for good fortune?,COMMANDER: Your domain was raided by a rival or invaded and you had to gather troops to defend the land in battle. Did you show good leadership? Did you leave the peasants to fend for their themselves?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"warlock": {skill: "Blather,Carousing,Daemonology,Invocations,Parley,Provoke,Reflexes,Theatrics", description: "A warlock is a sorcerer without a support system, or more accurately, a fraud. You claim to know more about the arcane arts than you do, making it up as you go along, using other&#x27;s belief in your powers to gain influence and power. You sometimes surprise those who see through you, since you have learned some tricks.", homeland: "Spiral", vagary: "Totally Normal",
event: "PITCHFORKS: Your tales of being a powerful sorcerer worked too well. A mob of locals blamed you for some local calamity and stormed your tower.,PRETENDER: A sorcerer felt upstaged by you or someone saw through your act and sought to expose you. Were you able to keep up the act or were you exposed?,SORCERY: You were called on by a community to use your magic to aid them. Were you able to trick them into believing your lies or were you exposed?,SORCERER: You have learned bits and pieces of sorcery and used real power. Did you fend off your unbelieving enemies? Did your enemies accept this or see it as part of your act?,PATRON: Someone with power and influence believed your tales and took you as an advisor and court sorcerer. Did your web of lies catch up with you? Did your patron suffer ir did they discover for deception?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"abomination": {skill: "Athletics,Changeling,Might,Provoke,Reflexes,Scout,Spirit,Stamina", description: "You were Lost in the Mist or the Underworld, and can now alter your body, taking on bestial characteristics. Superstitious folk discovered the hidden marks of monstrous corruption, forcing you into the life of a fugitive for a time. Your new identity and life is safe, for now...", homeland: "Mists of Madness: (REROLL)", vagary: "Changeling",
event: "SLAUGHTER: Your entire community was swallowed by the Mists and only a few survived all of them Abominations. Did you fight each other when the blood lust hit? ,RAMPAGE: You were one of the few swallowed by the Mists. You attacked those who loved you. Did you kill them? Was it discovered? Were you hunted as the monster you are?,COVER: You tried to hide your new nature and love as normal. When did the change come upon you? When alone with a loved one or to defend family when they were attacked? When you fled your community were there people who still believed in you?,SLAUGHTER: Your entire community was swallowed by the Mists and only a few survived all of them Abominations. Did you fight each other when the blood lust hit? ,RAMPAGE: You were one of the few swallowed by the Mists. You attacked those who loved you. Did you kill them? Was it discovered? Were you hunted as the monster you are?,COVER: You tried to hide your new nature and love as normal. When did the change come upon you? When alone with a loved one or to defend family when they were attacked? When you fled your community were there people who still believed in you?" },
"cataphract": {skill: "Battle,Etiquette,Fighting,Might,Scout,Shooting,Spirit,Stamina", description: "You are born in, or are accepted as a knight in, the Conquest of Mettle. You were a warrior-knight, who fought on a golem war mount constracted by the glassmancers of Tourmaline. The best of the Cataphracts are not unlike Paladins who have a code of chivalry and take their oaths a little too seriously. While regarded as the enemies in many foreign lands, they can be very loyal and noble, and believe themselves to be fighting a crusade to save the world from daemons.", homeland: "Mettle, Vulkan, or similar", vagary: "Volcanic Blood",
event: "ENSLAVED: Your nation was conquered and you were added to the slave legions of Mettle. Did you prove yourself or insist on being rebellious?,REBELLION: You were present during an uprising of slave knights. Were you part of the rebellion or the force putting them down? Were the rebels justified or selfish?,RIVAL: One of your fellow knights engaged in competition with you. Were you rivals for a romance? Were you caught in a blood feud? Who won the rivalry?,COMMAND: You led a unit in battle (against who?). How well did your unit do and how great was your command?,NOBILITY: You had the eye of a Khan and the opportunity to be granted freedom or noble rank. Was this in opposition to an outside nation or against other Mettle knights? How well did you do?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"chimera": {skill: "Pick any 8 skills except Changeling, Second Sight, and Weird", description: "You are a product of or were subject to the daemonic experiments of a sorcerer. You are not human any more.", homeland: "Satymphalia", vagary: "Monster",
event: "IMPRISONED: You were chosen as an experiment and offered to the sorcerer from a pool of perceived criminals and prisoners and wars. When you became a monster did you punish your oppressors?,PITCHFORKS: A mob of locals came for you and your mentor and drove you out of the community as a monster. Did they suffer from your magical might? Were pitchforks justified or just superstition and rumours? Were you a victim but they ignored that?,MENTOR: You voluntarily entered into the experiments that created you. Did the sorcerer suffer? Did you stand by them?,FAMILY: You found a home or made a new family. Did they discover your nature? Did you defend them against a threat? Were you the threat?,SISTREN: You found a community of creatures like yourself. Was it Satymphalia? Was it invaded from outside or torn apart from within? Were you seen as the cause?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"dispossessed": {skill: "Blather,Daemonology,Healing,Insight,Invocations,Second Sight,Spirit,Stamina", description: "You spent months or years possessed. Were you an agent by a nefarious sorcerer, or was it an accident when a demon broke free of its binding? Was the demon banished or exorcised, or does it still lurk within? What subtle supernatural or psychic gifts has the experience given you?", homeland: "Celebrant From (REROLL)", vagary: "Runetongue",
event: "MURDER: You committed a horrific crime while possessed and couldnt go home. Few could forgive you. What did the daemon possessing you do?,PRISONER: You were offered up as a Celebrant of the Eternal Empire after being captured in battle or as punishment for your crimes. Why? Do you vow revenge against those who did this to you?,EXORCISM: You were possessed unwillingly and rescued with an exorcism. Did a sorcerer have plans for you and your old job? Was it a rogue daemon seeking freedom? Were you thought to have accepted possession or pretended it to escape punishment for your actions?,TITHE: You won favour for your community by offering yourself in the Tithe to become a Celebrant of the Eternal Empire. Were you pressured into it and did you later find you were tricked? Did you leave because people never accepted you afterwards? You had changed.,SPEAKER FOR THE DAMNED: You dont remember the details but you spoke with a daemon after your possession ended. You had the opportunity to talk down a sorcerers daemon. Did it obey you?,ILLUMINANT: You won the favour of your friends and society while possessed! Your daemon was beloved more than you. People wish you were possessed again and may try to have you possessed!" },
"dryad": {skill: "Astrology,Daemonology,Healing,Invocations,Scout,Second Sight,Search,Spirit", description: "You are visibly not human, perhaps hailing from a distant outland or a victim of sorcerous experiments. You are attuned to magical powers. ", homeland: "Vestia", vagary: "Floromancer",
event: "PITCHFORKS: A mob of locals discovered your alien-ness and blamed you for some recent event. They came for you. Did they suffer from your magical might? Were you behind their problems? ,SECRETS: You discover your alien-ness in a world that despises you. Someone discovered your nature. Do you protect your secret? Are you exposed? Do friends and family turn against you or protect you?,EXP-ROSION: You are seen using your powers possibly in defence of a loved one or your community. There are those who want you captured for study or even destroyed. Are friends and family among them?,FAMILY: You found a new home or made a new family. Did they discover your nature? Did you defend against a threat? Were you the threat?,VESTRIA: You found a community of creatures like yourself. Was it Vestria? Why were you driven out?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"scion": {skill: "Battle,Carousing,Etiquette,Fencing,Invocations,Lore,Reflexes,Stamina", description: "A lesser child of nobility, born to wealth and privilege, or one raised up by achievement, wealth, or conquest. Did you find the decadence stifling and seek adventure? Are you on a secret mission for your Witch-Queen? Are you in exile for dishonour or treachery, or fleeing the conquest or supernatural disaster that befell your homeland?", homeland: "Scion of... (REROLL)", vagary: "One Of Us",
event: "BLACK SHEEP: You were never accepted in your status. Why was that? What did your enemies do to you? Did you win or lose over them?,CONSPIRACY: Your family was involved in a plot against your superiors. Did you join or thwart them? Were they exposed and punished or did their plot succeed?,RIVAL: Another of your family or class was jealous of your favour and plotted against you. Did they frame you in some plot? Did you defeat their meddling?,ALLIANCE: You had the opportunity to strengthen your status with an alliance with another noble house. Did you befriend the house? Did your enemies thwart this goal?,ASCENDANT: You had an opportunity to humiliate and defeat your enemies. Maybe in a duel or battle. Perhaps through outwitting your enemies in political intrigue. Did you win the opportunity or were you toppled?,GLORIOUS: You receive justified rewards of riches and privilege and are sought out for assistance by the less well off. How do you handle your time of glory?" },
"traveller": {skill: "Pick any 8 skills except Changeling, Second Sight, and Weird", description: "You walked out of the mists one day, or spent some time inside, apparently unharmed with no memory of what happened on the other side. Rumours say you visited another world. (You can take this option in place of any other Special legend or possibly any other Legend.", homeland: "Beyond the Mists", vagary: "Amnesia",
event: "MYSTERY: You have no memory of these years.,MYSTERY: You have no memory of these years.,MYSTERY: You have no memory of these years.,MYSTERY: You have no memory of these years.,MYSTERY: You have no memory of these years.,MYSTERY: You have no memory of these years." },
};
const events = {
battles: [
"BATTLE: The region is assimilated, peacefully or violently, by the Eternal Empire of Empress Sofiria.",
"BATTLE: The region is sacked by a gathering of the Pirates of the Living Sea if coastal, or the Highlanders if inland. Entire cities are raided.",
"BATTLE: The region is at war with the daemon-hating Golem Cataphracts of Mettle. Entire cities are conquered.",
"BATTLE: The region is beset by a tribe raiding from the Outlands. Entire cities burn.",
"BATTLE: The region is at war with a neighbouring nation (or local rivals go to war with each other), and civilians and adventurers like yourself are caught up in the turmoil:.",
"BATTLE: The region suffers the depredations of a Kaiju-like Leviathan. Entire cities are burned, stomped, or similarly attacked before it gets bored or is driven away.",
],
outcomes: [
"MURDER: You are thought responsible for the death of one or more people, due to inactivity or malice.",
"BETRAYAL: People who trusted you were betrayed. Or you were betrayed by those you trusted.",
"DEFEAT: A rivalry with a Nemesis goes badly for you. The Nemesis, or those close to them, bear a grudge.",
"VICTORY: A rivalry with a Nemesis goes well for you. The Nemesis, or those close to them, bear a grudge.",
"ROMANCE: An ally, romance, or mentor is instrumental in your victory. The adoration may be mutual or one-sided.",
"HEROISM: Whether by action, happenstance, or taking credit for others actions, you were victorious and are thought responsible for brave deeds.",
],
turmoil: [
"TURMOIL: Abomination - The Mists of Madness roll in, causing chaos and creating one or more Abominations some of whom might have been friends.",
"TURMOIL: Rebellion - the local sovereign is toppled and replaced. There are weeks, months, or years of unrest. Which side were you on?",
"TURMOIL: Uprising - the local sovereign puts down an attempt to topple her after weeks, months, or years of unrest, including a possible purge. Which side were you on?",
"TURMOIL: Witch-hunt - A witch hunt, moral panic, or other social contagion causing upheaval in peoples lives. What was it, and did you profit or suffer from the panic?",
"TURMOIL: Hardship - The region experiences a famine, plague, strange weather, or some other problem that afflicts an entire region, leading people to turn on each other in the struggle to survive.",
"TURMOIL: Part of the region suffers the depredations of a wish gone awry (aka Spontaneous Magic) and entire cities are now Hexland.",
],
personal: [
"PERSONAL: Imprisoned - You spend time imprisoned, as a comfortable prisoner or in a work camp. What for? Maybe you are part of an escape.",
"PERSONAL: Crime - You are involved in a criminal enterprise whether willingly or not. What is the crime?",
"PERSONAL: Loyalty - A friend or family member is in trouble, and you are dragged into it as an ally or enemy.Maybe they come to you for help.",
"PERSONAL: Relationship - Make or break a relationship, whether romantic, friendship, or professional. What happens to jeopardise the relationship?",
"PERSONAL: Patron - You assist or oppose someone in a position of power in their endeavours, and may make a new enemy or mentor. ",
"PERSONAL: Windfall - You have an opportunity for power or great riches, maybe through family, crime, or other connections. You may be mobbed",
],
sorcery: [
"SORCERY: Possession - You are recruited to serve someone who you find out is possessed. Are they a rogue daemon or working for a sorcerer?",
"SORCERY: Scourge - A rogue daemon has been identified and is being hunted. What mischief and mayhem does it cause before its death?",
"SORCERY: Bound - A powerful daemon is bound, and people in power fight for its ownership. What is your role?",
"SORCERY: Magic - A mysterious magical event causes upheaval. No sorcerer is behind it as far as you know it just happened.",
"SORCERY: Sorcerer - You find yourself caught up in the schemes of a sorcerer who might become an enemy or friend. What were they up to?",
"SORCERY: Coven - You assist a sorcerous group or organisation, a powerful group that helps to rule. Do you gain their trust?",
],
table: [
"legend",
"legend",
"legend:",
"legend",
"legend",
"personal",
"sorcery",
"battle",
"turmoil",
"reroll",
"reroll",
],
table2: [
"legend",
"legend",
"legend:",
"legend",
"legend",
"personal",
"sorcery",
"battle",
"turmoil",
"legend",
"legend",
],
}; // maybe get ride of table and use only table2; the special legends only occur on rerolls.
const locations = [
"Festivus",
"Crucible",
"Labyrinth",
"Fendish",
"Sanctuary",
"Sanguine",
"Infinite Library",
"Living among the Derespine",
"Islands of the Living Sea (Landlubber)",
"Islands of the Living Sea (Sailing)",
"Mirthrendor",
"Viand",
"Lampoon",
"Spiral",
"In The Outlands (Borders)",
"In The Outlands (Tribes)",
"The Mettle Conquest (Frontier)",
"The Mettle Conquest (Heartland)",
"Tourmaline (Mettle)",
"Legendary Land",
];
const legends = [
"adventurer",
"brute",
"buccaneer",
"charlatan",
"desperado",
"diva",
"duellist",
"lifegiver",
"loremaster",
"primeval",
"ranger",
"scourge",
"sellsword",
"sorcerer",
"tinkerer",
"trickster",
"undertaker",
"wayfarer",
"vizier",
"warlock",
"abomination",
"cataphract",
"chimera",
"dispossessed",
"dryad",
"scion",
"traveller",
];
const vagaries = {
"(reroll)": "Opportunist",
"ogre-kin": "Mighty Thews",
"living sea": "Daredevil",
"derespine": "All For One",
"homeless exile ((reroll))": "Forgotten",
"lampoon": "Loose Lips",
"mirthrendor": "Swash",
"festivus": "Blessed",
"infinite library": "Revelations",
"outland tribe": "Barbarian",
"viand": "Eagle Eye",
"crucible": "Quickening",
"fendish": "Defender",
"sanguine": "Blood Magic",
"tournaline (mettle)": "Glassmancer",
"sanctuary": "Gambit",
"hexlands near (reroll)": "Deflection",
"fountain": "Tall Tales",
"labyrinth": "Mysteries",
"spiral": "Totally Normal",
"mists of madness: (reroll)": "Changeling",
"mettle, vulkan, or similar": "Volcanic Blood",
"satymphalia": "Monster",
"celebrant from (reroll)": "Runetongue",
"vestia": "Floromancer",
"scion of... (reroll)": "One Of Us",
"beyond the mists": "Amnesia",
}
// items must be arrays
const changes = items => items.reduce((all, one) => `${all} change:${one}`, '');
const clicked = items => items.reduce((all, one) => `${all} clicked:${one}`, '');
const glory_range = seq(11, 0);
glory_range.forEach(i => {
on(`clicked:glory_${i}`, () => {
const output = {};
output.glory = i;
setAttrs(output);
// might add an announcement to chat here.
});
});
on('clicked:epic', () => {
getAttrs(['epic'], v => {
const epic = +v.epic || 0;
setAttrs({
epic: 1-epic,
});
});
});
on('change:epic', () => {
getAttrs(['epic'], v => {
const epic = +v.epic || 0;
const epic_label = epic ? 'Epic': 'Heroic' ;
setAttrs({
epic_label: epic_label
})
});
});
on('clicked:reset', () => {
const output = {};
const sections = {
vagaries: ['use']
}
getSectionObject(sections, data => {
data.fields.forEach(use => output[use] = 0);
setAttrs(output);
});
});
on('change:glory sheet:opened', () => {
getAttrs(['glory'], v => {
const glory = +v.glory || 0;
const upper_limit = glory_range[glory_range.length-1];
const output = {};
if(glory > upper_limit) output.glory = 10;
glory_range.forEach(i => {
output[`glory_${i}`] = (i === glory) ? 1 : 0;
});
if(output.glory >= upper_limit) {
output[`glory_${upper_limit}`] = 1;
} else if (glory < 0) {
output[`glory_0`] = 1;
output[`glory`] = 0;
}
setAttrs(output);
})
})
on('change:homeland', () => {
getAttrs(['homeland'], v => {
const homeland = v.homeland;
const output = {};
const homeland_vagary = Object.keys(vagaries).includes(homeland.toLowerCase()) ? vagaries[homeland.toLowerCase()] : "what?";
output.vagary_name = homeland_vagary;
output.homeland_vagary = `VAGARY: ${homeland_vagary}`
setAttrs(output);
});
});
on('clicked:mod', () => {
getAttrs(['mod_label'], v => {
const output = {};
const mod_label = v.mod_label || 'No Roll Mods';
output.mod_label = mod_label === 'No Roll Mods' ? 'Roll Mods' : 'No Roll Mods';
output.modifier = mod_label === 'No Roll Mods' ? '?{Modifier|0}' : '0';
setAttrs(output);
});
});
on('clicked:whisper', () => {
getAttrs(['whisper_label'], v => {
const output = {};
const whisper_label = v.whisper_label || 'Rolls to Chat';
output.whisper_label = whisper_label === 'Rolls to Chat' ? 'Whispered Rolls' : 'Rolls to Chat';
output.whisper_roll = whisper_label === 'Rolls to Chat' ? '/w GM ' : '';
setAttrs(output);
});
});
on('clicked:visibility', () => {
getAttrs(['visible_toggle'], v => {
const output = {};
const visible_toggle = +v.visible_toggle || 0;
output.visibility_label = visible_toggle === 1 ? 'Show Skills' : 'Hide Skills';
output.visible_toggle = 1 - visible_toggle;
setAttrs(output);
});
});
on('clicked:clear_mods', () => {
const output = {};
[...Object.keys(skills_obj), ...stats.map(stat => stat.toLowerCase())].forEach(item => output[`${item}_mod`] =0);
getSectionIDs('repeating_d20', ids => {
ids.forEach(id => output[section_name('d20', id, 'mod')] = 0);
getSectionIDs('repeating_d6', ids => {
ids.forEach(id => output[section_name('d6', id, 'mod')] = 0);
setAttrs(output);
});
});
});
/* Do Rolls */
on(clicked(['body', 'sorcery', 'repeating_demons:spirit', ...Object.keys(skills_obj), ...stats.map(stat => stat.toLowerCase())]), (event) => {
const item = event.triggerName.replace('clicked:', '').replace(':', '_');
const demon = event.triggerName.startsWith('clicked:repeating_demons');
const row = demon ? event.triggerName.split('_')[2] : '-';
const attrs = demon ? [item, `repeating_demons_${row}_name`] : [`${item}`];
getAttrs(attrs, v => {
const demon_name = demon ? v[`repeating_demons_${row}_name`] : '';
const label = demon ? `Daemon ${demon_name ? ` (${demon_name}) ` : ''} Spirit` : item;
const score = +v[`${item}`] || 0;
const good = calc_score(score/2);
const excellent = calc_score(score/4);
const poor = calc_score(score * 2);
const spectacular = (score >= 20) ? calc_score(score/8) : 0;
const roll_string = `@{whisper_roll}&{template:pages} {{title=${title(label)} Roll }} {{subtitle=@{character_name} }} {{Score=**${score}** (G${good}-E${excellent}${spectacular ? `-S${spectacular}` : ''})}} {{modifier=[[@{modifier}]]}} {{roll=[[1d20cs0cf20]]}} {{average=[[${score}+@{modifier}]]}} {{good=[[floor(${score}/2+@{modifier}/2)]]}} {{poor=[[${score} *2 +2*@{modifier}]]}} {{excellent=[[floor(${score}/4+@{modifier}/4)]]}} {{spectacular=[[floor(${score}/8+@{modifier}/8)]]}} ${demon ? `{{desc=[Weapon Damage](~repeating_demons_${row}_weapon) [Demon Damage](~repeating_demons_${row}_damage) }}` : ''}`;
// might make this more of a smart roll, so modifier, poor, good, etc., are all taken into better account.
// title, subtitle, score, roll, modifier - could serve as holders for poor, good, excellent, spctacular
// the idea is Good, etc need not be supplied, they are calculated automatically
// survival roll
const ask = `!{{template:pages}}{{ask=![[?{Do You want to make a Survival Roll?|No,0|Yes,1}]]}}`;
if(item === 'body') {
startRoll(ask, question => {
const answer = question.results.ask.result;
if(answer) {
startRoll(roll_string, results => {
finishRoll(results.rollId);
});
}
});
} else {
startRoll(roll_string, results => {
finishRoll(results.rollId);
});
}
});
});
on('change:modifier change:repeating_d20:score change:repeating_d20:source change:repeating_d20:item change:repeating_d20:mod sheet:opened', (event) => {
getSectionIDs('repeating_d20', ids => {
const fields = ids.reduce((all, id) => [...all, `repeating_d20_${id}_score`, `repeating_d20_${id}_source`, `repeating_d20_${id}_item`, `repeating_d20_${id}_mod`],[]);
getAttrs(fields, v => {
const output = {};
ids.forEach(id => {
const score_base = +v[`repeating_d20_${id}_score`] || 0;
const mod = +v[`repeating_d20_${id}_mod`] || 0;
const score = score_base + mod;
const source = v[`repeating_d20_${id}_source`];
const item = v[`repeating_d20_${id}_item`];
const good = calc_score(score/2);
const excellent = calc_score(score/4);
const poor = calc_score(score * 2);
const spectacular = (score >= 20) ? calc_score(score/8) : 0;
const score_roll = `@{whisper_roll}&{template:pages} {{title=${title(item)} Roll }} {{subtitle=${title(source)} }} {{Score=**${score}** (G${good}-E${excellent}${spectacular ? `-S${spectacular}` : ''})}} {{modifier=[[@{Modifier}]]}} {{roll=[[1d20cs0cf20]]}} {{average=[[${score}+@{Modifier}]]}} {{good=[[${good}+@{Modifier}/2]]}} {{poor=[[${poor}+2*@{Modifier}]]}} {{excellent=[[${excellent}+@{Modifier}/4]]}} {{spectacular=[[${spectacular}+@{Modifier}/8]]}}`;
output[`repeating_d20_${id}_score_roll`] = score_roll;
});
setAttrs(output);
});
});
});
/* need to enter the current cost of advances for a skill, and NOT update it when skill is increased. */
on('change:repeating_advances:skill', () => {
getAttrs(['repeating_advances_skill', ...Object.keys(skills_obj).map(skill => `${skill}_advances`), 'skill_min' ], v => {
const skill_min = +v.skill_min || 0;
const output = {};
const skill = v.repeating_advances_skill;
if(Object.keys(skills_obj).includes(skill)) {
const advances = +v[`${skill}_advances`] || 0;
output[`repeating_advances_skill_cost`] = Math.max(skill_min, advances +1);
setAttrs(output);
};
});
});
on('change:repeating_vagaries:cost change:repeating_vagaries:owned remove:repeating_vagaries change:repeating_advances:skill_cost remove:repeating_advances', (event) => {
const sections = {
advances: ['skill_cost'],
vagaries: ['cost', 'owned'],
};
getSectionObject(sections, obj => {
getAttrs([...obj.fields, 'xp'], v => {
const xp = +v.xp || 0;
const output = {};
const xp_advances = obj.advances.reduce((all, id) => all + int(v[section_name('advances', id, 'skill_cost')]), 0);
const xp_vagaries = obj.vagaries.reduce((all, id) => all + int(v[section_name('vagaries', id, 'cost')]) * int(v[section_name('vagaries', id, 'owned')]), 0);
output.xp_spent = int(xp_advances) + int(xp_vagaries);
// this doesn't add properly if Vagary
output.last_advance = event.triggerName.endsWith('cost') ? (event.newValue || 0) : 0;
output.xp = xp - (output.last_advance - (event.previousValue || 0));
output.number_advances = obj.advances.length + obj.vagaries.reduce((all, id) => all + int(v[section_name('vagaries', id, 'owned')]), 0);
setAttrs(output);
});
});
});
// will there be a modifier section so each skill and stat can be modified?
const mods = [...Object.keys(skills_obj), ...stats].map(score => `${score}_mod`);
// mostly works, but when pasting a legend, it doesnt take the event roll into account.
// pasting a legend rerolls it.
// maybe in legend roll dont set event and outcome, set them in this function
// and also have roll button to roll them separately.
const send_alert = (title, subtitle, popup_message) => {
const roll_string = `&{template:pages} {{title=${title} }} ${subtitle ? `{{subtitle=${subtitle} }}` : ''} ?{${popup_message}|ok|ok}`;
startRoll(roll_string, id => {
finishRoll(id.rollId);
});
};
const roll_legend = () => {
// rolls new legend. Might have parameters for Legend, Event, Outcome from the last term.
getSectionIDsOrdered('repeating_careers', function(ids_careers) {
let legends = ids_careers.reduce((all, id) => [...all, section_name(`careers`, id, `legend`), section_name(`careers`, id, `time`)], []);
const terms = ids_careers.length;
const last_id = terms ? ids_careers[terms -1] : '';
if (ids_careers.length) {
const event = section_name(`careers`, last_id, `event`);
const outcome = section_name(`careers`, last_id, `outcome`);
legends = [...legends, event, outcome];
}
const output = {};
getAttrs([...legends, 'age_roll', 'age', 'exit_flag', 'epic', 'term_limit'], v => {
//console.info({terms});
const term_limit = +v.term_limit || 0;
const exit = +v.exit_flag || 0;
const epic = +v.epic || 0;
const age_roll = +v.age_roll || 0;
const age = +v.age || 0;
const careers = ids_careers.reduce((all, id) => [...all, v[section_name(`careers`, id, `legend`)]], []).join(', ');
/*
if (exit) {
const title = '@{character_name} Finishes Lifepath';
const subtitle=`${ids_careers.length} Terms: ${careers}`;
const popup = 'Your Career Has Finished';
send_alert(title, subtitle, popup);
return;
}*/
// roll to see if get greater or equal number of terms to keep rolling.
// if roll less, end careers.
let display_text;
if(exit ) {
output.exit_flag = 1;
display_text = '@{character_name} has finished Lifepath';
const subtitle=`${ids_careers.length} Terms: ${careers}`;
const popup = 'Your Career Has Finished';
//send_alert(title, subtitle, popup);
// maybe in change:exit_flag, set all in repeating section to equal the same amount.
setAttrs(output, {silent:false}, send_alert(display_text, subtitle, popup) );
return;
} else {
// a term actually happens
const last_outcome = terms ? (+v[section_name(`careers`, last_id, `outcome`)] || 0) : 0;
const last_legend = terms ? v[section_name(`careers`, last_id, `legend`)] : 0;
const past_legends = Object.values(v); // gets an array of legend names, but also the outcome and event rolls - but they don't matter.
// at this point we have the history of legends, and the last event and outcome scores.
// roll to see if exceed or equal terms. If not add to an exit attribute. check
// now we need to create a new row
// add an event,
// if it's 6, roll a new event and pick from sub legends
// add legend
// if last outcome was 5-6, take same legend
// if last legend was one of the 3 specials, roll d6 on their table
// otherwise roll d20
// if it matches an existing legend, do something
// roll to see if event is a special/reroll.
/*
need to add an array to roll each legend, and build a string.
*/
const roll_events = roll();
const num_events = epic ? Math.max(1, Math.floor(roll_events/2)) : 1 ; // events per term
let event_2d6_roll = roll() + roll() -2;
let event_type = events.table2[event_2d6_roll]; // was table
let new_legend;
// wqant to make sure if career is (select) it doesnt become the same thing again.
// if last income 6, this event 6, or a legend you have had before, pick any.
//const temp_legend = legends_all.standard[roll(legends_all.standard.length)-1];
if(event_type === 'reroll') { //&& last_id === ''
// last_id is only = '' when its the first term.
// set legend to one of the special legends
new_legend = title(Object.keys(legends_obj)[20+roll() -1]); //legends_all.specials[roll(legends_all.specials.length)-1];
event_2d6_roll = roll() + roll() -2;
event_type = events.table[event_2d6_roll] === 'reroll' ? 'legend' : events.table[event_2d6_roll];
/* } else if (last_outcome > 5) {
new_legend = choose_lifepath; */
} else {
const career_roll = roll(20) -1;
new_legend = title(Object.keys(legends_obj)[career_roll]); // legends_all.standard[roll(legends_all.standard.length)-1];
// if legend has already been rolled, erase it. maybe not?
if(past_legends.includes(new_legend)) {
new_legend = title(Object.keys(legends_obj)[20+roll() -1]); //new_legend = choose_lifepath; // set this to 21-26?
}
}
const new_id = generateRowID();
output[section_name('careers',new_id,'legend')] = new_legend;
const legend_roll = new_legend === choose_lifepath ? 1 : legends_obj[new_legend.toLowerCase()].event.split(',').length;
let event_roll = roll(6);
const event_array = [];
event_array.push((event_type[0].toUpperCase() === "O" ? "L" : event_type[0].toUpperCase()) + event_roll);
// events 2-3 use a different table
if(num_events > 1) {
for(let i = 1; i < num_events; i++) {
event_2d6_roll = roll() + roll() -2;
event_type = events.table2[event_2d6_roll]
event_roll = event_type === 'legend' ? roll(legend_roll) : roll(6);
event_array.push(event_type[0].toUpperCase() + event_roll);
}
}
output[section_name('careers', new_id, `event`)] = event_array.join(' ');
output[section_name('careers', new_id, 'outcome')] = roll();
const time = roll()+ids_careers.length +1;
output[section_name('careers', new_id, 'time')] = time;
// PROGRESS ROLL
const term_roll = roll(20);
const target = next_legend - (ids_careers.length +1) *4;
//console.info({term_limit, terms})
if(((terms +1) >= term_limit) || (terms && term_roll > target)) {
output.exit_flag = 1;
display_text = `@{character_name} rolls ${new_legend} and finishes Lifepath`;
//const subtitle=`${ids_careers.length} Terms: ${careers}`;
//const popup = 'Your Career Has Finished';
} else {
display_text = `@{character_name} rolls ${new_legend}`;
output.exit_flag = 0;
}
output.age_roll = age_roll ? age_roll : 16; //roll() + 12;
const years = roll() +1;
output[section_name('careers', new_id, `years`)] = years;
output.age = age ? age + years : output.age_roll + years;
setAttrs(output, {silent:false}, send_alert(display_text, '', `You complete term ${ids_careers.length + 1}`) );
// inserting legend will trigger a new event and outcome roll, fill in skills, etc.
}
});
});
};
const recalculate_careers = () => {
getSectionIDs('repeating_careers', id_careers => {
const fields = id_careers.reduce((all,id) => [...all, section_name('careers', id, 'sanity')], []);
getAttrs(fields, v => {
const output = {};
const test = +v[fields[0]] || 0;
if(test) {
fields.forEach(field => output[field] = 0);
//setAttrs(output);
}
//setAttrs(output);
});
});
};
on(`change:repeating_careers:sanity change:repeating_careers:legend change:repeating_careers:event change:repeating_careers:outcome remove:repeating_careers`, (eventInfo) => {
getSectionIDs('repeating_careers', id_careers => {
const fields = id_careers.reduce((all,id) => [...all, section_name('careers', id, 'legend'), section_name('careers', id, 'event'), section_name('careers', id, 'outcome')], []);
getAttrs(fields, v => {
const output = {};
//eventInfo.previousValue = eventInfo.newValue;
id_careers.forEach((id, index) => {
output[section_name('careers', id, 'sanity')] = 1;
// if event starts with 1 (contains -), need to find the second entry and look up on Invaders.
const tables = {
L: "legend",
T: "turmoil",
B: "battles",
P: "personal",
S: "sorcery"
};
const legend = v[section_name('careers', id, 'legend')].toLowerCase();
const event_string = section_name('careers', id, 'event') === eventInfo.sourceAttriute ? eventInfo.newValue : v[section_name('careers', id, 'event')];
const event_array = event_string.includes(' ') ? event_string.split(' ') : [event_string];
// set event_array to 3 items.
event_array.length = 3;
[1,2,3].forEach(item => event_array[item] = (event_array[item] ? event_array[item] : ''));
// find which event to use based on initial letter
event_array.forEach((item,index) => {
const description = `event${index +1}_description`;
if(item.length !== 2 || ['L', "T", 'P', 'B', 'S'].includes(item[0].toUpperCase()) === false || int(item[1]) === 0 ) {
output[section_name('careers', id, description)] = '';
} else if(legends_obj[legend]) {
const table_code = item[0];
const table_number = int(item[1]);
if (Object.keys(tables).includes(table_code) && [1,2,3,4,5,6].includes(table_number)) {
const table_type = tables[table_code];
const legend_list = legends_obj[legend].event; // not an array ERROR
const legend_array = isNaN(legend_list) ? legend_list.split(',') : legend_list;
output[section_name('careers', id, description)] = table_type === 'legend' ? legend_array[table_number -1]
: events[table_type][table_number-1];
} else {
output[section_name('careers', id, description)] = '';
}
}
});
// now work through outcome values, its a bit simpler
const outcome = parseInt(v[section_name('careers', id, 'outcome')]) || 0;
if(outcome && outcome < 7) {
output[section_name('careers', id, 'outcome_description')] = events.outcomes[outcome-1];
} else {
output[section_name('careers', id, 'outcome_description')] = '';
}
if(eventInfo.sourceAttribute && eventInfo.sourceAttribute.endsWith('legend')) {
if(index === 0 && legend && legend !== choose_lifepath) { // first item is homeland
let where = `WHERE: ${legends_obj[legend].homeland}`; // ERROR
// REROLL is randomly rolled every time sheet is opened, need to fix that.
if(where.includes('REROLL') || where.includes('Ogre-kin')) {
const first_roll = roll(20);
const location_roll = first_roll === 21 ? 20 + roll() : first_roll -1;
let location = legends_obj[Object.keys(legends_obj)[location_roll]].homeland;
if(location.includes('Living Sea') && legend.toLowerCase() === 'abomination') {
const new_locations = ['Mettle', 'Volkan', 'Vestria'];
where = where.replace('(REROLL)', new_locations[roll(new_locations.length)-1]);
where = where.replace('(Ogre-kin)', new_locations[roll(new_locations.length)-1] + ' (Ogre-kin)');
} else {
where = where.replace('(REROLL)', locations[roll(locations.length)-1]);
where = where.replace('(REROLL)', new_locations[roll(new_locations.length)-1] + ' (Ogre-kin)');
}
}
output[section_name('careers', id, 'where')] = where;
} else if(legend.toLowerCase() === "buccaneer") {
output[section_name('careers', id, 'where')] = `WHERE: Isles of the Living Sea`;
} else if(legend.toLowerCase() === "primeval") {
output[section_name('careers', id, 'where')] = `WHERE: In The Outlands`;
} else if(legend.toLowerCase() === "vagabond") {
output[section_name('careers', id, 'where')] = `WHERE: Unknown Lands`;
} else {
output[section_name('careers', id, 'where')] = `WHERE: ${locations[roll(locations.length)-1]}`;
}
};
});
if(eventInfo.triggerName !== 'sheet:opened') {
// want to make sure dont count careers where legend is (select)
const empty_legends = id_careers.filter(id => v[section_name('careers', id, 'legend')] === choose_lifepath);
output.glory = id_careers.length - empty_legends.length;
}
setAttrs(output,{silent:false},recalculate_careers());
});
});
});
on('change:_reporder:careers change:repeating_careers',()=>{
getSectionIDsOrdered('repeating_careers', function(id_array) {
// do stuff with id_array
const output = {};
id_array.forEach((id,index) => output[`repeating_careers_${id}_number`] = index +1);
setAttrs(output);
});
});
// how to update if rows are changed with no attribute change?
on('clicked:repeating_careers:exit clicked:exit', () => {
roll_legend();
});
// set skills
on('change:repeating_careers:legend', () => {
getAttrs([`repeating_careers_legend`], v => {
const output = {}
const legend = v.repeating_careers_legend ? v.repeating_careers_legend.toLowerCase() : '';
if(legend) {
const skills = Object.keys(legends_obj).includes(legend) ? legends_obj[legend].skill : '';
const skills_validated = skills.replaceAll(",", ", ").replaceAll(" ", " ");
output.repeating_careers_skills = skills_validated;
}
output.repeating_careers_specialty = choose_lifepath;
output.repeating_careers_description = Object.keys(legends_obj).includes(legend) ? `${legend.toUpperCase()}: ${legends_obj[legend].description}` : legend.toUpperCase();
setAttrs(output);
});
});
const calculate_score = (base, stat) => {
// handle halveing over each increment of maximum.
// could accept the ability to handle stat scores above 16, using them instead of
// has been adjusted - base = number of skills, stat = number of advances in total
let result =0;
let multiplier = 1
//if(stat > base) base = stat;
do {
const change = Math.min(base, high_score * multiplier);
base -= change;
result += Math.floor(change/multiplier)
multiplier = multiplier *2;
} while (base > 0);
return result;
};
on('change:exit_flag change:repeating_careers sheet:opened', () => {
getSectionIDs('repeating_careers', ids => {
getAttrs(['exit_flag'], v => {
const flag = +v.exit_flag || 0;
const output = {};
ids.forEach(id => output[`repeating_careers_${id}_exit_flag`] = flag);
if(!ids.length) output.exit_flag = 0;
setAttrs(output);
});
});
});
const choices = seq(6).map(skill => `skill_choice_${skill}`);
const settings = ['vigour', 'body', 'armour', 'skill_min'];
on(`sheet:opened ${settings.map(s => `change:settings_${s}`).join(' ')} change:wealth change:epic change:skill_weird change:load_level change:visible_toggle change:repeating_careers:skills change:repeating_careers:specialty change:repeating_advances:skill remove:repeating_advances remove:repeating_careers ${choices.map(choice => `change:${choice}`).join(" ")} ${mods.map(mod => `change:${mod.toLowerCase()}`).join(' ')}`, (event) => {
getSectionIDs(`repeating_careers`, id_careers => {
const career_skills = id_careers.reduce((all, id) => [...all, `repeating_careers_${id}_skills`], []);
const career_specialties = id_careers.reduce((all, id) => [...all, `repeating_careers_${id}_specialty`], []);
getSectionIDs(`repeating_advances`, id_advances => {
const advance_skills = id_advances.reduce((all, id) => [...all, `repeating_advances_${id}_skill`], []);
getAttrs([...settings.map(s => `settings_${s}`), ...career_skills, 'epic', ...career_specialties, ...advance_skills, ...choices, ...mods, 'skill_weird', 'visible_toggle', 'load_level', 'wealth'], v => {
const setting = {};
const wealth = +v.wealth ||0;
settings.forEach(s => {
setting[`settings_${s}`] = +v[`settings_${s}`] || 0;
});
const epic = +v.epic || 0;
const skill_per_advance = 2 + epic;
const skill_list = Object.keys(skills_obj);
const weird = +v.skill_weird || 0;
// define basic variables
const skill_count = {};
const stat_count = {};
const visible_toggle= +v.visible_toggle;
const skill_toggle = +v.skill_toggle || 0;
let ranks = {competent: 0, professional: 0, expert: 0, elite: 0};
Object.keys(skills_obj).forEach(skill => skill_count[skill] = 0);
stats.forEach(stat => stat_count[stat] = 0);
const output = {};
output.sorcery = 0;
let init_base = 0;
// want to set the maximum advance per stat, and cant buy above that.
// advances can be higher than this but dont count as highest than that.
// need to loop through each array
// get rid of skills that dont match
// split the career_skills group into appropriate skills
// to lower case, replace spaces inside skill name with "_"
// split on commas
// then trim each entry
const add_skill = (skill_name, skill_count) => {
//const skill_name = v[skill];
if (skill_list.includes(skill_name)) {
skill_count[skill_name] = Number(skill_count[skill_name]) ? (skill_count[skill_name] = skill_count[skill_name]+1) : 1;
} else {
//console.info(`${skill_name} not found`);
}
};
career_specialties.forEach(skill => add_skill(v[skill], skill_count));
choices.forEach(skill => add_skill(v[skill], skill_count));
advance_skills.forEach(skill => add_skill(v[skill], skill_count));
// now want to split the skills
career_skills.forEach(box => {
const skills_found = v[box].split(",");
const skills_valid = skills_found.map(skill => skill.toLowerCase().trim().replaceAll(' ', '_'));
skills_valid.forEach(skill => add_skill(skill, skill_count));
});
if(weird) add_skill('weird', skill_count);
// need to calculate the number of advances per skill
Object.keys(skill_count).forEach(skill => {
output[`${skill}_advances`] = skill_count[skill];
if(skill_count[skill]) {
stat = skills_obj[skill].stat;
stat_count[stat] = Number(stat_count[stat]) ? stat_count[stat] += skill_count[skill] : skill_count[skill];
}
});
// total skill ranks and stat scores
output.total_advances = Object.keys(stat_count).reduce((all, one) => all + stat_count[one], 0);
output.total_score = 0;
// calculate total stat sciores. Note stat_hidden is the true stat, without modifiers.
Object.keys(stat_count).forEach(stat => {
const count = stat_count[stat];
output[`${stat}_advances`] = count;
const mod = +v[`${stat}_mod`] || 0;
const score_hidden = skill_base + (count >= 15 ? triangle(count) : Math.floor(count/3)) + (count ? 1 : 0);//skill_base + triangle(count);//calculate_score(skill_base + triangle(count))
output.total_score += score_hidden;
const score_base = score_hidden;
const score = Math.min(score_base + mod, score_base * 2);
output[`${stat}`] = score;
output[`${stat}_max`] = triangle(count); // should actually be the total of skills minus the highest.
output[`${stat}_hidden`] = score_hidden;
output[`${stat}_levels`] = `${calc_score(score/2)}-${calc_score(score/4)}${(score > 19) ? `-${calc_score(score/8)}` : ''}` ;
});
// add base score + skill advances together, remembering to halve above 20 ??
Object.keys(skill_count).forEach(skill => {
const stat = skills_obj[skill].stat;
const mod = +v[`${skill}_mod`] || 0;
const advances = skill_count[skill];
const max_advances = Math.max(3, Math.floor(stat_count[stat]/2) +1); //stat_count[stat] - advances +1; // id_careers.length +1; // Math.max(3, Math.floor(stat_count[stat]/2) +1);
const score_base = output[`${stat}_hidden`] + skill_per_advance * Math.min(advances, max_advances);
const score_limit = calculate_score(score_base, stat); // this needs altering
const score = Math.min(score_limit + mod, score_limit * 2) ; //score_limit > 20 ? calc_score(score_limit/2) +10 : score_limit;
output[`${skill}`] = (advances == 0 && skills_obj[skill].multiple == 0) ? 0: score; //score;
output[`${skill}_levels`] = output[`${skill}`] ? `${calc_score(score/2)}-${calc_score(score/4)}${(score > 19) ? `-${calc_score(score/8)}` : ''}` : '---';
output[`${skill}_toggle`] = (skill_count[skill] || visible_toggle) ? 1 : 0;
output[`${skill}_exceed_max`] = advances > max_advances ? 1 : 0;
if(score > 23) ranks.elite +=1;
else if(score > 19) ranks.expert +=1;
else if(score>15) ranks.professional +=1;
else if(score>11) ranks.competent +=1;
if (stat === "Psyche") output.sorcery += Math.floor(output[`${skill}`] / 4);
if (skills_obj[skill].initiative && Math.floor(output[skill]/4) > init_base) init_base = Math.floor(output[skill]/4);
});
// calculate derived attribute
output.damage = calc_score(output.might/4) ;
output.damage_display = output.damage + "d6"
output.body_max = Math.max(output.Ferocity, output.Psyche) + (setting.settings_body ? Math.min(output.Ferocity, output.Psyche) : 0);
output.vigour_max = output.stamina * (1+ setting.settings_vigour); //+ setting.settings_vigour *10;
output.power_max = output.spirit;
const load_level = +v.load_level || 0;
output.load_limit = load_level ? wealth /* calc_score(output.scout/4)*/ : '-';
switch (load_level) {
case 2:
output.move = calc_score(output.scout/4)+calc_score(output.athletics/4) + calc_score(output.reflexes/4) +2;
output.initiative = calc_score(Math.floor(output.scout/4) + Math.floor(output.battle/4) + Math.floor(output.reflexes/4));
output.move = "L";
break;
case 4:
output.move = calc_score(output.scout/4)+calc_score(output.athletics/4) +2;
output.initiative = calc_score(Math.floor(output.battle/4) + Math.floor(output.reflexes/4));
output.move = "M";
break;
case 6:
output.move = calc_score(output.athletics/4) +2;
output.initiative = calc_score(Math.floor(output.battle/4));
output.move = "H";
break;
default:
output.move = '-';
output.initiative = '0';
}
if(output.initiative) output.initiative += init_base;
seq(10).forEach(row => {
output[`load_hide${row}`] = row <= output.load_limit ? 1 : 0;
if(output[`load_hide${row}`] === 0) {
output[`slot${row}_name`] = "";
output[`slot${row}_load`] = 0;
}
});
if(event.triggerName != 'sheet:opened') {
output.body = output.body_max;
output.vigour = output.vigour_max;
output.power = output.power_max;
}
output.toughness = calc_score(output.might/4)+calc_score(output.stamina/4) + load_level * setting.settings_armour;
output.evasion = calc_score(output.athletics/4)+calc_score(output.reflexes/4) + load_level * setting.settings_armour;
output.load = output.load_limit;
output.recovery = calc_score(output.spirit/4)+calc_score(output.stamina/4); //calc_score(Math.max(output.spirit, output.stamina)/4);
// need to create new Invocations.
// maybe check if item just changed is a choice name, and
output.skill_summary = `Competent: ${ranks.competent}; Professional: ${ranks.professional}, Expert: ${ranks.expert}; Elite: ${ranks.elite}`;
output.sorcery_levels = '---';
if (output.sorcery > 0) {
const ranks = `${Math.floor(output.sorcery/2)}/${Math.floor(output.sorcery/4)}${output.sorcery > 19 ? `/${Math.floor(output.sorcery/8)}` : ''}`;
output.sorcery_levels = ranks;
}
setAttrs(output);
});
});
});
// calclate skills stuff
});
/*
on('clicked:xp', () => {
getAttrs(['skill_toggle'], v => {
const toggle = +v.skill_toggle || 0;
const output = {};
output.skill_toggle = 1 - toggle;
output.xp_label = toggle ? 'Epic' : 'Hero';
setAttrs(output);
});
});
*/
const roll_skill_template = (random_skills = false, order = 0) => {
const sections = {
careers: ['legend', 'skills', 'specialty']
}
getSectionObject(sections, data => {
getAttrs(data.fields, v => {
const output = {};
const which = order > 1 ? order -2 : Math.floor(Math.random() * Object.keys(skill_template).length);
const name = Object.keys(skill_template)[which];
const skills_array = skill_template[name];
skills_array.forEach((skill, index) => output[`skill_choice_${index +1}`] = skill.toLowerCase());
if (random_skills) {
data.careers.forEach(row => {
const legend = v[section_name('careers', row, 'legend')];
const skills = v[section_name('careers', row, 'skills')];
const skill_list = skills.split(',').map(skill => skill.trim()).map(skill => skill.replace(' ', '_'));
const specialty = v[section_name('careers', row, 'specialty')];
if ((1 - (legend === choose_lifepath)) * (specialty === choose_lifepath) * (1 - (skill_list.includes(',')))) {
const skill = skill_list[Math.floor(Math.random() * skill_list.length)];
output[section_name('careers', row, 'specialty')] = skill.toLowerCase();
}
});
}
const roll_string = `@{whisper_roll}&{template:pages} {{title=@{character_name} Rolls Random Skills}}{{template:=**${name}**}}`;
setAttrs(output, {
silent: false
}, startRoll(roll_string, id => {
finishRoll(id.rollId)
}));
})
});
}
on('clicked:skill_template', () => {
const ask = 'Are You Sure? This replaces chosen skills|No,0|Random Skills Template,1,' + Object.keys(skill_template).map((name,index) => `${name},${index +2}`).join('|');
startRoll(`!{{template:pages}}{{ask=![[?{${ask}}]]}}`, (question) => { /*|Entire Character,3*/
const query = question.results.ask.result;
if(query) {
roll_skill_template(true, query);
}
});
});
on('clicked:clear', () => {
startRoll("!{{template:pages}}{{ask=![[?{Are You Sure? This will erase everything on the sheet|No,0|Do It!,1}]]}}", (question) => { /*|Entire Character,3*/
const query = question.results.ask.result;
if(query) {
roll_string = `@{whisper_roll}&{template:pages} {{title=Clear Sheet}} {{desc=**@{character_name} Clears Their Sheet**}}`;
clear_sheet(roll_string); // finishRoll(id.rollId)
}
});
});
// might check if Body is below half, or if damage is over half Vigour or Body.
['glory', 'power', 'vigour', 'body'].forEach(button => {
on(`clicked:${button}-button`, () => {
const roll_string = `How much ${button} do you spend?`;
startRoll(`!{{template:pages}}{{ask=![[?{${roll_string}|1}]]}}`, (question) => {
const amount = question.results.ask.result;
getAttrs([`${button}`, `${button}_max`], v => {
const old = +v[button] || 0;
const max = +v[`${button}_max`] || 0;
const new_value = old - amount;
const output = {};
output[button] = new_value;
const new_string = `{{${title(button)} Spent=${amount}}} {{${title(button)} Left=${new_value} }}`;
const full_string = `@{whisper_roll}&{template:pages}{{title=@{character_name} spends ${title(button)} }}${new_string}`;
setAttrs(output,{silent:false},startRoll(`${full_string}`, question => {
finishRoll(question.rollId);
}));
});
});
});
});
recovery_types.forEach(item => {
on(`clicked:demon${item.toLowerCase()}`, () => {
// possibly add a are you sure query here.
getSectionIDs('repeating_demons', ids => {
const fields = ids.reduce((all, id) => [...all, `repeating_demons_${id}_spirit`, `repeating_demons_${id}_vigour`, `repeating_demons_${id}_power`, `repeating_demons_${id}_body`], []);
getAttrs([...fields, 'settings_vigour'], v => {
const vigourX = +v.settings_vigour || 0;
const output = {};
let recover_text = '';
ids.forEach(id => {
const spirit = +v[`repeating_demons_${id}_spirit`] || 0;
const rec = Math.floor(spirit/4);
const vigour = +v[`repeating_demons_${id}_vigour`] || 0;
const power = +v[`repeating_demons_${id}_power`] || 0;
const body = +v[`repeating_demons_${id}_body`] || 0;
switch (item) {
case 'breather':
output[`repeating_demons_${id}_vigour`] = Math.min(spirit * (1+vigourX), rec + vigour);
output[`repeating_demons_${id}_power`] = Math.min(spirit, 1 + power);
recover_text = 'take a Breather';
break;
case 'recovery':
output[`repeating_demons_${id}_vigour`] = spirit *(1+vigourX);
output[`repeating_demons_${id}_power`] = Math.min(spirit, rec + power);
output[`repeating_demons_${id}_body`] = Math.min(Math.floor(spirit/2), 1 + body);
recover_text = 'are Refreshed';
break;
case 'heal':
output[`repeating_demons_${id}_vigour`] = spirit *(1+vigourX);
output[`repeating_demons_${id}_power`] = Math.min(spirit, rec + power);
output[`repeating_demons_${id}_body`] = Math.min(Math.floor(spirit/2), rec + body);
recover_text = 'enjoy a Heal';
}
});
roll_string = `@{whisper_roll}&{template:pages} {{title=${title(item)}}} {{desc=@{character_name}'s daemons ${recover_text}.}}`;
setAttrs(output, {silent:true}, startRoll(roll_string, id => {
finishRoll(id.rollId)
}));
});
});
});
});
on(`clicked:recover`, () => {
getAttrs(['recovery', 'vigour', 'power', 'body', 'vigour_max', 'power_max', 'body_max', ], values => {
const v = +values.vigour || 0;
const vm = +values.vigour_max || 0
const p = +values.power || 0;
const pm = +values.power_max || 0
const b = +values.body || 0;
const bm = +values.body_max || 0;
const rec = +values.recovery || 0;
const roll_string = `!{{template:pages}}{{ask=![[?{Are You Sure?|No,0|Take an end-of-turn Breather,1|Take an end of scene Refresh,2|Enjoy a full Heal,3|Restore Everything,4}]]}}`;
startRoll(roll_string, (question) => {
const query = question.results.ask.result;
if(query) {
const heal_type = query === 1 ? 'Breather' : query === 2 ? 'Recovery': query === 3 ? 'Heal' : "Restore";
const max_heal_v = query === 1 ? rec : vm ;
const max_heal_p = query === 1 ? 1 : query === 4 ? pm : rec;
const max_heal_b = query === 1 ? 0 : query === 2 ? 1 : query === 4 ? bm : rec;
const heal_v = Math.min(max_heal_v, vm - v);
const heal_p = Math.min(max_heal_p, pm - p);
const heal_b = Math.min(max_heal_b, bm - b);
const new_roll_string = `@{whisper_roll}&{template:pages}{{title=@{character_name} takes a ${heal_type === 'Restore' ? 'Full Restore' : heal_type}}} {{Vigour=${heal_v <0 ? '' : '+'}${heal_v} = ${v+heal_v} }} {{Power=${heal_p <0 ? '' : '+'}${heal_p} = ${p + heal_p} }}{{Body=${heal_b <0 ? '' : '+'}${heal_b} = ${b+heal_b} }}`;
startRoll(new_roll_string, (id) => {
const output = {};
if(heal_v) output.vigour = v + heal_v;
if(heal_p) output.power = p + heal_p;
if(heal_b) output.body = b + heal_b;
setAttrs(output,{silent:false},finishRoll(id.rollId));
});
}
});
});
});
// new clear sheet
const clear_sheet = () => {
const sections = {
careers: [],
power: [],
passions: [],
vagaries: [],
loyalty: [],
demons: [],
advances: [],
gear: [],
attacks: [],
notes: [],
d20: [],
d6: []
};
getSectionObject(sections, obj => {
Object.keys(obj).forEach(section => {
if(section != 'fields' && obj[section].length) {
obj[section].forEach(id => removeRepeatingRow(`repeating_${section}_${id}`));
}
});
const output = {};
seq(6).forEach(i => output[`skill_choice_${i}`] = choose_lifepath);
const global_zeroes = ['xp', 'number_advances', 'glory', 'xp_spent', 'last_advance', 'age', 'age_roll', 'exit_flag', 'skill_weird'];
global_zeroes.forEach(stat => output[stat] = 0);
output.demons = "";
Object.keys(skills_obj).forEach(skill => output[`${skill}_mod`] = 0);
stats.forEach(stat => output[`${stat}_mod`] = 0);
// want to run the clear_mods, clear personal skil lchoices
setAttrs(output, {silent:false},force_recalculation());
});
};
clear_check = () => {
}
on('clicked:power', () => {
startRoll("!{{template:pages}}{{ask=![[?{Are You Sure? This will delete all Invocations and Vagaries. Buy all your starting skills first|No,0|Do It!,1}]]}}", (question) => { /*|Entire Character,3*/
const query = question.results.ask.result;
if(query) {
const sections = {
power: [],
vagaries: [],
careers: ['legend', 'number']
}
getSectionObject(sections, data => {
// first delete existing Vagaries and Invocations
data.vagaries.forEach(row => removeRepeatingRow(`repeating_vagaries_${row}`) );
data.power.forEach(row => removeRepeatingRow(`repeating_power_${row}` ));
getAttrs([...data.fields, 'invocations', 'homeland'], v => {
const output = {};
const first_row = data.careers.filter(row => int(v[section_name('careers', row, 'number')]) === 1);
if(first_row.length === 0) return;
const legend = v[section_name('careers', first_row, 'legend')];
const homeland = legends_obj[legend.toLowerCase()].homeland; //v.homeland; // might get homeland from first legend.
const vagaries = [];
//vagaries.push('Flashback Ritual');
vagaries.push(`${legends_obj[legend.toLowerCase()].vagary} (Flashback)`)
//console.info(({first_row, legend, vagaries, homeland}));
const special_legends = ['abomination', 'cataphract', 'dispossessed', 'dryad', 'scion', 'traveller', 'chimera'];
data.careers.forEach(id => {
// option: include all vagaries, but set owned to 0 for all but these. But that encourages peopleto get ine ones.
const new_legend = v[section_name('careers', id, 'legend')];
if(special_legends.includes(new_legend.toLowerCase())) {
const vagary = legends_obj[new_legend.toLowerCase()].vagary;
vagaries.push(vagary);
}
});
const vagaries_unique = new Set(vagaries);
vagaries_unique.forEach(vagary => {
const row = generateRowID();
output[section_name('vagaries', row, 'name')] = vagary;
output[section_name('vagaries', row, 'cost')] = 0;
output[section_name('vagaries', row, 'owned')] = 1;
});
//INVOCATIONS
const score = +v.invocations || 0;
const number = Math.max(0,calc_score(score/4)-1 +(homeland === 'Celebrant' ? 1 : 0));
const words = [
["DOUBLE", "Chill", "Babble", "Becalm", "Cleave", "Barrel"],
["Fade", "DOUBLE", "Counter", "Drench", "Jangle", "Blight"],
["Itch", "Cremate", "DOUBLE", "Gust", "Obfuscate", "Dust"],
["Leapfrog", "Dazzle", "Fascinate", "DOUBLE", "Stick", "Growth"],
["Spider", "Scry", "Rage", "Lightning", "DOUBLE", "Quickland"],
["Twitch", "Snuff", "Truth", "Thunder", "Surge", "DOUBLE"],
];
let found = [];
// might want to check there are no duplicates
for(let i=0; i<number; i++) {
let roll1 = roll() -1;
let roll2 = roll() -1;
if(roll1 === roll2) {
roll1 = roll() -1;
roll2 = roll() -1;
if(roll1 === roll2) {
found.push('choose');
} else {
found.push(words[roll1][roll2]);
found.push(words[roll2][roll1]);
}
} else {
found.push(`${words[roll1][roll2]}/${words[roll2][roll1]}`);
}
}
found.forEach(item => {
const row_id = generateRowID();
if(item.includes('/')) {
const items = item.split('/');
output[`repeating_power_${row_id}_name`] = items[0] + '/' + items[1];
} else {
output[`repeating_power_${row_id}_name`] = item;
}
});
output.skill_weird = 1;
output.xp = 0;
setAttrs(output);
});
});
}
});
});
on('clicked:push', () => {
//[[ {[[?{How Many Dice?}d6]]}kh1]] {{Rolled Dice=$[[0]]}}{{Highest Die=$[[1]]}}
startRoll('@{whisper_roll}&{template:pages} {{title=@{character_name} Rolls ?{How Many Dice?|1|2|3|4|5|6|7|8|9} Dice}}{{Highest Die=[[?{How Many Dice?}d6cs0cf6kh1]]}}', make_roll => {
finishRoll(make_roll.rollId);
})
});
on('clicked:d6', () => {
startRoll('@{whisper_roll}&{template:pages} {{title=@{character_name} rolls a D6}}{{Roll=[[1d6cs7cf0]]}}', make_roll => {
finishRoll(make_roll.rollId);
})
});
on('clicked:d20', () => {
//const roll_string = `&{template:pages} {{title=@{character_name} rolls a D20}}{{Roll=[[1d20]]}} {{Easy=7 [3/1]}} {{Typical=13 [6/3]}} {{Challenging=19 [9/4]}} {{Formidable=26 [13/6/3]}} {{Folly=33 [16/8/4]}} {{Imposible=40 [20/10/5]}}`;
const roll_string = `@{whisper_roll}&{template:pages} {{title=@{character_name} rolls a D20}}{{Roll=[[1d20cs0cf20]]}} {{Easy=7 [3/1]}} {{Typical=13 [6/3]}} {{Challenging=19 [9/4]}}`;
startRoll(roll_string, make_roll => {
finishRoll(make_roll.rollId);
})
});
on('change:repeating_attacks:damage_type', () => {
getAttrs(['repeating_attacks_damage_type'], v => {
let output = '@{whisper_roll}&{template:pages} {{title=@{name} Attack }} {{subtitle=@{character_name} }} {{Score=**@{score}** (@{attack_string})}} {{modifier=[[?{Modifier|0}]]}} {{roll=[[1d20cs0cf20]]}} {{average=[[@{score}+?{Modifier}]]}} {{poor=[[@{poor}+2*?{Modifier}]]}} {{good=[[@{good}+?{Modifier}/2]]}} {{excellent=[[@{excellent}+?{Modifier}/4]]}} {{spectacular=[[@{spectacular}+?{Modifier}/8]]}} {{damage=[[@{damage}cf0cs7 + @{damage_bonus}d6cf0cs7]]}}';
const damage_type = v.repeating_attacks_damage_type;
if(damage_type === '-') {
output = '@{whisper_roll}&{template:pages} {{title=@{name} Attack }} {{subtitle=@{character_name} }} {{Score=**@{score}** (@{attack_string})}} {{modifier=[[?{Modifier|0}]]}} {{roll=[[1d20cs0cf20]]}} {{average=[[@{score}+?{Modifier}]]}} {{poor=[[@{poor}+2*?{Modifier}]]}} {{good=[[@{good}+?{Modifier}/2]]}} {{excellent=[[@{excellent}+?{Modifier}/4]]}} {{spectacular=[[@{spectacular}+?{Modifier}/8]]}} {{damage=[[@{damage_bonus}d6cf0cs7]]}}';
}
setAttrs({
repeating_attacks_roll_string: output
});
});
});
/* need to construct the entire string without ability calls */
//button_damage: @{whisper_roll}&{template:pages} {{title=@{repeating_demons_name} Damage}} {{subtitle=@{character_name} Daemon}} {{Damage ([[ floor(@{row_spirit}/4) + @{modifier}]]d6+[[floor(@{row_spirit}/4)]]):=[[ [[floor(@{row_spirit}/4) + @{modifier}]]d6cf0cs7 + [[floor(@{row_spirit}/4)]] ]]}}
//button_weapon: @{whisper_roll}&{template:pages} {{title=@{repeating_demons_name} Weapon}} {{subtitle=@{character_name} Daemon}} {{Damage ([[ floor(@{row_spirit}/4) + @{weapon_select} + @{modifier}]]d6):=[[ [[floor(@{row_spirit}/4) + @{weapon_select} + @{modifier}]]d6cf0cs7 ]]}}
on('change:repeating_demons', () => {
getSectionIDs('repeating_demons', id_array => {
const fields = id_array.reduce((all, id) => [...all, section_name('demons', id, 'name'), section_name('demons', id, 'spirit')], []);
getAttrs(fields, v => {
const output = {};
id_array.forEach(id => {
const spirit = +v[section_name('demons', id, 'spirit')] || 0;
const name = v[section_name('demons', id, 'name')];
output[section_name('demons', id, 'row_id')] = id;
output[section_name('demons', id, 'spirit_damage')] = Math.floor(spirit/4);
output[section_name('demons', id, 'hidden_name')] = name;
});
setAttrs(output, {silent:true});
});
});
});
on('change:repeating_demons:spirit', () => {
getAttrs(['repeating_demons_spirit', 'settings_vigour'], v => {
const setting_vigour = +v.settings_vigour || 0;
const power = +v.repeating_demons_spirit || 0;
const output = {};
output.repeating_demons_power = power;
output.repeating_demons_power_max = power;
output.repeating_demons_vigour = power * (1 + setting_vigour);
output.repeating_demons_vigour_max = power *2;
output.repeating_demons_body_max = Math.floor(power/2);
output.repeating_demons_body = Math.floor(power/2);
setAttrs(output);
});
});
const change_weapons = () => {
getSectionIDs('repeating_attacks', ids => {
const changes = ids.reduce((all, one) => [...all, `repeating_attacks_${one}_skill`, `repeating_attacks_${one}_mod`], []);
getAttrs([...changes, ...Object.keys(skills_obj).map(skill => `${skill}`)], v => {
const output = {};
ids.forEach(id => {
const skill = v[`repeating_attacks_${id}_skill`];
const score_base = +v[`${skill}`] || 0;
const score_mod = +v[`repeating_attacks_${id}_mod`] || 0;
const score = score_base + score_mod;
output[`repeating_attacks_${id}_score`] = score;
output[`repeating_attacks_${id}_poor`] = calc_score(score *2);
output[`repeating_attacks_${id}_good`] = calc_score(score/2);
output[`repeating_attacks_${id}_excellent`] = calc_score(score/4);
output[`repeating_attacks_${id}_spectacular`] = score > 19 ? calc_score(score/8) : 0;
output[`repeating_attacks_${id}_attack_string`] = `G${calc_score(score/2)}-E${calc_score(score/4)}${score > 19 ? `-S${calc_score(score/8)}`: ''}`;
});
setAttrs(output);
});
});
}
on('change:repeating_attacks:name change:repeating_attacks:skill change:repeating_attacks:mod', (event) => {
change_weapons();
});
const swaps = {
front: 'sheet_tab',
back: 'sheet_tab',
gm: 'sheet_tab',
design: 'design_mode',
play: 'design_mode'
}
on('clicked:bio_toggle', () => {
getAttrs(['bio_toggled'], v => {
const toggle = +v.bio_toggled || 0;
setAttrs({
bio_toggled: 1-toggle
})
});
});
Object.keys(swaps).forEach(button => {
on(`clicked:${button}`, () => {
setAttrs({
[swaps[button]]: button
});
});
});
[2, 3].forEach(swap => {
on(`clicked:swaplegend_${swap}`, () => {
getAttrs([`legend_choice_${swap-1}`, `legend_choice_${swap}`], v => {
const one = v[`legend_choice_${swap-1}`];
const two = v[`legend_choice_${swap}`];
const output = {}
output[`legend_choice_${swap}`] = one;
output[`legend_choice_${swap-1}`] = two;
/*if(swap === 3) {
getSectionIDs('repeating_passions', id_array => {
if(id_array.length) {
const row = id_array[0];
output[`repeating_passions_${row}_name`] = `Glory: ${(one)}`;
}
setAttrs(output);
});
} else {
setAttrs(output);
}*/
setAttrs(output);
});
});
});
const force_recalculation = (roll_string) => {
getAttrs(['recalaculate'], v => {
const calc = +v.recalaculate|| 0;
setAttrs({
recalaculate: 1 - calc
},{silent:false}, startRoll(roll_string, id => {
finishRoll(id.rollId)
}));
});
};
on('sheet:opened change:repeating_gear remove:repeating_gear change:load_special', () => {
getSectionIDs('repeating_gear', ids => {
const changes = ids.reduce((all,id) => [...all, `repeating_gear_${id}_count`, `repeating_gear_${id}_load`, `repeating_gear_${id}_checked`], []);
getAttrs([...changes, 'load_special'], v => {
const special = +v.load_special || 0;
const output = {};
let carried = 0;
let other = 0;
ids.forEach(id => {
const how_many = +v[`repeating_gear_${id}_count`] || 0;
const per_item = +v[`repeating_gear_${id}_load`] || 0;
const sum = per_item * how_many;
const checked = +v[`repeating_gear_${id}_checked`] || 0;
carried += checked ? sum : 0;
other += checked ? 0 : sum;
});
output.carried = carried + special;
output.other = other;
setAttrs(output);
});
});
});
on('change:sheet_tab change:design_mode change:flip_attacks', () => {
getAttrs(['sheet_tab','design_mode', 'flip_attacks'], v => {
const tab = v.sheet_tab;
const mode = v.design_mode;
const flip = +v.flip_attacks || 0;
const output ={};
output.heroic_visible = (tab === 'front' && mode === 'design') ? 1 : 0;
output.xp_button_visible = (tab === 'front' && mode === 'play') ? 1 : 0;
output.settings_visible = 0;
output.flipped = (mode === 'design' || (mode === 'play' && flip)) ? 1 : 0;
output.xp_visible = 0;
setAttrs(output);
});
});
const special_buttons = ['settings', 'xp']
special_buttons.forEach(button => {
on(`clicked:${button}`, () => {
getAttrs([`${button}_visible`], v => {
const settings = +v[`${button}_visible`] || 0;
setAttrs({
[`${button}_visible`]: 1 - settings
});
});
});
});
on('change:sheet_tab', () => {
const output = {};
special_buttons.forEach(button => output[[`${button}_visible`]] = 0);
setAttrs(output);
});
</script>
<input type="hidden" name="attr_test_damage_attribute" value="~Me|test_damage">
<button type="roll" name="roll_test_damage" class="hidden" value="&{template:default} {{title=@{character_name} rolls Damage}} {{roll=[[1d6+@{damage_bonus}]]}}"></button>
<rolltemplate class="sheet-rolltemplate-attack">
<div class="key">Attack Roll:</div>
<div class="value">{{attack}}</div>
<div class="key">Target:</div>
<div class="value">{{target}}</div>
<div class="key">Result:</div>
<div class="value">
{{#rollGreater() attack target}}Success{{/rollGreater() attack target}}
{{#rollLess() attack target}}Failure{{/rollLess() attack target}}
</div>
{{#^rollLess() attack target}}
<div class="damage-roll">
[Damage]({{button}})
</div>
{{/^rollLess() attack target}}
</rolltemplate>