#include <sys.h>

string name;
string short;

get_type() { return TYPE_CORPSE; }

self_destruct() { destruct(this_object()); return 1; }

id(arg) { return arg=="corpse" || arg=="body"; }

static init() {
  if (prototype(this_object())) return;
  alarm(30,"decay");
}

get_name() { return name; }
set_name(arg) { name=arg; short= "fresh corpse of "+name; return 1; }
get_short() { return short; }
get_long() { return "It's just the "+short; }
get() { return 1; }

static decay() {
  short="rotten, gassy corpse of "+name;
  alarm(30,"really_decay");
  tell_room(location(this_object()),"The deliquescing corpse of "+name+
            " is really starting to smell.\n");
}

static really_decay() {
  tell_room(location(this_object()),"The gas-bloated corpse of "+name+
            " bursts, showering you with rotting goo.\n");
  destruct(this_object());
}

stat() {
  tell_player(this_player(),"Object Type: CORPSE\n");
  tell_player(this_player(),"Name: "+name+"\n");
  return 1;
}