Salvage Union

@randsum/salvageunion

Salvage Union mechanics for mech-based tabletop RPG gameplay.

Installation

npm install @randsum/salvageunion
# or
bun add @randsum/salvageunion

Examples

Basic Roll

import { rollTable } from "@randsum/salvageunion"
import type { SalvageUnionTableResult } from "@randsum/salvageunion"

// Basic roll with default table
const result = rollTable()
// Returns table result with hit type, label, description, and roll value

Roll with Specific Table

import { rollTable } from "@randsum/salvageunion"

// Roll with specific table
const result = rollTable("Morale")

Type-Safe Result Handling

import { rollTable } from "@randsum/salvageunion"

const { hit, label, description, roll } = rollTable("Core Mechanic")
switch (hit) {
  case "Nailed It":
    // 20
    break
  case "Success":
    // 11-19
    break
  case "Tough Choice":
    // 6-10
    break
}

Installation

npm install @randsum/salvageunion
# or
bun add @randsum/salvageunion

About Salvage Union

The @randsum/salvageunion package provides mechanics for Salvage Union , a post-apocalyptic mech-based tabletop RPG.

This package implements the core dice mechanics for Salvage Union, supporting mech combat, salvage operations, and the unique systems of this post-apocalyptic RPG.

For more information, see the package source code .