… | |
… | |
616 | { |
616 | { |
617 | sprintf (buf, "%s%s you.", &hitter->name, buf2); |
617 | sprintf (buf, "%s%s you.", &hitter->name, buf2); |
618 | if (dam != 0) |
618 | if (dam != 0) |
619 | { |
619 | { |
620 | if (dam < 10) |
620 | if (dam < 10) |
621 | play_sound_player_only (op->contr, SOUND_PLAYER_IS_HIT1, 0, 0); |
621 | op->contr->play_sound (sound_find ("player_is_hit1")); |
622 | else if (dam < 20) |
622 | else if (dam < 20) |
623 | play_sound_player_only (op->contr, SOUND_PLAYER_IS_HIT2, 0, 0); |
623 | op->contr->play_sound (sound_find ("player_is_hit2")); |
624 | else |
624 | else |
625 | play_sound_player_only (op->contr, SOUND_PLAYER_IS_HIT3, 0, 0); |
625 | op->contr->play_sound (sound_find ("player_is_hit3")); |
626 | } |
626 | } |
627 | } |
627 | } |
|
|
628 | |
628 | new_draw_info (NDI_BLACK, 0, op, buf); |
629 | new_draw_info (NDI_BLACK, 0, op, buf); |
629 | } /* end of player hitting player */ |
630 | } /* end of player hitting player */ |
630 | |
631 | |
631 | if (hitter->type == PLAYER) |
632 | if (hitter->type == PLAYER) |
632 | { |
633 | { |
633 | sprintf (buf, "You %s.", buf1); |
634 | sprintf (buf, "You %s.", buf1); |
634 | if (dam != 0) |
635 | if (dam != 0) |
635 | { |
636 | { |
636 | if (dam < 10) |
637 | if (dam < 10) |
637 | play_sound_player_only (hitter->contr, SOUND_PLAYER_HITS1, 0, 0); |
638 | op->contr->play_sound (sound_find ("player_hits1")); |
638 | else if (dam < 20) |
639 | else if (dam < 20) |
639 | play_sound_player_only (hitter->contr, SOUND_PLAYER_HITS2, 0, 0); |
640 | op->contr->play_sound (sound_find ("player_hits2")); |
640 | else |
641 | else |
641 | play_sound_player_only (hitter->contr, SOUND_PLAYER_HITS3, 0, 0); |
642 | op->contr->play_sound (sound_find ("player_hits3")); |
642 | } |
643 | } |
|
|
644 | |
643 | new_draw_info (NDI_BLACK, 0, hitter, buf); |
645 | new_draw_info (NDI_BLACK, 0, hitter, buf); |
644 | } |
646 | } |
645 | else if (hitter->owner != NULL && hitter->owner->type == PLAYER) |
647 | else if (hitter->owner != NULL && hitter->owner->type == PLAYER) |
646 | { |
648 | { |
647 | /* look for stacked spells and start reducing the message chances */ |
649 | /* look for stacked spells and start reducing the message chances */ |
… | |
… | |
656 | if (next) |
658 | if (next) |
657 | while (next) |
659 | while (next) |
658 | { |
660 | { |
659 | if (next->type == SPELL_EFFECT && (next->subtype == SP_EXPLOSION || next->subtype == SP_BULLET || next->subtype == SP_CONE)) |
661 | if (next->type == SPELL_EFFECT && (next->subtype == SP_EXPLOSION || next->subtype == SP_BULLET || next->subtype == SP_CONE)) |
660 | i *= 3; |
662 | i *= 3; |
|
|
663 | |
661 | tmp = next; |
664 | tmp = next; |
662 | next = tmp->above; |
665 | next = tmp->above; |
663 | } |
666 | } |
664 | |
667 | |
665 | if (i < 0) |
668 | if (i < 0) |
… | |
… | |
670 | } |
673 | } |
671 | else if (rndm (0, 5) != 0) |
674 | else if (rndm (0, 5) != 0) |
672 | return; |
675 | return; |
673 | |
676 | |
674 | sprintf (buf, "Your %s%s %s.", &hitter->name, buf2, &op->name); |
677 | sprintf (buf, "Your %s%s %s.", &hitter->name, buf2, &op->name); |
675 | play_sound_map (op->map, op->x, op->y, SOUND_PLAYER_HITS4); |
678 | op->play_sound (sound_find ("player_hits4")); |
676 | new_draw_info (NDI_BLACK, 0, hitter->owner, buf); |
679 | new_draw_info (NDI_BLACK, 0, hitter->owner, buf); |
677 | } |
680 | } |
678 | } |
681 | } |
679 | |
682 | |
680 | |
683 | |
… | |
… | |
1474 | else |
1477 | else |
1475 | new_draw_info_format (NDI_BLACK, 0, owner, "You killed %s.", query_name (op)); |
1478 | new_draw_info_format (NDI_BLACK, 0, owner, "You killed %s.", query_name (op)); |
1476 | |
1479 | |
1477 | /* Only play sounds for melee kills */ |
1480 | /* Only play sounds for melee kills */ |
1478 | if (hitter->type == PLAYER) |
1481 | if (hitter->type == PLAYER) |
1479 | play_sound_map (owner->map, owner->x, owner->y, SOUND_PLAYER_KILLS); |
1482 | owner->play_sound (sound_find ("player_kills")); |
1480 | } |
1483 | } |
1481 | |
1484 | |
1482 | /* If a player kills another player, not on |
1485 | /* If a player kills another player, not on |
1483 | * battleground, the "killer" looses 1 luck. Since this is |
1486 | * battleground, the "killer" looses 1 luck. Since this is |
1484 | * not reversible, it's actually quite a pain IMHO. -AV |
1487 | * not reversible, it's actually quite a pain IMHO. -AV |
… | |
… | |
1620 | { |
1623 | { |
1621 | object *owner1 = op->owner; |
1624 | object *owner1 = op->owner; |
1622 | |
1625 | |
1623 | if (owner1 && owner1->type == PLAYER) |
1626 | if (owner1 && owner1->type == PLAYER) |
1624 | { |
1627 | { |
1625 | play_sound_player_only (owner1->contr, SOUND_PET_IS_KILLED, 0, 0); |
1628 | owner1->contr->play_sound (sound_find ("pet_is_killed")); |
1626 | /* Maybe we should include the owner that killed this, maybe not */ |
1629 | /* Maybe we should include the owner that killed this, maybe not */ |
1627 | new_draw_info_format (NDI_UNIQUE, 0, owner1, "Your pet, the %s, is killed by %s.", &op->name, &hitter->name); |
1630 | new_draw_info_format (NDI_UNIQUE, 0, owner1, "Your pet, the %s, is killed by %s.", &op->name, &hitter->name); |
1628 | } |
1631 | } |
1629 | |
1632 | |
1630 | remove_friendly_object (op); |
1633 | remove_friendly_object (op); |