key.c
skylib_fluffos_v3/mudlib/std/key.c · 1.1 KB
From the archive skylib_fluffos_v3.zip
Download the archive « Back to the archive contents
/**
* A key object. This provides a nice easy way to create keys.
*
* @author ceres
*/
inherit OBJECT_OBJ;
/** @ignore yes */
void create() {
do_setup++;
::create();
do_setup--;
set_name("key");
set_long("A key. Wonder where it fits?.\n");
add_plural("keys");
set_short("key");
if(!do_setup) {
TO->setup();
}
}
/**
* Setup the key. This method handles setting up the short, plural,
* adjectives etc.
*
* @param str The short of the key (minus the word 'key')
* @param prop The key property (should match the lock)
*/
void set_key( string str, string prop ) {
string *bits;
int i;
set_short( str + " key" );
set_main_plural( str + " keys" );
set_name( "key" );
add_plural( "keys" );
bits = explode( str, " " );
for( i = 0; i < sizeof( bits ); i ++ ) {
add_adjective( bits[i] );
}
add_property( prop, 1 );
set_value( 0 );
set_weight( 1 );
} /* set_key() */
/** @ignore yes */
mixed query_static_auto_load() {
if ( base_name(TO) + ".c" == __FILE__ )
return int_query_static_auto_load();
return ([ ]);
}