MAINSTRE.C
LIB3/D/HOME/CITY/MAINSTRE.C · 2.7 KB
From the archive nm4dos.zip
Download the archive « Back to the archive contents
#include "path.h"
inherit "/std/room.c";
object guard1, guard2;
setup ()
{
set_short("West end of Main Street");
set_long("This is Main Street, which runs east"+
"/west through "+CITYNAME+". To the west, a heavy "+
"gate marks the edge of the city, while the road "+
"continues to the east.\n");
add_item( ({"street", "road", "main street", "Main Street"}),
"Main Street was originally a beautifully cobbled "+
"thoroughfare, but is now badly in need of repair.\n");
add_item( ({"gate", "portcullis"}),
"The gate is constructed from heavy oak beams, "
+"reinforced with iron bands. They stand open for "
+"now, but could be shut in an instant.\n");
add_exit("east", HOMECITY+"mainstreet2", "road");
add_exit("west", SURROUND+"westroad1", "gate");
modify_exit("west", ({"function", "leave_city"}) );
guard1 = clone_object(MONSTERS+"guard");
guard1->move(this_object());
guard2 = clone_object(MONSTERS+"guard");
guard2->move(this_object());
set_zone("mid");
set_light(60);
}
int leave_city()
{
if(guard1 || guard2)
{
if((string)this_player()->query_race_ob() == "std/races/polymorph")
{
notify_fail("The guard stops you, saying 'Hey, you'll have "
+"to choose a race before leaving the city!'\n");
say("A guard stops "+this_player()->query_cap_name()
+" from leaving the city, on the grounds that "
+this_player()->query_pronoun()+" is still a polymorph.\n");
return 0;
}
if(this_player()->query_level() < 2)
{
notify_fail("A guard stops you leaving the city, saying "
+"'You are to inexperienced to leave the city yet, "
+this_player()->query_cap_name()+". Why not gain "
+"a bit more experince before venturing out into the "
+"big bad world?'\n");
say("A guard stops "+this_player()->query_cap_name()+" leaving"
+" the city on the grounds that "+this_player()->query_pronoun()
+" is too inexperienced.\n");
return 0;
}
if(this_player()->query_level() < 5)
{
write("A guard steps up to you, saying 'Beware, "
+this_player()->query_cap_name()+". You are still "
+"rather inexperienced to be leaving the city. Do not "
+"wander too far!'\n");
say("A guard says something to "+this_player()->query_cap_name()+
" before allowing "+this_player()->query_objective()
+" to leave the city.\n");
return 1;
}
write("A guard gives you a cursory glance before "
+"motioning you on.\n");
return 1;
}
write("There are no guards here, so you pass freely through the gate.\n");
return 1;
}