1.0.14 • Published 7 years ago

drop-table v1.0.14

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

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();
1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago