@randsum/blades
Version:
Blades in the Dark compatible dice rolling implementation
64 lines (46 loc) âĸ 2.02 kB
Markdown
<div align="center">
<img width="150" height="150" src="https://raw.githubusercontent.com/RANDSUM/randsum/main/icon.webp">
<h1>@randsum/blades</h1>
<h3>Blades in the Dark compatible dice rolling for randsum</h3>
[](https://www.npmjs.com/package/@randsum/blades)
[](https://bundlephobia.com/package/@randsum/blades)
[](https://www.npmjs.com/package/@randsum/blades)
[](https://github.com/RANDSUM/randsum/blob/main/LICENSE)
[](https://www.npmjs.com/package/@randsum/blades)
</div>
A utility for rolling dice in [Forged in the Dark](https://bladesinthedark.com/) systems!
- đ˛ Standard Blades in the Dark position and effect rolls
- đ¯ Automatic handling of dice pools
- đ Full TypeScript support
- đĒļ Lightweight implementation
## Installation
```bash
npm install @randsum/blades
# or
yarn add @randsum/blades
# or
bun add @randsum/blades
```
## Usage
```typescript
import { rollBlades } from '@randsum/blades'
import type { BladesResult } from '@randsum/blades'
// Basic roll with dice pool
const result = rollBlades(2)
// Returns the highest die result and determines outcome
```
## API Reference
### `rollBlades`
Makes a Blades in the Dark roll, returning the result based on the highest die.
```typescript
function rollBlades(dicePool: number): BladesResult
```
```typescript
type BladesResult = 'critical' | 'success' | 'partial' | 'failure'
```
## Related Packages
- [@randsum/dice](https://github.com/RANDSUM/randsum/tree/main/packages/dice): Core dice rolling implementation
- [@randsum/notation](https://github.com/RANDSUM/randsum/tree/main/packages/notation): Dice notation parser
<div align="center">
Made with đš by <a href="https://github.com/RANDSUM">RANDSUM</a>
</div>