ldmud-3.3.719/
ldmud-3.3.719/doc/
ldmud-3.3.719/doc/efun.de/
ldmud-3.3.719/doc/efun/
ldmud-3.3.719/doc/man/
ldmud-3.3.719/doc/other/
ldmud-3.3.719/mud/
ldmud-3.3.719/mud/heaven7/
ldmud-3.3.719/mud/lp-245/
ldmud-3.3.719/mud/lp-245/banish/
ldmud-3.3.719/mud/lp-245/doc/
ldmud-3.3.719/mud/lp-245/doc/examples/
ldmud-3.3.719/mud/lp-245/doc/sefun/
ldmud-3.3.719/mud/lp-245/log/
ldmud-3.3.719/mud/lp-245/obj/Go/
ldmud-3.3.719/mud/lp-245/players/lars/
ldmud-3.3.719/mud/lp-245/room/death/
ldmud-3.3.719/mud/lp-245/room/maze1/
ldmud-3.3.719/mud/lp-245/room/sub/
ldmud-3.3.719/mud/lp-245/secure/
ldmud-3.3.719/mud/sticklib/
ldmud-3.3.719/mud/sticklib/src/
ldmud-3.3.719/mudlib/deprecated/
ldmud-3.3.719/mudlib/uni-crasher/
ldmud-3.3.719/pkg/
ldmud-3.3.719/pkg/debugger/
ldmud-3.3.719/pkg/diff/
ldmud-3.3.719/pkg/misc/
ldmud-3.3.719/src/
ldmud-3.3.719/src/autoconf/
ldmud-3.3.719/src/ptmalloc/
ldmud-3.3.719/src/util/
ldmud-3.3.719/src/util/erq/
ldmud-3.3.719/src/util/indent/hosts/next/
ldmud-3.3.719/src/util/xerq/
ldmud-3.3.719/src/util/xerq/lpc/
ldmud-3.3.719/src/util/xerq/lpc/www/
ldmud-3.3.719/test/generic/
ldmud-3.3.719/test/inc/
ldmud-3.3.719/test/t-0000398/
ldmud-3.3.719/test/t-0000548/
ldmud-3.3.719/test/t-030925/
ldmud-3.3.719/test/t-040413/
ldmud-3.3.719/test/t-041124/
ldmud-3.3.719/test/t-language/
object listen_ob;
int num_turn, safe_is_unlocked, safe_is_open;
object money;

void reset(int arg) {
    num_turn = 0;
    safe_is_unlocked = 0;
    safe_is_open = 0;
    if (!money || environment(money) != this_object()) {
	money = clone_object("obj/money");
	money->set_money(random(1000));
	move_object(money, this_object());
    }
}

void long(string str) {
    if (str == "wheel" || str == "code wheel") {
	write("You see nothing special.\n");
	return;
    }
    write("It is a rather small safe, formed as a cube. It looks\n");
    write("Very heavy. On the safe is a numbered code wheel.\n");
}

string short() {
    if (safe_is_open)
	return "A safe (open)";
    return "A safe";
}

int id(string str) {
    return str == "safe" || str == "wheel" ||
	str == "code wheel";
}

void init() {
    add_action("open", "open");
    add_action("turn", "turn");
}

int open(string str) {
    if (!id(str))
	return 0;
    if (!safe_is_unlocked) {
	write("The safe is locked.\n");
	return 1;
    }
    safe_is_open = 1;
    write("Ok.\n");
    say(this_player()->query_name() + " opens the safe.\n");
    return 1;
}

int turn(string str) {
    int listen;
    if (str != "wheel" && str != "code wheel")
	return 0;
    if (listen_ob && listen_ob->query_listening()) {
	num_turn += 1;
	if (num_turn >= 3) {
	    write("klock\n");
	    safe_is_unlocked = 1;
	    return 1;
	}
	write("klick\n");
	return 1;
    }
    write("You turn the wheel randomly, but nothing happens.\n");
    say(this_player()->query_name() +
	" turns the wheel on the safe randomly.\n");
    return 1;
}

int use_stethoscope(object stet)
{
    listen_ob = stet;
    return 1;
}

int can_put_and_get() {
    return safe_is_open;
}

int add_weight() { return 1; }