/
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";

string  me, him;

void    setup()
{
    set_name( "frisbee" );
    set_short( "black frisbee" );
    add_adjective( "black" );
    set_long( "A small black frisbee.  Looks like you could throw it to " +
	      "people.\n" );
    add_property( "feeding_frenzy", "frisbee" );
    set_weight( 20 );
    set_value( 200 );
    set_main_plural( "black frisbees" );
    add_plural( "frisbees" );
}

void    init()
{
    add_action( "throw", "throw" );
    ::init();
}

int     throw( string str )
{
    object *from, *dest;
    int     i, j;

    notify_fail( "What are you going to throw?\n" );
    if( !str )
	return 0;
    if( sscanf( str, "%s at %s", me, him ) != 2 &&
	    sscanf( str, "%s to %s", me, him ) != 2 &&
	    sscanf( str, "%s the %s", him, me ) != 2 &&
	    sscanf( str, "%s %s", me, him ) != 2 )
	return 0;
    him = (string)this_player()->expand_nickname( him );
    me = (string)this_player()->expand_nickname( me );
    from = find_match( me, this_player() ) +
	find_match( me, environment( this_player() ) );
    dest = find_match( him, this_player() ) +
	find_match( him, environment( this_player() ) );
    if( !sizeof( dest ) )
	if( !find_living( him ) )
	    return 0;
	else
	    dest = ({ find_living( him ) });
    for( i = 0; i < sizeof( from ); i++ )
	for( j = 0; j < sizeof( dest ); j++ )
	    if( !from[ i ]->do_throw( dest[ j ] ) )
		write( "You cannot throw " + from[ i ]->short() + ".\n" );

    return 1;
}

int     do_throw( object dest )
{
    if( environment() != this_player() )
    {
	write( "You must have the " + short( 0 ) + " to throw it.\n" );

	return 1;
    }
    say( this_player()->query_cap_name() + " throws " + me + " to " + him + "\n",
	 ({ dest, this_player() }) );
    write( "You throw the frisbee to " + him + ".\n" );
    if( move( dest ) )
    {
	tell_object( dest, this_player()->query_cap_name() + " throws " +
		     this_object()->short() + " at you, but it falls on the floor.\n" );

	tell_room( environment( dest ), "A frisbee arcs through the air, " +
		   dest->query_name() + " trys to catch it but fails and it " +
		   "fall on the floor", ({ dest, this_player() }) );
	move( environment( dest ) );
    }
    else
    {
	tell_object( dest, this_player()->query_cap_name() + " throws a frisbee " +
		     "at you, you catch it... just.\n" );
	tell_room( environment( dest ), dest->query_cap_name() +
		   " fumbles the catch of the " +
		   short   ( 0 ) + " but manages to keep hold of it.\n",
		           ({ dest, this_player() }) );
    }
    return 1;
}