1 | /* |
1 | /* |
2 | * static char *rcsid_attack_c = |
2 | * static char *rcsid_attack_c = |
3 | * "$Id: attack.c,v 1.10 2006/03/31 17:33:40 root Exp $"; |
3 | * "$Id: attack.c,v 1.11 2006/04/24 05:54:31 root Exp $"; |
4 | */ |
4 | */ |
5 | /* |
5 | /* |
6 | CrossFire, A Multiplayer game for X-windows |
6 | CrossFire, A Multiplayer game for X-windows |
7 | |
7 | |
8 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
8 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
… | |
… | |
562 | /* scale down magic considerably. */ |
562 | /* scale down magic considerably. */ |
563 | if (type & AT_MAGIC && rndm(0, 5)) |
563 | if (type & AT_MAGIC && rndm(0, 5)) |
564 | return; |
564 | return; |
565 | |
565 | |
566 | /* Did a player hurt another player? Inform both! */ |
566 | /* Did a player hurt another player? Inform both! */ |
567 | /* only show half the player->player combat messages */ |
|
|
568 | if(op->type==PLAYER && rndm(0, 1) && |
567 | if(op->type==PLAYER && |
569 | (get_owner(hitter)==NULL?hitter->type:hitter->owner->type)==PLAYER) { |
568 | (get_owner(hitter)==NULL?hitter->type:hitter->owner->type)==PLAYER) { |
570 | if(get_owner(hitter)!=NULL) |
569 | if(get_owner(hitter)!=NULL) |
571 | sprintf(buf,"%s's %s %s you.", |
570 | sprintf(buf,"%s's %s %s you.", |
572 | hitter->owner->name, hitter->name, buf2); |
571 | hitter->owner->name, hitter->name, buf2); |
573 | else { |
572 | else { |
… | |
… | |
582 | } |
581 | } |
583 | } |
582 | } |
584 | new_draw_info(NDI_BLACK, 0,op,buf); |
583 | new_draw_info(NDI_BLACK, 0,op,buf); |
585 | } /* end of player hitting player */ |
584 | } /* end of player hitting player */ |
586 | |
585 | |
587 | /* scale down these messages too */ |
|
|
588 | if(hitter->type==PLAYER && rndm(0, 2) == 0) { |
586 | if(hitter->type==PLAYER) { |
589 | sprintf(buf,"You %s.",buf1); |
587 | sprintf(buf,"You %s.",buf1); |
590 | if (dam != 0) { |
588 | if (dam != 0) { |
591 | if (dam < 10) |
589 | if (dam < 10) |
592 | play_sound_player_only(hitter->contr, SOUND_PLAYER_HITS1,0,0); |
590 | play_sound_player_only(hitter->contr, SOUND_PLAYER_HITS1,0,0); |
593 | else if (dam < 20) |
591 | else if (dam < 20) |