WORKROOM.C
LIB3/STD/CREATOR/WORKROOM.C · 4.4 KB
From the archive nm4dos.zip
Download the archive « Back to the archive contents
inherit "/std/room";
object button;
void setup()
{
/* The short description of a room is what is seen in brief mode. */
set_short( CREATOR + "'s Workroom" );
/* You set this so you can see in the room.
* For a description of light levels and what they mean type
* "man light".
*/
set_light( 100 );
/* The long description is the description you get when you type
* look and when you work into a room in verbose mode.
*/
set_long(
"This is the workroom of " + CREATOR + ". You can see a small, " +
"wooden desk sulking in the corner of the room, with a " +
"beautifully-carved wooden rolly chair in front of it. The room " +
"appears to be newly created; there is a smell of paint and " +
"leather in the air." );
/* The items are the things in the room that you can look at.
* Try and put lots of these in the rooms you make; it makes them
* much more interesting.
*/
add_item( ({ "chair", "rolly chair" }),
"The teak rolly chair has amazing carvings of dragons and " +
"... other things on it. They almost seem alive; you especially " +
"don't notice the way the dragon blinks at you." );
add_item( ({ "desk", "wooden desk" }),
"The desk is made of mahogany with a touch of mountain ash. The " +
"top has two little basket things on it labeled \"in\" and " +
"\"out\". The in basket is rather small." );
add_item( "dragon", "As I said, you don't see it winking at you." );
add_item( "in basket",
"The in basket is full of small yellow forms with large red " +
"letters on them which say, \"Important! Read me first\" and " +
"which don't appear to actually have any thing else on them." );
add_item( "out basket", "It is completely empty." );
add_item( "basket",
"There are two baskets sitting on top of the desk. They have " +
"the words \"in\" and \"out\" written on them." );
add_item( "paint",
"You look around to see the source of the paint smell and you " +
"can't find it. The walls of the room seem to be twisting in a " +
"confused mish mash of shapes; you are sure they are not " +
"threatening." );
add_item( "wall",
"The walls are made up of a cloudy substance, white in nature, " +
"that is roiling around the place where you are standing. Great " +
"magic must be holding it back; every now and then you see a " +
"demonic head push its way out of the cloud, roll its eyes, and " +
"fade back into the cloud." );
add_item( "cloud",
"The cloud is white colored with a few flashes of light " +
"bursting in it." );
add_item( "demon",
"The demonic heads that pop out are pretty nasty-looking; they " +
"disappear with a snarl of strain." );
/* Add the exits to the room.
* The first parameter is the verb used to get through the exit.
* The second is where to go once that exit is opened.
* The third is the type of the exit. For a better description of
* this read the docs on rooms.
*/
add_exit( "common", "/w/common", "door" );
add_exit( "pub", "/d/home/city/newbiepub1", "door" );
/* These two add_alias alias the exits. Now when you type north (or n)
* you will go to the newbie pub and south to the common room.
*/
add_alias( "north", "pub" );
add_alias( "south", "common" );
/* This adds an exit back to your workroom into the common room. */
"/w/common"->add_exit( lower_case( CREATOR ), file_name( this_object() ), "door" );
}
void reset()
{
/* If the button does not exist (it has been dested or it hasnt been
* created yet) the variable is set to 0. This makes sure you don't get
* more than one button in your room.
*/
if( !button )
{
button = clone_object( "/obj/misc/button" );
button->move( this_object() );
}
}
void dest_me()
{
/* The dest_me function is called when an object is destructed. We trap
* this so that when the room is updated you dont end up with lots of
* buttons, which does look pretty silly.
*/
if( button )
button->dest_me();
/* For a description of what the :: does, go and shoot someone.
* I don't think I can explain it in less than ten pages, and you would
* not understand it anyway.
*/
::dest_me();
}