Generates loot/item placements using weighted rarity tables.
Usage:
const loot = new LootGenerator({ table: [ { type: 'health_potion', weight: 10 }, { type: 'speed_boost', weight: 5 }, { type: 'rare_sword', weight: 1, minDifficulty: 5 }, ],});const items = loot.generate(level, difficulty, seededRandom); Copy
const loot = new LootGenerator({ table: [ { type: 'health_potion', weight: 10 }, { type: 'speed_boost', weight: 5 }, { type: 'rare_sword', weight: 1, minDifficulty: 5 }, ],});const items = loot.generate(level, difficulty, seededRandom);
Optional
Generate loot placements for a level
Get available items at a given difficulty
Get the loot table
Generates loot/item placements using weighted rarity tables.
Usage: