Browse Source

Add roll20-side code

master
Brandon Cornejo 2 years ago
parent
commit
9282331512
  1. 359
      roll20/char_sheet.css
  2. 714
      roll20/char_sheet.html

359
roll20/char_sheet.css

@ -0,0 +1,359 @@
.sheet-main {
display: grid;
width: 800px;
height: 900px;
grid-gap: 4px;
grid-template-columns: 1fr 1fr;
grid-template-rows: 130px 1fr 1fr 1fr;
grid-template-areas:"header header"
"attributes saves"
"lactions ractions"
"equipment loot"
"spells spells";
}
.sheet-npc {
display: grid;
grid-gap: 4px;
grid-template-columns: 1fr 1fr;
}
.sheet-section {
padding: 5px;
border-style: solid;
}
.sheet-inner-section {
padding: 5px;
}
/** SECTION LISTING **/
.sheet-header {
grid-area: header;
/*background-color: olive;*/
}
.sheet-attributes {
grid-area: attributes;
/*background-color: orange;*/
}
.sheet-saves {
grid-area: saves;
/*background-color: brown;*/
}
.sheet-lactions {
grid-area: lactions;
/*background-color: coral;*/
}
.sheet-ractions {
grid-area: ractions;
/*background-color: green;*/
}
.sheet-spells {
grid-area: spells;
/*grid-column: 1 / span 2;*/
}
/** INNER GRIDS **/
div.sheet-grid-container-2col {
display: grid;
grid-template-columns: 1fr 1fr;
}
div.sheet-header-grid {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 30px 1fr;
row-gap: 5px;
column-gap: 5px;
}
div.sheet-header-field-grid {
padding: 5px 15px;
display: grid;
grid-template-columns: 80px 1fr;
}
div.sheet-stat-grid {
display: grid;
grid-template-columns: 50px 50px 50px 50px;
row-gap: 5px;
}
div.sheet-stat2-grid {
display: grid;
grid-template-columns: 1fr 1fr;
row-gap: 5px;
column-gap: 5px;
}
div.sheet-movement-grid {
display: grid;
grid-template-columns: 1fr 1fr;
row-gap: 5px;
}
div.sheet-saves-grid {
display: grid;
grid-template-columns: 100px auto auto auto;
row-gap: 5px;
column-gap: 10px;
}
div.sheet-attacks-grid {
display: grid;
grid-template-columns: 1fr 50px 50px 50px;
row-gap: 5px;
column-gap: 10px;
margin-bottom: 5px;
}
div.sheet-proficiencies-grid {
display: grid;
grid-template-columns: 1fr 50px 50px;
row-gap: 5px;
column-gap: 10px;
margin-bottom: 5px;
}
div.sheet-equipment-grid {
display: grid;
grid-template-columns: 1fr 75px;
row-gap: 5px;
column-gap: 10px;
margin-bottom: 5px;
}
div.sheet-currency-grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
row-gap: 5px;
column-gap: 10px;
}
div.sheet-spells-grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr;
row-gap: 5px;
column-gap: 10px;
margin-bottom: 5px;
}
/** GENERAL ELEMENT STYLE **/
input.sheet-line-input {
width: 214px!important;
border: 0;
outline: 0;
border-bottom: 1px solid black;
background: rgba(0, 0, 0, 0.0);
border-radius: 0px;
}
input.sheet-name-input {
width: 100%;
}
div.sheet-spells-grid span {
text-align: center;
}
div.sheet-spells.grid input {
padding-left: 50px;
margin-left: 50px;
}
.sheet-stat-input {
width: 100%;
text-align: center;
background: rgba(255, 255, 255, 0.25);
}
.sheet-stat-span {
text-align: center;
text-transform: uppercase;
font-weight: bold;
font-size: 16px;
font-family: "Candal";
}
.sheet-initiative-span {
font-weight: bold;
font-size: 18px;
grid-column: 1 / span 2;
}
input.sheet-currency-input {
font-size: 11px;
width: 60px!important;
}
input.sheet-spells-input {
width: 60px!important;
margin-left: 22px;
}
.sheet-text-center {
text-align: center;
}
.sheet-title-line {
font-weight: bold;
font-size: 18px;
}
.sheet-textarea {
outline: 0;
border-radius: 0;
box-sizing: content-box;
background-color: rgba(255, 255, 255, 0.3);
overflow-y: hidden;
padding: 10px;
max-width: 90%;
resize: none;
}
.sheet-roll-button {
font-size: 1.6em;
border-radius: 0.25em;
}
.sheet-header-field-grid select {
margin: 5px 0px;
}
.sheet-header-field-grid span {
margin: 5px 0px;
}
.sheet-hidden {
display: none;
}
.sheet-margin-top {
margin-top: 35px;
}
.sheet-grid-span-1-2 {
grid-column: 1 / span 2;
}
.sheet-grid-span-4-2 {
grid-column: 4 / span 2;
}
input.sheet-input-big {
width: 55px!important;
}
/** INDIVIDUAL ELEMENT STYLES **/
.sheet-system-title {
margin-bottom: 10px;
}
.sheet-stat-title {
text-align: center;
grid-column: 1 / span 4;
}
.sheet-movement-title {
text-align: center;
grid-column: 1 / span 2;
}
.sheet-saves-title {
text-align: center;
grid-column: 1 / span 4;
}
.sheet-attack-title {
text-align: center;
grid-column: 1 / span 4;
margin-top: 10px;
}
.sheet-proficiency-title {
text-align: center;
grid-column: 1 / span 3;
margin-top: 25px;
}
.sheet-equipment-title {
text-align: center;
grid-column: 1 / span 2;
}
.sheet-currency-title {
text-align: center;
grid-column: 1 / span 5;
margin-top: 25px;
}
.sheet-spells-title {
text-align: center;
grid-column: 1 / span 7;
}
.sheet-exp-title {
text-align: center;
grid-column: 1 / span 5;
}
.sheet-hp-span {
font-size: 28px;
text-align: center;
text-transform: uppercase;
font-weight: bold;
vertical-align: bottom;
grid-column: 1 / span 2;
}
.sheet-hp-input {
width: 75%;
float: right;
}
.sheet-ac-wrapper {
grid-column: 1 / span 2;
text-align: center;
}
.sheet-hp-mod-input {
width: 75%;
float: left;
}
.sheet-ac-input {
width: 50%;
}
.sheet-exp-current {
grid-column: 1 / span 2;
}
.sheet-exp-needed {
grid-column: 3 / span 2;
}
.sheet-exp-current > input, .sheet-exp-needed > input {
width: 150px;
}
.sheet-lootbox {
grid-column: 1 / span 5;
}
div.sheet-npc-rsection, div.sheet-npc-lsection {
padding: 5px;
border: 4px solid black;
border-radius: 4px;
margin-left: 10px;
}
.sheet-spells-grid-daily > input {
text-align: center;
}
/** Roll Templates **/
.sheet-rolltemplate-acks {}
.sheet-rolltemplate-acks div.sheet-acks-container {
border: 2px solid black;
border-radius: 3px;
margin-bottom: 5px;
}
.sheet-rolltemplate-acks div.sheet-acks-header {
background-color: rgba(112, 32, 130, 1);
border-bottom: 1px solid black;
padding: 5px;
line-height: 1.6em;
font-size: 1.2em;
font-weight: bold;
color: #FFF;
text-align: center;
}
.sheet-rolltemplate-acks div.sheet-acks-subheader {
font-weight: bold;
text-align: center;
color: rgb(112, 32, 130);
font-size: 1.1em;
}
.sheet-rolltemplate-acks div.sheet-acks-row {
/*border-bottom: 1px solid black;*/
padding: 10px;
}
.sheet-rolltemplate-acks div.sheet-acks-row .inlinerollresult {
float: right;
}
.sheet-rolltemplate-acks div.sheet-acks-row .sheet-acks-target-value {
float: right;
border: none;
background-color: transparent;
color: green;
}
.sheet-rolltemplate-acks div.sheet-acks-row:nth-child(odd) {
background-color: rgba(217, 217, 214, 1);
}
.sheet-rolltemplate-acks div.sheet-acks-row:nth-child(even) {
background-color: rgba(233, 233, 233, 1);
}
.sheet-rolltemplate-acks div.sheet-ask-desc {
font-size: 0.7em;
color: rgb(115, 115, 115);
}
div.sheet-main { display: grid; }
div.sheet-npc { display: none; }
/*input.sheet-block-switch { display: none; };*/
input.sheet-block-switch:checked ~ div.sheet-main { display: none; }
input.sheet-block-switch:checked ~ div.sheet-npc { display: grid; }

