#include struct object { int (*condition)(struct object*); const char *description; const char **tags; struct object *location; struct object *destination; struct object *prospect; const char *details; const char *contents; const char *text_go; int weight; int capacity; int health; const char *(*open)(struct object*); const char *(*close)(struct object*); const char *(*lock)(struct object*); const char *(*unlock)(struct object*); }; extern struct object objs[]; - field description "an open field" tags "field" details "The filed is a nice and quiet place under a clear blue sky." - cave description "a little cave" tags "cave" details "The cave is just a cold, damp, rocky chamber." - silver description "a silver coin" tags "silver", "coin", "sirver coin" location field details "The coin has an eagle on the obverse." weight 1 - gold description "a gold coin" tags "gold", "coin", "gold coin" location cave details "The shiny coin seems to be a rare and priceless artefact." weight 1 - guard description "a burly guard" tags "guard", "burly guard" location field details "The guard is a really big fellow." contents "He has" health 100 capacity 20 - player description "yourself" tags "me" location field details "You would need a mirror to look at yourself." contents "You have" health 100 capacity 20 - into_cave condition { return guard->health == 0 || silver->location == guard; } description "a cave entrance to the east" tags "east", "entrance" location field destination cave details "The entrance is just a narrow opening in a small outcrop." text_go "You walk into the cave." open is_already_open - into_cave_blocked condition { return guard->health > 0 && silver->location != guard; } description "a cave entrance to the east" tags "east", "entrance" location field prospect cave details "The entrance is just a narrow opening in a small outcrop." text_go "The guard stops you from walking into the cave." open is_already_open - exit_cave description "a way out to the west" tags "west", "out" location cave destination field details "Sunlight pours in through an opening in the cave's wall." text_go "You walk out of the cave." open is_already_open - wall_field description "dense forest all around" tags "west", "north", "south", "forest" location field details "The field is surrounded by trees and undergrowth." text_go "Dense forest is blocking the way." - wall_cave description "solid rock all around" tags "east", "north", "rock" location cave details "carved in stone is a secret password 'abccb'." text_go "Solid rock is blocking the way." - backroom description "a backroom" tags "backroom" details "The room is dusty and messy." - wall_backroom description "solid rock all around" tags "east", "west", "south", "rock" location backroom details "Trendy wallpaper covers the rock walls." text_go "Solid rock is blocking the way." - open_door_to_backroom description "an open door to the south" tags "south", "door", "doorway" destination backroom details "The door is open." text_go "You walk through the door into the backroom." open is_already_open close toggle_backdoor - closed_door_to_backroom description "a closed door to the south" tags "south", "door", "doorway" location cave prospect backroom details "The door is closed." text_go "The door is closed." open toggle_backdoor close is_already_closed - open_door_to_cave description "an open door to the north" tags "north", "door", "doorway" destination cave details "The door is open" text_go "You walk through the door into the cave." open is_already_open close toggle_backdoor - closed_door_to_cave description "a closed door to the north" tags "north", "door", "doorway" location backroom prospect cave details "The door is closed." text_go "The door is closed." open toggle_backdoor close is_already_closed - open_box description "a wooden box" tags "box", "wooden box" details "The box is open." weight 5 capacity 10 open is_already_open close toggle_box lock is_still_open unlock is_already_open - closed_box description "a wooden box" tags "box", "wooden box" details "The box is closed." weight 5 open toggle_box close is_already_closed lock toggle_box_lock unlock is_already_unlocked - locked_box description "a wooden box" tags "box", "wooden box" location backroom details "The box is closed." weight 5 open is_still_locked close is_already_closed lock is_already_locked unlock toggle_box_lock - key_for_box description "a tiny key" tags "key", "tiny key" location cave details "The key is really small and shiny." weight 1 - knife description "a small, rusty knife" tags "knife", "rusty knife", "small knife" location open_box details "This knife has surely seen better times." weight 1