Skip to content

Instantly share code, notes, and snippets.

@marcus-downing
Last active May 27, 2018 23:15
Show Gist options
  • Save marcus-downing/24bbe8803a8c5ff367867b9c30501d7c to your computer and use it in GitHub Desktop.
Save marcus-downing/24bbe8803a8c5ff367867b9c30501d7c to your computer and use it in GitHub Desktop.
Dyslexic Character Sheets - Pathfinder 2 Javascript - Sample 1
/*
CLERIC
Pathfinder 2 Playtest
*/
registerClass('cleric', 'Cleric', {
require: [
'subsystems/spells',
'subsystems/spell_points',
'feats/class/cleric/*',
],
activate: (game, char, build) => {
// basics
build.addSkillProficiency([
]);
build.addArmorProficiency([
'Light',
'Medium',
]);
build.addWeaponProficiency([
]);
build.addSpellProficiency([
]);
// pages
build.addPage('cleric', 'Cleric' {
'layout' => 'A'
});
// core features
build.enableSubsystem('spells');
build.enableSubsystem('spell_points');
// page elements
build.at('cleric', 'small')
.addClassTitle()
.addUntitledSection('deity', [
build.p('of', {
align: center
}),
build.element('deity')
])
.addPrimarySection('domain', 'Domain', [
build.element('cleric__domain')
])
.addSection('powers', 'Powers', [
])
.addSection('spellbox', 'Spells', [
build.element('spellbox', {
keyAbility: 'WIS',
maxlevel: 10
});
])
.addSection('channel_energy', 'Channel Energy', [
build.element('cleric__channel_energy')
])
build.at('cleric', 'spells')
.addSection('cantrips', 'Cantrips', [
build.element('cantrips', {
count: 10
})
])
.addSection('spells_list', 'Prepared Spells', [
build.element('spells', {
count: 3,
maxlevel: 10
})
]);
build.at('wizard', 'feats')
.addSection('feats', 'Wizard Feats', [
build.element('feats_list', {
from: 'feats/wizard',
at_levels: [ 2, 4, 6, 8, 10, 14, 18, 20 ]
});
]);
}
});
registerElement('cleric__domain', 'Domain', {
activate: (game, char, build) => {
build.addElements([
build.field('cleric__domain', {
label: 'Domain',
type: 'text',
wide: true
}),
build.field('cleric__domain__favored_weapon', {
label: 'Favored Weapon',
type: 'text',
wide: true
})
]);
}
});
registerElement('cleric__domain_powers', 'Domain Powers', {
activate: (game, char, build) => {
build.addElements([
build.element('feats_list', {
from: 'cleric__domain_powers',
count: 2
})
]);
}
});
registerElement('cleric__channel_energy', 'Channel Energy', {
activate: (game, char, build) => {
build.addElements([
build.choice('cleric__channel_energy__type', {
options: ['Heal', 'Harm']
}),
build.hr(),
build.calculation({
output: build.field('cleric__channel_energy__per_day', 'Uses per day'),
input: [
3,
build.field('CHA')
]
}),
build.tickboxes('cleric__channel_energy__today', 'Uses today', {
float: right,
count: 10
})
]);
}
});
/*
DEITY
Pathfinder 2 Playtest
*/
registerElement('deity', 'Deity', {
activate: (game, char, build) => {
build.addElements([
build.field('deity', {
label: 'Deity',
type: 'text',
wide: true
}),
build.element('alignment_grid', {
field_id: 'deity_alignment',
float: right
}),
build.hr(),
build.field('anathema', {
label: 'Anathema',
type: 'text',
lines: 3
})
])
}
});
/*
FAMILIAR
Pathfinder 2 Playtest
*/
registerFeat('wizard__familar', 'Familiar', {
category: 'wizard',
activate: (game, char, build) => {
activateSubsystem('familiar');
}
});
registerFeat('gnome__familiar', 'Familiar', {
category: 'ancestry',
activate: (game, char, build) => {
activateSubsystem('familiar');
}
});
registerSubsystem('familiar', 'Familiar', {
activate: (game, char, build) => {
build.addPage('familiar', 'Familiar', {
size: 'small',
layout: 'A',
zones: [ [ 'info' ], [ 'large', 'skills' ] ]
});
build.addPage('familiar/combat', 'Familiar Combat', {
size: 'small',
layout: 'B',
duplex: 'familiar',
zones: [ 'combat', 'combat_small' ]
});
// Add the familiar itself as a sub-character
const familiar = build.addSubCharacter('familiar', 'Familiar', [ 'familiar', 'familiar/combat' ]);
familiar.enableSubsystems('skills', 'feats');
familiar.addTitle('familiar', 'info');
familiar.addSection('familiar', 'info', );
}
});
/*
ROGUE
Pathfinder 2 Playtest
*/
registerClass('rogue', 'Rogue', {
require: [
'feats/class/rogue/*'
],
activate: (game, char, build) => {
// basics
build.addSkillProficiency([
'acrobatics',
'athletics',
'crafting',
'deception',
'diplomacy',
'intimidation',
'performance',
'society',
'stealth',
'thievery',
]);
build.addArmorProficiency([
'Light'
]);
build.addWeaponProficiency([
'Martial'
]);
// pages
build.addPage('rogue', 'Rogue', {
layout: 'A'
});
// page elements
build.at('rogue', 'small')
.addClassTitle()
.addPrimarySection('rogue', 'Rogue', [
build.element('progression_table', {
class: 'rogue'
})
])
.addSection('sneak_attack', 'Sneak Attack', [
build.element('rogue__sneak_attack'),
build.element('rogue__debilitating_strike'),
])
.addSection('master_strike', 'Master Strike', [
build.element('rogue__master_strike')
]);
build.at('rogue', 'large')
.addSection('feats', 'Rogue Feats', [
build.element('feats_list', {
from: 'feats/rogue',
atLevels: [ 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 ]
})
]);
}
});
registerElement('rogue__sneak_attack', 'Sneak Attack', {
activate: (game, char, build) => {
build.addElements([
build.p('Add precision damage when striking a flat-footed foe.'),
build.calc({
output: build.field('rogue__sneak_attack__d6', 'Sneak Attack Damage', {
epithet: 'd6'
}),
input: [
build.divide([
build.field('rogue__level'),
3
]),
build.field('misc')
]
}),
])
}
});
registerElement('rogue__debilitating_strike', 'Debilitating Strike', {
level: 9,
activate: (game, char, build) => {
build.addElements([
build.p('Entangle of enfeeble foes on a successful sneak attack.'),
build.field('rogue__debilitating_strike__conditions', 'Conditions', {
count: 5,
wide: true
})
])
}
});
registerElement('rogue__master_strike', 'Master Strike', {
level: 19,
activate: (game, char, build) => {
build.addElements([
build.p('...')
]);
}
})
/*
WIZARD
Pathfinder 2 Playtest
*/
registerClass('wizard', 'Wizard', {
require: [
'subsystems/spells',
'subsystems/spell_points',
'feats/class/wizard/*',
'feats/familiar',
],
activate: (game, char, build) => {
// basics
build.addSkillProficiency([ 'arcana' ]);
build.addArmorProficiency([ 'light' ]);
// pages
build.addPage('wizard', 'Wizard' {
'layout' => 'A'
});
// core features
build.enableSubsystem('spells');
build.enableSubsystem('spell_points');
// page elements
build.at('wizard', 'small')
.addClassTitle()
.addPrimarySection('spell_school', 'Spell School', [
build.element('wizard__spell_school');
])
.addSection('spellbox', 'Spells', [
build.element('spellbox', {
keyAbility: 'INT',
maxlevel: 10
});
])
.addSection('spell_points');
build.at('wizard', 'spells')
.addSection('cantrips', 'Cantrips', [
build.element('cantrips', {
count: 10
})
])
.addSection('spells_list', 'Prepared Spells', [
build.element('spells', {
count: 3,
maxlevel: 10
})
]);
build.at('wizard', 'feats')
.addSection('feats', 'Wizard Feats', [
build.element('feats_list', {
from: 'feats/wizard',
atLevels: [ 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 ]
});
]);
}
});
registerElement('wizard__spell_school', 'Spell School', {
activate: (game, char, build) => {
build.addElements([
build.field('preferred_spell_school', 'Preferred Spell School', {
'type': 'text',
'enum': 'spell_school',
'wide': true,
'primary': true,
}),
build.field('forbidden_spell_school', 'Forbidden Spell School', {
'type': 'text',
'enum': 'spell_school',
'wide': true,
})
]);
}
});
registerEnum('spell_school', 'Spell School', {
'type': 'text',
'items': [
'Abjuration',
'Conjuration',
'Divination',
'Enchantment',
'Evocation',
'Illusion',
'Necromancy',
'Transmutation',
]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment