Salvage Union
@randsum/games/salvageunion: d20 table rolls for mech combat and salvage operations.
Tabletop games, ready to roll
Typed rolls for D&D 5e, Blades in the Dark, Daggerheart, Fate and more, generated from open .randsum.json specs.
import { roll } from '@randsum/games/fifth'
const { result } = roll({ modifier: 5, rollingWith: 'Advantage' })Roll dice for D&D 5e, Blades in the Dark, Daggerheart, Fate Core, PbtA, Root RPG and Salvage Union with typed, game-specific functions. Each game validates input, rolls using the core engine, and interprets the result according to that system’s rules.
Every game runs on @randsum/roller, which implements the full RANDSUM Dice Notation (RDN) Specification.
Salvage Union
@randsum/games/salvageunion: d20 table rolls for mech combat and salvage operations.
D&D 5th Edition
@randsum/games/fifth: ability checks, saving throws and attack rolls with advantage and disadvantage.
Blades in the Dark
@randsum/games/blades: dice pool action rolls with critical, success, partial and failure outcomes.
Powered by the Apocalypse
@randsum/games/pbta: 2d6+stat rolls for Dungeon World, Monster of the Week, Apocalypse World and more.
Daggerheart
@randsum/games/daggerheart: Hope and Fear dice with amplification, advantage and disadvantage.
Fate Core
@randsum/games/fate: 4dF plus a skill rating, read off the Fate ladder from Terrible to Legendary.
Root RPG
@randsum/games/root-rpg: 2d6+bonus with Strong Hit, Weak Hit and Miss outcomes.
Every game follows a three-step pipeline: validate input, roll dice, interpret the result.
import { roll } from '@randsum/games/salvageunion'
// 1. Validate: checks that the table name matches a known table// 2. Roll: rolls the d20 with @randsum/roller// 3. Interpret: looks up the result in that table by rangeconst result = roll('Core Mechanic')
console.log(result.result.label) // 'Nailed it' | 'Success' | 'Tough Choice' | ...console.log(result.result.description) // full outcome textconsole.log(result.total) // d20 rollconsole.log(result.rolls) // raw RollRecord[] from the rollerEvery game shares these characteristics:
roll() function: each subpath exports roll() as its main API, plus its inputs schema and SchemaErrorGameRollResult return type: includes result (the game outcome), total, rolls, and optional detailsValidationError (from roller) for out-of-range numeric input and SchemaError for game-specific issues like invalid enum values or unmatched outcome tables@randsum/roller, never on each other| Game | Dice | Input | Outcomes |
|---|---|---|---|
salvageunion |
1d20 | tableName (string) |
Table result with label + description |
fifth |
1d20 or 2d20 | modifier, rollingWith, crit |
Numeric total |
fate |
4dF | modifier (skill rating, -2 to 5) |
A Fate ladder rung, terrible to legendary |
blades |
Nd6 pool | rating (number, 0-10) |
critical, success, partial, failure |
pbta |
2d6 | stat, forward, ongoing, rollingWith |
strong_hit, weak_hit, miss |
daggerheart |
Hope/Fear dice | modifier, amplifyHope, amplifyFear, rollingWith |
critical_hope, hope, fear |
root-rpg |
2d6 | bonus, rollingWith |
strong_hit, weak_hit, miss |
Install @randsum/games once, then import the game you need via subpath exports. This also installs @randsum/roller as a dependency.
bun add @randsum/gamesimport { roll } from '@randsum/games/salvageunion'import { roll } from '@randsum/games/fifth'import { roll } from '@randsum/games/blades'import { roll } from '@randsum/games/pbta'import { roll } from '@randsum/games/daggerheart'import { roll } from '@randsum/games/fate'import { roll } from '@randsum/games/root-rpg'.randsum.json specs power the codegen pipeline