Table of Contents
Items in the game are usually stored with their template name and amount. When using items, or checking their properties, the name is looked up in items/items.txt to get the full information on that item.
An item stored in the inventory would look like:
{
"amount": 4,
"type": "fungus"
}
Whereas the item information when looked up would be:
fungus={
"id": 0,
"on_eat": {
"hp": [2]
}
}
Properties
Items have various properties for apply their effects.
on_eattriggered on eating (unimplemented)hplist of possible hp values, random value is picked when eatinghp_displaystring to display in the inventory in place of average of thehplist
on_drinktriggered on drinking (unimplemented)on_helmettriggered when wearing item on head (unimplemented)on_capetriggered when wearing item on body (unimplemented)on_glovetriggered when wearing item on hands (unimplemented)on_boottriggered when wearing item on feet (unimplemented)
Additionally, each item has its id and a corporeal flag (unimplemented). Items with the corporeal flag will count towards the inventory item limit, whereas items with corporeal set to false will not.
Stacking
The maximum number of items in a stack is defined in items/items.txt under [info] -> stacks, using item ids.
Descriptions
Item descriptions are stored in items/items.txt under [info] -> descriptions, using item ids.