Suggested Module suggestion - random loot pool

Adrijaned

Administrator
Contributor
Right now one thing I miss/would like to find is some kind of pool to drag random items from, for instance as treasures in randomly generated structures or as rewards for beating bosses/solving quests/freeing a village/drinking a coffee/whatever a module finds reasonable.

This module should not be dependent on anything, and is not meant to be used by end user.

The loot pool might be split in several different loot pools, such as loot from bosses/random structures/quests/coffee plantations/whatever or based on categories, like valuables/tools/weapons/armor/coffee/tea/whatever. That would however have to be defined during implementation based on the real needs, or left to get sorted out by itself, just like categories work on blocks now.

Each new block/item added, whose author would like to include that block/item into a loot pool of sorts, would just need to include something like this in its prefab:
Code:
"RandomLoot": [
  {
    "category": "coffee",
    "rarity": 100,
    "quantity": "1 1"
  },
  {
    "category": "tea",
    "rarity": 50,
    "quantity": "5 7"
  }
],
There could be easily seen the whole idea behind registering new items to loot pool, as well as other features of the system, which are rarity and quantity. Basically, the lower rarity, the more often the block/item will be pulled from the pool. The quantity then defines, that when the block/items get pulled, in what amount it should be put in chest/coffee mug/whatever. This is usable for example for some decorative blocks, which would be kinda useless in low amounts, or for coffee beans, since you can't brew a coffee from single bean.

Generating random loot from registered pools could then be done as simply as calling method like this:
Code:
chest.add(RandomPool.get("coffee"))
.
 

Adrijaned

Administrator
Contributor
Actually, I don't like coffee at all. It's just that after the first sentence, more coffee kept coming and coming, and coming...
 
Top