DESOLATION

Help manual · Example Code

Example item

Example Item.

//inherits object
inherit OBJ;
// is able to be opened
inherit M_OPENABLE;
// is able to be taken
inherit M_GETTABLE;

void setup(){
  // view: tiny little music-box
  set_adj("tiny little");
  set_id("%^YELLOW%^music-box%^RESET%^", "music-box", "music box", "box", "musicbox",);
  // in room desc
  set_in_room_desc( "A tiny little %^YELLOW%^music-box%^RESET%^ lays here in the dust..");
   
  set_size(VERY_SMALL);
  set_long("This tiny little music box fits squarely in the average person's "  
  "hand. It's circular in shape. It's made of brass.. where it used to perhaps "
  "shine brightly, a golden colour when polished, it's just dull. Intricate "
  "designs on its cover are worn down, scratched, a memory of the past. The cover "
  "also used to pack some cloth, probably some elaborate stitching, a pattern or a "
  "picture. Another artifact of the past. Another ghost of the world that once "
  "was.");
}

// special feature that occurs when opened
void do_on_open(){
  this_body()->simple_action("$N gingerly $vopen the little music-box. A tiny "
  "tune plays from the music box, a tune that has been many a day repeated, a "
  "beautiful, sad, lonely little tune, each note from the mechanism inside the "
  "little box striking a chord within your heart. Slowly, $n $vclose the box."); 
   set_closed(1);
}

Category: Example Code