view doc/src/specs/inventory.md @ 198:bf17be3e20f2

misc: remove .clang
author David Demelier <markand@malikania.fr>
date Tue, 27 Nov 2018 21:07:00 +0100
parents 5b0f7ffab962
children
line wrap: on
line source

# Inventory

This document describes the inventory system in Malikania's Kingdom.

# Synopsis

The inventory is a persistent component where user stores its objects. It can be
equipments, drinks, foods and so on. As Malikania tries to follow some concepts
in real life, the inventory has limited size to avoid storing ten thousands of
objects.

# Slots

Inventory is composed of slots, you can think this as a cell in a grid. The user
inventory has 16 slots. Each slot can only have one type of object but may have
multiple amount of the same object in it.

Example:

+---+---+---+---+---+---+---+---+
| E | P | R |   |   |   |   |   |
+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+

Here we have E, P and R types of object which can be anything, a drink, a food
or an equipment.

Note: equipped gears are not in inventory!

# Amount

Since not all objects are created equal, the amount by type is different. For
example, one may have dozen of the same biscuit in a slot but only have one
sword per slot. This means that an item must define a maximum amount.

Example:

- biscuits (A): maximum amount to 64
- sword (B): maximum amount to 1
- drinks (C): maximum amount to 8

Then, if user wants to carry 10 drinks (C), 1 sword (B) and 120 biscuits (A),
the stack will look like:

+-----+-----+-----+-----+-----+-----+-----+-----+
|  A  |  A  |  B  |  C  |  C  |     |     |     |
| x56 | x64 | x1  | x8  | x2  |     |     |     |
+-----+-----+-----+-----+-----+-----+-----+-----+
|     |     |     |     |     |     |     |     |
|     |     |     |     |     |     |     |     |
+-----+-----+-----+-----+-----+-----+-----+-----+