dest.c

gurba-0.40/lib/cmds/wiz/dest.c · 1.1 KB

From the archive gurba.tgz

Download the archive   « Back to the archive contents

void main( string str ) {
   object ob;

   ob = this_player()->query_environment()->find_object( str );
   if( ob != 0 ) {
      if( ob->is_player() == 1) {
         this_player()->simple_action( "$N $vtry to dest a player, and $vfail miserably.\n" );
      } else {
         this_player()->simple_action( "$N $vtouch the " + ob->query_id() + ", and it disappears.\n" );
         if( ob->query_environment() != 0 ) {
            ob->query_environment()->remove_object( ob );
         }
         ob->destruct();
      }
   }
   else if( this_player()->find_object( str ) ) {
      ob = this_player()->find_object( str );
      if( ob != 0 ) {
         if( ob->is_player() == 1) {
            this_player()->simple_action( "$N $vtry to dest a player, and $vfail miserably.\n" );
         }
         else {
            this_player()->simple_action( "$N $vtouch the " + ob->query_id() + ", and it disappears.\n" );
            if( ob->query_environment() != 0 ) {
               ob->query_environment()->remove_object( ob );
            }
            ob->destruct();
         }
      } 
   }
   else {
      write( "You can't seem to find the " + str + ".\n" );
   }
}

Site Stats

Snippets: 1791
Codebases: 571