@allemandi/gacha-engine
Version:
Practical, type-safe toolkit for simulating and understanding gacha rates and rate-ups.
22 lines (21 loc) • 584 B
TypeScript
export interface GachaItem {
name: string;
weight: number;
rateUp?: boolean;
}
export interface RarityInput {
rarity: string;
items: GachaItem[];
}
/** Weighted mode requires explicit rarityRates */
export interface WeightedGachaEngineConfig {
mode: 'weighted';
rarityRates: Record<string, number>;
pools: RarityInput[];
}
/** Flat rate mode does NOT use rarityRates */
export interface FlatRateGachaEngineConfig {
mode: 'flatRate';
pools: RarityInput[];
}
export type GachaEngineConfig = WeightedGachaEngineConfig | FlatRateGachaEngineConfig;