Skip to main content
Module

x/fortuna/mod.ts

Weighted gacha system
Go to Latest
import * as fortuna from "https://deno.land/x/fortuna@v2.0.2/mod.ts";

Classes

A gacha machine for weighted selection.

Interfaces

Data transformed by the constructor, fed to the binary search function. The result property holds the result that will be returned after rolling. chance is the weight of the result. cumulativeChance is used to make it fit for binary search. tier is an optional parameter to group the items for rolling.

Something unnecessary.

Raw data fed to the linear search function. The result property holds the result that will be returned after rolling. chance is the weight of the result.

Data fed to the constructor. The result property holds the result that will be returned after rolling. chance is the weight of the result. tier is an optional parameter to group the items for rolling.