notify message fixes
authorFruitieX <rasse@rasse-lappy.localdomain>
Thu, 17 Jun 2010 15:40:08 +0000 (18:40 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Thu, 17 Jun 2010 15:40:08 +0000 (18:40 +0300)
qcsrc/client/hud.qc
qcsrc/common/constants.qh
qcsrc/server/g_damage.qc

index d6c6423..da19f03 100644 (file)
@@ -2337,8 +2337,8 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg)
                        HUD_KillNotify_Push(s1, "", 0, DEATH_CAMP);
                        if (alsoprint)
                                print ("^1",s1, "^1 thought they found a nice camping ground\n");
-               } else if (type == DEATH_MIRRORDAMAGE) {
-                       HUD_KillNotify_Push(s1, "", 0, DEATH_MIRRORDAMAGE);
+               } else if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) {
+                       HUD_KillNotify_Push(s1, "", 0, type);
                        if (alsoprint)
                                print ("^1",s1, "^1 didn't become friends with the Lord of Teamplay\n");
                } else if (type == DEATH_CHEAT) {
@@ -2364,8 +2364,8 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg)
                        if (alsoprint)
                                print("^1", s1, "^1 ", Weapon_KillMessage(type), "\n");
                }
-               else if(type == KILL_TEAM || type == KILL_TEAM_SPREE) {
-                       HUD_KillNotify_Push(s1, s2, 1, DEATH_MIRRORDAMAGE);
+               else if(type == KILL_TEAM_RED || type == KILL_TEAM_BLUE || type == KILL_TEAM_SPREE) {
+                       HUD_KillNotify_Push(s1, s2, 1, type);
                        if(alsoprint)
                        {
                                if(cvar("cl_gentle")) {
@@ -2376,15 +2376,15 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg)
                        }
                        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");
+                                       print ("^1",s1,"^1 ended a ",s3," 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");
+                                       print ("^1",s1,"^1 ended a ",s3," 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");
+                                       print ("^1",s1,"'s ^1",s3," 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");
+                                       print ("^1",s1,"'s ^1",s3," kill spree was ended by a team mate!\n");
                        }
                }
                else if(type == KILL_FIRST_BLOOD)
@@ -2657,7 +2657,7 @@ void HUD_Centerprint(string s1, string s2, float type, float msg)
                                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) {
+               } else if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) {
                        if(cvar("cl_gentle"))
                                centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Don't go against team mates!"));
                        else
@@ -2671,9 +2671,9 @@ void HUD_Centerprint(string s1, string s2, float type, float msg)
                                centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You killed your own dumb self!"));
                }
        } else if(msg == MSG_KILL) {
-               if (type == KILL_TEAM) {
+               if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) {
                        if(cvar("cl_gentle")) {
-                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Moron! You went against a team mate!"));
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Moron! You went against", s1, ",a team mate!"));
                        } else {
                                centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Moron! You fragged ", s1, ", a team mate!"));
                        }
@@ -2691,13 +2691,13 @@ void HUD_Centerprint(string s1, string s2, float type, float msg)
                        }
                } 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));
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You scored against ^7", s1, "^1 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));
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were scored against by ^7", s1, "^1 while you were typing!", s2));
                        } else {
                                centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were typefragged by ^7", s1, s2));
                        }
@@ -2709,14 +2709,14 @@ void HUD_Centerprint(string s1, string s2, float type, float msg)
                        }
                } else if (type == KILL_FRAGGED) {
                        if(cvar("cl_gentle")) {
-                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You were scored against by ^7", s1, s2));
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were scored against by ^7", s1, s2));
                        } else {
-                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You were fragged by ^7", s1, s2));
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You 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));
+               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Watch your step!"));
        }
 }
 
@@ -2815,9 +2815,14 @@ void HUD_Notify (void)
                                drawpic_skin(weap_pos, "notify_camping", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
                                drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
                        }
