void do_installcybernetic( CHAR_DATA * ch, char *argument )
{
CHAR_DATA *victim;
char arg1[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
OBJ_DATA *holdscalpel;
OBJ_DATA *obj;
bool checkcyber;
checkcyber = FALSE;
argument = one_argument( argument, arg1 );
argument = one_argument( argument, arg2 );
if ( arg1[0] == '\0' )
{
send_to_char( "Install what?\n\r", ch );
return;
}
if ( arg2[0] == '\0' )
{
send_to_char( "In who?\n\r", ch );
return;
}
if( IS_NPC( ch ) )
return;
if( ( victim = get_char_room( ch, arg2 ) ) == NULL )
{
send_to_char( "They aren't here.\n\r", ch );
return;
}
if( IS_NPC( victim ) )
{
send_to_char( "You can't install cybernetic parts in NPC's!\n\r", ch );
return;
}
if( IS_IMMORTAL( victim ) )
{
send_to_char( "Don't try to install cybernetic parts on immortals.\n\r", ch );
return;
}
if( ch == victim )
{
send_to_char( "You can't install cybernetics yourself!\n\r", ch );
return;
}
holdscalpel = get_eq_char ( ch, WEAR_HOLD );
if( holdscalpel && !( holdscalpel->item_type == ITEM_SCALPEL ) )
holdscalpel = NULL;
if( !holdscalpel )
{
send_to_char( "You need to be holding a scalpel to preform this surgery.\n\r", ch );
return;
}
/* if (ch->pcdata->maxcybers == ch->pcdata->cybers )
{
send_to_char( "This person can't take any more cybernetics and stay human\n\r", ch );
return;
}*/
for ( obj = ch->last_carrying; obj; obj = obj->prev_content )
{
if (obj->item_type == ITEM_EYECYBER || obj->item_type == ITEM_COMMCYBER ||
obj->item_type == ITEM_LEGCYBER || obj->item_type == ITEM_CHESTCYBER ||
obj->item_type == ITEM_REFLEXCYBER || obj->item_type == ITEM_MINDCYBER ||
obj->item_type == ITEM_STRCYBER || obj->item_type == ITEM_REACTORCYBER)
checkcyber = TRUE;
}
if ( !checkcyber )
{
send_to_char( "&RYou don't seem to have a cybernetic part right now.\n\r", ch);
return;
}
if ( !xIS_SET(ch->in_room->room_flags, ROOM_OPERATINGROOM) )
{
send_to_char ("&R You need to be in an operating room to do this proceedure.\n\r", ch );
return;
}
if ( ms_find_obj(ch) )
return;
obj = get_obj_carry( ch, arg1 );
if (obj->item_type == ITEM_COMMCYBER)
{
if (IS_SET(victim->pcdata->cyber, CYBER_COMM))
{
send_to_char( "&RThey seem to already have that cybernetic part installed.\n\r", ch);
return;
}
checkcyber = TRUE;
separate_obj( obj );
obj_from_char( obj );
extract_obj( obj );
SET_BIT (victim->pcdata->cyber, CYBER_COMM );
}
else if (obj->item_type == ITEM_EYECYBER)
{
if (IS_SET(victim->pcdata->cyber,CYBER_EYES))
{
send_to_char( "&RThey seem to already have that cybernetic part installed.\n\r", ch);
return;
}
SET_BIT (victim->pcdata->cyber, CYBER_EYES );
victim->affected_by = AFF_INFRARED;
}
else if (obj->item_type == ITEM_LEGCYBER)
{
if (IS_SET(victim->pcdata->cyber,CYBER_LEGS))
{
send_to_char( "&RThey seem to already have that cybernetic part installed.\n\r", ch);
return;
}
checkcyber = TRUE;
separate_obj( obj );
obj_from_char( obj );
extract_obj( obj );
SET_BIT (victim->pcdata->cyber, CYBER_LEGS );
victim->max_move += number_range ( 200 , 500 );
}
else if (obj->item_type == ITEM_CHESTCYBER)
{
if (IS_SET(victim->pcdata->cyber,CYBER_CHEST))
{
send_to_char( "&RThey seem to already have that cybernetic part installed.\n\r", ch);
return;
}
checkcyber = TRUE;
separate_obj( obj );
obj_from_char( obj );
extract_obj( obj );
SET_BIT (victim->pcdata->cyber, CYBER_CHEST );
}
else if (obj->item_type == ITEM_REFLEXCYBER)
{
if (IS_SET(victim->pcdata->cyber,CYBER_REFLEXES))
{
send_to_char( "&RThey seem to already have that cybernetic part installed.\n\r", ch);
return;
}
checkcyber = TRUE;
separate_obj( obj );
obj_from_char( obj );
extract_obj( obj );
SET_BIT (victim->pcdata->cyber, CYBER_REFLEXES );
}
else if (obj->item_type == ITEM_REACTORCYBER)
{
if (IS_SET(victim->pcdata->cyber,CYBER_REACTOR))
{
send_to_char( "&RThey seem to already have that cybernetic part installed.\n\r", ch);
return;
}
checkcyber = TRUE;
separate_obj( obj );
obj_from_char( obj );
extract_obj( obj );
SET_BIT (victim->pcdata->cyber, CYBER_REACTOR );
}
else if (obj->item_type == ITEM_MINDCYBER)
{
if (IS_SET(victim->pcdata->cyber,CYBER_MIND))
{
send_to_char( "&RThey seem to already have that cybernetic part installed.\n\r", ch);
return;
}
checkcyber = TRUE;
separate_obj( obj );
obj_from_char( obj );
extract_obj( obj );
SET_BIT (victim->pcdata->cyber, CYBER_MIND );
}
else if (obj->item_type == ITEM_STRCYBER)
{
if (IS_SET(victim->pcdata->cyber,CYBER_STRENGTH))
{
send_to_char( "&RThey seem to already have that cybernetic part installed.\n\r", ch);
return;
}
checkcyber = TRUE;
separate_obj( obj );
obj_from_char( obj );
extract_obj( obj );
SET_BIT (victim->pcdata->cyber, CYBER_STRENGTH );
}
}
|