/
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/
/* /obj/handlers/weather_room.c */
inherit "std/room";

mixed   leverarr;

reset( arg )
{
    if( arg )
	return;

    set_short( "The weather room" );
    set_long( "The weather control center for the entire mud. On the floor " +
	      "should be the controller itself, scattered around the room " +
	      "are hundred of impressive flashing lights, dials and levers.  " +
	      "You get the feeling however that they don't actually do " +
	      "anything.\n" );

    set_light( 50 );
    seteuid( "pinkfish" );
    add_property( "inside" );
    add_exit( "bannor", "/w/bannor/workroom" );
    add_item( "lights", "What did I say? there are lots of them and they " +
	      "are insesantly flashing.\n" );
    add_item( "dials", "Large dials with all sort of things on them. One you " +
	      "can see says 'Colour of spring', it is currently pointing at " +
	      "purple.\n" );
    add_item( "levers", "The levers are large multicolour protuberances " +
	      "which are scattered around the room in random profusion.\n" );
    leverarr = ({ ({ "blue", "The rooms spins and a small bit of printed " +
		     "paper falls from the Weather controller saying:\n" +
		     "#query_rain" }),
		  ({ "white", "The ground heaves in a major convulsion and a " +
		     "mound of paper falls onto You from the ceiling saying:\n" +
		     "#query_cloud" }) });

}

init()
{
     ::init();
    add_action( "pull", "pull" );
    add_action( "push", "push" );
}


pull( str )
{
    int     i;
    string  type, rand;
    object  lever, weather;

    if( str == "lever" || str == "levers" )
	lever = leverarr[ random( sizeof( leverarr ) ) ];
    else
    {
	if( !sscanf( str, "%s lever%s", type, rand ) )
	{
	    notify_fail( "You have to pull a lever.\n" );
	    return 0;
	}
	for( i = 0; i < sizeof( leverarr ); i++ )
	{
	    if( leverarr[ i ][ 0 ] == type )
	    {
		lever = leverarr[ i ];
		break;
	    }
	}
    }
    if( !lever )
    {
	notify_fail( "You need to choose and existing lever" );
	return;
    }

    weather = present( "weather", this_object() );
    if( !weather )
    {
	notify_fail( "Opps the weather controller does not exist.\n" );
	return 0;
    }
    sscanf( lever[ 1 ], "%s#%s", type, rand );
    write( type );
    this_player()->print_object( call_other( weather, rand ) );
    return 1;
}

push( str )
{
    object  lever;
    int     i;
    string  type, bing;

    if( str == "levers" && str == "lever" )
	lever = leverarr[ random( sizeof( leverarr ) ) ];
    else
    {
	if( !sscanf( str, "%s lever%s", type, bing ) )
	{
	    notify_fail( "You must push an existing lever.\n" );
	    return 0;
	}
	for( i = 0; i < sizeof( leverarr ); i++ )
	    if( type == leverarr[ i ][ 0 ] )
	    {
		lever = leverarr[ i ];
		break;
	    }
    }
    if( !lever )
    {
	notify_fail( "An existing lever could be usefull...\n" );
	return 0;
    }

    write( "You huff and you puff, but you just cant push that lever.\n" );
}