1 | /* |
1 | /* |
2 | * static char *rcsid_attack_c = |
2 | * static char *rcsid_attack_c = |
3 | * "$Id: attack.c,v 1.9 2006/03/31 17:20:10 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) |
… | |
… | |
1653 | #ifdef PROHIBIT_PLAYERKILL |
1651 | #ifdef PROHIBIT_PLAYERKILL |
1654 | if (op->type == PLAYER) { |
1652 | if (op->type == PLAYER) { |
1655 | object *owner = get_owner (hitter); |
1653 | object *owner = get_owner (hitter); |
1656 | if (!owner) owner = hitter; |
1654 | if (!owner) owner = hitter; |
1657 | if (owner->type == PLAYER |
1655 | if (owner->type == PLAYER |
1658 | && (!op_on_battleground (op, 0, 0) || op->contr->peaceful || op->contr->peaceful) |
1656 | && (!op_on_battleground (op, 0, 0) && (op->contr->peaceful || owner->contr->peaceful)) |
1659 | && op != owner) { |
1657 | && op != owner) { |
1660 | return 0; |
1658 | return 0; |
1661 | } |
1659 | } |
1662 | } |
1660 | } |
1663 | #endif |
1661 | #endif |