]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Adapt keepaway to use Send_KillNotification; code is complete, just needs new images...
authorunknown <samual@xonotic.org>
Thu, 25 Nov 2010 11:59:09 +0000 (06:59 -0500)
committerunknown <samual@xonotic.org>
Thu, 25 Nov 2010 11:59:09 +0000 (06:59 -0500)
qcsrc/client/hud.qc
qcsrc/common/constants.qh
qcsrc/server/mutators/gamemode_keepaway.qc

index ddffdcc8d1075c41d706d507f7ed19f43e3bee46..74c7b8d28b03ca801ebcea36678fe3f2c7e3a094 100644 (file)
@@ -2974,6 +2974,17 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s
                else if(type == RACE_FAIL) {
                        HUD_KillNotify_Push(s1, s2, 1, RACE_FAIL);
                }
+       } else if(msg == MSG_KA) {
+               if(type == KA_PICKUPBALL) {
+                       HUD_KillNotify_Push(s1, s2, 0, KA_PICKUPBALL);
+                       if(alsoprint)
+                               print (s1, "^7 has picked up the ball!\n");
+               }
+               else if(type == KA_DROPBALL) {
+                       HUD_KillNotify_Push(s1, s2, 0, KA_DROPBALL);
+                       if(alsoprint)
+                               print(s1, "^7 has dropped the ball!\n");
+               }
        }
 }
 
@@ -3253,6 +3264,15 @@ void HUD_Notify (void)
                                        s = "notify_blue_captured";
                                }
                        }
+                       else if(killnotify_deathtype[j] == KA_DROPBALL)
+                       {
+                               s = "notify_blue_lost";
+                       }
+                       else if(killnotify_deathtype[j] == KA_PICKUPBALL)
+                       {
+                               s = "notify_blue_captured";
+                       }
+                       
                        attacker = textShortenToWidth(killnotify_attackers[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors);
                        pos_attacker = pos + eX * (0.52 * mySize_x + height) + eY * (0.5 * fontsize_y + i * height);
                        weap_pos = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height;
index da40ae2cb3965413d5ea2f887076bafab75839e0..576be7c56832b762ec854735fd5dee82f9c16e9d 100644 (file)
@@ -567,7 +567,7 @@ float MSG_SPREE = 2;
 float MSG_KILL_ACTION = 3;
 float MSG_KILL_ACTION_SPREE = 4;
 float MSG_INFO = 5;
-
+float MSG_KA = 6;
 float MSG_RACE = 10;
 
 float KILL_TEAM_RED = 10301;
@@ -595,6 +595,9 @@ float INFO_LOSTFLAG = 10321;
 float INFO_RETURNFLAG = 10322;
 float INFO_CAPTUREFLAG = 10323;
 
+float KA_PICKUPBALL = 10350;
+float KA_DROPBALL = 10351;
+
 float RACE_SERVER_RECORD = 10400;
 float RACE_NEW_TIME = 10401;
 float RACE_NEW_RANK = 10402;
index 8acb81fb8bf1c2b334b4d0a6ff767db8b19a69c9..be5435c82a0b4784d2bbb35cec41da68ad870c5a 100644 (file)
@@ -118,8 +118,8 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth
        other.effects |= 8;
        other.alpha = 0.6;
 
-       // messages and prints
-       bprint(other.netname, "^7 has picked up the ball!\n");
+       // messages and sounds
+       Send_KillNotification(other.netname, "", "", KA_PICKUPBALL, MSG_KA);
        WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
        WriteString(MSG_BROADCAST, strcat("\n\n", other.netname, "^7 has picked up the ball!\n"));
        sound(self.owner, CHAN_AUTO, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE);
@@ -162,8 +162,8 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        plyr.alpha = 1.0;
        plyr.glow_trail = FALSE;
        
-       // messages and prints
-       bprint(plyr.netname, "^7 has dropped the ball!\n");
+       // messages and sounds
+       Send_KillNotification(plyr.netname, "", "", KA_DROPBALL, MSG_KA);
        WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
        WriteString(MSG_BROADCAST, strcat("\n\n", plyr.netname, "^7 has dropped the ball!\n"));
        sound(other, CHAN_AUTO, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE);