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/
/*
 * This is a decaying corpse. It is created automatically
 * when a player or monster die.
 */

#define DECAY_TIME	120

string name;
int decay;

int prevent_insert() {
    write("The corpse is too big.\n");
    return 1;
}

void init() {
    add_action("search", "search");
}

void reset(string arg) {
    if (arg)
	return;
    name = "noone";
    decay = 2;
}

void set_name(string n)
{
    name = n;
    call_out("decay", DECAY_TIME);
}

string short() {
    if (decay < 2)
	return "The somewhat decayed remains of " + capitalize(name);
    return "Corpse of " + capitalize(name);
}

void long() {
    write("This is the dead body of " + capitalize(name) + ".\n");
}

int id(string str) {
    return str == "corpse" || str == "corpse of " + name ||
	str == "remains";
}

void decay()
{
    decay -= 1;
    if (decay > 0) {
	call_out("decay", 20);
	return;
    }
    destruct(this_object());
}

int can_put_and_get() { return 1; }

int search_obj(object cont)
{
    object ob;
    int total;

    if (!cont->can_put_and_get())
	return 0;
    ob = first_inventory(cont);
    while(ob) {
	total += 1;
	write(ob->short() + ", ");
	ob = next_inventory(ob);
    }
    return total;
}

int search(string str)
{
    object ob;
    if (!str || !id(str))
	return 0;
    ob = present(str, environment(this_player()));
    if (!ob)
	ob = present(str, this_player());
    if (!ob)
	return 0;
    write("You search " + str + ", and find:\n");
    say(this_player()->query_name() + " searches " + str + ".\n");
    if (!search_obj(ob))
	write("\tNothing.\n");
    else
	write("\n");
    return 1;
}

int get() {
    return 1;
}

int query_weight() {
    return 5;
}