Skip to main content
Module

x/fortuna/mod.ts>GachaMachine

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

Gacha system.

Constructors

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

Properties

writeonly
items: GachaChoice<T>[]

Methods

get(count: number): T[]

Roll items from the gacha machine.

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

If you are looking for the distinct rolls, try importing GachaMachine3 instead of GachaMachine.