/
LIB3/
LIB3/D/ADMIN/
LIB3/D/ADMIN/OBJ/
LIB3/D/ADMIN/ROOM/W/
LIB3/D/HOME/
LIB3/D/HOME/CITY/ARENA/
LIB3/D/HOME/CITY/ITEMS/
LIB3/D/HOME/CITY/POSTOFFI/
LIB3/DOC/
LIB3/GLOBAL/SPECIAL/
LIB3/GLOBAL/VIRTUAL/
LIB3/NET/
LIB3/NET/CONFIG/
LIB3/NET/DAEMON/CHARS/
LIB3/NET/GOPHER/
LIB3/NET/INHERIT/
LIB3/NET/OBJ/
LIB3/NET/SAVE/
LIB3/NET/VIRTUAL/
LIB3/OBJ/B_DAY/
LIB3/OBJ/HANDLERS/TERM_TYP/
LIB3/PLAYERS/B/
LIB3/PLAYERS/N/
LIB3/ROOM/
LIB3/SAVE/
LIB3/SAVE/BOARDS/
LIB3/SAVE/ENVIRON/
LIB3/SAVE/POST/
LIB3/STD/COMMANDS/SHADOWS/
LIB3/STD/CREATOR/
LIB3/STD/DOM/
LIB3/STD/EFFECTS/
LIB3/STD/EFFECTS/HEALING/
LIB3/STD/EFFECTS/OTHER/
LIB3/STD/EFFECTS/POISONS/
LIB3/STD/ENVIRON/
LIB3/STD/GUILDS/
LIB3/STD/LIQUIDS/
LIB3/STD/ROOM/
LIB3/STD/TRIGGER/SHADOW/
LIB3/W/
LIB3/W/BANNOR/
LIB3/W/NEWSTYLE/
inherit "std/object";
#include "pub.h"

int     weight_per_bite;
string  eat_object, eat_func;

void    init()
{
    ::init();
    this_player()->add_command( "eat", this_object() );
}				/* init() */

int     query_weight_per_bite()
{
    return weight_per_bite;
}
string  query_eat_object()
{
    return eat_object;
}
string  query_eat_func()
{
    return eat_func;
}

void    set_weight_per_bite( int i )
{
    weight_per_bite = i;
}
void    set_eat_object( string s )
{
    eat_object = s;
}
void    set_eat_func( string s )
{
    eat_func = s;
}
void    setup_eat( string eo, string ef )
{
    eat_object = eo;
    eat_func = ef;
}				/* setup_eat() */

int     do_eat( object *dests, string s1, string s2, string prep )
{
    if( sizeof( dests ) )
    {
	notify_fail( "Eat " + prep + "???\n" );
	return 0;
    }

    if( weight <= 0 )
    {
	call_out( "dest_me", 0 );
	return 1;
    }
    if( !weight_per_bite )
    {
	call_out( "dest_me", 0 );
	if( eat_func )
	    if( eat_object )
		call_other( eat_object, eat_func, this_object() );
	    else
		call_other( this_object(), eat_func, this_object() );
	return 1;
    }
    environment()->add_weight( -weight_per_bite );
    weight -= weight_per_bite;
    if( eat_func )
	if( eat_object )
	    call_other( eat_object, eat_func, this_object() );
	else
	    call_other( this_object(), eat_func, this_object() );
    if( weight <= 0 )
    {
	call_out( "dest_me", 0 );
	environment()->add_weight( -weight );
    }
    return 1;
}				/* do_eat() */

mixed   query_static_auto_load()
{
    return({  ::int_query_static_auto_load(), weight_per_bite, eat_object,
	     eat_func });
}				/* query_static_auto_load() */

void    init_static_arg( mixed bing )
{
    if( !pointerp( bing ) )
	return;
     ::init_static_arg( bing[ 0 ] );
    weight_per_bite = bing[ 1 ];
    eat_object = bing[ 2 ];
    eat_func = bing[ 3 ];
}				/* init_static_arg() */