[ANGRY PIXEL] The Betweenlands

[ANGRY PIXEL] The Betweenlands

24M Downloads

New structure loot tables

TheCyberBrick opened this issue ยท 0 comments

commented

Now that the structure loot table stuff is implemented we need the actual loot tables.

The new loot tables consist of three parts:

  • Shared loot pool (i.e. the structure loot pool):
    The shared loot pool determines what items are generated in the structure's loot pool. Think of it like one big chest for the whole structure (but only for that loot table).
  • Individual loot pool (per chest/pot/etc.):
    The individual loot pools determine which items are pulled from the shared loot pool. These items are only generated if the same items are still available in the shared loot pool. If items are generated then they are removed from the shared loot pool.
  • Normal vanilla loot pool:
    These are the normal vanilla loot pools we've been using so far. They're independent of the shared loot pool. Can be be used for random common filler items where the shared loot pool isn't needed.

How they work:

First off, all loot pools work exactly the same as the vanilla loot pools, i.e. they can use any conditions/functions etc. that normal loot pools (or loot entries) can use (including player specific things such as luck or other entity loot conditions).

  • Shared loot pool:
    Add the thebetweenlands:shared_pool loot condition to all loot pools that generate the shared loot pool for the loot table.
    See shared_loot_pool_test.json#L5.
  • Individual loot pool:
    Add the thebetweenlands:from_shared_pool loot condition to all loot entries that are supposed to pull from the shared loot pool.
    Additionally, this loot condition can also specify a guaranteed_after and
    guaranteed_after_percentage property which guarantees that the loot entry generates after N chests/pots/etc. with the same loot table have been opened, where N is the value specified by guaranteed_after,
    or after X% of the chests/pots/etc. with the same loot table in the structure have been opened, where X/100 is the value specified by guaranteed_after_percentage. This allows giving the loot entry a chance to not generate in the first chest opened but still guarantee that it will be in one of the chests.
    See shared_loot_pool_test.json#L41.
  • Normal vanilla loot pool:
    Any loot pool or loot entry without the thebetweenlands:shared_pool or thebetweenlands:from_shared_pool condition will be treated as a normal vanilla loot pool, i.e. the items will be generated independently of the shared loot pool.

Example:
https://github.com/Angry-Pixel/The-Betweenlands/blob/1.12-dev/src/main/resources/assets/thebetweenlands/loot_tables/loot/shared_loot_pool_test.json
This loot table has a 50% chance to generate a Gem Singer per shared loot pool (i.e. same loot table in same structure) and generates 1-3 Valonite Blocks per shared loot pool.
If a Gem Singer is generated in the shared loot pool, each chest/pot/etc. has a 25% chance to contain the Gem Singer, but it is guaranteed to be in one of the first 4 chests/pots/etc. (if it wasn't in the first 3 it'll be guaranteed in the 4th)!
Each chest may contain a Valonite Block with 50% chance, as long as Valonite Blocks are still available in the shared loot pool.
Each individual chest can contain 1-8 Betweenstone, independently of the shared loot pool.