Closed xFrednet closed 4 years ago
{
"loot_tables": {
<loot_table_id>: [
{
"name": <pool_name>,
"entries": [
{
"type": ("item"|"loot_table"),
"content_id": (<item_name>|<loot_table_id>),
"chance": (0.0-1.0),
"count_matrix": [<chance>, <count>]
}
]
}
]
}
}
{
"loot_tables": {
"iron_meteoroid_destruction": [
{
"name": "default",
"entries": [
{
"type": "item",
"content_id": "sf:item:iron_ore",
"chance": 1,
"count_matrix": [
0.5, 1,
0.3, 2,
0.2, 3
]
},
{
"type": "item",
"content_id": "sf:item:iron_nugget",
"chance": 0.25,
"count_matrix": [
1, 1
]
}
]
}
]
}
}
The loot tables cant be stored inside the ItemInfoManager
because we need to use the manager to get the item ids. This would lead to a cyclic dependency (This is sadly blocked by GDScript)
Tests and LootTableManager.get_loot_table_item_entities()
should be the last things to add before this can be merged and closed
Create a loot table thingy that can be referenced by meteoroids and other stuff to get items.
Possible steps: