717 lines
26 KiB
HTML
717 lines
26 KiB
HTML
<div class="container">
|
||
|
||
<div class="top grid-small">
|
||
<img
|
||
src="https://raw.githubusercontent.com/roll20/roll20-character-sheets/master/Heart-the-City-Beneath-mk2/Heart-logo-transparent.png"
|
||
alt="Heart: The City Beneath logo" />
|
||
<label>
|
||
<span class="redtext" data-i18n="name">Name</span>
|
||
<input type="text" spellcheck="false" name="attr_character_name">
|
||
</label>
|
||
<label>
|
||
<span class="redtext" data-i18n="class">Class</span>
|
||
<input type="text" spellcheck="false" name="attr_class">
|
||
</label>
|
||
<label>
|
||
<span class="redtext" data-i18n="calling">Calling</span>
|
||
<input type="text" spellcheck="false" name="attr_calling">
|
||
</label>
|
||
<label>
|
||
<span class="redtext" data-i18n="ancestry">Ancestry</span>
|
||
<input type="text" spellcheck="false" name="attr_ancestry">
|
||
</label>
|
||
</div>
|
||
|
||
<div class="stress grid-large">
|
||
<div class="stress-values grid-tiny">
|
||
<h3 class="redtext stresslabel" data-i18n="stress">Stress</h3>
|
||
<h3 class="redtext" data-i18n="protection">Protection</h3>
|
||
|
||
<label>
|
||
<span class="redtext" data-i18n="blood">Blood</span>
|
||
<input type="number" value="0" min="0" max="10" name="attr_blood_stress" />
|
||
</label>
|
||
<input type="number" placeholder="0" min="0" max="5" name="attr_blood_protection" />
|
||
|
||
<label>
|
||
<span class="redtext" data-i18n="mind">Mind</span>
|
||
<input type="number" value="0" min="0" max="10" name="attr_mind_stress" />
|
||
</label>
|
||
<input type="number" placeholder="0" min="0" max="5" name="attr_mind_protection" />
|
||
|
||
<label>
|
||
<span class="redtext" data-i18n="echo">Echo</span>
|
||
<input type="number" value="0" min="0" max="10" name="attr_echo_stress" />
|
||
</label>
|
||
<input type="number" placeholder="0" min="0" max="5" name="attr_echo_protection" />
|
||
|
||
<label>
|
||
<span class="redtext" data-i18n="fortune">Fortune</span>
|
||
<input type="number" value="0" min="0" max="10" name="attr_fortune_stress" />
|
||
</label>
|
||
<input type="number" placeholder="0" min="0" max="5" name="attr_fortune_protection" />
|
||
|
||
<label>
|
||
<span class="redtext" data-i18n="supplies">Supplies</span>
|
||
<input type="number" value="0" min="0" max="10" name="attr_supplies_stress" />
|
||
</label>
|
||
<input type="number" placeholder="0" min="0" max="5" name="attr_supplies_protection" />
|
||
|
||
<label>
|
||
<span class="redtext" data-i18n="total">Total</span>
|
||
<input type="number" value="0" min="0" max="10" name="attr_total_stress" readonly />
|
||
</label>
|
||
</div>
|
||
|
||
<div class="stress-clear">
|
||
<h3 class="redtext" data-i18n="clearstress">Clear Stress</h3>
|
||
<select name="attr_clearedstress">
|
||
<option value="blood" data-i18n="blood" selected>Blood</option>
|
||
<option value="mind" data-i18n="mind">Mind</option>
|
||
<option value="echo" data-i18n="echo">Echo</option>
|
||
<option value="fortune" data-i18n="fortune">Fortune</option>
|
||
<option value="supplies" data-i18n="supplies">Supplies</option>
|
||
<option value="all" data-i18n="all-stress">All Stress</option>
|
||
</select>
|
||
<button type="action" title="Clear Stress" name="act_clear_stress" data-i18n="clear">Clear</button>
|
||
</div>
|
||
|
||
<button type="roll" title="Receive fallout?" name="roll_fallout" data-i18n="fallout-test"
|
||
value="&{template:heart} {{title=^{fallout}}} {{name=@{character_name}}} {{fallout_against=[[@{total_stress}]]}} {{roll=[[1d12cs0cf0]] vs [[@{total_stress}]]}}">Fallout</button>
|
||
|
||
<div class="rollbutton grid-large">
|
||
<select name="attr_roll_skill" class="skill-select">
|
||
<option value="" selected>–</option>
|
||
<option value="compel" data-i18n="compel">Compel</option>
|
||
<option value="delve" data-i18n="delve">Delve</option>
|
||
<option value="discern" data-i18n="discern">Discern</option>
|
||
<option value="endure" data-i18n="endure">Endure</option>
|
||
<option value="evade" data-i18n="evade">Evade</option>
|
||
<option value="hunt" data-i18n="hunt">Hunt</option>
|
||
<option value="kill" data-i18n="kill">Kill</option>
|
||
<option value="mend" data-i18n="mend">Mend</option>
|
||
<option value="sneak" data-i18n="sneak">Sneak</option>
|
||
</select>
|
||
<select name="attr_roll_domain" class="domain-select">
|
||
<option value="" selected>–</option>
|
||
<option value="cursed" data-i18n="cursed">Cursed</option>
|
||
<option value="desolate" data-i18n="desolate">Desolate</option>
|
||
<option value="haven" data-i18n="haven">Haven</option>
|
||
<option value="occult" data-i18n="occult">Occult</option>
|
||
<option value="religion" data-i18n="religion">Religion</option>
|
||
<option value="technology" data-i18n="technology">Technology</option>
|
||
<option value="warren" data-i18n="warren">Warren</option>
|
||
<option value="wild" data-i18n="wild">Wild</option>
|
||
</select>
|
||
<label class="mastery">
|
||
<input type="checkbox" name="attr_roll_mastery" value="1" />
|
||
<span></span>
|
||
<span data-i18n="mastery?">Mastery?</span>
|
||
</label>
|
||
<label class="extradice">
|
||
<span>+</span>
|
||
<input type="number" name="attr_roll_extra_dice" value="0" />
|
||
</label>
|
||
<select name="attr_roll_difficulty" class="difficulty">
|
||
<option value="0" data-i18n="standard">Standard</option>
|
||
<option value="1" data-i18n="risky">Risky</option>
|
||
<option value="2" data-i18n="dangerous">Dangerous</option>
|
||
</select>
|
||
<button type="roll" title="roll dice" name="roll_normal" data-i18n="roll"
|
||
value="&{template:heart} {{title=@{roll_title}}} {{name=@{character_name}}} {{roll=@{roll_formula}}} {{roll_details=@{roll_formula_single}}} {{details=@{roll_message}}} {{showresult=1}} @{roll_zerodice}">Roll</button>
|
||
<input type="hidden" name="attr_roll_formula" value="" />
|
||
<input type="hidden" name="attr_roll_formula_single" value="" />
|
||
<input type="hidden" name="attr_roll_message" value="" />
|
||
<input type="hidden" name="attr_roll_title" value="" />
|
||
<input type="hidden" name="attr_roll_zerodice" value="" />
|
||
<div class="small-text">
|
||
<b><span data-i18n="standard">Standard</span>:</b>
|
||
<span data-i18n="standard-pool-label">use highest result</span>
|
||
<br />
|
||
<b><span data-i18n="risky">Risky</span>:</b>
|
||
<span data-i18n="risky-pool-label">drop highest result, use second-highest result</span>
|
||
<br />
|
||
<b><span data-i18n="dangerous">Dangerous</span>:</b>
|
||
<span data-i18n="dangerous-pool-label">drop 2 highest results, use third-highest result</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="beats grid-tiny">
|
||
<h3 class="redtext" data-i18n="active-beats">Active Beats</h3>
|
||
<fieldset class="repeating_activebeats">
|
||
<div class="reprow grid-tiny">
|
||
<label class="check">
|
||
<input type="checkbox" name="attr_beat_check" value="1" />
|
||
<span></span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_beat_name"></span>
|
||
<textarea spellcheck="false" name="attr_beat_name"></textarea>
|
||
</div>
|
||
<select name="attr_beat_type">
|
||
<option value="minor" data-i18n="minor">Minor</option>
|
||
<option value="major" data-i18n="major">Major</option>
|
||
<option value="zenith" data-i18n="zenith">Zenith</option>
|
||
</select>
|
||
</div>
|
||
</fieldset>
|
||
</div>
|
||
|
||
<div class="equipment grid-tiny">
|
||
<h3 class="redtext" data-i18n="equipment">Equipment</h3>
|
||
<div class="equipment-grid grid-tiny">
|
||
<h4 data-i18n="name">Name</h4>
|
||
<h4 data-i18n="description-label">Domain/Tags</h4>
|
||
<h4 data-i18n="die">Die</h4>
|
||
</div>
|
||
<fieldset class="repeating_equipment">
|
||
<div class="equipment-grid grid-tiny">
|
||
<div class="auto-expand"><span name="attr_equipment_name"></span>
|
||
<textarea spellcheck="false" name="attr_equipment_name"></textarea>
|
||
</div>
|
||
<div class="auto-expand"><span name="attr_equipment_desc"></span>
|
||
<textarea spellcheck="false" name="attr_equipment_desc"></textarea>
|
||
</div>
|
||
<select name="attr_equipment_die">
|
||
<option value="0" data-i18n="none" selected>None</option>
|
||
<option value="2">d2</option>
|
||
<option value="4">d4</option>
|
||
<option value="6">d6</option>
|
||
<option value="8">d8</option>
|
||
<option value="10">d10</option>
|
||
<option value="12">d12</option>
|
||
<option value="20">d20</option>
|
||
</select>
|
||
<button type="roll" name="roll_roll"
|
||
value="&{template:heart} {{name=@{character_name}}} {{title=@{equipment_name}}} {{title_suffix=@{equipment_desc}}} {{roll=[[d@{equipment_die}]]}}"></button>
|
||
</div>
|
||
</fieldset>
|
||
</div>
|
||
|
||
<div class="resources grid-tiny">
|
||
<h3 class="redtext" data-i18n="resources">Resources</h3>
|
||
<div class="equipment-grid grid-tiny">
|
||
<h4 data-i18n="name">Name</h4>
|
||
<h4 data-i18n="description-label">Domain/Tags</h4>
|
||
<h4 ata-i18n="die">Die</h4>
|
||
</div>
|
||
<fieldset class="repeating_resources">
|
||
<div class="equipment-grid grid-tiny">
|
||
<div class="auto-expand"><span name="attr_resource_name"></span>
|
||
<textarea spellcheck="false" name="attr_resource_name"></textarea>
|
||
</div>
|
||
<div class="auto-expand"><span name="attr_resource_desc"></span>
|
||
<textarea spellcheck="false" name="attr_resource_desc"></textarea>
|
||
</div>
|
||
<select name="attr_resource_die">
|
||
<option value="0" data-i18n="none" selected>None</option>
|
||
<option value="2">d2</option>
|
||
<option value="4">d4</option>
|
||
<option value="6">d6</option>
|
||
<option value="8">d8</option>
|
||
<option value="10">d10</option>
|
||
<option value="12">d12</option>
|
||
<option value="20">d20</option>
|
||
</select>
|
||
<button type="roll" name="roll_roll"
|
||
value="&{template:heart} {{name=@{character_name}}} {{title=@{resource_name}}} {{title_suffix=@{resource_desc}}} {{roll=[[d@{resource_die}]]}}"></button>
|
||
</div>
|
||
</fieldset>
|
||
</div>
|
||
|
||
<div class="skills-domains grid-large">
|
||
<div class="skills grid-small">
|
||
<h3 class="redtext" data-i18n="skills">Skills</h3>
|
||
<h4 class="pinktext" data-i18n="knacks">Knacks</h4>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_skill_compel" value="1" />
|
||
<span></span>
|
||
<span data-i18n="compel">Compel</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_compel_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_compel_knacks"></textarea>
|
||
</div>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_skill_delve" value="1" />
|
||
<span></span>
|
||
<span data-i18n="delve">Delve</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_delve_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_delve_knacks"></textarea>
|
||
</div>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_skill_discern" value="1" />
|
||
<span></span>
|
||
<span data-i18n="discern">Discern</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_discern_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_discern_knacks"></textarea>
|
||
</div>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_skill_endure" value="1" />
|
||
<span></span>
|
||
<span data-i18n="endure">Endure</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_endure_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_endure_knacks"></textarea>
|
||
</div>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_skill_evade" value="1" />
|
||
<span></span>
|
||
<span data-i18n="evade">Evade</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_evade_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_evade_knacks"></textarea>
|
||
</div>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_skill_hunt" value="1" />
|
||
<span></span>
|
||
<span data-i18n="hunt">Hunt</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_hunt_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_hunt_knacks"></textarea>
|
||
</div>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_skill_kill" value="1" />
|
||
<span></span>
|
||
<span data-i18n="kill">Kill</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_kill_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_kill_knacks"></textarea>
|
||
</div>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_skill_mend" value="1" />
|
||
<span></span>
|
||
<span data-i18n="mend">Mend</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_mend_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_mend_knacks"></textarea>
|
||
</div>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_skill_sneak" value="1" />
|
||
<span></span>
|
||
<span data-i18n="sneak">Sneak</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_sneak_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_sneak_knacks"></textarea>
|
||
</div>
|
||
</div>
|
||
<div class="domains grid-small">
|
||
<h3 class="redtext" data-i18n="domains">Domains</h3>
|
||
<h4 class="pinktext" data-i18n="knacks">Knacks</h4>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_domain_cursed" value="1" />
|
||
<span></span>
|
||
<span data-i18n="cursed">Cursed</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_cursed_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_cursed_knacks"></textarea>
|
||
</div>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_domain_desolate" value="1" />
|
||
<span></span>
|
||
<span data-i18n="desolate">Desolate</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_desolate_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_desolate_knacks"></textarea>
|
||
</div>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_domain_haven" value="1" />
|
||
<span></span>
|
||
<span data-i18n="haven">Haven</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_haven_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_haven_knacks"></textarea>
|
||
</div>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_domain_occult" value="1" />
|
||
<span></span>
|
||
<span data-i18n="occult">Occult</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_occult_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_occult_knacks"></textarea>
|
||
</div>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_domain_religion" value="1" />
|
||
<span></span>
|
||
<span data-i18n="religion">Religion</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_religion_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_religion_knacks"></textarea>
|
||
</div>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_domain_technology" value="1" />
|
||
<span></span>
|
||
<span data-i18n="technology">Technology</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_technology_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_technology_knacks"></textarea>
|
||
</div>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_domain_warren" value="1" />
|
||
<span></span>
|
||
<span data-i18n="warren">Warren</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_warren_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_warren_knacks"></textarea>
|
||
</div>
|
||
|
||
<label class="skill-box">
|
||
<input type="checkbox" name="attr_domain_wild" value="1" />
|
||
<span></span>
|
||
<span data-i18n="wild">Wild</span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_wild_knacks"></span>
|
||
<textarea spellcheck="false" name="attr_wild_knacks"></textarea>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="abilities grid-tiny">
|
||
<h3><span class="whiteonredtext" data-i18n="abilities">Abilities</span></h3>
|
||
<fieldset class="repeating_abilities">
|
||
<div class="reprow grid-tiny">
|
||
<input type="text" class="redtext" spellcheck="false" name="attr_ability_name"
|
||
data-i18n-placeholder="ability_name" />
|
||
<select name="attr_ability_type">
|
||
<option value="core" data-i18n="core">Core</option>
|
||
<option value="minor" data-i18n="minor" selected>Minor</option>
|
||
<option value="major" data-i18n="major">Major</option>
|
||
<option value="zenith" data-i18n="zenith">Zenith</option>
|
||
</select>
|
||
<label class="check">
|
||
<input type="checkbox" name="attr_ability_check" value="1" />
|
||
<span></span>
|
||
</label>
|
||
<div class="auto-expand"><span name="attr_ability_details"></span>
|
||
<textarea spellcheck="false" name="attr_ability_details"></textarea>
|
||
</div>
|
||
<button class="broadcast-button" type="roll" name="roll_Show"
|
||
value="&{template:heart} {{title=@{ability_name} (^{@{ability_type}})}} {{name=@{character_name}}} {{details=@{ability_details}}}">:</button>
|
||
</div>
|
||
</fieldset>
|
||
</div>
|
||
|
||
<div class="fallout grid-tiny">
|
||
<h3><span class="whiteonredtext" data-i18n="fallout">Fallout</span></h3>
|
||
<fieldset class="repeating_fallout">
|
||
<div class="reprow grid-tiny">
|
||
<input type="text" spellcheck="false" class="sheet-redtext" name="attr_fallout_name"
|
||
data-i18n-placeholder="fallout_name" />
|
||
<select name="attr_fallout_type">
|
||
<option value="blood" data-i18n="blood" selected>Blood</option>
|
||
<option value="mind" data-i18n="mind">Mind</option>
|
||
<option value="echo" data-i18n="echo">Echo</option>
|
||
<option value="fortune" data-i18n="fortune">Fortune</option>
|
||
<option value="supplies" data-i18n="supplies">Supplies</option>
|
||
</select>
|
||
<select name="attr_fallout_severity">
|
||
<option value="minor" data-i18n="minor">Minor</option>
|
||
<option value="major" data-i18n="major">Major</option>
|
||
<option value="critical" data-i18n="critical">Critical</option>
|
||
</select>
|
||
<div class="auto-expand"><span name="attr_fallout_details"></span>
|
||
<textarea spellcheck="false" name="attr_fallout_details"></textarea>
|
||
</div>
|
||
<button class="broadcast-button" type="roll" name="roll_Show"
|
||
value="&{template:heart} {{title=@{fallout_name} (^{@{fallout_type}}, ^{@{fallout_severity}})}} {{name=@{character_name}}} {{details=@{fallout_details}}}">:</button>
|
||
</div>
|
||
</fieldset>
|
||
</div>
|
||
|
||
<div class="notes grid-tiny">
|
||
<h3><span class="redtext" data-i18n="notes">Notes</h3>
|
||
<fieldset class="repeating_notes">
|
||
<div class="auto-expand"><span name="attr_notes"></span>
|
||
<textarea spellcheck="false" name="attr_notes"></textarea>
|
||
</div>
|
||
</fieldset>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<input type="hidden" name="attr_version" value="0" />
|
||
|
||
<rolltemplate class="sheet-rolltemplate-heart">
|
||
<div class="title">
|
||
{{title}}
|
||
{{#title_suffix}}({{title_suffix}}){{/title_suffix}}
|
||
</div>
|
||
<div class="name">{{name}}</div>
|
||
{{#roll}}<div class="roll">
|
||
<div class="main-roll">{{roll}}</div>
|
||
<div class="roll-details">{{roll_details}}</div>
|
||
</div>{{/roll}}
|
||
{{#showresult}}<div class="result">
|
||
{{^zerodice}}
|
||
{{#rollTotal() roll 1}}
|
||
<span data-i18n="critical-failure-msg"></span>
|
||
{{/rollTotal() roll 1}}
|
||
{{#rollBetween() roll 2 5}}
|
||
<span data-i18n="failure-msg"></span>
|
||
{{/rollBetween() roll 2 5}}
|
||
{{#rollBetween() roll 6 7}}
|
||
<span data-i18n="success-at-a-cost-msg"></span>
|
||
{{/rollBetween() roll 6 7}}
|
||
{{#rollBetween() roll 8 9}}
|
||
<span data-i18n="success-msg"></span>
|
||
{{/rollBetween() roll 8 9}}
|
||
{{#rollTotal() roll 10}}
|
||
<span data-i18n="critical-success-msg"></span>
|
||
{{/rollTotal() roll 10}}
|
||
{{/zerodice}}
|
||
{{#zerodice}}
|
||
{{#rollTotal() roll 1}}
|
||
<span data-i18n="critical-failure-msg"></span>
|
||
{{/rollTotal() roll 1}}
|
||
{{#rollBetween() roll 2 9}}
|
||
<span data-i18n="failure-msg"></span>
|
||
{{/rollBetween() roll 2 9}}
|
||
{{#rollTotal() roll 10}}
|
||
<span data-i18n="success-at-a-cost-msg"></span>
|
||
{{/rollTotal() roll 10}}
|
||
{{/zerodice}}
|
||
</div>{{/showresult}}
|
||
{{#details}}<div class="details">{{details}}</div>{{/details}}
|
||
{{#fallout_against}}<div class="fallout">
|
||
{{#rollGreater() roll fallout_against}}
|
||
<span data-i18n="no-fallout"></span>.
|
||
{{/rollGreater() roll fallout_against}}
|
||
{{#^rollGreater() roll fallout_against}}
|
||
{{#rollGreater() roll 6}}<span data-i18n="take-major-fallout"></span>.{{/rollGreater() roll 6}}
|
||
{{#^rollGreater() roll 6}}<span data-i18n="take-minor-fallout"></span>.{{/^rollGreater() roll 6}}
|
||
{{/^rollGreater() roll fallout_against}}
|
||
</div>{{/fallout_against}}
|
||
|
||
</rolltemplate>
|
||
|
||
<script type="text/worker">
|
||
const kStresses = ["blood", "mind", "echo", "fortune", "supplies"].map(
|
||
(x) => `${x}_stress`
|
||
);
|
||
|
||
const kSkills = [
|
||
"compel",
|
||
"delve",
|
||
"discern",
|
||
"endure",
|
||
"evade",
|
||
"hunt",
|
||
"kill",
|
||
"mend",
|
||
"sneak",
|
||
];
|
||
const kDomains = [
|
||
"cursed",
|
||
"desolate",
|
||
"haven",
|
||
"occult",
|
||
"religion",
|
||
"technology",
|
||
"warren",
|
||
"wild",
|
||
];
|
||
const Difficulty = {
|
||
Standard: 0,
|
||
Risky: 1,
|
||
Dangerous: 2,
|
||
};
|
||
|
||
const kRollAffectingAttributes = [
|
||
...kSkills.map((skill) => `skill_${skill}`),
|
||
...kDomains.map((domain) => `domain_${domain}`),
|
||
"roll_skill",
|
||
"roll_domain",
|
||
"roll_mastery",
|
||
"roll_extra_dice",
|
||
"roll_difficulty",
|
||
];
|
||
|
||
function getTranslation(key) {
|
||
return key ? (getTranslationByKey(key) || "") : "";
|
||
}
|
||
|
||
// This is not very efficient, but it only runs at most once.
|
||
function runLegacyUpgrade() {
|
||
console.log("Running one-time upgrade from pre-versioned sheet.");
|
||
const attrRenames = {
|
||
domainCursed: "domain_cursed",
|
||
domainDesolate: "domain_desolate",
|
||
domainHaven: "domain_haven",
|
||
domainOccult: "domain_occult",
|
||
domainReligion: "domain_religion",
|
||
domainTechnology: "domain_technology",
|
||
domainWarren: "domain_warren",
|
||
domainWild: "domain_wild",
|
||
skillCompel: "skill_compel",
|
||
skillDelve: "skill_delve",
|
||
skillDiscern: "skill_discern",
|
||
skillEndure: "skill_endure",
|
||
skillEvade: "skill_evade",
|
||
skillHunt: "skill_hunt",
|
||
skillKill: "skill_kill",
|
||
skillMend: "skill_mend",
|
||
skillSneak: "skill_sneak",
|
||
};
|
||
getAttrs([...Object.keys(attrRenames), "fallout"], (v) => {
|
||
const attrs = {};
|
||
for (const [oldName, newName] of Object.entries(attrRenames)) {
|
||
if (v[oldName] === "1") attrs[newName] = "1";
|
||
}
|
||
if (v.fallout) {
|
||
attrs[`repeating_fallout_${generateRowID()}_fallout_details`] = v.fallout;
|
||
}
|
||
setAttrs(attrs);
|
||
});
|
||
|
||
const repeatingRenames = {
|
||
abilities: {
|
||
abilityTitle: "ability_name",
|
||
abilityDetails: "ability_details",
|
||
},
|
||
activebeats: {
|
||
beats: "beat_name",
|
||
},
|
||
};
|
||
for (const [sectionName, sectionAttrs] of Object.entries(repeatingRenames)) {
|
||
getSectionIDs(`repeating_${sectionName}`, (sectionIds) => {
|
||
const attrsToGet = sectionIds.flatMap((id) =>
|
||
Object.keys(sectionAttrs).map(
|
||
(x) => `repeating_${sectionName}_${id}_${x}`
|
||
)
|
||
);
|
||
getAttrs(attrsToGet, (v) => {
|
||
const attrs = {};
|
||
for (const [oldName, newName] of Object.entries(sectionAttrs)) {
|
||
for (const id of sectionIds) {
|
||
attrs[`repeating_${sectionName}_${id}_${newName}`] =
|
||
v[`repeating_${sectionName}_${id}_${oldName}`];
|
||
}
|
||
}
|
||
setAttrs(attrs);
|
||
});
|
||
});
|
||
}
|
||
}
|
||
|
||
function clearStress() {
|
||
getAttrs(["clearedstress"], (v) => {
|
||
const attrs = {};
|
||
if (v["clearedstress"] === "all") {
|
||
kStresses.forEach((stress) => {
|
||
attrs[stress] = 0;
|
||
});
|
||
} else {
|
||
attrs[v["clearedstress"] + "_stress"] = 0;
|
||
}
|
||
setAttrs(attrs);
|
||
});
|
||
}
|
||
|
||
function calculateTotalStress() {
|
||
getAttrs(kStresses, (v) => {
|
||
const total_stress = kStresses.reduce((m, stress) => {
|
||
return m + parseInt(v[stress], 10) || 0;
|
||
}, 0);
|
||
setAttrs({ total_stress });
|
||
});
|
||
}
|
||
|
||
function getDifficultyMessage(difficulty, is_zero) {
|
||
let difficulty_str = "";
|
||
switch (difficulty) {
|
||
case Difficulty.Standard:
|
||
difficulty_str = getTranslation("standard");
|
||
break;
|
||
case Difficulty.Risky:
|
||
difficulty_str = getTranslation("risky");
|
||
break;
|
||
case Difficulty.Dangerous:
|
||
difficulty_str = getTranslation("dangerous");
|
||
}
|
||
return (
|
||
`**${getTranslation("difficulty")}:** ${difficulty_str}.` +
|
||
(is_zero ? ` **${getTranslation("zero-effective-dice")}**.` : "")
|
||
);
|
||
}
|
||
|
||
function computeFormula(num_dice, difficulty) {
|
||
const rolls = [...Array(num_dice)].map(() => "[[d10]]").join(", ");
|
||
return `[[{${rolls}}dh${difficulty}kh${difficulty + 1}]]`;
|
||
}
|
||
|
||
function computeSingleDice(num_dice) {
|
||
return num_dice <= 1
|
||
? ""
|
||
: [...Array(num_dice)].map((_, i) => `$[[${i}]]`).join("");
|
||
}
|
||
|
||
function buildDicePool() {
|
||
getAttrs(kRollAffectingAttributes, (v) => {
|
||
const roll_skill = v["roll_skill"];
|
||
const roll_domain = v["roll_domain"];
|
||
const difficulty = parseInt(v["roll_difficulty"], 10);
|
||
|
||
const roll_dice =
|
||
1 +
|
||
(roll_skill ? parseInt(v[`skill_${roll_skill}`], 10) : 0) +
|
||
(roll_domain ? parseInt(v[`domain_${roll_domain}`], 10) : 0) +
|
||
parseInt(v["roll_mastery"], 10) +
|
||
parseInt(v["roll_extra_dice"], 10);
|
||
const is_zero = roll_dice - difficulty <= 0;
|
||
const number_of_dice = is_zero ? 1 : roll_dice;
|
||
|
||
const roll_formula = computeFormula(number_of_dice, difficulty);
|
||
const roll_formula_single = computeSingleDice(number_of_dice);
|
||
const roll_message = getDifficultyMessage(difficulty, is_zero);
|
||
const roll_title =
|
||
roll_skill && roll_domain
|
||
? `${getTranslation(roll_skill)} + ${getTranslation(roll_domain)}`
|
||
: `${getTranslation(roll_skill)}${getTranslation(roll_domain)}`;
|
||
const roll_zerodice = is_zero ? "{{zerodice=1}}" : "";
|
||
|
||
setAttrs({
|
||
roll_formula,
|
||
roll_formula_single,
|
||
roll_zerodice,
|
||
roll_message,
|
||
roll_title,
|
||
});
|
||
});
|
||
}
|
||
|
||
on("clicked:clear_stress", clearStress);
|
||
|
||
on(kStresses.map((x) => `change:${x}`).join(" "), calculateTotalStress);
|
||
|
||
on(
|
||
[...kRollAffectingAttributes.map((x) => `change:${x}`), "sheet:opened"].join(
|
||
" "
|
||
),
|
||
buildDicePool
|
||
);
|
||
|
||
on("sheet:opened", () => {
|
||
getAttrs(["version"], (v) => {
|
||
if (v.version === "0") runLegacyUpgrade();
|
||
setAttrs({ version: "1" });
|
||
});
|
||
});
|
||
</script>
|