+
+string Weapon_SuicideMessage(float deathtype)
+{
+ w_deathtype = deathtype;
+ get_weaponinfo(DEATH_WEAPONOF(deathtype)).weapon_func(WR_SUICIDEMESSAGE);
+ return w_deathtypestring;
+}
+
+string Weapon_KillMessage(float deathtype)
+{
+ w_deathtype = deathtype;
+ get_weaponinfo(DEATH_WEAPONOF(deathtype)).weapon_func(WR_KILLMESSAGE);
+ return w_deathtypestring;
+}
+
+float killnotify_times[10];
+float killnotify_deathtype[10];
+string killnotify_attackers[10];
+string killnotify_victims[10];
+void HUD_KillNotify_Push(string attacker, string victim, float wpn)
+{
+ float i;
+ for (i = 9; i > 0; --i) {
+ killnotify_times[i] = killnotify_times[i-1];
+ killnotify_deathtype[i] = killnotify_deathtype[i-1];
+ if(killnotify_attackers[i])
+ strunzone(killnotify_attackers[i]);
+ killnotify_attackers[i] = strzone(killnotify_attackers[i-1]);
+ if(killnotify_victims[i])
+ strunzone(killnotify_victims[i]);
+ killnotify_victims[i] = strzone(killnotify_victims[i-1]);
+ }
+ killnotify_times[0] = time;
+ killnotify_deathtype[0] = wpn;
+ if(killnotify_attackers[0])
+ strunzone(killnotify_attackers[0]);
+ killnotify_attackers[0] = strzone(attacker);
+ if(killnotify_victims[0])
+ strunzone(killnotify_victims[0]);
+ killnotify_victims[0] = strzone(victim);
+}
+
+void HUD_KillNotify(string s1, string s2, string s3, float type, float msg)
+{
+ float w;
+ if(msg == MSG_SUICIDE) {
+ HUD_KillNotify_Push(s1, "", DEATH_KILL);
+
+ // TODO: cl_gentle
+ w = DEATH_WEAPONOF(type);
+ if(WEP_VALID(w)) {
+ if (!HUD_Panel_CheckActive(4) || cvar("hud_notify_print"))
+ print("^1", s1, "^1 ", Weapon_SuicideMessage(type), "\n");
+ }
+ else if (type == DEATH_KILL)
+ print ("^1",s1, "^1 couldn't take it anymore\n");
+ else if (type == DEATH_ROT)
+ print ("^1",s1, "^1 died\n");
+ else if (type == DEATH_NOAMMO)
+ print ("^7",s1, "^7 committed suicide. What's the point of living without ammo?\n");
+ else if (type == DEATH_CAMP)
+ print ("^1",s1, "^1 thought they found a nice camping ground\n");
+ else if (type == DEATH_MIRRORDAMAGE)
+ print ("^1",s1, "^1 didn't become friends with the Lord of Teamplay\n");
+ else if (type == DEATH_CHEAT)
+ print ("^1",s1, "^1 unfairly eliminated themself\n");
+ else if (type == DEATH_FIRE)
+ print ("^1",s1, "^1 burned to death\n");
+ else if (type != DEATH_TEAMCHANGE && type != DEATH_QUIET)
+ print ("^1",s1, "^1 couldn't resist the urge to self-destruct\n");
+ if (stof(s2) > 2) // killcount > 2
+ print ("^1",s1,"^1 ended it all after a ",s2," kill spree\n");
+ } else if(msg == MSG_KILL) {
+ w = DEATH_WEAPONOF(type);
+ if(WEP_VALID(w)) {
+ HUD_KillNotify_Push(s2, s1, w);
+ if (!HUD_Panel_CheckActive(4) || cvar("hud_notify_print"))
+ print("^1", s1, "^1 ", Weapon_KillMessage(type), "\n");
+ }
+ else if(type == KILL_TEAM || type == KILL_TEAM_SPREE) {
+ if(cvar("cl_gentle")) {
+ print ("^1", s1, "^1 took action against a team mate\n");
+ } else {
+ print ("^1", s1, "^1 mows down a team mate\n");
+ }
+ if (stof(s2) > 2 && type == KILL_TEAM_SPREE) {
+ if(cvar("cl_gentle"))
+ print ("^1",s1,"^1 ended a ",s2," scoring spree by going against a team mate\n");
+ else
+ print ("^1",s1,"^1 ended a ",s2," kill spree by killing a team mate\n");
+ }
+ else if (stof(s2) > 2) {
+ if(cvar("cl_gentle"))
+ print ("^1",s1,"'s ^1",s2," scoring spree was ended by a team mate!\n");
+ else
+ print ("^1",s1,"'s ^1",s2," kill spree was ended by a team mate!\n");
+ }
+ }
+ else if(type == KILL_FIRST_BLOOD)
+ print("^1",s1, "^1 drew first blood", "\n");
+ else if (type == DEATH_TELEFRAG)
+ print ("^1",s1, "^1 was telefragged by ", s2, "\n");
+ else if (type == DEATH_DROWN) {
+ HUD_KillNotify_Push(s2, s1, DEATH_FALL);
+ print ("^1",s1, "^1 was drowned by ", s2, "\n");
+ }
+ else if (type == DEATH_SLIME) {
+ HUD_KillNotify_Push(s2, s1, DEATH_FALL);
+ print ("^1",s1, "^1 was slimed by ", s2, "\n");
+ }
+ else if (type == DEATH_LAVA) {
+ HUD_KillNotify_Push(s2, s1, DEATH_FALL);
+ print ("^1",s1, "^1 was cooked by ", s2, "\n");
+ }
+ else if (type == DEATH_FALL) {
+ HUD_KillNotify_Push(s2, s1, DEATH_FALL);
+ print ("^1",s1, "^1 was grounded by ", s2, "\n");
+ }
+ else if (type == DEATH_SHOOTING_STAR) {
+ HUD_KillNotify_Push(s2, s1, DEATH_FALL);
+ print ("^1",s1, "^1 was shot into space by ", s2, "\n");
+ }
+ else if (type == DEATH_SWAMP) {
+ HUD_KillNotify_Push(s2, s1, DEATH_FALL);
+ print ("^1",s1, "^1 was conserved by ", s2, "\n");
+ }
+ else if (type == DEATH_HURTTRIGGER && s3 != "")
+ {
+ HUD_KillNotify_Push(s2, s1, DEATH_FALL);
+ // p ?!?! :o
+ //if(p < 0)
+ print("^1", s1, "^1 ", s3, " ", s2, "\n");
+ //else
+ // bprint("^1", s1, "^1 ", substring(s3, 0, p), s2, "^1", substring(s3, p+1, strlen(s3) - (p+1)), "\n");
+ }
+ else if(type == DEATH_SBCRUSH)
+ print ("^1",s1, "^1 was crushed by ^1", s2, "\n");
+ else if(type == DEATH_SBMINIGUN)
+ print ("^1",s1, "^1 got shredded by ^1", s2, "\n");
+ else if(type == DEATH_SBROCKET)
+ print ("^1",s1, "^1 was blased to bits by ^1", s2, "\n");
+ else if(type == DEATH_SBBLOWUP)
+ print ("^1",s1, "^1 got cought in the destruction of ^1", s2, "'s vehicle\n");
+
+ else if(type == DEATH_WAKIGUN)
+ print ("^1",s1, "^1 was bolted down by ^1", s2, "\n");
+ else if(type == DEATH_WAKIROCKET)
+ print ("^1",s1, "^1 could find no shelter from ^1", s2, "'s rockets\n");
+ else if(type == DEATH_WAKIBLOWUP)
+ print ("^1",s1, "^1 dies when ^1", s2, "'s wakizashi dies.\n");
+
+ else if(type == DEATH_TURRET)
+ print ("^1",s1, "^1 was pushed into the line of fire by ^1", s2, "\n");
+ else if(type == DEATH_TOUCHEXPLODE)
+ print ("^1",s1, "^1 was pushed into an accident by ^1", s2, "\n");
+ else if(type == DEATH_CHEAT)
+ print ("^1",s1, "^1 was unfairly eliminated by ^1", s2, "\n");
+ else if (type == DEATH_FIRE)
+ print ("^1",s1, "^1 was burnt to death by ^1", s2, "\n");
+ else if (type == DEATH_CUSTOM)
+ print ("^1",s1, "^1 ", s2, "\n");
+ else
+ print ("^1",s1, "^1 was fragged by ", s2, "\n");
+ } else if(msg == MSG_SPREE) {
+ if(type == KILL_END_SPREE) {
+ if(cvar("cl_gentle"))
+ print ("^1",s1,"'s ^1", s2, " scoring spree was ended by ", s3, "\n");
+ else
+ print ("^1",s1,"'s ^1", s2, " kill spree was ended by ", s3, "\n");
+ } else if(type == KILL_SPREE) {
+ if(cvar("cl_gentle"))
+ print ("^1",s1,"^1 made ",s2," scores in a row\n");
+ else
+ print ("^1",s1,"^1 has ",s2," frags in a row\n");
+ } else if(type == KILL_SPREE_3) {
+ if(cvar("cl_gentle"))
+ print (s1,"^7 made a ^1TRIPLE SCORE\n");
+ else
+ print (s1,"^7 made a ^1TRIPLE FRAG\n");
+ } else if(type == KILL_SPREE_5) {
+ if(cvar("cl_gentle"))
+ print (s1,"^7 unleashes ^1SCORING RAGE\n");
+ else
+ print (s1,"^7 unleashes ^1RAGE\n");
+ } else if(type == KILL_SPREE_10) {
+ if(cvar("cl_gentle"))
+ print (s1,"^7 made ^1TEN SCORES IN A ROW!\n");
+ else
+ print (s1,"^7 starts the ^1MASSACRE!\n");
+ } else if(type == KILL_SPREE_15) {
+ if(cvar("cl_gentle"))
+ print (s1,"^7 made ^1FIFTEEN SCORES IN A ROW!\n");
+ else
+ print (s1,"^7 executes ^1MAYHEM!\n");
+ } else if(type == KILL_SPREE_20) {
+ if(cvar("cl_gentle"))
+ print (s1,"^7 made ^1TWENTY SCORES IN A ROW!\n");
+ else
+ print (s1,"^7 is a ^1BERSERKER!\n");
+ } else if(type == KILL_SPREE_25) {
+ if(cvar("cl_gentle"))
+ print (s1,"^7 made ^1TWENTY FIFE SCORES IN A ROW!\n");
+ else
+ print (s1,"^7 inflicts ^1CARNAGE!\n");
+ } else if(type == KILL_SPREE_30) {
+ if(cvar("cl_gentle"))
+ print (s1,"^7 made ^1THIRTY SCORES IN A ROW!\n");
+ else
+ print (s1,"^7 unleashes ^1ARMAGEDDON!\n");
+ }
+ } else if(msg == MSG_KILL_ACTION) { // wtf is this? isnt it basically the same as MSG_SUICIDE?
+ HUD_KillNotify_Push(s1, "", DEATH_KILL);
+ if (type == DEATH_DROWN) {
+ if(cvar("cl_gentle"))
+ print ("^1",s1, "^1 was in the water for too long\n");
+ else
+ print ("^1",s1, "^1 drowned\n");
+ }
+ else if (type == DEATH_SLIME)
+ print ("^1",s1, "^1 was slimed\n");
+ else if (type == DEATH_LAVA) {
+ if(cvar("cl_gentle"))
+ print ("^1",s1, "^1 found a hot place\n");
+ else
+ print ("^1",s1, "^1 turned into hot slag\n");
+ }
+ else if (type == DEATH_FALL) {
+ if(cvar("cl_gentle"))
+ print ("^1",s1, "^1 tested gravity (and it worked)\n");
+ else
+ print ("^1",s1, "^1 hit the ground with a crunch\n");
+ }
+ else if (type == DEATH_SHOOTING_STAR)
+ print ("^1",s1, "^1 became a shooting star\n");
+ else if (type == DEATH_SWAMP) {
+ if(cvar("cl_gentle"))
+ print ("^1",s1, "^1 discovered a swamp\n");
+ else
+ print ("^1",s1, "^1 is now conserved for centuries to come\n");
+ }
+ else if(type == DEATH_TURRET)
+ print ("^1",s1, "^1 was mowed down by a turret \n");
+ else if (type == DEATH_CUSTOM)
+ print ("^1",s1, "^1 ", s2, "\n");
+ else if(type == DEATH_TOUCHEXPLODE)
+ print ("^1",s1, "^1 died in an accident\n");
+ else if(type == DEATH_CHEAT)
+ print ("^1",s1, "^1 was unfairly eliminated\n");
+ else if(type == DEATH_FIRE) {
+ if(cvar("cl_gentle"))
+ print ("^1",s1, "^1 felt a little hot\n");
+ else
+ print ("^1",s1, "^1 burnt to death\n");
+ }
+ else {
+ if(cvar("cl_gentle"))
+ print ("^1",s1, "^1 needs a restart\n");
+ else
+ print ("^1",s1, "^1 died\n");
+ }
+ } else if(msg == MSG_KILL_ACTION_SPREE) {
+ HUD_KillNotify_Push(s1, "", DEATH_KILL);
+ if(cvar("cl_gentle"))
+ print ("^1",s1,"^1 needs a restart after a ",s2," scoring spree\n");
+ else
+ print ("^1",s1,"^1 died with a ",s2," kill spree\n");
+ } else if(msg == MSG_INFO) {
+ if(type == INFO_GOTFLAG) {
+ HUD_KillNotify_Push(s1, s2, INFO_GOTFLAG);
+ print(s1, "^7 got the ", s2, "\n");
+ } else if(type == INFO_LOSTFLAG) {
+ HUD_KillNotify_Push(s1, s2, INFO_LOSTFLAG);
+ print(s1, "^7 lost the ", s2, "\n");
+ } else if(type == INFO_PICKUPFLAG) {
+ HUD_KillNotify_Push(s1, s2, INFO_GOTFLAG);
+ print(s1, "^7 picked up the ", s2, "\n");
+ } else if(type == INFO_RETURNFLAG) {
+ HUD_KillNotify_Push(s1, s2, INFO_RETURNFLAG);
+ print(s1, "^7 returned the ", s2, "\n");
+ }
+ }
+
+}
+
+#define DAMAGE_CENTERPRINT_SPACER NEWLINES
+
+void HUD_Centerprint(string s1, string s2, float type, float msg)
+{
+ if(msg == MSG_SUICIDE) {
+ if (type == DEATH_TEAMCHANGE) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "You are now on: ", s1));
+ } else if (type == DEATH_AUTOTEAMCHANGE) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "You have been moved into a different team to improve team balance\nYou are now on: ", s1));
+ } else if (type == DEATH_CAMP) {
+ if(cvar("cl_gentle"))
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Reconsider your tactics, camper!"));
+ else
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Die camper!"));
+ } else if (type == DEATH_NOAMMO) {
+ if(cvar("cl_gentle"))
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You are reinserted into the game for running out of ammo..."));
+ else
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were killed for running out of ammo..."));
+ } else if (type == DEATH_ROT) {
+ if(cvar("cl_gentle"))
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You need to preserve your health"));
+ else
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You grew too old without taking your medicine"));
+ } else if (type == DEATH_MIRRORDAMAGE) {
+ if(cvar("cl_gentle"))
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Don't go against team mates!"));
+ else
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Don't shoot your team mates!"));
+ } else if (type == DEATH_QUIET) {
+ // do nothing
+ } else if (type == DEATH_KILL) {
+ if(cvar("cl_gentle"))
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You need to be more careful!"));
+ else
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You killed your own dumb self!"));
+ }
+ } else if(msg == MSG_KILL) {
+ if (type == KILL_TEAM) {
+ if(cvar("cl_gentle")) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Moron! You went against a team mate!"));
+ } else {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Moron! You fragged ", s1, ", a team mate!"));
+ }
+ } else if (type == KILL_FIRST_BLOOD) {
+ if(cvar("cl_gentle")) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1First score"));
+ } else {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1First blood"));
+ }
+ } else if (type == KILL_FIRST_VICTIM) {
+ if(cvar("cl_gentle")) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1First casualty"));
+ } else {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1First victim"));
+ }
+ } else if (type == KILL_TYPEFRAG) { // s2 contains "advanced kill messages" such as ping, handicap...
+ if(cvar("cl_gentle")) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You scored against ^7", s1, "^7 who was typing!", s2));
+ } else {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You typefragged ^7", s1, s2));
+ }
+ } else if (type == KILL_TYPEFRAGGED) {
+ if(cvar("cl_gentle")) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were scored against by ^7", s1, "^7 while you were typing!", s2));
+ } else {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were typefragged by ^7", s1, s2));
+ }
+ } else if (type == KILL_FRAG) {
+ if(cvar("cl_gentle")) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You scored against ^7", s1, s2));
+ } else {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You fragged ^7", s1, s2));
+ }
+ } else if (type == KILL_FRAGGED) {
+ if(cvar("cl_gentle")) {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You were scored against by ^7", s1, s2));
+ } else {
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You were fragged by ^7", s1, s2));
+ }
+ }
+ } else if(msg == MSG_KILL_ACTION) {
+ // TODO: invent more centerprints here?
+ centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Watch your step!", s1));
+ }
+}
+