38 lines
2.6 KiB
Plaintext
38 lines
2.6 KiB
Plaintext
mixin attribute(name, short)
|
|
- var trait = name.toLowerCase()
|
|
|
|
.sheet-attribute(class=`sheet-attribute--${trait}`)
|
|
|
|
input(type='hidden', name=`attr_rename_${trait}`, value=name)
|
|
input(type='hidden', name=`attr_${trait}_roll`, value='1d4')
|
|
input(type='hidden', name=`attr_${trait}_wd_roll`, value='1d6')
|
|
input(type='hidden', name=`attr_${trait}_extra_wd_roll`, value='-10000')
|
|
input(type='hidden', name=`attr_${trait}_code`, value='d4')
|
|
|
|
input(type='hidden', name=`attr_${trait}_global_wd_roll`, value=`{{global_wd=@{query_global_wd}}} {{global_wdroll=[[ @{query_global_wd}!cs2 + (@{${trait}_mod}+0)[Flat] - (@{fatigue_mod})[Fatigue] - (@{wound_mod})[Wounds] + (?{@{query_modifier}|0})[Modifier] ]]}}`)
|
|
|
|
input(type='hidden', name=`attr_${trait}_global_bonus_wd_roll`, value=`{{bonus_wd=@{query_global_bonus_wd}}} {{bonus_wdroll=[[ @{query_global_bonus_wd}!cs2 + (@{${trait}_mod}+0)[Flat] - (@{fatigue_mod})[Fatigue] - (@{wound_mod})[Wounds] + (?{@{query_modifier}|0})[Modifier] ]]}}`)
|
|
|
|
input(type='hidden',
|
|
name=`attr_${trait}_roll_body`,
|
|
value!=`@{gm_roll} &{template:TraitRoll} {{rof=[[ 0 + @{query_global_rof} ]]}} {{header=@{name} ^{rolls} @{rename_${trait}}}} {{trait=@{rename_${trait}}}} {{traitdie=@{${trait}_code}}} {{wounds=[[ @{wound_mod} ]]}} {{fatigue=[[ @{fatigue_mod} ]]}} {{modifier=?{@{query_modifier}|0}}} ${maxRof.map(n => `{{traitroll${n}=[[ @{${trait}_roll}!cs2 + (@{${trait}_mod}+0)[Flat] - (@{fatigue_mod})[Fatigue] - (@{wound_mod})[Wounds] + (?{@{query_modifier}|0})[Modifier] ]]}}`).join(' ')} @{${trait}_global_wd_roll} @{${trait}_global_bonus_wd_roll}`)
|
|
|
|
button(type='roll',
|
|
name=`roll_${trait}`,
|
|
value!=`@{${trait}_roll_body} {{wd=@{${trait}_wd}}} {{wdroll=[[ @{${trait}_wd_roll}!cs2 + (@{${trait}_mod}+0)[Flat] - (@{fatigue_mod})[Fatigue] - (@{wound_mod})[Wounds] + (?{@{query_modifier}|0})[Modifier] ]]}} {{reroll=[r](~${trait})}}`,
|
|
class='sheet-attribute__button')
|
|
span(name=`attr_rename_${short.toLowerCase()}`, data-i18n=`${short.toLowerCase()}-u`)= short
|
|
|
|
input(type='text',
|
|
name=`attr_${trait}`,
|
|
placeholder='d4',
|
|
value='d4',
|
|
spellcheck='false',
|
|
class='sheet-hex sheet-hex--48 sheet-hexfield__input')
|
|
|
|
+hexfield(`${trait}_natural`, 'Natural', 'left', 'd4', '', 'sheet-hide-until-needed sheet-hexfield-gray sheet-hexfield--nat')
|
|
|
|
+hexfield(`${trait}_mod`, 'Bonus', 'right sheet-exception', '0', '', 'sheet-hide-until-needed sheet-stay-on-input sheet-hexfield--mod')
|
|
|
|
+hexfield(`${trait}_wd`, 'WD', 'right', 'd6', '', 'sheet-hide-until-needed sheet-hexfield-gray sheet-hexfield--wd')
|