Room with a Monster

// by Petrarch // Forest room, file=f_room2.c // This time with a monster in it #include <std.h> inherit ROOM; void create() { ::create(); set_short("lost in a forest"); set_day_long("This section of the forest is overgrown with tall " "trees that stretch to the sky. They block out almost " "all sunlight from above making it rather dark as well " "as drop the occassional leaf to the ground."); set_night_long("The forest is nearly completely dark. Any light " "from the moons or stars is completely blocked out from " "the tall overhanging trees."); set_items(([ "forest" : "The forest is thich with trees.", "sky" : "The sky can barely be seen though the tall trees.", "ground" : "The ground is littered with leaves and twigs from " "the tree braches above.", ({"leaves", "leaf", "twig", "twigs", "brach", "bracnches"}): "Leaves and twigs litter the ground.", ({"tree", "trees"}) : "The trees stretch high into the sky.", ])); set_properties(([ "light" : 1, "night light" : 0, ])); set_exits(([ "south" : "/realms/petrarch/forest/f_room3.c", "north" : "/realms/petrarch/forest/f_room1.c", ])); } void reset() { if(!present("gnome")) new("/realms/petrarch/forest/monsters/gnome")->move(this_object()); } <font color=880000> We may also want to limit the monster (or object) so that it appears just ONCE per reboot. In that case we add this instead, and change the create() function as follows.... </font> // A moving Monster, or object that there can only be ONE of at a time void create() { ::create(); set_no_clean(1); set_short("lost in a forest"); set_day_long("This section of the forest is overgrown with tall " "trees that stretch to the sky. They block out almost " . . . } object gnome; void reset() { if(!gnome) { gnome = new("/realms/petrarch/forest/monsters/gnome"); gnome->move(this_object()); } } // A slightly different example where there can only be ONE // object per reboot, so that once it gets destroyed it does // come back either. void create() { ::create(); set_no_clean(1); set_short("lost in a forest"); set_day_long("This section of the forest is overgrown with tall " "trees that stretch to the sky. They block out almost " . . . } int gnome; void reset() { if(!gnome) { gnome = 1; new("/realms/petrarch/forest/monsters/gnome")->move(this_object()); } }