A system-agnostic module to quickly toggle between manual and automatic Foundry core dice configuration!
If a user has a role with permission to make manual rolls in the first place, a button (icon R) will be added to the client's Token Controls sidebar.
Clickon it to toggle between automatic and manual dice rolling, or automatic and smart routing if smart routing options are enabled*.SHIFT + Clickto open the Foundry Configure Dice settings menu and set specific dice to manual.
Added functionality by providing a hotkey (default B) to avoid clicking on the Token Controls ACDC button.
CTRL + Btoggles between automatic and manual dice rolling, or automatic and smart routing if smart routing options are enabled*.SHIFT + Bopens the Foundry Configure Dice settings menu.
* Smart routing is a new feature in ACDC v14.364.1+ that allows systems and modules to register roll types for ACDC to automatically route to the manual resolver.
If you like what I do, consider supporting this lonely bugbear 🐾
Every shiny gold coin helps keep the ideas flowing and the goblins at bay.
You can also join the Bugbear’s Den to hang out, get help, or check what I might be working on!
Usage.webm
ACDC currently ships smart routing choices for the dnd5e system. Other systems and modules can register their own roll types as needed.
Systems or modules can register roll types for ACDC smart routing during acdcRegisterSmartRollTypes.
Hooks.on('acdcRegisterSmartRollTypes', (api) => {
if (game.system.id !== 'dnd4e') return;
api.registerSmartRollType({
id: 'attack',
label: 'ACDC.Settings.RollTypes.attack',
test: (roll) => roll.data?.isAttackRoll === true,
});
api.registerSmartRollType({
id: 'initiative',
label: 'ACDC.Settings.RollTypes.initiative',
test: (roll) => roll.options?.flags?.dnd4e?.roll?.type === 'init',
});
api.registerSmartRollType({
id: 'damage',
label: 'ACDC.Settings.RollTypes.damage',
test: (roll) => roll.options?.hitTypeDamage === true || ['normal', 'crit', 'miss'].includes(roll.options?.hitType),
});
api.registerSmartRollType({
id: 'healing',
label: 'ACDC.Settings.RollTypes.healing',
test: (roll) => roll.options?.hitTypeHealing === true || roll.options?.hitType === 'heal',
});
api.registerSmartRollType({
id: 'save',
label: 'ACDC.Settings.RollTypes.save',
test: (roll) => roll.options?.flags?.dnd4e?.roll?.type === 'save',
});
api.registerSmartRollType({
id: 'deathSave',
label: 'ACDC.Settings.RollTypes.deathSave',
test: (roll) => roll.options?.flags?.dnd4e?.roll?.type === 'save' && String(roll.options?.flavor ?? '').includes(game.i18n.localize('DND4E.RollDeathSave')),
});
});The test function receives the Roll and the current dice term. Return true when the roll or dice term belongs to that smart routing type.
We could also register a smart routing type for d20Advantage like:
api.registerSmartRollType({
id: 'd20Advantage',
label: 'd20 advantage',
test: (_roll, term) => term.denomination === 'd20' && term.modifiers?.includes('adv'),
});