wear.c

gurba-0.40/lib/cmds/player/wear.c · 551 B

From the archive gurba.tgz

Download the archive   « Back to the archive contents

void main( string str ) {
  object obj;
  object worn;

  obj = this_player()->find_object( lowercase( str ) );
  if( obj == 0 ) {
    write( "Maybe you should get one first?" );
    return;
  }
  if( obj->is_wearable() == 0 ) {
    write( "You can't wear that." );
    return;
  }

  worn = this_player()->query_slot( obj->query_slot() );
  if( worn != 0 ) {
    write("You're already wearing a " + worn->query_id() + "." );
    return;
  }
  
  this_player()->do_wear( obj );
  this_player()->targetted_action( obj->query_wear_message(), 0, obj );
}

Site Stats

Snippets: 1791
Codebases: 571