Skip to main content

LootTable

A class in Root.Township, Alta.Loot.

A loot table asset: item entries grouped by rarity, with extra entries for festivals. GetLoot rolls an item for a dock.

Constructors​

MemberWhat it is
LootTable()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

4 private and internal fields
MemberWhat it is
private List<LootTable.RarityList> entriesItem entries grouped by rarity, with optional festival-only entries. Exposed as Entries.
private static List<Origin> triedOriginsOrigins already tried for the current rarity in GetLoot.
private static List<Rarity> triedRaritiesRarities already tried in GetLoot.
private static List<LootTable.Entry> workingListShared list of candidate entries filled while picking loot.

Properties​

MemberWhat it is
List<LootTable.RarityList> Entries { get; }The entry lists, one per rarity.

Methods​

MemberWhat it is
static Item GetLoot(PickupDock dock, LootTable[] localTables, float weightingPower, out int count)Rolls a rarity, then an origin, then a category and an item for a dock. Returns the item and count, or null. The count never reaches Maximum unless it equals Minimum.
static Item GetLoot(PickupDock dock, LootTable[] localTables, float weightingPower, out int count, out Rarity rarity, out Origin origin)Rolls a rarity, then an origin, then a category and an item for a dock. Returns the item and count, or null. The count never reaches Maximum unless it equals Minimum.

Used in​

Members of other types that take, return or hold a LootTable: