Skip to content

l-brett/drop-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DropTable

A small library for creating a loot table that can be use for receiving random loot in games.

It is simple to use, just create a new instance of DropTable.

let table = new DropTable();

And start adding items.

table.addItem({
    'name':'elixir',
    'data': {},
    'weight': 50
});

All weights are normalized so they don't need to be a percentage.

It also possible to initialize the DropTable with a list of items.

let table = new DropTable(items);

Remove items by name:

table.removeItem('elixir');

And of course get a random result

let result = table.drop();

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published