Lines 56-61
Link Here
|
56 |
last_weapon = WEAPON_HAMMER; |
56 |
last_weapon = WEAPON_HAMMER; |
57 |
queued_weapon = -1; |
57 |
queued_weapon = -1; |
58 |
|
58 |
|
|
|
59 |
if(game.controller->is_instagib()) |
60 |
{ |
61 |
active_weapon = WEAPON_RIFLE; |
62 |
last_weapon = WEAPON_RIFLE; |
63 |
queued_weapon = -1; |
64 |
} |
65 |
|
59 |
//clear(); |
66 |
//clear(); |
60 |
this->player = player; |
67 |
this->player = player; |
61 |
this->pos = pos; |
68 |
this->pos = pos; |
Lines 662-667
Link Here
|
662 |
dbg_msg("game", "kill killer='%d:%s' victim='%d:%s' weapon=%d special=%d", |
669 |
dbg_msg("game", "kill killer='%d:%s' victim='%d:%s' weapon=%d special=%d", |
663 |
killer, server_clientname(killer), |
670 |
killer, server_clientname(killer), |
664 |
player->client_id, server_clientname(player->client_id), weapon, mode_special); |
671 |
player->client_id, server_clientname(player->client_id), weapon, mode_special); |
|
|
672 |
|
673 |
if(on_spree()) |
674 |
{ |
675 |
game.create_sound(pos, SOUND_GRENADE_EXPLODE); |
676 |
game.create_explosion(pos, player->client_id, WEAPON_RIFLE, true); |
677 |
} |
678 |
|
679 |
if(game.get_player_char(killer)) |
680 |
game.get_player_char(killer)->spree_add(); |
681 |
spree_end(killer); |
665 |
|
682 |
|
666 |
// send the kill message |
683 |
// send the kill message |
667 |
NETMSG_SV_KILLMSG msg; |
684 |
NETMSG_SV_KILLMSG msg; |
Lines 694-705
Link Here
|
694 |
player->respawn_tick = server_tick()+server_tickspeed()/2; |
711 |
player->respawn_tick = server_tick()+server_tickspeed()/2; |
695 |
} |
712 |
} |
696 |
|
713 |
|
|
|
714 |
char spree_note[4][32] = { "is on a killing spree", "is on a rampage", "is dominating", "is unstoppable" }; |
715 |
|
716 |
void CHARACTER::spree_add() |
717 |
{ |
718 |
spree++; |
719 |
if(spree % 5 == 0) |
720 |
{ |
721 |
int p = (int)spree/5-1; |
722 |
if(p > 3) |
723 |
p = 3; |
724 |
char buf[256]; |
725 |
str_format(buf, sizeof(buf), "%s %s with %d kills!", server_clientname(player->client_id), spree_note[p], spree); |
726 |
game.send_chat(-1, GAMECONTEXT::CHAT_ALL, buf); |
727 |
} |
728 |
} |
729 |
|
730 |
void CHARACTER::spree_end(int killer) |
731 |
{ |
732 |
if(spree >= 5) |
733 |
{ |
734 |
char buf[256]; |
735 |
str_format(buf, sizeof(buf), "%s %d-kills killing spree was ended by %s", server_clientname(player->client_id), spree, server_clientname(killer)); |
736 |
game.send_chat(-1, GAMECONTEXT::CHAT_ALL, buf); |
737 |
} |
738 |
spree = 0; |
739 |
} |
740 |
|
741 |
bool CHARACTER::on_spree() |
742 |
{ |
743 |
if(spree >= 5) |
744 |
return true; |
745 |
return false; |
746 |
} |
747 |
|
697 |
bool CHARACTER::take_damage(vec2 force, int dmg, int from, int weapon) |
748 |
bool CHARACTER::take_damage(vec2 force, int dmg, int from, int weapon) |
698 |
{ |
749 |
{ |
699 |
core.vel += force; |
750 |
core.vel += force; |
700 |
|
751 |
|
701 |
if(game.controller->is_friendly_fire(player->client_id, from) && !config.sv_teamdamage) |
752 |
if(game.controller->is_friendly_fire(player->client_id, from) && !config.sv_teamdamage) |
702 |
return false; |
753 |
return false; |
|
|
754 |
|
755 |
if(game.controller->is_instagib() && weapon == WEAPON_GAME) |
756 |
return false; |
757 |
|
758 |
if(game.controller->is_instagib()) |
759 |
{ |
760 |
game.create_sound(pos, SOUND_HIT, cmask_one(from)); |
761 |
die(from, weapon); |
762 |
return true; |
763 |
} |
703 |
|
764 |
|
704 |
// player only inflicts half damage on self |
765 |
// player only inflicts half damage on self |
705 |
if(from == player->client_id) |
766 |
if(from == player->client_id) |