Files
roll20-character-sheets-tester/Pathfinder_Cazra/pug/fields.pug
T
2017-07-18 00:26:41 -04:00

76 lines
2.2 KiB
Plaintext

mixin fieldBox(type, name, label)
.fieldBox(style=attributes.style)
if(label)
label= label
.inner: input(type=type, name='attr_' + name, value=attributes.value|0)
mixin fraction(name)
.fraction
input(type='number', name='attr_' + name)
span /
input(type='number', name='attr_' + name + '_max')
mixin input(type, name)
input(type=type, name='attr_' + name, placeholder=attributes.placeholder, style=attributes.style, value=attributes.value)
mixin labelledAbove(label)
.labelledAbove(style=attributes.style)
label= label
.inner: block
mixin labelledBoxH(label)
.labelledBoxH(class=attributes.class, style=attributes.style)
label= label
.inner: block
mixin labelledBoxV(label)
.labelledBoxV(class=attributes.class, style=attributes.style)
label= label
.inner: block
mixin labelledUnderlined(label)
.labelledUnderlined(style=attributes.style)
label= label
.inner: block
mixin option(view, value, isSelected)
-
if(!value)
value = view;
option(value=value, selected=isSelected)= view
mixin readOnlyBox(name)
.readOnlyBox(style=attributes.style): span(name='attr_' + name)
input(type='hidden', name='attr_' + name)
mixin repeating(name)
fieldset(class='repeating_' + name)
block
mixin rollButton(attr, notes, options)
-
var tpl = '&{template:pf} {{charName=@{character_name}}} ';
if(options && options.isAttack) {
tpl += '{{attr=@{' + options.attackName + '}}} {{result=[[1d20cs>@{' + options.crit.range + '} + @{' + attr + '}]]}} ' +
'{{damage=[[@{' + options.damage + '}]]}} ' +
'{{critConfirm=[[1d20cs>@{' + options.crit.range + '} + @{' + attr + '}]]}} ' +
'{{critDamage=[[(@{' + options.damage + '}) * @{' + options.crit.multiplier + '}]]}}' +
'{{isAttack=true}}';
}
else
tpl += '{{attr=' + attr + '}} {{result=[[1d20 + @{' + attr + '}]]}}' +
'{{isNotAttack=true}}';
if(notes)
tpl += '{{notes=@{' + notes + '}}}';
button(type='roll', value=tpl)
mixin select(name)
select(name='attr_' + name, style=attributes.style)
block
mixin textarea(name)
textarea(name='attr_' + name, style=attributes.style, placeholder=attributes.placeholder)