ldmud-3.2.9/doc/
ldmud-3.2.9/doc/efun/
ldmud-3.2.9/mud/
ldmud-3.2.9/mud/heaven7/
ldmud-3.2.9/mud/heaven7/lib/
ldmud-3.2.9/mud/lp-245/
ldmud-3.2.9/mud/lp-245/banish/
ldmud-3.2.9/mud/lp-245/doc/
ldmud-3.2.9/mud/lp-245/doc/examples/
ldmud-3.2.9/mud/lp-245/doc/sefun/
ldmud-3.2.9/mud/lp-245/log/
ldmud-3.2.9/mud/lp-245/obj/Go/
ldmud-3.2.9/mud/lp-245/players/lars/
ldmud-3.2.9/mud/lp-245/room/death/
ldmud-3.2.9/mud/lp-245/room/maze1/
ldmud-3.2.9/mud/lp-245/room/sub/
ldmud-3.2.9/mud/lp-245/secure/
ldmud-3.2.9/mud/morgengrauen/
ldmud-3.2.9/mud/morgengrauen/lib/
ldmud-3.2.9/mud/sticklib/
ldmud-3.2.9/mud/sticklib/src/
ldmud-3.2.9/mudlib/uni-crasher/
ldmud-3.2.9/pkg/
ldmud-3.2.9/pkg/debugger/
ldmud-3.2.9/pkg/diff/
ldmud-3.2.9/pkg/misc/
ldmud-3.2.9/src/autoconf/
ldmud-3.2.9/src/bugs/
ldmud-3.2.9/src/bugs/MudCompress/
ldmud-3.2.9/src/bugs/b-020916-files/
ldmud-3.2.9/src/bugs/doomdark/
ldmud-3.2.9/src/bugs/ferrycode/ferry/
ldmud-3.2.9/src/bugs/ferrycode/obj/
ldmud-3.2.9/src/bugs/psql/
ldmud-3.2.9/src/done/
ldmud-3.2.9/src/done/order_alist/
ldmud-3.2.9/src/done/order_alist/obj/
ldmud-3.2.9/src/done/order_alist/room/
ldmud-3.2.9/src/gcc/
ldmud-3.2.9/src/gcc/2.7.0/
ldmud-3.2.9/src/gcc/2.7.1/
ldmud-3.2.9/src/hosts/
ldmud-3.2.9/src/hosts/GnuWin32/
ldmud-3.2.9/src/hosts/amiga/NetIncl/
ldmud-3.2.9/src/hosts/amiga/NetIncl/netinet/
ldmud-3.2.9/src/hosts/amiga/NetIncl/sys/
ldmud-3.2.9/src/hosts/i386/
ldmud-3.2.9/src/hosts/msdos/byacc/
ldmud-3.2.9/src/hosts/msdos/doc/
ldmud-3.2.9/src/hosts/os2/
ldmud-3.2.9/src/hosts/win32/
ldmud-3.2.9/src/util/
ldmud-3.2.9/src/util/erq/
ldmud-3.2.9/src/util/indent/hosts/next/
ldmud-3.2.9/src/util/xerq/
ldmud-3.2.9/src/util/xerq/lpc/
ldmud-3.2.9/src/util/xerq/lpc/www/
/*

   This object is a standard food object and works
   like /obj/alco_drink.c or /obj/armour.c

   To use this you can do:
     inherit "obj/food";
   ......
   or,
   object ob;
   ob = clone_object("obj/food");
   ob->set_name("apple pie");

*  For more documentation look at /doc/build/food


   These functions are defined:

	   set_name(string)	To set the name of the item. For use in id().

   Two alternative names can be set with the calls:

	   set_alias(string) and set_alt_name(string)

	   set_short(string)	To set the short description.

	   set_long(string)	To set the long description.

	   set_value(int)	To set the value of the item.

	   set_weight(int)	To set the weight of the item.

	   set_strength(int)	To set the healing power of the item. If you
				don't wish the item to have healing powers
				just set this value to 0.

	   set_eater_mess(string)
				To set the message that is written to the
				player when he eats the item.

	   set_eating_mess(string)
				To set the message given to the surrounding
				players when this object is eaten.


	For an example of the use of this object, please read:
*	/doc/examples/apple_pie.c

*/

string name, short, long, eating_mess, eater_mess, alias, alt_name;
int value, strength, weight;

init()
{
	add_action("eat", "eat");
}

reset(arg)
{
	if (arg)
		return;

	weight = 1;
	eater_mess = "Yum yum yum.\n";
}

prevent_insert()
{
  write("You don't want to ruin " + short + ".\n");
  return 1;
}

id(str)
{
	return  str == name || str == alt_name || str == alias;
}

short()
{
	if(!short)
	    return name;

	return short;
}

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

get()
{
	return 1;
}

eat(str)
{
	object tp;

	tp = this_player();

	if (!str || !id(str))
		return 0;

	if(tp->query_level() * 8 < strength)
	{
		write("You realize even before trying that you'll never be able to eat all this.\n");
		return 1;
	}

	if (!tp->eat_food(strength))
		return 1;

	tp->heal_self(strength);
	write(eater_mess);
	if (eating_mess)
		say(capitalize(this_player()->query_name()) + eating_mess);
	else
		say(capitalize(this_player()->query_name()) + " eats " + short + ".\n");
	destruct(this_object());
	return 1;
}

min_cost()
{
	return 4 * strength + (strength * strength) / 10;
}

set_name(n)
{
	name = n;
}

set_short(s)
{
	short = s;
}

set_long(l)
{
	long = l;
}

set_value(v)
{
	value = v;
}

set_weight(w)
{
	weight = w;
}

set_strength(s)
{
	strength = s;
}

set_alias(a)
{
	alias = a;
}

set_alt_name(an)
{
	alt_name = an;
}

set_eating_mess(em)
{
	eating_mess = em;
}

set_eater_mess(em)
{
	eater_mess = em;
}

/*
 * Things that other objects might want to know.
 */

query_value()
{
	if (value)
		return value;
	else
		return min_cost();
}

query_weight()
{
	return weight;
}