Root RPG
@randsum/root-rpg
Root RPG system implementation with reputation, relationships, and advancement mechanics.
Overview
@randsum/root-rpg implements the Root RPG system, featuring reputation mechanics, relationship tracking, and advancement systems. This package provides all the tools needed to run Root RPG games, including faction relationships, reputation rolls, and character advancement.
Installation
Installation
npm install @randsum/root-rpg
# or
bun add @randsum/root-rpg Examples
Basic Roll
import { rollRootRpg } from "@randsum/root-rpg"
import type { RootRpgRollResult } from "@randsum/root-rpg"
// Basic roll with modifier
const { outcome, roll, result } = rollRootRpg(2)
// outcome: 'Strong Hit' | 'Weak Hit' | 'Miss'
// roll: numeric total, result: detailed roll information Type-Safe Result Handling
import { rollRootRpg } from "@randsum/root-rpg"
const { outcome } = rollRootRpg(0)
switch (outcome) {
case "Strong Hit":
// 10 or higher
break
case "Weak Hit":
// 7-9
break
case "Miss":
// 6 or lower
break
}