Skip to content

helix / LootPool

Class: LootPool

Defined in: core/values/loot-table.ts:62

Fluent loot pool: how many rolls, which entries, and pool-wide functions.

Constructors

Constructor

new LootPool(): LootPool

Returns

LootPool

Methods

empty()

empty(weight?): this

Defined in: core/values/loot-table.ts:86

Add an empty (nothing) entry with weight.

Parameters

weight?

number

Returns

this


func()

func(fn): this

Defined in: core/values/loot-table.ts:92

A function applied to every entry rolled from this pool.

Parameters

fn

LootFunction

Returns

this


item()

item(item, opts?): this

Defined in: core/values/loot-table.ts:74

Add an item entry (see LootEntry.item).

Parameters

item

ItemValue

opts?

EntryOpts

Returns

this


lootTable()

lootTable(ref, opts?): this

Defined in: core/values/loot-table.ts:80

Add a nested-loot-table entry.

Parameters

ref

string | LootTableRef

opts?

EntryOpts

Returns

this


rolls()

rolls(n): this

Defined in: core/values/loot-table.ts:68

Number of times this pool is rolled (exact or a {min,max} range).

Parameters

n

NumberProvider

Returns

this


toJson()

toJson(version): Record<string, unknown>

Defined in: core/values/loot-table.ts:97

Parameters

version

VersionProfile

Returns

Record<string, unknown>

Released under the MIT License · Credits