From: unknown Date: Thu, 25 Nov 2010 11:59:09 +0000 (-0500) Subject: Adapt keepaway to use Send_KillNotification; code is complete, just needs new images... X-Git-Tag: xonotic-v0.1.0preview~86^2~2^2~1^2~9 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=b34fc8210b8f92e55a622147b1398f5e2899ab43;hp=7eb1015823c7b86bd36ad10be79701239e695dec Adapt keepaway to use Send_KillNotification; code is complete, just needs new images for it. --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index ddffdcc8d1..74c7b8d28b 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -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; diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index da40ae2cb3..576be7c568 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -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; diff --git a/qcsrc/server/mutators/gamemode_keepaway.qc b/qcsrc/server/mutators/gamemode_keepaway.qc index 8acb81fb8b..be5435c82a 100644 --- a/qcsrc/server/mutators/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/gamemode_keepaway.qc @@ -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);