DEATH.C
LIB3/OBJ/DEATH.C · 2.3 KB
From the archive nm4dos.zip
Download the archive « Back to the archive contents
#include "library.h"
inherit "/obj/monster";
object ob;
void setup()
{
set_name( "death" );
set_short( "death" );
set_long( "The grim reaper, the big bad dude. You know "
+ "who he is...\n" );
}
void person_died( string name )
{
ob = find_living( name );
if( !ob )
{
return;
}
ob->add_property( "dead", 1 );
ob->add_property( "noregen", 1 );
tell_object( ob, "Oh no, you are dead.\n I wonder what happens now?\n" );
call_out( "death1", 5 );
}
void death1()
{
this_object()->move( environment( ob ) );
tell_object( ob, "Death appears beside you, giving you an awful fright.\n" );
tell_object( ob, "Death says : My my, you don't look to healthy..\n" );
say( "You shudder with fright as you feel ... something "
+ "enter the room.\n", ob );
call_out( "death2", 4 );
}
void death2()
{
tell_object( ob, "Death says : Now let me see, should I give you "
+ "another chance....\n" );
if( ob->query_max_deaths() > ob->query_deaths() )
call_out( "death3", 4 );
else
call_out( "fatal1", 4 );
}
void death3()
{
tell_object( ob, "Death says : Oh, I suppose so then.\n" );
call_out( "death4", 2 );
}
void death4()
{
tell_object( ob, "Death sets your spirit free, then departs.\n" );
say( "You exhale in relief as the spirits depart.\n", ob );
ob->remove_property( "noregen" );
/*
ob->move_to_start();
*/
this_object()->dest_me();
}
void fatal1()
{
tell_object( ob, "Death says : No, I have let you off once to often...\n" );
call_out( "fatal2", 2 );
}
void fatal2()
{
LIBRARY->complete_death( this_player()->query_name() );
say( "You shudder as you hear the dreadful sound of "
+ "a soul being ripped apart.\n", ob );
tell_object( ob, "You know with a deadly certainty that "
+ "you have met your end.\n" );
this_object()->dest_me();
}
int can_see( object player )
{
if( player->query_property( "dead" ) )
return 1;
if( this_player()->query_creator() )
return 1;
return 0;
}
string short( int dark )
{
if( can_see( this_player() ) )
{
return ::short( dark );
}
return 0;
}
string long( string str, int dark )
{
if( can_see( this_player() ) )
{
return ::long( str, dark );
}
return "You do not think that death is here.\n";
}