Skip to main content
Module

x/fortuna/mod.ts>GachaMachine3

Gacha system (random weighted selection) in TypeScript.
Go to Latest
class GachaMachine3
import { GachaMachine3 } from "https://deno.land/x/fortuna@v4.0.0-alpha.1/mod.ts";

Gacha system.

Constructors

new
GachaMachine3(items: GachaChoice<T>[])

Properties

writeonly
items: GachaChoice<T>[]

Methods

get(count: number, distinct?)

Roll items from the gacha machine.

const machine = new GachaMachine(items);
machine.get(11)

You can roll n distinct items using the get(n, true) format. However, rolling distinct items does not mutate the pool. The items rolled are only distinct within the n items.