m_wearable.c

gurba-0.40/lib/std/modules/m_wearable.c · 1.6 KB

From the archive gurba.tgz

Download the archive   « Back to the archive contents

static string slot;
static int worn;
static string wear_message;
static string remove_message;

void create( void ) {
  slot == "";
  wear_message = "$N $vwear $o.";
  remove_message = "$N $vremove $o.";
}

void set_wear_message( string str ) {
  wear_message = str;
}

string query_wear_message( void ) {
  return( wear_message );
}

void set_remove_message( string str ) {
  remove_message = str;
}

string query_remove_message( void ) {
  return( remove_message );
}

int is_wearable( void ) {
  return( 1 );
}

void set_worn( int state ) {
  worn = state;
}

int query_worn( void ) {
  return( worn );
}

int is_worn( void ) {
  return( worn );
}

string query_slot( void ) {
  return( slot );
}

void set_slot( string str ) {
  str = lowercase( str );

  switch( str ) {
  case "torso":
  case "head":
  case "hands":
  case "feet":
  case "arm":
  case "neck":
  case "body":
  case "legs":
  case "waist":
  case "finger":
    break;
  default:
    if( this_player() != 0 ) {
      write( "Illegal bodyslot.\n" );
      return;
    }
    return;
    break;
  }
  slot = str;
}

string query_wear_position( void ) {
  switch( slot ) {
  case "torso":
    return( "on the upper body" );
  case "head":
    return( "on head" );
  case "hands":
    return( "on hands" );
  case "finger":
    return( "on one finger" );
  case "feet":
    return( "on feet" );
  case "arm":
    return( "on an arm" );
  case "neck":
    return( "about the neck" );
  case "body":
    return( "about the body" );
  case "legs":
    return( "on the lower body" );
  case "waist":
    return( "about the waist" );
  default:
    return( "somewhere" );
  }
}

Site Stats

Snippets: 1791
Codebases: 571