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/
/*
 * This "room" is a special object which can be dropped once.
 */
int dropped;
int grow_stage;
string owner;

set_owner(n) {
    owner = n;
}

reset(arg) {
    if (arg)
	return;
    dropped = 0;
    grow_stage = 5;
}

short() {
    return "portable castle";
}

long() {
    write(short() + ".\n");
}

heart_beat() {
    if (!dropped)
	return;
    if (grow_stage > 0) {
	say("The castle grows...\n");
	grow_stage -= 1;
	return;
    }
    if (grow_stage == 0) {
	string name;
	say("The portable castle has grown into a full castle !\n");
	shout("Something in the world has changed.\n");
	name = create_wizard(lower_case(owner));
	if (name)
	    move_object(name, environment());
	destruct(this_object());
	return;
    }
}

id(str) {
    return str == "castle";
}

drop() {
    if (environment(this_player())->query_drop_castle()) {
	write("Not this close to the city!\n");
	return 1;
    }
    dropped = 1;
    shout("There is a mighty crash, and thunder.\n");
    set_heart_beat(1);
    return 0;
}

get() {
    if (dropped) {
	write("You can't take it anymore !\n");
	return 0;
    }
    return 1;
}