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.

2d20+5; 4d6kh3
2d20+5; v5(7,3,4); fate(4)
assim(d6=2,d10=1,d12=1,keep=2); daggerheart(modifier=2,difficulty=15)
System Positional Named
Vampire V5 v5(7,3,4) v5(pool=7,hunger=3,difficulty=4)
Fate fate() or fate(4) fate(dice=4)
Assimilation assim(2,1,1,1) assim(d6=2,d10=1,d12=1,keep=1)
Daggerheart dh() 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

Try 2d20+5;v5(7,3,4) · Try fate(4);daggerheart(2,15) · Try assim(d6=2,d10=1,d12=1,keep=2)