LIFT_BUT.C
LIB3/OBJ/MISC/LIFT_BUT.C · 889 B
From the archive nm4dos.zip
Download the archive « Back to the archive contents
/* Standard lift button. */
inherit "/std/object";
object lift;
string name;
setup()
{
set_name( "button" );
set_short( "lift button" );
add_adjective( "lift" );
set_long( "A lift button. If you were to 'press' "
+ "it it would summon the lift for you.\n" );
reset_get();
}
/* For receiveing info from the lift. */
void set_lift( object ob, string lname )
{
lift = ob;
name = lname;
}
void init()
{
::init();
this_player()->add_command( "press", this_object() );
this_player()->add_command( "push", this_object() );
}
/* Adds this level to the lifts goto list. */
int do_press()
{
write( "You " + query_verb() + " the lift button.\n" );
say( this_player()->query_cap_name() + " " +
query_verb() + "'s the lift button.\n" );
lift->add_goto( name );
return 1;
}
int do_push()
{
return do_press();
}