Skip to main content

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!"
}
}
}
FieldDescription
descriptionText shown when the player inspects the item.
imageOptional image path.
iconOptional emoji or short icon.
usableWhether the player can use the item from the inventory.
effectsStat changes applied when the item is used.
useMessageMessage shown after using the item.

Item types​

When a choice gives an item, it declares a type:

{
"id": "potion",
"name": "Healing Potion",
"type": "consumable"
}
TypeBehavior
permanentStays in the inventory forever.
consumableRemoved from the inventory after being used.
consumeRemoved 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"]
}
}