Skip to content

Interface. Tools Inventory

Mr. Fat Guy edited this page Apr 9, 2024 · 18 revisions

Table of Contents:

Table of contents generated with markdown-toc.

General

You can carry:

  • 10 pieces of hardware or mercantile items along with you
  • And +10 items extra for every donkey that you purchase at the stable.

So, up to 40 tools items at most (when having three donkeys) in 10x4 matrix:

Tools Inventory

Bullets and bags of gold (and in the future possibly matches as well) are the only type of items that have finite quantity).

Internal Array

Implemented in: #125.

Example

The representation of the above example tools inventory, using our internal products IDs would look like that:

P 19 21 22
D
D 24 23 27 12 14
D 25 26 26 26 26 26 26 17 21 13

Construction

Each array's item has corresponding item's ID or null value and quantity (set to 1 through entire game for most of the items). For tools (on contrary to food) game does implement quantities (for bullets and bags of gold).

So, the above table or inventory "translated" into Javascript array could look something like that:

let tools = [
    [[19, 1], [21, 1], [22, 1], null, null, null, null, null, null, null],
    [null, null, null, null, null, null, null, null, null, null],
    [[24, 1], [23, 1], [27, 1], [12, 1], [14, 1], null, null, null, null, null],
    [[25, 1], [26, 50], [26, 50], [26, 50], [26, 50], [26, 11], [16, 1], [17, 1], [21, 1], [13, 1]]
];

Multi-dimensional array is suggested, to make it easier to implement functionality, where player can move items between its own pocket and donkeys that he has purchased (as in graphical example above).

Meaning of the IDs can be found among shop goods and extra items.

Initial Values

Player starts a new game with a completely empty Tools Inventory meaning that all 28 array items are set to null.

Home

Game

Town

Locations

Gameplay

Development

Clone this wiki locally