Basic inventory and drop/pickup items from the ground
domob1812 opened this issue · comments
Implement basic inventory for characters as well as piles of loot on the ground. Allow characters to drop stuff and pick stuff up on their current location.
Items are just identified by keyword strings and an integer count for them.
In the game state, we will add an inventory as (item name, count) array to the character state. We will also add separate piles of loot on the ground, which are simply entries (x, y, item, count).
Then there will be two new moves for characters, to drop and pickup loot:
{"c":{"42":{"drop":{"f":{"item1":10,"item2":3}}}}}
{"c":{"42":{"pu":{"f":{"item1":5,"item2":10}}}}}
Characters will also have a certain cargo space, which restricts their inventory. Each item type has a per-item volume/weight/whatever that takes up cargo space.
For testing, we should have a new god-mode command to create piles of loot on the ground, as if a character dropped stuff. With this, it will also be easily possible with pickup commands to bring arbitrary stuff into a character's inventory.
Also, when a character is killed, their inventory should be dropped to the ground.