Use when the player takes, drops, inspects, stores, or retrieves items. Includes container logic for the brown sack.
Apply this skill when the player:
When the player picks up an item, you MUST add the full item object {id, name, description} to the inventory array using update_game_state.
DO NOT just store the item ID string. Store the complete object to preserve the item's description even if the player moves to a different location.
Example:
{
"inventory": [
{"id": "brass_lantern", "name": "Brass Lantern", "description": "A battery-powered brass lantern."},
{"id": "sword", "name": "Elvish Sword", "description": "A blade that glows faintly blue."}
]
}
When the player drops an item:
inventoryflags.dropped_items[current_location] arrayupdate_game_state with both changesExample state update:
{
"inventory": [...remaining items...],
"flags": {
"dropped_items": {
"hallway": [{"id": "sword", "name": "Elvish Sword", "description": "..."}]
}
}
}
When describing a location, check flags.dropped_items[location_id]:
When the player takes an item from flags.dropped_items[current_location]:
flags.dropped_items[current_location]inventoryupdate_game_state with both changesThe brown sack (brown_sack) contains hidden items:
garlic)lunch)When the player inspects the sack:
Once revealed, the player may:
take garlic - Add garlic to main inventory as a separate itemtake lunch - Add lunch to main inventory as a separate itemIf the player drops the sack:
take garlic) remain in inventorydropped_itemsIf the player has brown_sack in inventory and inspects it:
garlic and lunch as accessible/takeableNever assume an item is gone unless state confirms it:
inventoryflags.trophy_caseflags.dropped_items[current_location]If an item is listed in the location's interactables and is NOT in any of these places, it is still present and can be taken.