Skip to main content

Rolls and modifiers

Mixed roll batches

Combine generic formulas and system rolls in one batch.

Batch separator

rollMixedDice() splits top-level segments with ;. Each generic segment supports the full grammar, including N#. + still adds within a segment. A special system call may also occupy a segment.

SystemPositionalNamed
Vampire V5v5(7,3,4)v5(pool=7,hunger=3,difficulty=4)
Fatefate() or fate(4)fate(dice=4)
Assimilationassim(2,1,1,1)assim(d6=2,d10=1,d12=1,keep=1)
Daggerheartdh() or dagger(2,15)daggerheart(modifier=2,difficulty=15)

Aliases: vampiro, vampire, vampirev5; fatedice; AS, assimilacao, assimilation; dagger and dh. Names are normalized without case or accent differences. Arguments are integer literals, either positional or named, never mixed.

Result for 3D interfaces

The batch has rolls discriminated by kind and flattened dice with unique IDs, physicalValue, and, for systems, profileId/faceKey. It has no shared total because counts, symbols, and numeric totals cannot be added together. detail: 'compact' compacts only system baseRoll data; generic segments remain complete.

import { rollMixedDice } from '@erpg/dicecore/systems/mixed'
const batch = rollMixedDice('d20+5; fate(4)', { seed: 'session-42' })
const again = rollMixedDice(batch.input, { replay: batch.replay })

Try the examples

2D + 3D

Mixed roll in one batch

Separate rolls with semicolons to combine generic dice, Vampire V5, Fate, Assimilation, and Daggerheart. The 2D result and 3D overlay receive the same dice list in the same order.

Use ; between systems. The + sign remains part of each generic formula.