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

1008 lines
59 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.
<span class="hide" data-i18n="ability">Ability</span><span class="hide" data-i18n="advantage">Advantage</span><span class="hide" data-i18n="disadvantage">Disadvantage</span><span class="hide" data-i18n="roll_type">Roll Type</span><span class="hide" data-i18n="roll">Roll</span><span class="hide" data-i18n="normal">Normal</span><span class="hide" data-i18n="success_on">Success On</span>
<input type="hidden" name="attr_roll_query"/>
<input type="hidden" name="attr_rtype" value="1d20"/>
<input type="hidden" name="attr_wtype"/>
<input type="hidden" name="attr_sheet_mode" value="character"/>
<div class="deathinspace">
<main class="character">
<header class="header">
<div class="header__character">
<div class="header__name" data-i18n="death_in_space">Death in Space</div>
<label class="header__sheet" data-i18n="personal_data_sheet">Personal Data Sheet</label>
</div>
<div class="header__section-zero"><span class="header__section-zero--span" data-i18n="player_information">Section 0. Player Information</span>
<label class="death__label" data-i18n="player_name">Player Name</label>
<input class="header__section-zero--input header__player_name--text" name="attr_player_name" type="text" data-i18n-placeholder="placeholder_player_name" placeholder="Gene Starwind"/>
</div>
</header>
<nav class="nav nav__character">
<input class=" nav__nav--hidden" name="attr_nav" type="hidden" value="personal"/>
<div class="nav__page nav__page--personal">
<input class="nav__page--input nav__nav--radio" name="attr_nav" type="radio" value="personal" data-i18n-title="title_nav_personal" title="Section 1. Personal Infomation"/>
<label class="nav__label nav__label--personal" data-i18n="nav_personal">Section 1. Personal Infomation</label>
</div>
<div class="nav__page nav__page--situation">
<input class="nav__page--input nav__nav--radio" name="attr_nav" type="radio" value="situation" data-i18n-title="title_nav_situation" title="Section 2. Current Situation"/>
<label class="nav__label nav__label--situation" data-i18n="nav_situation">Section 2. Current Situation</label>
</div>
<div class="nav__page nav__page--belongings">
<input class="nav__page--input nav__nav--radio" name="attr_nav" type="radio" value="belongings" data-i18n-title="title_nav_belongings" title="Section 3. Personal Belongings"/>
<label class="nav__label nav__label--belongings" data-i18n="nav_belongings">Section 3. Personal Belongings</label>
</div>
<div class="nav__page nav__page--notes">
<input class="nav__page--input nav__nav--radio" name="attr_nav" type="radio" value="notes" data-i18n-title="title_nav_notes" title="Section 4. Notes"/>
<label class="nav__label nav__label--notes" data-i18n="nav_notes">Section 4. Notes</label>
</div>
<div class="nav__page nav__page--config">
<input class="nav__page--input nav__nav--radio" name="attr_nav" type="radio" value="config" data-i18n-title="title_nav_config" title="Config"/>
<label class="nav__label nav__label--config" data-i18n="nav_config">Config</label>
</div>
</nav>
<input class="navigator" name="attr_nav" type="hidden"/>
<div class="page-container page--personal">
<section class="personal">
<div class="death__block personal__origin">
<label class="death__label" data-i18n="origin">Origin</label>
<div class="divider--dotted"></div>
<input class=" personal__origin--text" name="attr_origin" type="text" data-i18n-placeholder="placeholder_origin" placeholder="Carbon"/>
</div>
<div class="death__block personal__nickname">
<div class="personal__nickname--block">
<label class="death__label" data-i18n="character_name">Name</label>
<input class=" personal__character_name--text" name="attr_character_name" type="text" data-i18n-placeholder="placeholder_character_name" placeholder="Aisha Clanclan"/>
</div>
<div class="personal__nickname--block">
<label class="death__label" data-i18n="nickname">Nickname</label>
<input class=" personal__nickname--text" name="attr_nickname" type="text" data-i18n-placeholder="placeholder_nickname" placeholder="Fire Cat"/>
</div>
</div>
<div class="death__block personal__origin-benefit">
<label class="death__label" data-i18n="origin_benefit">Origin Benefit</label>
<textarea class=" personal__origin_benefit--textarea" name="attr_origin_benefit" data-i18n-placeholder="placeholder_origin_benefit" placeholder="Engineered lungs"></textarea>
</div>
<div class="death__block personal__xp">
<label class="death__label" data-i18n="xp">XP</label>
<input class=" personal__xp--number" name="attr_xp" type="number" data-i18n-placeholder="placeholder_xp" placeholder="0"/>
</div>
<div class="death__block personal__background">
<label class="death__label" data-i18n="background">Background</label>
<input class=" personal__background--text" name="attr_background" type="text" data-i18n-placeholder="placeholder_background" placeholder="Moon Outlaw"/>
</div>
<div class="death__block personal__past-allegiance">
<label class="death__label" data-i18n="past_allegiance">Past Allegiance</label>
<input class=" personal__past_allegiance--text" name="attr_past_allegiance" type="text" data-i18n-placeholder="placeholder_past_allegiance" placeholder="An idea"/>
</div>
<div class="death__block personal__trait">
<label class="death__label" data-i18n="trait">Trait</label>
<input class=" personal__trait--text" name="attr_trait" type="text" data-i18n-placeholder="placeholder_trait" placeholder="Polite"/>
</div>
<div class="death__block personal__drive">
<label class="death__label" data-i18n="drive">Drive</label>
<input class=" personal__drive--text" name="attr_drive" type="text" data-i18n-placeholder="placeholder_drive" placeholder="Friends"/>
</div>
<div class="death__block personal__looks">
<label class="death__label" data-i18n="looks">Looks</label>
<textarea class=" personal__looks--textarea" name="attr_looks" data-i18n-placeholder="placeholder_looks" placeholder="Trucker cap with patch"></textarea>
</div>
<div class="death__block personal__abilities">
<label class="death__label" data-i18n="abilities">Abilities</label>
<div class="personal__abilities--block">
<button class="ability__button" name="act_body" type="action"><span class="ability__label" data-i18n="body">Body</span></button>
<input class="ability__value death__input--bordered personal__body--number" name="attr_body" type="number" data-i18n-placeholder="placeholder_body" placeholder="0"/>
</div>
<div class="personal__abilities--block">
<button class="ability__button" name="act_dexterity" type="action"><span class="ability__label" data-i18n="dexterity">Dexterity</span></button>
<input class="ability__value death__input--bordered personal__dexterity--number" name="attr_dexterity" type="number" data-i18n-placeholder="placeholder_dexterity" placeholder="0"/>
</div>
<div class="personal__abilities--block">
<button class="ability__button" name="act_savvy" type="action"><span class="ability__label" data-i18n="savvy">Savvy</span></button>
<input class="ability__value death__input--bordered personal__savvy--number" name="attr_savvy" type="number" data-i18n-placeholder="placeholder_savvy" placeholder="0"/>
</div>
<div class="personal__abilities--block">
<button class="ability__button" name="act_tech" type="action"><span class="ability__label" data-i18n="tech">Tech</span></button>
<input class="ability__value death__input--bordered personal__tech--number" name="attr_tech" type="number" data-i18n-placeholder="placeholder_tech" placeholder="0"/>
</div>
</div>
<div class="death__block personal__defense">
<div class="personal__defense--block">
<label class="death__label" data-i18n="defense">Defense</label><span class="death__subtitle" data-i18n="defense_formula">12+DEX Unarmored</span><span class="death__subtitle"> (<span name="attr_unarmored"></span>)</span>
</div>
<div class="personal__defense--block defense__value">
<input class="death__input--bordered personal__defense--number" name="attr_defense" type="number" data-i18n-placeholder="placeholder_defense" placeholder="0"/>
</div>
</div>
<div class="death__block personal__hitpoints">
<div class="personal__hitpoints--block">
<label class="death__label" data-i18n="hitpoints">Hit Points</label><span class="death__subtitle fst-italic" data-i18n="start_with">Start with 1d8</span><br/><span class="death__subtitle fst-italic" data-i18n="recover">Recover 1d8+BDY</span><br/>
</div>
<div class="personal__hitpoints--block hitpoints__value">
<label class="death__label text-center" data-i18n="hp">Current</label>
<input class="death__input--bordered personal__hp--number" name="attr_hp" type="number" data-i18n-placeholder="placeholder_hp" placeholder="0"/>
</div>
<div class="personal__hitpoints--block hitpoints__value">
<label class="death__label text-center" data-i18n="hp_max">Max</label>
<input class="death__input--bordered personal__hp_max--number" name="attr_hp_max" type="number" data-i18n-placeholder="placeholder_hp_max" placeholder="0"/>
</div>
</div>
<div class="death__block personal__portrait">
<label class="death__label" data-i18n="character_avatar">Portrait</label><img class="personal__portrait--image" name="attr_character_avatar"/>
</div>
</section>
</div>
<div class="page-container page--situation">
<section class="situation">
<div class="death__block situation__void-points">
<div class="situation__void-points--block">
<label class="death__label" data-i18n="void_points">Void Points</label>
<div class="void-points__radios">
<label class="void-points__radio">
<input class="void-points__input situation__void_points--radio" name="attr_void_points" type="radio" value="0" data-i18n-title="title_void_points_0" title="0"/><span class="void-points__label" data-i18n="void_points_0">0</span>
</label>
<label class="void-points__radio">
<input class="void-points__input situation__void_points--radio" name="attr_void_points" type="radio" value="1" data-i18n-title="title_void_points_1" title="1"/><span class="void-points__label" data-i18n="void_points_1">1</span>
</label>
<label class="void-points__radio">
<input class="void-points__input situation__void_points--radio" name="attr_void_points" type="radio" value="2" data-i18n-title="title_void_points_2" title="2"/><span class="void-points__label" data-i18n="void_points_2">2</span>
</label>
<label class="void-points__radio">
<input class="void-points__input situation__void_points--radio" name="attr_void_points" type="radio" value="3" data-i18n-title="title_void_points_3" title="3"/><span class="void-points__label" data-i18n="void_points_3">3</span>
</label>
<label class="void-points__radio">
<input class="void-points__input situation__void_points--radio" name="attr_void_points" type="radio" value="4" data-i18n-title="title_void_points_4" title="4"/><span class="void-points__label" data-i18n="void_points_4">4</span>
</label>
</div>
</div>
<div class="situation__void-points--block"><span class="void-points__uses death__subtitle" data-i18n="use_void_point">Void Points can be used to:</span>
<ul>
<li class="death__subtitle fst-italic" data-i18n="void_point_use_1">Get advantage on an ability check or attack roll.</li>
<li class="death__subtitle fst-italic" data-i18n="void_point_use_2">Activate a cosmic mutation.</li>
</ul>
</div>
</div>
<div class="death__block situation__cosmic-mutations">
<label class="death__label" data-i18n="cosmic_mutation">Cosmic Mutations</label>
<textarea class=" situation__cosmic_mutation--textarea" name="attr_cosmic_mutation" data-i18n-placeholder="placeholder_cosmic_mutation" placeholder="Feedback Loop. Can jump back ten seconds in time, at the cost of losing one important memory, chosen by the player."></textarea>
</div>
<div class="death__block situation__life-support">
<label class="death__label" data-i18n="life_support">Life Support</label>
<div class="life-support">
<input class=" situation__life_support--hidden" name="attr_life_support" type="hidden"/>
<div class="life-support__labels">
<label class="life-support__label">0%</label>
<label class="life-support__label">100%</label>
</div>
<div class="life-support__oxygen-tank">
<div class="life-support__oxygen-tank--grid">
<label class="oxygen-tank__bar oxygen-tank__bar--0">
<input class="oxygen-tank__bar--input situation__life_support--radio" name="attr_life_support" type="radio" value="0" data-i18n-title="title_life_support_0" title="0 hours remaining"/><span class="oxygen-tank__bar--empty" title="Empty" data-i18n-title="Empty">*</span>
</label>
<label class="oxygen-tank__bar oxygen-tank__bar--1">
<input class="oxygen-tank__bar--input situation__life_support--radio" name="attr_life_support" type="radio" value="1" data-i18n-title="title_life_support_1" title="1 hour remaining"/>
</label>
<label class="oxygen-tank__bar oxygen-tank__bar--2">
<input class="oxygen-tank__bar--input situation__life_support--radio" name="attr_life_support" type="radio" value="2" data-i18n-title="title_life_support_2" title="2 hours remaining"/>
</label>
<label class="oxygen-tank__bar oxygen-tank__bar--3">
<input class="oxygen-tank__bar--input situation__life_support--radio" name="attr_life_support" type="radio" value="3" data-i18n-title="title_life_support_3" title="3 hours remaining"/>
</label>
<label class="oxygen-tank__bar oxygen-tank__bar--4">
<input class="oxygen-tank__bar--input situation__life_support--radio" name="attr_life_support" type="radio" value="4" data-i18n-title="title_life_support_4" title="4 hours remaining"/>
</label>
<label class="oxygen-tank__bar oxygen-tank__bar--5">
<input class="oxygen-tank__bar--input situation__life_support--radio" name="attr_life_support" type="radio" value="5" data-i18n-title="title_life_support_5" title="5 hours remaining"/>
</label>
<label class="oxygen-tank__bar oxygen-tank__bar--6">
<input class="oxygen-tank__bar--input situation__life_support--radio" name="attr_life_support" type="radio" value="6" data-i18n-title="title_life_support_6" title="6 hours remaining"/>
</label>
<label class="oxygen-tank__bar oxygen-tank__bar--7">
<input class="oxygen-tank__bar--input situation__life_support--radio" name="attr_life_support" type="radio" value="7" data-i18n-title="title_life_support_7" title="7 hours remaining"/>
</label>
</div>
</div>
<div class="life-support__time-remaining">
<label class="life-support__label text-center life-support__time-remaining--0" data-i18n="life_support_0">0 hours remaining</label>
<label class="life-support__label text-center life-support__time-remaining--1" data-i18n="life_support_1">1 hour remaining</label>
<label class="life-support__label text-center life-support__time-remaining--2" data-i18n="life_support_2">2 hours remaining</label>
<label class="life-support__label text-center life-support__time-remaining--3" data-i18n="life_support_3">3 hours remaining</label>
<label class="life-support__label text-center life-support__time-remaining--4" data-i18n="life_support_4">4 hours remaining</label>
<label class="life-support__label text-center life-support__time-remaining--5" data-i18n="life_support_5">5 hours remaining</label>
<label class="life-support__label text-center life-support__time-remaining--6" data-i18n="life_support_6">6 hours remaining</label>
<label class="life-support__label text-center life-support__time-remaining--7" data-i18n="life_support_7">7 hours remaining</label>
</div>
</div>
</div>
<div class="death__block situation__void-corruption">
<label class="death__label" data-i18n="void_corruption">Void Corruption</label>
<textarea class=" situation__void_corruption--textarea" name="attr_void_corruption" data-i18n-placeholder="placeholder_void_corruption" placeholder="Your most important memory transcends to an item you carry. You and others can feel and see the memory if they hold the object."></textarea>
</div>
</section>
</div>
<div class="page-container page--belongings">
<section class="belongings">
<div class="death__block belongings__carry">
<label class="carry__formula" data-i18n="item_slots">Please note that the number of item slots is equal to 12+BDY</label>
<div class="belongings__carry--block carry__value">
<label class="text-center" data-i18n="carry">Current</label><span class="death__label" name="attr_carry"></span>
</div>
<div class="belongings__carry--block carry__value">
<label class="text-center" data-i18n="carry_max">Max</label><span class="death__label" name="attr_carry_max"></span>
</div>
</div>
<div class="death__block belongings__inventory">
<div class="inventory__header">
<div></div>
<label class="inventory__label inventory__label--left text-center" data-i18n="condition">Condition</label>
<label class="inventory__label inventory__label--left text-center" data-i18n="slots">Slots</label>
<div></div>
<label class="inventory__label inventory__label--right text-center" data-i18n="condition">Condition</label>
<label class="inventory__label inventory__label--right text-center" data-i18n="slots">Slots</label>
</div>
<input class="repeating__is-empty" name="attr_is_inventory_empty" value="0" type="hidden"/>
<label class="repeating__empty" data-i18n="inventory_is_empty">No inventory recorded.</label>
<fieldset class="repeating_inventory">
<div class="inventory">
<div class="inventory--block">
<input class="inventory__input inventory__item_name--text" name="attr_item_name" type="text" data-i18n-placeholder="placeholder_item_name" placeholder="Light EVA suit"/>
<input class="inventory__input inventory__item_condition--number" name="attr_item_condition" type="number" data-i18n-placeholder="placeholder_item_condition" placeholder="0"/>
<input class="inventory__input inventory__item_slots--number" name="attr_item_slots" type="number" value="1" data-i18n-placeholder="placeholder_item_slots" placeholder="1"/>
</div>
</div>
</fieldset>
</div>
<div class="death__block belongings__small-items">
<label class="death__label" data-i18n="small_items">Small Items</label>
<input class="repeating__is-empty" name="attr_is_small-items_empty" value="0" type="hidden"/>
<label class="repeating__empty" data-i18n="small-items_is_empty">No small-items recorded.</label>
<fieldset class="repeating_small-items">
<div class="small-items">
<div class="small-items--block">
<input class="small-items__input small-items__item_name--text" name="attr_item_name" type="text" data-i18n-placeholder="placeholder_item_name" placeholder="Duct tape"/>
</div>
</div>
</fieldset>
</div>
<div class="death__block belongings__weapons">
<div class="weapons__header">
<label class="death__label" data-i18n="weapons">Weapons</label>
<label class="weapons__label" data-18n="weapon_damage">Damage</label>
<label class="weapons__label" data-18n="weapon_uses">Uses</label>
<label class="weapons__label" data-18n="weapon_condition">Condition</label>
<label class="weapons__label" data-18n="weapon_slots">Slots</label>
</div>
<input class="repeating__is-empty" name="attr_is_weapons_empty" value="0" type="hidden"/>
<label class="repeating__empty" data-i18n="weapons_is_empty">No weapons recorded.</label>
<fieldset class="repeating_weapons">
<div class="weapons">
<div class="weapons--block">
<input class="weapons__input weapons__weapon_name--text" name="attr_weapon_name" type="text" data-i18n-placeholder="placeholder_weapon_name" placeholder="Oscillator Knife"/>
<input class="weapons__input text-center weapons__weapon_damage--text" name="attr_weapon_damage" type="text" data-i18n-placeholder="placeholder_weapon_damage" placeholder="1d4"/>
<input class="weapons__input weapons__weapon_uses--number" name="attr_weapon_uses" type="number" data-i18n-placeholder="placeholder_weapon_uses" placeholder="0"/>
<input class="weapons__input weapons__weapon_condition--number" name="attr_weapon_condition" type="number" data-i18n-placeholder="placeholder_weapon_condition" placeholder="0"/>
<input class="weapons__input weapons__weapon_slots--number" name="attr_weapon_slots" type="number" value="1" data-i18n-placeholder="placeholder_weapon_slots" placeholder="0"/>
</div>
</div>
</fieldset>
</div>
<div class="death__block belongings__armor">
<div class="armor__header">
<label class="death__label" data-i18n="armor">armor</label>
<label class="armor__label" data-18n="armor_protects_against">Protects Against</label>
<label class="armor__label" data-18n="armor_bonus">DR Bonus</label>
<label class="armor__label" data-18n="armor_condition">Condition</label>
<label class="armor__label" data-18n="armor_slots">Slots</label>
</div>
<input class="repeating__is-empty" name="attr_is_armor_empty" value="0" type="hidden"/>
<label class="repeating__empty" data-i18n="armor_is_empty">No armor recorded.</label>
<fieldset class="repeating_armor">
<div class="armor">
<div class="armor--block">
<input class="armor__input armor__armor_name--text" name="attr_armor_name" type="text" data-i18n-placeholder="placeholder_armor_name" placeholder="Light: Stab proof"/>
<input class="armor__input text-center armor__armor_protects_against--text" name="attr_armor_protects_against" type="text" data-i18n-placeholder="placeholder_armor_protects_against" placeholder="Melee and thrown weapons"/>
<input class="armor__input armor__armor_bonus--number" name="attr_armor_bonus" type="number" data-i18n-placeholder="placeholder_armor_bonus" placeholder="0"/>
<input class="armor__input armor__armor_condition--number" name="attr_armor_condition" type="number" data-i18n-placeholder="placeholder_armor_condition" placeholder="0"/>
<input class="armor__input armor__armor_slots--number" name="attr_armor_slots" type="number" value="1" data-i18n-placeholder="placeholder_armor_slots" placeholder="0"/>
</div>
</div>
</fieldset>
</div>
<div class="death__block belongings__holos">
<div class="belongings__holos--block">
<label class="death__label" data-i18n="holos">Holos</label>
<input class=" belongings__holos--number" name="attr_holos" type="number" data-i18n-placeholder="placeholder_holos" placeholder="0"/>
</div>
<div class="belongings__holos--block">
<label class="death__label" data-i18n="debts">Debts</label>
<input class=" belongings__debts--number" name="attr_debts" type="number" data-i18n-placeholder="placeholder_debts" placeholder="0"/>
</div>
</div>
</section>
</div>
<div class="page-container page--notes">
<section class="notes">
<div class="death__block notes__note">
<label class="death__label" data-i18n="notes">Notes</label>
<input class="repeating__is-empty" name="attr_is_notes_empty" value="0" type="hidden"/>
<label class="repeating__empty" data-i18n="notes_is_empty">No notes recorded.</label>
<fieldset class="repeating_notes">
<div class="note">
<div class="note--block">
<input class=" notes__note_title--text" name="attr_note_title" type="text" data-i18n-placeholder="placeholder_note_title" placeholder="Title"/>
<textarea class=" notes__note_body--textarea" name="attr_note_body" data-i18n-placeholder="placeholder_note_body" placeholder="Notes"></textarea>
</div>
</div>
</fieldset>
</div>
</section>
</div>
<div class="page-container page--config">
<section class="config">
<div class="death__block config__sheet-mode">
<label class="death__label" data-i18n="sheet_mode">Sheet Mode</label>
<div class="sheet-mode__radios">
<label class="sheet-mode__radio">
<input class="sheet-mode__input sheet-mode__sheet_mode--radio" name="attr_sheet_mode" type="radio" value="character" data-i18n-title="title_sheet_mode_character" title="Character"/><span class="sheet-mode__label" data-i18n="sheet_mode_character">character</span>
</label>
<label class="sheet-mode__radio">
<input class="sheet-mode__input sheet-mode__sheet_mode--radio" name="attr_sheet_mode" type="radio" value="hub" data-i18n-title="title_sheet_mode_hub" title="Hub"/><span class="sheet-mode__label" data-i18n="sheet_mode_hub">hub</span>
</label>
</div>
</div>
<div class="death__block config__roll-type">
<label class="death__label" data-i18n="rtype">Roll Queries</label>
<select class="roll-type__input config__rtype--select" name="attr_rtype" type="select">
<option data-i18n="normal" value="1d20">Normal</option>
<option data-i18n="advantage" value="2d20kh1">Advantage</option>
<option data-i18n="disadvantage" value="2d20kl1">Disadvantage</option>
<option data-i18n="always_query" value="@{roll_query}">Always Query</option>
</select>
</div>
<div class="death__block config__whisper-type">
<label class="death__label" data-i18n="wtype">Whisper to GM</label>
<input class="whisper-type__input config__wtype--checkbox" name="attr_wtype" type="checkbox" value="/w gm " data-i18n-title="title_wtype_w_gm_" title="Whisper to GM"/>
</div>
</section>
</div>
</main>
<main class="hub">
<header class="header">
<div class="header__hub">
<div class="header__name" data-i18n="death_in_space">Death in Space</div>
<label class="header__sheet" data-i18n="hub_data_sheet">Hub Data Sheet</label>
</div>
<div class="header__section-zero"><span class="header__section-zero--span" data-i18n="owner_information">Section 0. Owner Information</span>
<label class="death__label" data-i18n="owner_signature">Owner Name</label>
<input class="header__section-zero--input header__owner_signature--text" name="attr_owner_signature" type="text" data-i18n-placeholder="placeholder_owner_signature" placeholder="Gene Starwind"/>
</div>
</header>
<nav class="nav nav__hub">
<input class=" nav__nav--hidden" name="attr_nav" type="hidden" value="hubinfo"/>
<div class="nav__page nav__page--hubinfo">
<input class="nav__page--input nav__nav--radio" name="attr_nav" type="radio" value="hubinfo" data-i18n-title="title_nav_hubinfo" title="Section 1. Specific Information"/>
<label class="nav__label nav__label--hubinfo" data-i18n="nav_hubinfo">Section 1. Specific Information</label>
</div>
<div class="nav__page nav__page--hubdata">
<input class="nav__page--input nav__nav--radio" name="attr_nav" type="radio" value="hubdata" data-i18n-title="title_nav_hubdata" title="Section 2. Hub Data"/>
<label class="nav__label nav__label--hubdata" data-i18n="nav_hubdata">Section 2. Hub Data</label>
</div>
<div class="nav__page nav__page--hublayout">
<input class="nav__page--input nav__nav--radio" name="attr_nav" type="radio" value="hublayout" data-i18n-title="title_nav_hublayout" title="Section 3. Layout"/>
<label class="nav__label nav__label--hublayout" data-i18n="nav_hublayout">Section 3. Layout</label>
</div>
<div class="nav__page nav__page--hubcargo">
<input class="nav__page--input nav__nav--radio" name="attr_nav" type="radio" value="hubcargo" data-i18n-title="title_nav_hubcargo" title="Section 4. Cargo"/>
<label class="nav__label nav__label--hubcargo" data-i18n="nav_hubcargo">Section 4. Cargo</label>
</div>
<div class="nav__page nav__page--hubnotes">
<input class="nav__page--input nav__nav--radio" name="attr_nav" type="radio" value="hubnotes" data-i18n-title="title_nav_hubnotes" title="Section 5. Notes"/>
<label class="nav__label nav__label--hubnotes" data-i18n="nav_hubnotes">Section 5. Notes</label>
</div>
<div class="nav__page nav__page--config">
<input class="nav__page--input nav__nav--radio" name="attr_nav" type="radio" value="config" data-i18n-title="title_nav_config" title="Config"/>
<label class="nav__label nav__label--config" data-i18n="nav_config">Config</label>
</div>
</nav>
<input class="navigator" name="attr_nav" type="hidden"/>
<div class="page-container page--hubinfo">
<section class="hubinfo">
<div class="death__block hubinfo__nickname">
<label class="death__label" data-i18n="character_name_hub">Nickname</label>
<input class=" hubinfo__character_name--text" name="attr_character_name" type="text" data-i18n-placeholder="placeholder_character_name_hub" placeholder="Outlaw Star"/>
</div>
<div class="death__block hubinfo__hub-type">
<div class="hubinfo__hub-type--block">
<label class="death__label" data-i18n="hub_type">Hub Type</label>
<input class=" hubinfo__hub_type--text" name="attr_hub_type" type="text" data-i18n-placeholder="placeholder_hub_type" placeholder="Spacecraft"/>
</div>
</div>
<div class="death__block hubinfo__background">
<label class="death__label" data-i18n="background">Background</label>
<textarea class=" hubinfo__background--textarea" name="attr_background" data-i18n-placeholder="placeholder_background_hub" placeholder="Once lost for 31 years in a black hole"></textarea>
</div>
<div class="death__block hubinfo__appearance">
<label class="death__label" data-i18n="appearance">Appearance</label>
<textarea class=" hubinfo__appearance--textarea" name="attr_appearance" data-i18n-placeholder="placeholder_appearance" placeholder="Red and blue paint job"></textarea>
</div>
<div class="death__block hubinfo__quirks">
<label class="death__label" data-i18n="quirks">Quirks</label>
<input class="repeating__is-empty" name="attr_is_quirks_empty" value="0" type="hidden"/>
<label class="repeating__empty" data-i18n="quirks_is_empty">No quirks recorded.</label>
<fieldset class="repeating_quirks">
<div class="quirks">
<div class="quirks--block">
<input class="quirks__input hubinfo__quirk_name--text" name="attr_quirk_name" type="text" data-i18n-placeholder="placeholder_quirk_name" placeholder="The light is always eerily dimmed."/>
</div>
</div>
</fieldset>
</div>
</section>
</div>
<div class="page-container page--hubdata">
<section class="hubdata">
<div class="death__block hubdata__frame-integrity">
<div class="hubdata__frame-integrity--header">
<label class="death__label" data-i18n="frame_integrity">Frame Integrity</label><span class="death__label frame-integrity__value" name="attr_frame_integrity"></span>
</div>
<div class="hubdata__frame-integrity--grid">
<input class=" frame-integrity__frame_integrity--hidden" name="attr_frame_integrity" type="hidden"/>
<div class="frame-integrity">
<div class="frame-integrity--0 frame-integrity--block">
<label class="frame-integrity__frame">
<input class="frame-integrity__frame--input frame-integrity__frame_integrity--radio" name="attr_frame_integrity" type="radio" value="0" data-i18n-title="title_frame_integrity_0" title="0% Frame Integrity"/><span class="frame-integrity__frame--label">0%</span>
<div class="divider--arrow-down"></div>
</label>
</div>
<div class="frame-integrity--10 frame-integrity--block">
<label class="frame-integrity__frame">
<input class="frame-integrity__frame--input frame-integrity__frame_integrity--radio" name="attr_frame_integrity" type="radio" value="10" data-i18n-title="title_frame_integrity_10" title="10% Frame Integrity"/>
</label>
</div>
<div class="frame-integrity--20 frame-integrity--block">
<label class="frame-integrity__frame">
<input class="frame-integrity__frame--input frame-integrity__frame_integrity--radio" name="attr_frame_integrity" type="radio" value="20" data-i18n-title="title_frame_integrity_20" title="20% Frame Integrity"/>
</label>
</div>
<div class="frame-integrity--30 frame-integrity--block">
<label class="frame-integrity__frame">
<input class="frame-integrity__frame--input frame-integrity__frame_integrity--radio" name="attr_frame_integrity" type="radio" value="30" data-i18n-title="title_frame_integrity_30" title="30% Frame Integrity"/>
</label>
</div>
<div class="frame-integrity--40 frame-integrity--block">
<label class="frame-integrity__frame">
<input class="frame-integrity__frame--input frame-integrity__frame_integrity--radio" name="attr_frame_integrity" type="radio" value="40" data-i18n-title="title_frame_integrity_40" title="40% Frame Integrity"/>
</label>
</div>
<div class="frame-integrity--50 frame-integrity--block">
<label class="frame-integrity__frame">
<input class="frame-integrity__frame--input frame-integrity__frame_integrity--radio" name="attr_frame_integrity" type="radio" value="50" data-i18n-title="title_frame_integrity_50" title="50% Frame Integrity"/><span class="frame-integrity__frame--label">50%</span>
<div class="divider--arrow-down"></div>
</label>
</div>
<div class="frame-integrity--60 frame-integrity--block">
<label class="frame-integrity__frame">
<input class="frame-integrity__frame--input frame-integrity__frame_integrity--radio" name="attr_frame_integrity" type="radio" value="60" data-i18n-title="title_frame_integrity_60" title="60% Frame Integrity"/>
</label>
</div>
<div class="frame-integrity--70 frame-integrity--block">
<label class="frame-integrity__frame">
<input class="frame-integrity__frame--input frame-integrity__frame_integrity--radio" name="attr_frame_integrity" type="radio" value="70" data-i18n-title="title_frame_integrity_70" title="70% Frame Integrity"/>
</label>
</div>
<div class="frame-integrity--80 frame-integrity--block">
<label class="frame-integrity__frame">
<input class="frame-integrity__frame--input frame-integrity__frame_integrity--radio" name="attr_frame_integrity" type="radio" value="80" data-i18n-title="title_frame_integrity_80" title="80% Frame Integrity"/>
</label>
</div>
<div class="frame-integrity--90 frame-integrity--block">
<label class="frame-integrity__frame">
<input class="frame-integrity__frame--input frame-integrity__frame_integrity--radio" name="attr_frame_integrity" type="radio" value="90" data-i18n-title="title_frame_integrity_90" title="90% Frame Integrity"/>
</label>
</div>
<div class="frame-integrity--100 frame-integrity--block">
<label class="frame-integrity__frame">
<input class="frame-integrity__frame--input frame-integrity__frame_integrity--radio" name="attr_frame_integrity" type="radio" value="100" data-i18n-title="title_frame_integrity_100" title="100% Frame Integrity"/><span class="frame-integrity__frame--label">100%</span>
</label>
</div>
</div>
<div class="defense-rating">
<label class="death__label text-center" data-i18n="defense_rating">Defense Rating</label>
<input class="death__input--bordered hubdata__defense_rating--number" name="attr_defense_rating" type="number" data-i18n-placeholder="placeholder_defense_rating" placeholder="0"/>
</div>
</div>
</div>
<div class="death__block hubdata__integrity-events">
<label class="integrity-events__label--condition-zero" data-i18n="condition_zero">Condition 0</label>
<label class="integrity-events__label--distaster-table text-center" data-i18n="distaster_table">Roll on the spacecraft disasters table</label>
<label class="integrity-events__label--all-calm" data-i18n="all_calm">When all is calm, recover 1D6×10% frame integrity. A calm night restores to 100%.</label>
</div>
<div class="death__block hubdata__condition">
<label class="death__label" data-i18n="condition">Condition</label>
<div class="hubdata__condition--block">
<label class="text-center" data-i18n="current">Current</label>
<input class="death__input--bordered hubdata__condition--number" name="attr_condition" type="number" data-i18n-placeholder="placeholder_condition" placeholder="0"/>
</div>
<div class="hubdata__condition--block">
<label class="text-center" data-i18n="max">Max</label>
<input class="death__input--bordered hubdata__condition_max--number" name="attr_condition_max" type="number" data-i18n-placeholder="placeholder_condition_max" placeholder="0"/>
</div>
</div>
<div class="death__block hubdata__fuel">
<label class="death__label" data-i18n="fuel">Fuel</label>
<div class="hubdata__fuel--block">
<label class="text-center" data-i18n="current">Current</label>
<input class="death__input--bordered hubdata__fuel--number" name="attr_fuel" type="number" data-i18n-placeholder="placeholder_fuel" placeholder="0"/>
</div>
<div class="hubdata__fuel--block">
<label class="text-center" data-i18n="max">Max</label>
<input class="death__input--bordered hubdata__fuel_max--number" name="attr_fuel_max" type="number" data-i18n-placeholder="placeholder_fuel_max" placeholder="0"/>
</div>
</div>
<div class="death__block hubdata__power-source">
<label class="death__label" data-i18n="power_source">Power Source</label>
<div class="hubdata__power-source--block">
<div class="power-source">
<label class="power-source__radio">
<input class="power-source__input power-source__power_source--radio" name="attr_power_source" type="radio" value="slow" data-i18n-title="title_power_source_slow" title="Slow"/><span class="power-source__label fst-italic" data-i18n="power_source_slow">Slow</span>
</label>
<label class="power-source__radio">
<input class="power-source__input power-source__power_source--radio" name="attr_power_source" type="radio" value="fast" data-i18n-title="title_power_source_fast" title="Fast"/><span class="power-source__label fst-italic" data-i18n="power_source_fast">Fast</span>
</label>
<label class="power-source__radio">
<input class="power-source__input power-source__power_source--radio" name="attr_power_source" type="radio" value="unknown" data-i18n-title="title_power_source_unknown" title="Unknown"/><span class="power-source__label fst-italic" data-i18n="power_source_unknown">Unknown</span>
</label>
</div>
</div>
<div class="divider--arrow-right"></div>
</div>
<div class="death__block hubdata__output-power">
<label class="text-center" data-i18n="output_power">Output Power</label>
<input class="death__input--bordered hubdata__output_power--number" name="attr_output_power" type="number" data-i18n-placeholder="placeholder_output_power"/>
<div class="divider--arrow-down"></div>
</div>
<div class="death__block hubdata__modules">
<label class="text-center" data-i18n="output_power">Output Power</label><span class="modules__input" name="attr_output_power"></span>
</div>
<div class="death__block hubdata__modules">
<div class="hubdata__modules--block">
<div class="modules__header">
<label class="death__label" data-i18n="module_name">module</label>
<label class="modules__label text-center" data-i18n="module_power_cost">Power Cost</label>
</div>
<input class="repeating__is-empty" name="attr_is_modules_empty" value="0" type="hidden"/>
<label class="repeating__empty" data-i18n="modules_is_empty">No modules recorded.</label>
<fieldset class="repeating_modules">
<div class="modules">
<div class="modules--block">
<input class="modules__input modules__module_name--text" name="attr_module_name" type="text" data-i18n-placeholder="placeholder_module_name" placeholder="Panic Room"/>
<input class="modules__input modules__module_power_cost--number" name="attr_module_power_cost" type="number" value="0" data-i18n-placeholder="placeholder_module_power_cost" placeholder="0"/>
</div>
</div>
</fieldset>
<div class="modules__footer">
<label class="modules__footer--label text-end fst-italic" data-i18n="total_power_cost">The power cost sum should not exceed the output power.</label><span class="hubdata__total_power_cost--number" name="attr_total_power_cost"></span>
<div class="divider--arrow-right"></div>
</div>
</div>
</div>
<div class="death__block hubdata__overheated">
<label class="overheated__label text-center fst-italic" data-i18n="overheated_warning">Power cost &gt; power output = overheated</label>
<input class=" hubdata__overheated--hidden" name="attr_overheated" type="hidden"/>
<div class="overheated">
<label class="overheated__warning" data-i18n="overheated">Overheated</label>
<label class="text-center" data-i18n="output_power">Output Power</label>
<input class="death__input--bordered hubdata__output_power--number" name="attr_output_power" type="number" data-i18n-placeholder="placeholder_output_power"/>
</div>
</div>
</section>
</div>
<div class="page-container page--hublayout">
<section class="hublayout">
<div class="death__block hublayout__layout"><img name="attr_character_avatar"/></div>
</section>
</div>
<div class="page-container page--hubcargo">
<section class="hubcargo">
<div class="death__block hubcargo__cargo">
<div class="cargo__header">
<label class="death__label" data-i18n="cargo">Cargo</label>
<label class="death__label text-center" data-i18n="cargo_count">Qty.</label>
</div>
<input class="repeating__is-empty" name="attr_is_cargo_empty" value="0" type="hidden"/>
<label class="repeating__empty" data-i18n="cargo_is_empty">No cargo recorded.</label>
<fieldset class="repeating_cargo">
<div class="cargo">
<div class="cargo--block">
<input class="cargo__title cargo__cargo_title--text" name="attr_cargo_title" type="text" data-i18n-placeholder="placeholder_cargo_title" placeholder="Title"/>
<input class="cargo__count cargo__cargo_count--number" name="attr_cargo_count" type="number" data-i18n-placeholder="placeholder_cargo_count" placeholder="0"/>
<textarea class="cargo__body cargo__cargo_body--textarea" name="attr_cargo_body" data-i18n-placeholder="placeholder_cargo_body" placeholder="Description"></textarea>
</div>
</div>
</fieldset>
</div>
</section>
</div>
<div class="page-container page--hubnotes">
<section class="notes">
<div class="death__block notes__note">
<label class="death__label" data-i18n="notes">Notes</label>
<input class="repeating__is-empty" name="attr_is_notes_empty" value="0" type="hidden"/>
<label class="repeating__empty" data-i18n="notes_is_empty">No notes recorded.</label>
<fieldset class="repeating_notes">
<div class="note">
<div class="note--block">
<input class=" notes__note_title--text" name="attr_note_title" type="text" data-i18n-placeholder="placeholder_note_title" placeholder="Title"/>
<textarea class=" notes__note_body--textarea" name="attr_note_body" data-i18n-placeholder="placeholder_note_body" placeholder="Notes"></textarea>
</div>
</div>
</fieldset>
</div>
</section>
</div>
<div class="page-container page--config">
<section class="config">
<div class="death__block config__sheet-mode">
<label class="death__label" data-i18n="sheet_mode">Sheet Mode</label>
<div class="sheet-mode__radios">
<label class="sheet-mode__radio">
<input class="sheet-mode__input sheet-mode__sheet_mode--radio" name="attr_sheet_mode" type="radio" value="character" data-i18n-title="title_sheet_mode_character" title="Character"/><span class="sheet-mode__label" data-i18n="sheet_mode_character">character</span>
</label>
<label class="sheet-mode__radio">
<input class="sheet-mode__input sheet-mode__sheet_mode--radio" name="attr_sheet_mode" type="radio" value="hub" data-i18n-title="title_sheet_mode_hub" title="Hub"/><span class="sheet-mode__label" data-i18n="sheet_mode_hub">hub</span>
</label>
</div>
</div>
<div class="death__block config__roll-type">
<label class="death__label" data-i18n="rtype">Roll Queries</label>
<select class="roll-type__input config__rtype--select" name="attr_rtype" type="select">
<option data-i18n="normal" value="1d20">Normal</option>
<option data-i18n="advantage" value="2d20kh1">Advantage</option>
<option data-i18n="disadvantage" value="2d20kl1">Disadvantage</option>
<option data-i18n="always_query" value="@{roll_query}">Always Query</option>
</select>
</div>
<div class="death__block config__whisper-type">
<label class="death__label" data-i18n="wtype">Whisper to GM</label>
<input class="whisper-type__input config__wtype--checkbox" name="attr_wtype" type="checkbox" value="/w gm " data-i18n-title="title_wtype_w_gm_" title="Whisper to GM"/>
</div>
</section>
</div>
</main>
</div>
<rolltemplate class="sheet-rolltemplate-dis">
<div class="sheet-template-container">{{#name}}
<div class="sheet-template-character-name">{{ name }}</div>{{/name}}
<div class="sheet-template-header">
<div class="sheet-template-header__text"><span>{{ header }}</span></div>
<div class="sheet-template-header__roll">{{ roll }}</div>
</div>
<div class="sheet-template-result">{{#rollLess() roll 12}}
<div class="sheet-template-result--fail"><span data-i18n="failure">Failure</span></div>{{/rollLess() roll 12}}{{#^rollLess() roll 12}}
<div class="sheet-template-result--success"><span data-i18n="success">Success</span></div>{{/^rollLess() roll 12}}
</div>{{#damage}}
<div class="sheet-template-damage"><span class="sheet-template-damage__roll">{{ damage }}</span><span class="sheet-template-damage__text" data-i18n="damage">Damage</span></div>{{/damage}}
</div>
</rolltemplate>
<script type="text/worker">
const G_ABILITIES = ['body', 'dexterity', 'savvy', 'tech'];
const G_REPEATING_SECTIONS = [
'armor',
'cargo',
'inventory',
'modules',
'notes',
'quirks',
'small-items',
'weapons',
];
const G_INVENTORY_REPEATING = [
{ section: 'repeating_inventory', fields: ['item_slots', 'item_count'] },
{ section: 'repeating_weapons', fields: ['weapon_slots'] },
];
const G_MODULES_REPEATING = [{ section: 'repeating_modules', fields: ['module_power_cost'] }];
const G_MODULES_GLOBAL = ['output_power'];
const G_DERIVED_STATS = {
body: [{ name: 'carry_max', base: 12 }],
dexterity: [{ name: 'unarmored', base: 12 }],
};
const G_ROLL_TYPES = {
normal: '1d20',
advantage: '2d20kh1',
disadvantage: '2d20kl1',
};
const G_ROLL_ATTRIBUTE = 'roll_query';
const helpers = (() => {
/**
* Batch translate multiple keys at once.
* @param {Array} keys An array of keys to translate.
* @returns An array of translated keys.
*/
const getTranslationByArray = (keys) => keys.map((key) => getTranslationByKey(key));
return {
getTranslationByArray,
};
})();
/**
Checks if a repcontain (e.g. repeating_weapons) is empty.
This is calculated by looking at the length of IDs in fieldset.
@param {string} section: name of a repeating fieldset (repcontainer)
**/
const isFieldsetEmpty = (section) => {
getSectionIDs(section, (id) => {
const update = {};
update[`is_${section}_empty`] = id.length;
setAttrs(update);
});
};
/**
Gets all attributes, both repeating and non-repeating.
Default sectionDetails to a shallow clone of the global G_DEFAULT_REPEATING;
We're cloning because we'll be manipulating the array.
@param sectionDetails: an object containing the idArrays for each
repeating section, sorted based on their current order.
Example:
const G_DEFAULT_REPEATING = [
{ section: "repeating_inventory", fields: ["weight", "name", "quantity"] },
{ section: "repeating_attack", fields: ["bonus", "damage", "name"] },
];
@param getArray: an object containing all the attribute values
@returns
@param attributes: similar to getAttrs; object containing field names as key and values.
@param sections: similar to getSectionIDs; object containing fieldset name
as key and array of IDs as value.
**/
const getAllAttrs = function (callback, sectionDetails = [], getArray = []) {
getSections(getArray, sectionDetails, (getArr, sections) => {
getAttrs(getArr, (attributes) => {
// order the sections
// orderSections(attributes, sections);
// call the callback function to finally do what we wanted to do.
callback(attributes, sections);
});
});
};
/**
Gets the rowIDs for all the sections passed to it,
and assembles an array of repeating attributes to get
Does this via a work queue or burndown set up
Arguments are the same as for getAllAttrs with the addition of sections
@param sections: accumulates the idArrays for each section
**/
const getSections = function (getArray = [], sectionDetails = [], callback, sections = {}) {
// grab the first section to work;
let section = sectionDetails.shift();
getSectionIDs(section.section, (idArray) => {
// store the idArray for use later on if needed.
sections[section.section] = [...idArray];
// add the sections reporder to the getArray so that we can order the idArray later.
// getArray.push(`_reporder_${section.section}`);
// iterate through the ids
idArray.forEach((id) => {
// Iterate through each of the fields for the repeating section
section.fields.forEach((field) => {
// add the repeating attribute for this id to the getArray
getArray.push(`${section.section}_${id}_${field}`);
});
});
if (sectionDetails[0]) {
// If there's another section to work through, go through the burndown again
getSections(getArray, sectionDetails, callback, sections);
} else {
// If no sections are left, call the callback
callback(getArray, sections);
}
});
};
// The next three functions are only used for the ID ordering.
// orders the section id arrays to match the repOrder attribute
const orderSections = function (attributes, sections) {
Object.keys(sections).forEach((section) => {
attributes[`_reporder_${section}`] = commaArray(attributes[`_reporder_${section}`]);
orderSection(attributes[`_reporder_${section}`], sections[section]);
});
};
// splits a comma delimited string into an array
const commaArray = function (string = '') {
return string.toLowerCase().split(/\s*,\s*/);
};
// orders a single ID array
const orderSection = function (repOrder, IDs = []) {
IDs.sort((a, b) => {
return repOrder.indexOf(a.toLowerCase()) - repOrder.indexOf(b.toLowerCase());
});
};
/* Example: Sum inventory weight*quantity and available carrying capacity:
on("change:repeating_inventory:weight change:repeating_inventory:quantity", (event) => {
getAllAttrs((attributes, sections) => {
const setObj = {};
setObj.total_weight = sections.repeating_inventory.reduce((memo, id) => {
memo += value(attributes[`repeating_inventory_${id}_weight`])*value(attributes[`repeating_inventory_${id}_quantity`]);
}, 0);
setObj.available_weight = value(attributes.strength_mod)*value(attributes.size)*10 - setObj.total_weight;
setAttrs(setObj, {silent:true});
}, [], ["strength_mod", "size"]); // calling with default section details
});
*/
const setRollQueries = () => {
const update = {};
const [rollType, normal, advantage, disadvantage] = helpers.getTranslationByArray([
'roll_type',
'normal',
'advantage',
'disadvantage',
]);
const rollQuery = `?{${rollType}|${normal}, 1d20|${advantage}, 2d20kh1|${disadvantage}, 2d20kl1}`;
update[G_ROLL_ATTRIBUTE] = rollQuery;
setAttrs(update);
};
const calculateTotalSlots = () => {
getAllAttrs(
(values, sections) => {
const update = {};
let total = 0;
Object.keys(sections).forEach((section) => {
switch (section) {
case 'repeating_inventory': {
const itemslots = sections[section].reduce((sum, id) => {
const slot = +values[`${section}_${id}_item_slots`] || 0;
const count = 1; // +values[`${section}_${id}_item_count`] || 0;
return (sum += slot * count);
}, 0);
total += itemslots;
break;
}
case 'repeating_weapons': {
const wpnslots = sections[section].reduce((sum, id) => {
return (sum += +values[`${section}_${id}_weapon_slots`] || 0);
}, 0);
total += wpnslots;
break;
}
}
});
update.carry = total;
setAttrs(update);
},
[...G_INVENTORY_REPEATING]
);
};
const calculateTotalPowerCost = () => {
getAllAttrs(
(values, sections) => {
const update = {};
const total = Object.values(values).reduce((sum, val) => {
return sum + (+val || 0);
}, 0);
update.total_power_cost = total;
setAttrs(update);
console.log(update);
calculateOverheated(total);
},
[...G_MODULES_REPEATING]
);
};
const calculateOverheated = (totalPower) => {
getAttrs(G_MODULES_GLOBAL, (values) => {
const update = {};
const output = +values.output_power || 0;
update.overheated = totalPower > output ? 1 : 0;
console.log(update);
setAttrs(update);
});
};
/**
* Set Roll Type Query
*/
on(`sheet:opened`, (eventInfo) => {
setRollQueries();
});
G_REPEATING_SECTIONS.forEach((section) => {
on(`change:repeating_${section} remove:repeating_${section}`, (eventInfo) => {
isFieldsetEmpty(section);
});
});
// Calculate derived stats
Object.keys(G_DERIVED_STATS).forEach((stat) => {
on(`change:${stat}`, (eventInfo) => {
const update = {};
const value = +eventInfo.newValue || 0;
G_DERIVED_STATS[stat].forEach((derived) => {
update[derived.name] = derived.base + value;
});
setAttrs(update);
});
});
// Update item slots carried
on(
`change:repeating_inventory:item_slots change:repeating_inventory remove:repeating_inventory ` +
`change:repeating_weapons:weapon_slots change:repeating_weapons remove:repeating_weapons`,
(eventInfo) => calculateTotalSlots()
);
// Update total power cost
on(
`change:repeating_modules:module_power_cost change:repeating_modules remove:repeating_modules`,
(eventInfo) => calculateTotalPowerCost()
);
const makeRollString = (params) => {
const { header, ability, category } = params;
const template = [
`@{wtype}`,
`&{template:dis}`,
`{{name=@{character_name}}}`,
`{{header=${header}}}`,
`{{category=${category}}}`,
`{{roll=[[@{rtype}+${ability}]]}}`,
];
return template.join(' ');
};
const makeRoll = async (rollString) => {
const result = await startRoll(rollString);
const { rollId, results } = result;
finishRoll(rollId, results);
};
const rollAbility = async (ability) => {
const [abilityName, abilityWord] = helpers.getTranslationByArray([ability, 'ability']);
const abilityTag = `@{${ability}}[${abilityName}]`;
const params = {
header: abilityName,
category: abilityWord,
ability: abilityTag,
};
const rollString = makeRollString(params);
makeRoll(rollString);
};
/**
* Roll Abilities
*/
G_ABILITIES.forEach((ability) => {
on(`clicked:${ability}`, async (eventInfo) => {
rollAbility(ability);
});
});
</script>