mud/
mud/2.4.5/dgd/include/
mud/2.4.5/dgd/std/
mud/2.4.5/dgd/sys/
mud/2.4.5/doc/
mud/2.4.5/doc/examples/
mud/2.4.5/log/
mud/2.4.5/obj/Go/
mud/2.4.5/players/
mud/2.4.5/players/lars/
mud/2.4.5/room/death/
mud/2.4.5/room/maze1/
mud/2.4.5/room/post_dir/
mud/2.4.5/room/sub/
#include "std.h"
#undef EXTRA_LONG
#define EXTRA_LONG\
    if (str == "lever") {\
	write("The lever can be moved between two positions.\n");\
	return;\
    }\
    if (str == "door") {\
	if (call_other("room/sub/door_trap", "query_west_door"))\
	    write("The door is closed.\n");\
	else\
	    write("The door is open\n");\
    }
#undef EXTRA_INIT
#define EXTRA_INIT\
    add_action("west", "west");\
    add_action("open", "open");\
    add_action("close", "close");\
    add_action("pull", "pull");\
    add_action("pull", "turn");\
    add_action("pull", "move");

TWO_EXIT("room/narr_alley", "up",
	 "room/maze1/maze1", "north",
	 "Down the well",
	 "You are down the well. It is wet and slippery.\n" +
	 "There is a lever beside a door to the west.\n", 0)

west() {
    if (call_other("room/sub/door_trap", "query_west_door") == 0) {
	call_other(this_player(), "move_player", "west#room/sub/door_trap");
	return 1;
    }
    write("The door is closed.\n");
    return 1;
}

close(str) {
    if (!str && str != "door")
	return 0;
    write("You can't.\n");
    return 1;
}

open(str) {
    if (!str && str != "door")
	return 0;
    write("You can't.\n");
    return 1;
}

pull(str) {
    if (!str || str != "lever")
	return 0;
    call_other("room/sub/door_trap", "toggle_door");
    return 1;
}

id(str) {
    return str == "lever" || str == "door";
}