@randsum/blades
v1.1.0
Published
Blades in the Dark compatible dice rolling implementation
Downloads
455
Maintainers
Readme
A utility for rolling dice in Forged in the Dark systems!
- 🎲 Standard Blades in the Dark position and effect rolls
- 🎯 Automatic handling of dice pools
- 🔒 Full TypeScript support
- 🪶 Lightweight implementation
Installation
npm install @randsum/blades
# or
yarn add @randsum/blades
# or
bun add @randsum/bladesUsage
import { roll } from "@randsum/blades"
import type { BladesRollResult } from "@randsum/blades"
// Basic roll with dice pool
const { outcome, result } = roll(2)
console.log(outcome) // 'critical' | 'success' | 'partial' | 'failure'
// Different dice pool sizes
roll(1) // Desperate position
roll(2) // Risky position
roll(3) // Controlled position
roll(4) // Controlled with assistanceAPI Reference
roll
Makes a Blades in the Dark roll, returning the result based on the highest die.
function roll(dicePool: number): BladesRollResultParameters:
dicePool: Number of d6 dice to roll (typically 1-4)
Returns:
'critical': Rolled 6 on multiple dice (critical success)'success': Highest die was 4-6 (full success)'partial': Highest die was 1-3 (partial success/complication)'failure': No dice rolled (should not occur with valid input)
Result Interpretation:
type BladesResult = "critical" | "success" | "partial" | "failure"Related Packages
- @randsum/roller: Core dice rolling implementation
