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/
int money;

reset(arg) {
    if (arg)
	return;
    money = 1;
}

query_weight() { return 0; }

short() {
    if (money == 0)
	return 0;
    return money + " gold coins";
}

/*
 * If we are picked up by a player, then move the money to his "purse",
 * and destruct this object.

 901128: Changed by JnA to not destruct object until surely picked by the
 player, i.e. object moved to the players inventory with move_object()
*/
init()
{
  if (environment(this_object())==this_player()) {
    call_other(this_player(), "add_money", money);
    money = 0;
    set_heart_beat(1);
  }
}

get()
{
  return money>0;
}

set_money(m) {
    money = m;
}

id(str) {
    if (str == "coins")
	return 1;
    if (str == "money")
	return 1;
}

heart_beat() {
    if (money == 0)
	destruct(this_object());
}