-                       else if(killnotify_deathtype[j] == DEATH_MIRRORDAMAGE)
+                       else if(killnotify_deathtype[j] == KILL_TEAM_RED)
                        {
-                               drawpic_skin(weap_pos, "notify_teamkill", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+                               drawpic_skin(weap_pos, "notify_teamkill", '2 1 0' * height, '1 0 0', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+                               drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+                       }
+                       else if(killnotify_deathtype[j] == KILL_TEAM_BLUE)
+                       {
+                               drawpic_skin(weap_pos, "notify_teamkill", '2 1 0' * height, '0 0 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
                                drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
                        }
                        else if(killnotify_deathtype[j] == DEATH_DROWN)
@@ -2911,9 +2916,15 @@ void HUD_Notify (void)
                                drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
                                drawcolorcodedstring(pos_victim, victim, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
                        }
-                       else if(killnotify_deathtype[j] == DEATH_MIRRORDAMAGE)
+                       else if(killnotify_deathtype[j] == KILL_TEAM_RED)
+                       {
+                               drawpic_skin(weap_pos, "notify_teamkill", '2 1 0' * height, '1 0 0', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+                               drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+                               drawcolorcodedstring(pos_victim, victim, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+                       }
+                       else if(killnotify_deathtype[j] == KILL_TEAM_BLUE)
                        {
-                               drawpic_skin(weap_pos, "notify_teamkill", '2 1 0' * height, '1 1 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
+                               drawpic_skin(weap_pos, "notify_teamkill", '2 1 0' * height, '0 0 1', HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
                                drawcolorcodedstring(pos_attacker, attacker, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
                                drawcolorcodedstring(pos_victim, victim, fontsize, HUD_Panel_GetFgAlpha(id) * a, DRAWFLAG_NORMAL);
                        }
index 5a6bf6c..3e2cf69 100644 (file)
@@ -532,28 +532,29 @@ float MSG_KILL_ACTION = 3;
 float MSG_KILL_ACTION_SPREE = 4;
 float MSG_INFO = 5;
 
-float KILL_TEAM = 10301;
-float KILL_TEAM_SPREE = 10302;
-float KILL_FIRST_BLOOD = 10303;
-float KILL_FIRST_VICTIM = 10304;
-float KILL_TYPEFRAG = 10305;
-float KILL_TYPEFRAGGED = 10306;
-float KILL_FRAG = 10307;
-float KILL_FRAGGED = 10308;
-float KILL_SPREE = 10309;
-float KILL_END_SPREE = 10310;
-float KILL_SPREE_3 = 10311;
-float KILL_SPREE_5 = 10312;
-float KILL_SPREE_10 = 10313;
-float KILL_SPREE_15 = 10314;
-float KILL_SPREE_20 = 10315;
-float KILL_SPREE_25 = 10316;
-float KILL_SPREE_30 = 10317;
-
-float INFO_GOTFLAG = 10318;
-float INFO_PICKUPFLAG = 10319;
-float INFO_LOSTFLAG = 10320;
-float INFO_RETURNFLAG = 10321;
+float KILL_TEAM_RED = 10301;
+float KILL_TEAM_BLUE = 10302;
+float KILL_TEAM_SPREE = 10303;
+float KILL_FIRST_BLOOD = 10304;
+float KILL_FIRST_VICTIM = 10305;
+float KILL_TYPEFRAG = 10306;
+float KILL_TYPEFRAGGED = 10307;
+float KILL_FRAG = 10308;
+float KILL_FRAGGED = 10309;
+float KILL_SPREE = 10310;
+float KILL_END_SPREE = 10311;
+float KILL_SPREE_3 = 10312;
+float KILL_SPREE_5 = 10313;
+float KILL_SPREE_10 = 10314;
+float KILL_SPREE_15 = 10315;
+float KILL_SPREE_20 = 10316;
+float KILL_SPREE_25 = 10317;
+float KILL_SPREE_30 = 10318;
+
+float INFO_GOTFLAG = 10319;
+float INFO_PICKUPFLAG = 10320;
+float INFO_LOSTFLAG = 10321;
+float INFO_RETURNFLAG = 10322;
 
 // weapon requests
 float WR_SETUP         = 1; // (SVQC) setup weapon data
index b8e42bd..30e49cd 100644 (file)
@@ -315,30 +315,42 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
 
                        if (targ.killcount > 2)
                                msg = ftos(targ.killcount);
+                       if(teams_matter && attacker.team == targ.team)
+                       {
+                               if(attacker.team == COLOR_TEAM1)
+                                       deathtype = KILL_TEAM_RED;
+                               else
+                                       deathtype = KILL_TEAM_BLUE;
+                       }
+
                        Send_KillNotification(s, msg, ftos(w), deathtype, MSG_SUICIDE);
                }
                else if (attacker.classname == "player" || attacker.classname == "gib")
                {
                        if(teams_matter && attacker.team == targ.team)
                        {
-                               type = KILL_TEAM;
+                               if(attacker.team == COLOR_TEAM1)
+                                       type = KILL_TEAM_RED;
+                               else
+                                       type = KILL_TEAM_BLUE;
 
                                GiveFrags(attacker, targ, -1);
 
+                               Send_CSQC_Centerprint(attacker, s, "", type, MSG_KILL);
+
                                if (targ.killcount > 2) {
                                        msg = ftos(targ.killcount);
-                                       a = s;
                                }
+
                                if (attacker.killcount > 2) {
                                        msg = ftos(attacker.killcount);
                                        type = KILL_TEAM_SPREE;
                                }
+                               Send_KillNotification(a, s, msg, type, MSG_KILL);
 
                                attacker.killcount = 0;
 
                                LogDeath("tk", deathtype, attacker, targ);
-                               Send_CSQC_Centerprint(attacker, s, "", type, MSG_KILL);
-                               Send_KillNotification(a, msg, "", type, MSG_KILL);
                        }
                        else
                        {