Game Packages

RANDSUM includes specialized packages for popular tabletop RPG systems. Learn how to use them in your games.

D&D 5th Edition

The @randsum/fifth package provides D&D 5e mechanics including advantage, disadvantage, and ability checks.

D&D 5e Examples

import { roll } from '@randsum/fifth'

// Basic attack roll with modifier
const attack = roll({ modifier: 5 })

// With advantage
const advantageAttack = roll({
  modifier: 5,
  rollingWith: 'Advantage'
})

// With disadvantage
const disadvantageAttack = roll({
  modifier: -2,
  rollingWith: 'Disadvantage'
})

Read the full D&D 5e documentation

Blades in the Dark

The @randsum/blades package provides Blades in the Dark action roll mechanics.

Blades Examples

import { roll } from '@randsum/blades'

// Roll with dice pool
const result = roll(3)
// result.result: 'critical' | 'success' | 'partial' | 'failure'

// Desperate position (0 dice)
const desperate = roll(0)

Read the full Blades documentation

Powered by the Apocalypse

The @randsum/pbta package provides generic PbtA mechanics for any PbtA game.

PbtA Examples

import { roll } from '@randsum/pbta'

// Basic PbtA roll
const result = roll({ stat: 2 })
// result.result: 'strong_hit' | 'weak_hit' | 'miss'

// With bonuses
const bonusRoll = roll({
  stat: 1,
  forward: 1,  // One-time bonus
  ongoing: 0   // Persistent bonus
})

// With advantage
const advantageRoll = roll({
  stat: 2,
  advantage: true
})

Read the full PbtA documentation

Other Game Systems

RANDSUM also supports:

Installation

Install game packages individually:

Installing Game Packages

# D&D 5e
npm install @randsum/fifth

# Blades in the Dark
npm install @randsum/blades

# Powered by the Apocalypse
npm install @randsum/pbta

All game packages depend on @randsum/roller, which will be installed automatically.