CREATOR.C
LIB3/GLOBAL/CREATOR.C · 2.4 KB
From the archive nm4dos.zip
Download the archive « Back to the archive contents
/* This is the creator player object */
/*
* #pragma added, Bannor 31-OCT-93
*/
#pragma save_binary
#define CREGRADEOBJ "/obj/handlers/cregrade"
#include "mail.h"
inherit "/global/wiz_file_comm";
int invis;
void move_player_to_start( string bong, int new_pl, string c_name )
{
string temp;
if( !sscanf( file_name( previous_object() ), "/secure/login#%s", temp ) )
return 0;
::move_player_to_start( bong, new_pl, c_name );
if( query_invis() )
tell_object( this_object(), "===> You are currently INVISIBLE! <===\n" );
add_action( "visible", "vis" );
add_action( "invisible", "invis" );
add_action( "do_mail", "mail" );
add_action("do_collect_parcel", "collect" );
add_action("do_send_parcel", "send");
add_action( "do_grade", "grade" );
add_action( "do_sponsor", "sponsor" );
}
int do_collect_parcel()
{
return (int)PARCEL_OFFICE->collect_parcel();
}
int do_send_parcel(string s)
{
return (int)PARCEL_OFFICE->send_parcel(s);
}
int do_grade()
{
write( "You currently have " +
CREGRADEOBJ->query_cre_grade( query_name() ) +
" creator-points.\n" );
return 1;
}
int do_sponsor()
{
write( "Your sponsor is currently " +
capitalize( (string)CREGRADEOBJ->query_sponsor( query_name() ) ) +
".\n" );
return 1;
}
int do_mail( string str )
{
return( int ) "/obj/handlers/mail_track"->mail( str );
}
int query_invis()
{
return invis;
}
void set_invis( int i )
{
invis = i;
}
string short( int dark )
{
if( invis )
if( !this_player() || this_player()->query_creator() )
return ::short( dark ) + " (invis)";
else
return 0;
else
return ::short( dark );
}
int visible()
{
if( !invis )
{
notify_fail( "You are already visible.\n" );
return 0;
}
write( "You appear.\n" );
invis = 0;
return 1;
}
int invisible()
{
if( invis )
{
notify_fail( "You are already invisible.\n" );
return 0;
}
write( "You disappear.\n" );
invis = 1;
return 1;
}
nomask int query_creator()
{
return 1;
}
nomask int query_creator_playing()
{
return 0;
}
nomask int query_wizard()
{
return 1;
}
nomask int query_lord()
{
return( int ) "/secure/master"->
query_lord( geteuid( this_object() ) );
}
nomask string query_object_type()
{
return( string ) "/obj/handlers/cregrade"->query_cre_symbol( this_object()->query_name() );
}