Files
roll20-character-sheets-tester/Delta Green 2/deltagreen.pug
T
marcom 8871df5171 Bug Fix and new features
- update button to level up checked skills at the end of an operation
- add queries to all roll for modifiers
- allow to target token to roll SAN LOSS
- add SAN and BP to NPC sheet
- fixed Luck bug for new sheets
2020-09-21 01:58:43 -07:00

195 lines
14 KiB
Plaintext
Raw 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.
//- VERSION
//- =============================
input(name='attr_version' type='hidden' value='1.05')
//- MIXINS
include src/pug/_mixins.pug
//- SETUP INITIAL SAN, STR,CON, AND HP FLAGS THE FIRST TIME THE PLAYER INPUT POW
input(name='attr_initial_san' type='hidden' value=1)
input(name='attr_initial_con' type='hidden' value=1)
input(name='attr_initial_str' type='hidden' value=1)
input(name='attr_initial_hp' type='hidden' value=1)
// TABS
// =============================
input.type(name='attr_sheet_type' type='hidden' value='pc')
input.display_string(name='attr_toggles' type='hidden' value='')
//TABS & LOGO
// =============================
.tabs.grid
// Buttons to toggle on GM whisper
span(data-i18n-title='GM Whisper') GM Whisper
label.switch(data-i18-titlen='whisper rolls to gm' title='whisper rolls to gm')
input.whisper-toggle(name='attr_gm_toggle' type='checkbox' value='/w gm')
span.slider
// LOGO
img(alt='Delta Green' src='https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/Delta%20Green%202/img/deltagreenlogo.jpg')
// CHARACTER SHEETS
span(data-i18n='Sheet Type') Sheet Type
select(name='attr_sheet_type')
optgroup(label='Sheet Type')
option(data-i18n='pc' value='pc') pc
option(data-i18n='npc' value='npc') npc
//- OBJECTS
//- ============================={{/damage}}
include src/pug/_objects.pug
// NPC SHEET
// =============================
.npc
.grid
.section-header
label(data-i18n-title='enter a name for non-player character' title='enter a name for non-player character')
input(data-i18n-placeholder='character name' name='attr_name' placeholder='Character name' title='@{name}' type='text' value='')
.grid.section-body
label.row(data-i18n-title='enter npc description' title='enter npc description')
textarea(name='attr_npc_description' placeholder='description')
each val, key in statsObject
//without modifiers - const statRollValue = `@{gm_toggle} &{template:stats} {{header=^{${key}}}} {{subheader=@{${key}}}} {{dice=[[1d100]]}} {{stat=[[@{${key+'_score'}}]]}} {{score=[[@{${key}}]]}}`;
- const statRollValue = `@{gm_toggle} &{template:stats} {{header=^{${key}}}} {{subheader=@{${key}}}} {{dice=[[1d100]]}} {{modifier=[[?{Modifier|,0|+20%,20|+40%,40|-20%,-20|-40%,-40|custom (%),?{custom (%)}}]]}} {{stat=[[@{${key+'_score'}}+round(?{Modifier|,0|+20%,20|+40%,40|-20%,-20|-40%,-40|custom (%),?{custom (%)}})]]}} {{score=[[@{${key}}+?{Modifier|,0|+20%,20|+40%,40|-20%,-20|-40%,-40|custom (%),?{custom (%)}}]]}}`;
button(name=key data-i18n-title=key + ' roll' title=key + ' roll' type='roll' value!=statRollValue)
h1.align-left(data-i18n=val)=val
if (val === 'POW' || val === 'STR' || val === 'CON' )
label(data-i18n-title=key + ' score' title=key + ' score')
input.text-align-left.short( min=0 name='attr_' + key + '_score' style='width:40%' placeholder='-' title='@{' + key + '_score' + '}' type='number' value=' ')
span.slash [
span.center(name='attr_' + key title='@{' + key + '}')
span.slash %]
else
label(data-i18n-title=key + ' score' title=key + ' score')
input.text-align-left.short(data-i18n-placeholder='-' style='width:40%' min=0 name='attr_' + key + '_score' placeholder='10' title='@{' + key + '_score' + '}' type='number' value=' ')
span.slash [
span.center(name='attr_' + key title='@{' + key + '}')
span.slash %]
h1(data-i18n='HP') HP
label(data-i18n-title='enter hit points' title='enter hit points')
span.center(name='attr_hit_points_max' title='@{' + key + '}')
span.slash /
input.text-align-left.short(data-i18n-placeholder='-' style='width:50%' name='attr_hit_points' placeholder='-' title='@{hit_points}' type='number' value='')
h1(data-i18n='WP') WP
label(data-i18n-title='enter willpower points' title='enter willpower points')
span.center(name='attr_willpower_points_max' title='@{' + key + '}')
span.slash /
input.text-align-left.short(data-i18n-placeholder='-' style='width:50%' name='attr_willpower_points' placeholder='-' title='@{willpower_points}' type='number' value='')
h1(data-i18n='SAN') SAN
label(data-i18n-title='enter sanity points' title='enter sanity points')
span.center(name='attr_sanity_points_max' title='@{' + key + '}')
span.slash /
input.text-align-left.short(data-i18n-placeholder='-' style='width:50%' name='attr_sanity_points' placeholder='-' title='@{willpower_points}' type='number' value='')
h1(data-i18n='BP') BP
label(data-i18n-title='enter breaking points' title='enter breaking point')
span.center(name='attr_breaking_point_max' title='@{' + key + '}')
span.slash /
input.text-align-left.short(data-i18n-placeholder='-' style='width:50%' name='attr_breaking_point' placeholder='-' title='@{willpower_points}' type='number' value='')
.grid.section.sanloss
input.switchblock.none( name='attr_whatsanroll' title='@{target_san_loss}' type='checkbox' value='target')
span.switch-a
- const statRollValue = `@{gm_toggle} &{template:sanloss} {{type=^{@{san_type}}}} {{success=@{san_success}}} {{failure=@{san_failure}}} {{roll1=[[@{san_success}]]}} {{roll2=[[@{san_failure}]]}} {{hasminsan=[[@{has_san_success}]]}} {{hasmaxsan=[[@{has_san_failure}]]}}`;
button(name='san loss roll' data-i18n-title='san loss roll' title='san loss roll' type='roll' value!=statRollValue)
h1(data-i18n='SAN LOSS') SAN LOSS
span.switch-b
//without modifiers - const statRollValue2 = `@{gm_toggle} &{template:sanloss1} {{minloss=@{minsanloss}}} {{maxloss=@{maxsanloss}}} {{name=@{target|name} }} {{dice=[[1d100]]}} {{subheader=@{target|sanity_points}}} {{rating=[[@{target|sanity_points}]]}} {{type=^{@{san_type}}}} {{success=@{san_success}}} {{failure=@{san_failure}}} {{rsuccess=[@{san_success}](~rsuccess)}} {{rfailure=[@{san_failure}](~rfailure)}} {{hasminsan=[[@{has_san_success}]]}} {{hasmaxsan=[[@{has_san_failure}]]}}`;
- const statRollValue2 = `@{gm_toggle} &{template:sanloss1} {{minloss=@{minsanloss}}} {{maxloss=@{maxsanloss}}} {{name=@{target|name} }} {{dice=[[1d100]]}} {{subheader=@{target|sanity_points}}} {{modifier=[[?{Modifier|,0|+20%,20|+40%,40|-20%,-20|-40%,-40|custom (%),?{custom (%)}}]]}} {{rating=[[@{target|sanity_points}+?{Modifier|,0|+20%,20|+40%,40|-20%,-20|-40%,-40|custom (%),?{custom (%)}}]]}} {{type=^{@{san_type}}}} {{success=@{san_success}}} {{failure=@{san_failure}}} {{rsuccess=[@{san_success}](~rsuccess)}} {{rfailure=[@{san_failure}](~rfailure)}} {{hasminsan=[[@{has_san_success}]]}} {{hasmaxsan=[[@{has_san_failure}]]}}`;
button(name='san loss roll' data-i18n-title='san loss roll' title='san loss roll' type='roll' value!=statRollValue2)
h1(data-i18n='SAN LOSS') SAN LOSS
button.none(name='roll_rsuccess' type='roll' value='@{gm_toggle} &{template:damage} {{header=Success}} {{subheader=@{san_success}}} {{damage=[[@{san_success}+0]]}} ')
button.none(name='roll_rfailure' type='roll' value='@{gm_toggle} &{template:damage} {{header=Failure}} {{subheader=@{san_failure}}} {{damage=[[@{san_failure}+0]]}} ')
input.text-align-left(data-i18n-placeholder='0' name='attr_san_success' placeholder='0' title='@{san_success}' type='text' value='0')
input.text-align-left(name='attr_has_san_success' type='hidden' value='1')
span.slash /
input.text-align-left(data-i18n-placeholder='1' name='attr_san_failure' placeholder='1' title='@{san_failure}' type='text' value='1')
input.text-align-left(name='attr_has_san_failure' type='hidden' value='1')
input(name='attr_minsanloss' type='hidden' value='0')
input(name='attr_maxsanloss' type='hidden' value='1')
select(name='attr_san_type')
optgroup(label='Sanity Type')
option(data-i18n='unnatural' value='unnatural') unnatural
option(data-i18n='violence' value='violence') violence
option(data-i18n='helplessness' value='helplessness') helplessness
input.center( name='attr_whatsanroll' title='@{target_san_loss}' type='checkbox' value='target')
span.slash Target the selected token
h1(data-i18n='armor') ARMOR
label(data-i18n-title='enter armor text' title='enter armor text')
input(data-i18n-placeholder='8 points of thick hide' name='attr_armor' placeholder='8 points of thick hide' title='@{armor}' type='text' value='')
h1(data-i18n='skills') skills
.repeating-container.skills
.grid.section-header
h2(data-i18n='skill') name
h2(data-i18n='rank') skill %
h2(data-i18n='roll') roll
fieldset.repeating_skills
.grid.section-skills.border-bottom
//without modifiers - const npcSkillRollValue = `@{gm_toggle} &{template:rolls} {{header=@{name}}} {{subheader=@{rank}}} {{rating=[[@{rank}]]}} {{dice=[[1d100]]}}`;
- const npcSkillRollValue = `@{gm_toggle} &{template:rolls} {{header=@{name}}} {{subheader=@{rank}}} {{modifier=[[?{Modifier|,0|+20%,20|+40%,40|-20%,-20|-40%,-40|custom (%),?{custom (%)}}]]}} {{rating=[[@{rank}+?{Modifier|,0|+20%,20|+40%,40|-20%,-20|-40%,-40|custom (%),?{custom (%)}}]]}} {{dice=[[1d100]]}}`;
label(data-i18n-title='skill name' title='skill name')
input.center(data-i18n-placeholder='skill name' name='attr_name' placeholder='skill name' title='@{repeating_skills_${x}_name}' type='text' value='')
label(data-i18n-title='skill rank' title='skill rank')
input(data-i18n-placeholder='0' name='attr_rank' title='@{repeating_skills_${x}_rank}' placeholder='0' type='number' value='')
button.dicefontd10(data-i18n-title='skill roll' name='skill roll' title='skill roll' type='roll' value=npcSkillRollValue) k
h1(data-i18n='attacks') attacks
.repeating-container.attacks
//- const attackAttrs = ['weapons', 'skill %', 'damage', 'notes']
- const attackAttrs = ['weapons', 'skill %', 'base range', 'damage', 'armor piercing', 'lethality %', 'kill radius', 'ammo', 'notes']
.grid.section-header
each attack in attackAttrs
if (attack==='weapons')
h2(data-i18n='attack')='attack'
else
h2(data-i18n=attack)=attack
h2(data-i18n='roll') roll
fieldset.repeating_weapons
.grid.section-weapons.border-bottom
//without modifiers- const attackRollValue = `@{gm_toggle} &{template:rolls} {{name=@{name}}} {{header=@{weapons}}} {{subheader=@{skill_percent}}} {{rating=[[@{skill_percent}]]}} {{dice=[[1d100]]}} {{hasdamage=[[@{hasdamage}]]}} {{damage=^{damage} [@{damage}](~repeating_weapons_damage)}} {{damage_critical=^{damage (×2)} [@{damage}](~repeating_weapons_damage_critical)}} {{haslethality=[[@{haslethality}]]}} {{lethality=^{lethality} [@{lethality_percent}%](~repeating_weapons_lethality)}} {{lethality_critical=^{lethality (×2)} [@{lethality_percent}%](~repeating_weapons_lethality_critical)}} {{AP=[[@{armor_piercing}+0]]}}`;
- const attackRollValue = `@{gm_toggle} &{template:rolls} {{name=@{name}}} {{header=@{weapons}}} {{subheader=@{skill_percent}}} {{modifier=[[?{Modifier|,0|+20%,20|+40%,40|-20%,-20|-40%,-40|custom (%),?{custom (%)}}]]}} {{rating=[[@{skill_percent}+?{Modifier|,0|+20%,20|+40%,40|-20%,-20|-40%,-40|custom (%),?{custom (%)}}]]}} {{dice=[[1d100]]}} {{hasdamage=[[@{hasdamage}]]}} {{damage=^{damage} [@{damage}](~repeating_weapons_damage)}} {{damage_critical=^{damage (×2)} [@{damage}](~repeating_weapons_damage_critical)}} {{haslethality=[[@{haslethality}]]}} {{lethality=^{lethality} [@{lethality_percent}%](~repeating_weapons_lethality)}} {{lethality_critical=^{lethality (×2)} [@{lethality_percent}%](~repeating_weapons_lethality_critical)}} {{AP=[[@{armor_piercing}+0]]}}`;
each attack in attackAttrs
- const attrName = attack.replace(' ', '_').replace('%', 'percent')
- const type = attack.includes('%') || attack === 'ammo' ? 'number' : 'text';
if (attrName==='lethality_percent')
label(data-i18n-title=attack + ' input' title=attack + ' input')
input(data-i18n-placeholder=attack name='attr_' + attrName placeholder=attack title='@{repeating_weapons_${x}_' + attrName + '}' type=type value='')
input( name='attr_haslethality' type='hidden' value='0')
else if (attrName==='damage')
label(data-i18n-title=attack + ' input' title=attack + ' input')
input(data-i18n-placeholder=attack name='attr_' + attrName placeholder=attack title='@{repeating_weapons_${x}_' + attrName + '}' type=type value='')
input( name='attr_hasdamage' type='hidden' value='0')
else if (attrName==='weapons')
label(data-i18n-title=attack + ' input' title=attack + ' input')
input(data-i18n-placeholder='attack' name='attr_' + attrName placeholder='attack' title='@{repeating_weapons_${x}_' + attrName + '}' type=type value='')
else
label(data-i18n-title=attack + ' input' title=attack + ' input')
input(data-i18n-placeholder=attack name='attr_' + attrName placeholder=attack title='@{repeating_weapons_${x}_' + attrName + '}' type=type value='')
button.dicefontd10(name='weapon' type='roll' title='weapon roll' value=attackRollValue) k
button.none(name='roll_damage' type='roll' value='@{gm_toggle} &{template:damage} {{header=@{weapons}}} {{subheader=@{damage}}} {{damage=[[@{damage}]]}} {{AP=[[@{armor_piercing}+0]]}}')
button.none(name='roll_lethality' type='roll' value='@{gm_toggle} &{template:lethality} {{header=@{weapons}}} {{subheader=@{lethality_percent}}}{{lethality_rating=[[@{lethality_percent}]]}} {{lethality=[[1d100]]}} {{AP=[[@{armor_piercing}+0]]}}')
button.none(name='roll_damage_critical' type='roll' value='@{gm_toggle} &{template:damage} {{header=@{weapons}}} {{subheader=@{damage}}} {{damage=[[@{damage}*2]]}} {{AP=[[@{armor_piercing}+0]]}}')
button.none(name='roll_lethality_critical' type='roll' value='@{gm_toggle} &{template:lethality_critical} {{header=@{weapons}}} {{subheader=@{lethality_percent}}} {{lethality_rating=[[@{lethality_percent}*2]]}} {{lethality=[[1d100]]}} {{AP=[[@{armor_piercing}+0]]}}')
h1(data-i18n='other notes') other notes
.repeating-container.notes
.grid.section-header
h2(data-i18n='name') name
h2(data-i18n='notes') notes
fieldset.repeating_other
.grid.section.border-bottom
label(data-i18n-title='other notes name' title='other notes name')
input(data-i18n-placeholder='name' name='attr_name' placeholder='name' title='@{repeating_other_${x}_name}' type='text')
label(data-i18n-title='other notes' title='other notes')
input(data-i18n-placeholder='notes' name='attr_notes' placeholder='notes' title='@{repeating_other_${x}_notes}' type='text')
// PC SHEET
// =============================
include src/pug/_pc.pug
// ROLL TEMPLATE
// =============================
include src/pug/rolltemplate.pug
//SHEETWORKERS
// =============================
script(type='text/worker')
include src/pug/sheetworkers.js