DropTable
A loot/drop implementation in NodeJS that can be used for receiving loots in games.
Create & loot from droptables which can include items, or other droptables using their weights. Weights are arbitrary, not percentages, and don't need to add up to 100. Read overview of drop tables on Lost Garden.
//Create Itemslet gold = ;let silver = ;let sword = ;let helmet = ;//Create Loot Tablelet equipmentTable = ;//Add Loot Table EntryequipmentTable;equipmentTable;//Create Another Loot Tablelet chestOne = ;//Add Loot Table EntrychestOne;chestOne;//Create Another Loot Tablelet chestTwo = ;//Add Loot Table EntrychestTwo;chestTwo;//Drop Loot from Chest Onelet drops = await chestOne;console;drops;//Drop Loot from Chest Twodrops = await chestTwo;console;drops;
Check out tests/dropTest.js to get more idea on feature set.