src/fight.c
/*
 * Improved Death_cry contributed by Diavolo.
 */
Improved Death_cry contributed by Diavolo.
Improved Death_cry contributed by Diavolo .
void death_cry( CHAR_DATA *ch )
{
    ROOM_INDEX_DATA *was_in_room;
    char *msg;
    int door;
    int vnum;
    vnum = 0;
    msg = "You hear $n's death cry.";
    switch ( number_bits(4))
    {
    case  0: msg  = "$n hits the ground ... DEAD.";			break;
    case  1: 
	if (ch->material == 0)
	{
	    msg  = "$n splatters blood on your armor.";		
	    break;
	}
    case  2: 							
	if (IS_SET(ch->parts,PART_GUTS))
	{
	    msg = "$n spills $s guts all over the floor.";
	    vnum = OBJ_VNUM_GUTS;
	}
	break;
    case  3: 
	if (IS_SET(ch->parts,PART_HEAD))
	{
	    msg  = "$n's severed head plops on the ground.";
	    vnum = OBJ_VNUM_SEVERED_HEAD;				
	}
	break;
    case  4: 
	if (IS_SET(ch->parts,PART_HEART))
	{
	    msg  = "$n's heart is torn from $s chest.";
	    vnum = OBJ_VNUM_TORN_HEART;				
	}
	break;
    case  5: 
	if (IS_SET(ch->parts,PART_ARMS))
	{
	    msg  = "$n's arm is sliced from $s dead body.";
	    vnum = OBJ_VNUM_SLICED_ARM;				
	}
	break;
    case  6: 
	if (IS_SET(ch->parts,PART_LEGS))
	{
	    msg  = "$n's leg is sliced from $s dead body.";
	    vnum = OBJ_VNUM_SLICED_LEG;				
	}
	break;
    case 7:
	if (IS_SET(ch->parts,PART_BRAINS))
	{
	    msg = "$n's head is shattered, and $s brains splash all over you.";
	    vnum = OBJ_VNUM_BRAINS;
	}
    }
    act( msg, ch, NULL, NULL, TO_ROOM );
    if ( vnum != 0 )
    {
	char buf[MAX_STRING_LENGTH];
	OBJ_DATA *obj;
	char *name;
	name		= IS_NPC(ch) ? ch->short_descr : ch->name;
	obj		= create_object( get_obj_index( vnum ), 0 );
	obj->timer	= number_range( 4, 7 );
	sprintf( buf, obj->short_descr, name );
	free_string( obj->short_descr );
	obj->short_descr = str_dup( buf );
	sprintf( buf, obj->description, name );
	free_string( obj->description );
	obj->description = str_dup( buf );
	if (obj->item_type == ITEM_FOOD)
	{
	    if (IS_SET(ch->form,FORM_POISON))
		obj->value[3] = 1;
	    else if (!IS_SET(ch->form,FORM_EDIBLE))
		obj->item_type = ITEM_TRASH;
	}
	obj_to_room( obj, ch->in_room );
    }
    if ( IS_NPC(ch) )
	msg = "You hear something's death cry.";
    else
	msg = "You hear someone's death cry.";
    was_in_room = ch->in_room;
    for ( door = 0; door <= 5; door++ )
    {
	EXIT_DATA *pexit;
	if ( ( pexit = was_in_room->exit[door] ) != NULL
	&&   pexit->u1.to_room != NULL
	&&   pexit->u1.to_room != was_in_room )
	{
	    ch->in_room = pexit->u1.to_room;
	    act( msg, ch, NULL, NULL, TO_ROOM );
	}
    }
    ch->in_room = was_in_room;
    return;
}
void death_cry ( CHAR_DATA * ch ) { ROOM_INDEX_DATA * was_in_room ; char * msg ; int door ; int vnum ; vnum = 0 ; msg = " " ; switch ( number_bits ( 4 ) ) { case 0 : msg = " " ; break ; case 1 : if ( ch -> material == 0 ) { msg = " " ; break ; } case 2 : if ( IS_SET ( ch -> parts , PART_GUTS ) ) { msg = " " ; vnum = OBJ_VNUM_GUTS ; } break ; case 3 : if ( IS_SET ( ch -> parts , PART_HEAD ) ) { msg = " " ; vnum = OBJ_VNUM_SEVERED_HEAD ; } break ; case 4 : if ( IS_SET ( ch -> parts , PART_HEART ) ) { msg = " " ; vnum = OBJ_VNUM_TORN_HEART ; } break ; case 5 : if ( IS_SET ( ch -> parts , PART_ARMS ) ) { msg = " " ; vnum = OBJ_VNUM_SLICED_ARM ; } break ; case 6 : if ( IS_SET ( ch -> parts , PART_LEGS ) ) { msg = " " ; vnum = OBJ_VNUM_SLICED_LEG ; } break ; case 7 : if ( IS_SET ( ch -> parts , PART_BRAINS ) ) { msg = " " ; vnum = OBJ_VNUM_BRAINS ; } } act ( msg , ch , NULL , NULL , TO_ROOM ) ; if ( vnum != 0 ) { char buf [ MAX_STRING_LENGTH ] ; OBJ_DATA * obj ; char * name ; name = IS_NPC ( ch ) ? ch -> short_descr : ch -> name ; obj = create_object ( get_obj_index ( vnum ) , 0 ) ; obj -> timer = number_range ( 4 , 7 ) ; sprintf ( buf , obj -> short_descr , name ) ; free_string ( obj -> short_descr ) ; obj -> short_descr = str_dup ( buf ) ; sprintf ( buf , obj -> description , name ) ; free_string ( obj -> description ) ; obj -> description = str_dup ( buf ) ; if ( obj -> item_type == ITEM_FOOD ) { if ( IS_SET ( ch -> form , FORM_POISON ) ) obj -> value [ 3 ] = 1 ; else if ( ! IS_SET ( ch -> form , FORM_EDIBLE ) ) obj -> item_type = ITEM_TRASH ; } obj_to_room ( obj , ch -> in_room ) ; } if ( IS_NPC ( ch ) ) msg = " " ; else msg = " " ; was_in_room = ch -> in_room ; for ( door = 0 ; door <= 5 ; door ++ ) { EXIT_DATA * pexit ; if ( ( pexit = was_in_room -> exit [ door ] ) != NULL && pexit -> u1 . to_room != NULL && pexit -> u1 . to_room != was_in_room ) { ch -> in_room = pexit -> u1 . to_room ; act ( msg , ch , NULL , NULL , TO_ROOM ) ; } } ch -> in_room = was_in_room ; return ; }
Improved Death_cry contributed by Diavolo.
Improved Death_cry contributed by Diavolo .