Requirements and Items
Requirements
Requirements control whether a choice is visible. All requirement types can be combined.
Items
"requirements": {
"items": ["silver_key", "torch"]
}
The player must carry every listed item.
Flags
"requirements": {
"flags": ["door_opened", "talked_to_guard"]
}
Every listed flag must be set.
Inverse flags
"requirements": {
"notFlags": ["alarm_triggered", "boss_defeated"]
}
None of the listed flags may be set.
Perks
"requirements": {
"perks": ["lockpicker", "night_vision"]
}
The player must have every listed perk.
Combined requirements
"requirements": {
"items": ["lockpick"],
"perks": ["lockpicker"],
"flags": ["found_door"],
"notFlags": ["alarm_triggered"]
}
All conditions are evaluated together.
Item catalog
Items are defined once in the items object of each language:
{
"items": {
"potion": {
"description": "A ruby-red potion that restores health.",
"image": "src/images/inventories/potion.png",
"icon": "🧪",
"usable": true,
"effects": {
"health": 2
},
"useMessage": "You drink the potion and your wounds heal. +2 Health!"
}
}
}
| Field | Description |
|---|---|
description | Text shown when the player inspects the item. |
image | Optional image path. |
icon | Optional emoji or short icon. |
usable | Whether the player can use the item from the inventory. |
effects | Stat changes applied when the item is used. |
useMessage | Message shown after using the item. |
Item types
When a choice gives an item, it declares a type:
{
"id": "potion",
"name": "Healing Potion",
"type": "consumable"
}
| Type | Behavior |
|---|---|
permanent | Stays in the inventory forever. |
consumable | Removed from the inventory after being used. |
consume | Removed from the inventory when applied as an effect, typically combined with a requirement. |
Inventory capacity
The inventory holds up to Strength + 5 items. See Inventory for the player-facing behavior.
Example
{
"text": "Use the silver key",
"next": "treasure_room",
"requirements": {
"items": ["silver_key"]
},
"effects": {
"items": [
{
"id": "silver_key",
"name": "Silver Key",
"type": "consume"
}
],
"flags": ["treasure_room_opened"]
}
}