714
roll20/char_sheet.html

@ -0,0 +1,714 @@
<input type="checkbox" class="sheet-block-switch" name="attr_npcsheet" value="1"><span> NPC? (DO NOT CLICK)</span><br/><br/>
<div class="main">
<div class="header section">
<div class="header-grid">
<div class="header-field-grid">
<span>Name</span>
<input class="line-input" name="attr_character_name">
</div>
<div>
<h2>Adventurer Conqueror King</h2>
</div>
<div class="header-field-grid">
<span>Title</span>
<input class="line-input" type="text" name="attr_classtitle" value="the Unknown">
<span>Class</span>
<select name="attr_class">
<option>Fighter</option>
<option>Mage</option>
<option>Cleric</option>
<option>Thief</option>
<option>Assassin</option>
<option>Bard</option>
<option>Bladedancer</option>
<option>Explorer</option>
</select>
</div>
<div class="header-field-grid">
<span>Alignment</span>
<input class="line-input" type="text" name="attr_align" value="">
<span>Level</span>
<input class="line-input" type="text" name="attr_level" value="0">
</div>
</div>
</div>
<div class="attributes section">
<div class="grid-container-2col">
<div class="stat-grid">
<div class="sheet-stat-title">
<h3>Attributes</h3>
</div>
<span>Value</span><span></span><span>Modifier</span><span></span>
<!-- Strength -->
<input class="sheet-stat-input" type="text" name="attr_str" value="10">
<span class="sheet-stat-span">Str</span>
<input class="sheet-stat-input" type="text" name="attr_str_mod" value="0">
<button class="sheet-roll-button" type='roll' value='&{template:acks} {{name=Strength Throw}} {{roll=[[1d20 + @{str_mod}]]}}' name='roll_StrengthCheck'></button>
<!-- Intelligence -->
<input class="sheet-stat-input" type="text" name="attr_int" value="10">
<span class="sheet-stat-span">Int</span>
<input class="sheet-stat-input" type="text" name="attr_int_mod" value="0">
<button class="sheet-roll-button" type='roll' value='&{template:acks} {{name=Intelligence Throw}} {{roll=[[1d20 + @{int_mod}]]}}' name='roll_IntelligenceCheck'></button>
<!-- Wisdom -->
<input class="sheet-stat-input" type="text" name="attr_wis" value="10">
<span class="sheet-stat-span">Wis</span>
<input class="sheet-stat-input" type="text" name="attr_wis_mod" value="0">
<button class="sheet-roll-button" type='roll' value='&{template:acks} {{name=Wisdom Throw}} {{roll=[[1d20 + @{wis_mod}]]}}' name='roll_WisdomCheck'></button>
<!-- Dexterity -->
<input class="sheet-stat-input" type="text" name="attr_dex" value="10">
<span class="sheet-stat-span">Dex</span>
<input class="sheet-stat-input" type="text" name="attr_dex_mod" value="0">
<button class="sheet-roll-button" type='roll' value='&{template:acks} {{name=Dexterity Throw}} {{roll=[[1d20 + @{dex_mod}]]}}' name='roll_DexterityCheck'></button>
<!-- Constitution -->
<input class="sheet-stat-input" type="text" name="attr_con" value="10">
<span class="sheet-stat-span">Con</span>
<input class="sheet-stat-input" type="text" name="attr_con_mod" value="0">
<button class="sheet-roll-button" type='roll' value='&{template:acks} {{name=Constitution Throw}} {{roll=[[1d20 + @{con_mod}]]}}' name='roll_ConstitutionCheck'></button>
<!-- Charisma -->
<input class="sheet-stat-input" type="text" name="attr_chr" value="10">
<span class="sheet-stat-span">Chr</span>
<input class="sheet-stat-input" type="text" name="attr_chr_mod" value="0">
<button class="sheet-roll-button" type='roll' value='&{template:acks} {{name=Charisma Throw}} {{roll=[[1d20 + @{chr_mod}]]}}' name='roll_CharismaCheck'></button>
</div>
<div class="stat2-grid">
<!-- Hit Points -->
<span class="sheet-hp-span">HP</span>
<span class="sheet-text-center">Current</span><span class="sheet-text-center">Maximum</span>
<div><input class="sheet-stat-input sheet-hp-input" type="text" name="attr_hp"></div>
<div><input class="sheet-stat-input sheet-hp-mod-input" type="text" name="attr_hp_max"></div>
<!-- Hit Points -->
<span class="sheet-hp-span">AC</span>
<div class="sheet-ac-wrapper"><input class="sheet-stat-input sheet-ac-input" type="text" name="attr_ac" value="0"></div>
</div>
</div>
</div>
<div class="saves section">
<div class="grid-container-2col">
<div class="movement-grid">
<div class="sheet-movement-title">
<h3>Movement</h3>
</div>
<span class="sheet-save-span">Base</span>
<input class="sheet-stat-input sheet-input-big" type="text" name="attr_base_movement" value="120">
<span class="sheet-save-span">Combat</span>
<input class="sheet-stat-input sheet-input-big" type="text" name="attr_combat_movement" value="floor(@{base_movement} / 3)" disabled="true">
<span class="sheet-save-span">Chrg/Run</span>
<input class="sheet-stat-input sheet-input-big" type="text" name="attr_charge_movement" value="@{base_movement}" disabled="true">
<span class="sheet-save-span">Climb</span>
<input class="sheet-stat-input sheet-input-big" type="text" name="attr_climb_movement">
<span class="sheet-save-span">Stealth</span>
<input class="sheet-stat-input sheet-input-big" type="text" name="attr_stealth_movement" value="floor(@{base_movement} / 2)" disabled="true">
<span class="sheet-save-span">Daily</span>
<input class="sheet-stat-input sheet-input-big" type="text" name="attr_daily_movement" value="floor(@{base_movement} * 2 / 10)" disabled="true">
</div>
<div class="saves-grid">
<div class="sheet-saves-title">
<h3>Saving Throws</h3>
</div>
<span></span><span>Throw</span><span>Modifier</span><span></span>
<span class="sheet-save-span">Petrif. & Paral.</span>
<div><input class="sheet-stat-input" type="text" name="attr_save_pp"></div>
<div><input class="sheet-stat-input" type="text" name="attr_save_pp_mod" value="0"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=Saving Throw}} {{subheader=Petrification & Paralysis}} {{roll=[[1d20 + @{save_pp_mod}]]}} {{target=[[@{save_pp}]]}}" name="roll_PPSave"></button></div>
<span class="sheet-save-span">Poison & Death</span>
<div><input class="sheet-stat-input" type="text" name="attr_save_pd"></div>
<div><input class="sheet-stat-input" type="text" name="attr_save_pd_mod" value="0"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=Saving Throw}} {{subheader=Poison & Death}} {{roll=[[1d20 + @{save_pd_mod}]]}} {{target=[[@{save_pd}]]}}" name="roll_PDSave"></button></div>
<span class="sheet-save-span">Blast & Breath</span>
<div><input class="sheet-stat-input" type="text" name="attr_save_bb"></div>
<div><input class="sheet-stat-input" type="text" name="attr_save_bb_mod" value="0"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=Saving Throw}} {{subheader=Blast & Breath}} {{roll=[[1d20 + @{save_bb_mod}]]}} {{target=[[@{save_bb}]]}}" name="roll_BBSave"></button></div>
<span class="sheet-save-span">Staffs & Wands</span>
<div><input class="sheet-stat-input" type="text" name="attr_save_sw"></div>
<div><input class="sheet-stat-input" type="text" name="attr_save_sw_mod" value="0"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=Saving Throw}} {{subheader=Staffs & Wands}} {{roll=[[1d20 + @{save_sw_mod}]]}} {{target=[[@{save_sw}]]}}" name="roll_SWSave"></button></div>
<span class="sheet-save-span">Spells</span>
<div><input class="sheet-stat-input" type="text" name="attr_save_sp"></div>
<div><input class="sheet-stat-input" type="text" name="attr_save_sp_mod" value="0"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=Saving Throw}} {{subheader=Spells}} {{roll=[[1d20 + @{save_sp_mod}]]}} {{target=[[@{save_sp}]]}}" name="roll_SPSave"></button></div>
</div>
</div>
</div>
<div class="lactions section">
<div class="attacks-grid">
<!-- Initiative -->
<span class="sheet-initiative-span">Initiative</span>
<div><input class="sheet-stat-input" type="text" name="attr_initiative_mod" value="0"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=Initiative Roll}} {{subheader=@{character_name}}} {{roll=[[1d6 + @{initiative_mod} &{tracker}]]}}" name="roll_Initiative"></button></div>
<span class="sheet-initiative-span">Attack Throw</span>
<div><input class="sheet-stat-input" type="text" name="attr_attack_throw_vis" value="@{attack_throw}" disabled="true"></div>
<div><input class="sheet-stat-input sheet-hidden" type="text" name="attr_attack_throw"></div>
</div>
<div class="attacks-grid">
<div class="sheet-attack-title">
<h3>Weapons & Attacks</h3>
</div>
<span>Attack Name</span><span>Th. Mod</span><span>Damage</span><span></span>
</div>
<fieldset class="repeating_attacks">
<div class="attacks-grid">
<input class="sheet-name-input" type="text" name="attr_attack_name">
<div><input class="sheet-stat-input" type="text" name="attr_attack_throw_mod"></div>
<div><input class="sheet-stat-input" type="text" name="attr_attack_dmg"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=@{attack_name} Attack}} {{roll=[[1d20 + @{attack_throw_mod}]]}} {{target=[[@{attack_throw}]]}} {{damage=[[@{attack_dmg}]]}}" name="roll_Attack"></button></div>
</div>
</fieldset>
<div class="proficiencies-grid">
<div class="sheet-proficiency-title">
<h3>Proficiencies</h3>
</div>
<span>Proficiency</span><span>Desc</span><span></span>
</div>
<fieldset class="repeating_proficiencies">
<div class="proficiencies-grid">
<input class="sheet-name-input" type="text" name="attr_proficiency_name">
<div><input class="sheet-stat-input" type="text" name="attr_proficiency_desc"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=@{proficiency_name} Proficency}} {{desc=@{proficiency_desc}}}" name="roll_Proficiency"></button></div>
</div>
</fieldset>
</div>
<div class="ractions section">
<div class="proficiencies-grid">
<div class="sheet-proficiency-title">
<h3>Class & Race Abilities</h3>
</div>
<span>Ability Name</span><span>Throw</span><span></span>
</div>
<fieldset class="repeating_abilities">
<div class="proficiencies-grid">
<input class="sheet-name-input" type="text" name="attr_ability_name">
<div><input class="sheet-stat-input" type="text" name="attr_ability_throw"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=@{ability_name}}} {{@subheader=Class/Race Ability}} {{roll=[[1d20]]}} {{target=@{ability_throw}}}" name="roll_Ability"></button></div>
</div>
</fieldset>
<div class="proficiencies-grid">
<div class="sheet-proficiency-title">
<h3>Actions</h3>
</div>
<span>Action Name</span><span>Throw</span><span></span>
</div>
<div class="proficiencies-grid">
<input class="sheet-name-input" type="text" name="attr_opendoor_name" value="Open Door" disabled>
<div><input class="sheet-stat-input" type="text" name="attr_opendoor_throw"></div>
<div><button class="sheet-roll-button" type="roll" value="/roll 1d20" name="roll_OpenDoor"></button></div>
</div>
<div class="proficiencies-grid">
<input class="sheet-name-input" type="text" name="attr_detectdoor_name" value="Detect Secret Door" disabled>
<div><input class="sheet-stat-input" type="text" name="attr_detectdoor_throw"></div>
<div><button class="sheet-roll-button" type="roll" value="/roll 1d20" name="roll_DetectDoor"></button></div>
</div>
<div class="proficiencies-grid">
<input class="sheet-name-input" type="text" name="attr_hearnoise_name" value="Hear Noise" disabled>
<div><input class="sheet-stat-input" type="text" name="attr_hearnoise_throw"></div>
<div><button class="sheet-roll-button" type="roll" value="/roll 1d20" name="roll_HearNoise"></button></div>
</div>
<div class="proficiencies-grid">
<input class="sheet-name-input" type="text" name="attr_findtraps_name" value="Find Traps" disabled>
<div><input class="sheet-stat-input" type="text" name="attr_findtraps_throw"></div>
<div><button class="sheet-roll-button" type="roll" value="?{Spell|Cure Light Wounds, **Cure Light Wounds** Target Regains [[1d8+5]] HP. | Cure Moderate Wounds, **Cure Moderate Wounds** Target Regains [[2d8+8]] HP. | Cure Serious Wounds, **Cure Serious Wounds** Target Regains [[3d8+8]] HP.}" name="roll_FindTraps"></button></div>
</div>
<fieldset class="repeating_actions">
<div class="proficiencies-grid">
<input class="sheet-name-input" type="text" name="attr_action_name">
<div><input class="sheet-stat-input" type="text" name="attr_action_throw"></div>
<div><button class="sheet-roll-button" type="roll" value="/roll 1d20" name="roll_Action"></button></div>
</div>
</fieldset>
</div>
<div class="equipment section">
<div class="equipment-grid">
<div class="sheet-equipment-title">
<h3>Equipment & Magic Items</h3>
</div>
<span>Item Name</span><span>Encumb.</span>
</div>
<fieldset class="repeating_equipment">
<div class="equipment-grid">
<input class="sheet-name-input" type="text" name="attr_equipment_name">
<div><input class="sheet-stat-input" type="text" name="attr_equipment_encumb"></div>
</div>
</fieldset>
</div>
<div class="loot section">
<div class="currency-grid">
<div class="sheet-exp-title">
<h3>Experience</h3>
</div>
<span>Current</span><span></span><span>Needed</span><span></span><span>Bonus</span>
<div class="sheet-exp-current"><input type="text" name="attr_exp_current"></div>
<div class="sheet-exp-needed"><input type="text" name="attr_exp_needed"></div>
<div><input class="sheet-currency-input" type="text" name="attr_exp_bonus"></div>
<div class="sheet-currency-title">
<h3>Loot</h3>
</div>
<span>Copper</span><span>Silver</span><span>Electrum</span><span>Gold</span><span>Platinum</span>
<input class="currency-input" type="text" name="attr_cp">
<input class="currency-input" type="text" name="attr_sp">
<input class="currency-input" type="text" name="attr_ep">
<input class="currency-input" type="text" name="attr_gp">
<input class="currency-input" type="text" name="attr_pp">
<div class="sheet-lootbox"><textarea class="sheet-textarea" wrap="off" name="attr_loot"></textarea></div>
</div>
</div>
<div class="spells section">
<div class="spells-grid spells-grid-daily">
<div class="sheet-spells-title">
<h3>Spells Per Day</h3>
</div>
<span></span><span>One</span><span>Two</span><span>Three</span><span>Four</span><span>Five</span><span>Six</span>
<span>Used</span>
<input class="spells-input" type="text" name="attr_spells_l1">
<input class="spells-input" type="text" name="attr_spells_l2">
<input class="spells-input" type="text" name="attr_spells_l3">
<input class="spells-input" type="text" name="attr_spells_l4">
<input class="spells-input" type="text" name="attr_spells_l5">
<input class="spells-input" type="text" name="attr_spells_l6">
<span>Total</span>
<input class="spells-input" type="text" name="attr_spells_l1_max">
<input class="spells-input" type="text" name="attr_spells_l2_max">
<input class="spells-input" type="text" name="attr_spells_l3_max">
<input class="spells-input" type="text" name="attr_spells_l4_max">
<input class="spells-input" type="text" name="attr_spells_l5_max">
<input class="spells-input" type="text" name="attr_spells_l6_max">
</div>
<div class="spells-grid">
<div class="sheet-spells-title sheet-margin-top">
<h3>Spellbook</h3>
</div>
<span class="grid-span-1-2">Spell Name</span><span>Level</span><span class="grid-span-4-2">Effect</span><span>Damage</span><span></span><span></span><span></span>
</div>
<fieldset class="repeating_spells">
<div class="spells-grid">
<input class="sheet-name-input grid-span-1-2" type="text" name="attr_spell_name">
<div><input class="sheet-stat-input" type="text" name="attr_spell_level"></div>
<div class="grid-span-4-2"><input class="sheet-stat-input" type="text" name="attr_spell_effect"></div>
<div><input class="sheet-stat-input" type="text" name="attr_spell_damage"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=@{spell_name}}} {{subheader=Level @{spell_level} Arcane Spell}} {{desc=@{spell_effect}}} {{damage=[[@{spell_damage}]]}}" name="roll_Spell"></button></div>
</div>
</fieldset>
</div>
</div>
</div>
<div class="npc">
<div class="npc-header sheet-grid-span-1-2 sheet-text-center">
<h2>Adventurer Conqueror King System</h2>
<h4>NPC/Monster Stat Block</h4>
<br><br><br>
</div>
<div class="npc-lsection">
<div class="attacks-grid">
<span class="sheet-initiative-span">Attack Throw</span>
<div><input class="sheet-stat-input" type="text" name="attr_npc_attack_throw_vis" value="@{npc_attack_throw}" disabled="true"></div>
<div><input class="sheet-stat-input sheet-hidden" type="text" name="attr_npc_attack_throw"></div>
<span class="sheet-initiative-span">Armour Class</span>
<div><input class="sheet-stat-input" type="text" name="attr_ac" value="0"></div>
<div></div>
<!-- Initiative -->
<span class="sheet-initiative-span">Initiative</span>
<div><input class="sheet-stat-input" type="text" name="attr_initiative_mod" value="0"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=Initiative Roll}} {{subheader=@{character_name}}} {{roll=[[1d6 + @{initiative_mod} &{tracker}]]}}" name="roll_Initiative"></button></div>
</div>
<div class="attacks-grid">
<div class="sheet-attack-title">
<h3>Weapons & Attacks</h3>
</div>
<span>Attack Name</span><span>Th. Mod</span><span>Damage</span><span></span>
</div>
<fieldset class="repeating_attacks">
<div class="attacks-grid">
<input class="sheet-name-input" type="text" name="attr_attack_name">
<div><input class="sheet-stat-input" type="text" name="attr_attack_throw_mod"></div>
<div><input class="sheet-stat-input" type="text" name="attr_attack_dmg"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=@{attack_name} Attack}} {{roll=[[1d20 + @{attack_throw_mod}]]}} {{target=[[@{attack_throw}]]}} {{damage=[[@{attack_dmg}]]}}" name="roll_Attack"></button></div>
</div>
</fieldset>
<div class="proficiencies-grid">
<div class="sheet-proficiency-title">
<h3>Proficiencies</h3>
</div>
<span>Proficiency</span><span>Desc</span><span></span>
</div>
<fieldset class="repeating_proficiencies">
<div class="proficiencies-grid">
<input class="sheet-name-input" type="text" name="attr_proficiency_name">
<div><input class="sheet-stat-input" type="text" name="attr_proficiency_desc"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=@{proficiency_name} Proficency}} {{desc=@{proficiency_desc}}}" name="roll_Proficiency"></button></div>
</div>
</fieldset>
</div>
<div class="npc-rsection">
<div class="attacks-grid">
<span class="sheet-title-line">Hit Dice</span>
<input class="sheet-stat-input" type="text" name="attr_npc_hitdice">
<input class="sheet-stat-input" type="text" name="attr_npc_hitdicemod" value="d8">
<div><button class="sheet-roll-button" type="roll" value="/w gm &{template:acks}{{name=@{character_name} Hit Dice}}{{roll=[[@{npc_hitdice}@{npc_hitdicemod}]]}}" name="roll_NPCHitDice"></button></div>
<span class="sheet-title-line">Hit Points/Max</span><input class="sheet-stat-input" type="text" name="attr_hp"><input class="sheet-stat-input" type="text" name="attr_hp_max"><span></span>
<span class="sheet-title-line">Class</span><span></span><span class="sheet-title-line">Level</span><span></span>
<select name="attr_class">
<option>Fighter</option>
<option>Mage</option>
<option>Cleric</option>
<option>Thief</option>
<option>Assassin</option>
<option>Bard</option>
<option>Bladedancer</option>
<option>Explorer</option>
</select>
<span></span>
<input class="sheet-stat-input" type="text" name="attr_level">
<span></span>
</div>
<div class="saves-grid">
<div class="sheet-saves-title">
<h3>Saving Throws</h3>
</div>
<span></span><span>Throw</span><span>Modifier</span><span></span>
<span class="sheet-save-span">Petrif. & Paral.</span>
<div><input class="sheet-stat-input" type="text" name="attr_save_pp"></div>
<div><input class="sheet-stat-input" type="text" name="attr_save_pp_mod" value="0"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=Saving Throw}} {{subheader=Petrification & Paralysis}} {{roll=[[1d20 + @{save_pp_mod}]]}} {{target=[[@{save_pp}]]}}" name="roll_PPSave"></button></div>
<span class="sheet-save-span">Poison & Death</span>
<div><input class="sheet-stat-input" type="text" name="attr_save_pd"></div>
<div><input class="sheet-stat-input" type="text" name="attr_save_pd_mod" value="0"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=Saving Throw}} {{subheader=Poison & Death}} {{roll=[[1d20 + @{save_pd_mod}]]}} {{target=[[@{save_pd}]]}}" name="roll_PDSave"></button></div>
<span class="sheet-save-span">Blast & Breath</span>
<div><input class="sheet-stat-input" type="text" name="attr_save_bb"></div>
<div><input class="sheet-stat-input" type="text" name="attr_save_bb_mod" value="0"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=Saving Throw}} {{subheader=Blast & Breath}} {{roll=[[1d20 + @{save_bb_mod}]]}} {{target=[[@{save_bb}]]}}" name="roll_BBSave"></button></div>
<span class="sheet-save-span">Staffs & Wands</span>
<div><input class="sheet-stat-input" type="text" name="attr_save_sw"></div>
<div><input class="sheet-stat-input" type="text" name="attr_save_sw_mod" value="0"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=Saving Throw}} {{subheader=Staffs & Wands}} {{roll=[[1d20 + @{save_sw_mod}]]}} {{target=[[@{save_sw}]]}}" name="roll_SWSave"></button></div>
<span class="sheet-save-span">Spells</span>
<div><input class="sheet-stat-input" type="text" name="attr_save_sp"></div>
<div><input class="sheet-stat-input" type="text" name="attr_save_sp_mod" value="0"></div>
<div><button class="sheet-roll-button" type="roll" value="&{template:acks} {{name=Saving Throw}} {{subheader=Spells}} {{roll=[[1d20 + @{save_sp_mod}]]}} {{target=[[@{save_sp}]]}}" name="roll_SPSave"></button></div>
</div>
</div>
</div>
<!-- Roll Templates -->
<rolltemplate class="sheet-rolltemplate-acks">
<div class="sheet-acks-container">
<div class="sheet-acks-header">{{name}}</div>
{{#subheader}}
<div class="sheet-acks-subheader sheet-acks-row">{{subheader}}</div>
{{/subheader}}
{{#target}}
<div class="sheet-acks-row">Target <span class="sheet-acks-target-value">{{target}}+</span></div>
{{/target}}
{{#roll}}
<div class="sheet-acks-row">Roll {{roll}}</div>
{{/roll}}
{{#damage}}
<div class="sheet-acks-row">Damage {{damage}}</div>
{{/damage}}
{{#desc}}
<div class="sheet-acks-row sheet-acks-desc">{{desc}}</div>
{{/desc}}
</div>
</rolltemplate>
<!-- Sheet Workers -->
<script type="text/worker">
/*** ATTRIBUTE RELATED WORKERS ***/
const calculateAttrMod = function(attr) {
// Calculate the modifier for a given attribute value
let atr = parseInt(attr);
let mod = 0;
if(atr <= 3) mod = -3;
if(atr >= 4 && atr <= 5) mod = -2;
if(atr >= 6 && atr <= 8) mod = -1;
if(atr >= 9 && atr <= 12) mod = 0;
if(atr >= 13 && atr <= 15) mod = 1;
if(atr >= 16 && atr <= 17) mod = 2;
if(atr >= 18) mod = 3;
return mod;
};
/** Calculate Modifiers when an Attribute value changes **/
on("change:str", function(e) {
console.log('calculate mod for str');
setAttrs({str_mod: calculateAttrMod(e.newValue)});
});
on("change:int", function(e) {
console.log('calculate mod for int');
setAttrs({int_mod: calculateAttrMod(e.newValue)});
});
on("change:wis", function(e) {
console.log('calculate mod for wis');
setAttrs({wis_mod: calculateAttrMod(e.newValue)});
});
on("change:dex", function(e) {
console.log('calculate mod for dex');
setAttrs({dex_mod: calculateAttrMod(e.newValue)});
});
on("change:con", function(e) {
console.log('calculate mod for con');
setAttrs({con_mod: calculateAttrMod(e.newValue)});
});
on("change:chr", function(e) {
console.log('calculate mod for chr');
setAttrs({chr_mod: calculateAttrMod(e.newValue)});
});
</script>
<script type="text/worker">
/*** SAVES/THROWS RELATED WORKERS ***/
const calculateSavesThrows = function(level, clas) {
level = parseInt(level);
var saves = [0, 0, 0, 0, 0, 0];
switch(clas) {
case 'Fighter':
case 'Assassin':
case 'Explorer':
switch(level) {
case 0:
saves = [16, 15, 17, 17, 18];
break;
case 1:
saves = [15, 14, 16, 16, 17, 10];
break;
case 2:
case 3:
saves = [14, 13, 15, 15, 16, 9];
break;
case 4:
saves = [13, 12, 14, 14, 15, 8];
break;
case 5:
case 6:
saves = [12, 11, 13, 13, 14, 7];
break;
case 7:
saves = [11, 10, 12, 12, 13, 6];
break;
case 8:
case 9:
saves = [10, 9, 11, 11, 12, 5];
break;
case 10:
saves = [9, 8, 10, 10, 11, 4];
break;
case 11:
case 12:
saves = [8, 7, 9, 9, 10, 3];
break;
case 13:
saves = [7, 6, 8, 8, 9, 2];
break;
case 14:
saves = [6, 5, 7, 7, 8, 1];
break;
}
break;
case 'Mage':
switch(level) {
case 1:
case 2:
case 3:
saves = [13, 13, 15, 11, 12, 10];
break;
case 4:
case 5:
case 6:
saves = [12, 12, 14, 10, 11, 9];
break;
case 7:
case 8:
case 9:
saves = [11, 11, 13, 9, 10, 8];
break;
case 10:
case 11:
case 12:
saves = [10, 10, 12, 8, 9, 7];
break;
case 13:
case 14:
saves = [9, 9, 11, 7, 8, 6];
break;
}
break;
case 'Cleric':
case 'Bladedancer':
switch(level) {
case 1:
case 2:
saves = [13, 10, 16, 13, 15, 10];
break;
case 3:
case 4:
saves = [12, 9, 15, 12, 14, 9];
break;
case 5:
case 6:
saves = [11, 8, 14, 11, 13, 8];
break;
case 7:
case 8:
saves = [10, 7, 13, 10, 12, 7];
break;
case 9:
case 10:
saves = [9, 6, 12, 9, 11, 6];
break;
case 11:
case 12:
saves = [8, 5, 11, 8, 10, 5];
break;
case 13:
case 14:
saves = [7, 4, 10, 7, 9, 4];
break;
}
break;
case 'Thief':
case 'Bard':
switch(level) {
case 1:
case 2:
saves = [13, 13, 16, 14, 15, 10];
break;
case 3:
case 4:
saves = [12, 12, 15, 13, 14, 9];
break;
case 5:
case 6:
saves = [11, 11, 14, 12, 13, 8];
break;
case 7:
case 8:
saves = [10, 10, 13, 11, 12, 7];
break;
case 9:
case 10:
saves = [9, 9, 12, 10, 11, 6];
break;
case 11:
case 12:
saves = [8, 8, 11, 9, 10, 5];
break;
case 13:
case 14:
saves = [7, 7, 10, 8, 9, 4];
break;
}
break;
}
return saves;
};
on("change:level change:class", function(e) {
console.log('calculate saves and throws for class/level');
getAttrs(["level", "class"], function(v) {
let saves = calculateSavesThrows(v.level, v.class);
setAttrs({
save_pp: saves[0],
save_pd: saves[1],
save_bb: saves[2],
save_sw: saves[3],
save_sp: saves[4],
attack_throw: saves[5]
});
});
});
/* NPC Attack Throw */
const calculateNpcHit = function(hd) {
switch(hd.toString()) {
case '1':
return 10;
case '2':
return 9;
case '3':
return 8;
case '4':
return 7;
case '5':
return 6;
case '6':
return 5;
case '7':
return 4;
case '8':
case '9':
return 3;
case '10':
case '11':
return 2;
case '12':
case '13':
return 1;
case '14':
case '15':
return 0;
case '16':
case '17':
return -1;
case '18':
case '19':
return -2;
case '20':
case '21':
return -3;
default:
return -4;
}
};
on("change:npc_hitdice", function(e) {
getAttrs(["npc_hitdice"], function(v) {
let thrw = calculateNpcHit(v.npc_hitdice);
setAttrs({npc_attack_throw: thrw});
});
});
</script>
Loading…
Cancel
Save