]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Nix messages too
authorSamual Lenks <samual@xonotic.org>
Tue, 26 Feb 2013 20:36:45 +0000 (15:36 -0500)
committerSamual Lenks <samual@xonotic.org>
Tue, 26 Feb 2013 20:36:45 +0000 (15:36 -0500)
qcsrc/common/constants.qh
qcsrc/common/items.qc
qcsrc/common/items.qh
qcsrc/common/notifications.qh
qcsrc/server/cl_weapons.qc
qcsrc/server/mutators/mutator_nix.qc

index 11d88cfc8e2885e1bd12bc664402a1c9fbeb08a9..70e6c154dcad94cd26b79aa611ea155e1d7a4b7e 100644 (file)
@@ -378,8 +378,6 @@ float WATERLEVEL_SUBMERGED = 3;
 float MAX_SHOT_DISTANCE = 32768;
 
 //centerprint ID list
-float CPID_CTF_CAPTURESHIELD = 2;
-float CPID_NIX_WPNCHANGE = 4;
 float CPID_ROUND_STARTING = 6;
 float CPID_GAME_STARTING = 7;
 float CPID_TIMEOUT_COUNTDOWN = 8;
index 0aebde0af256b3a4a63d8a260030a9df429202c4..c961895d95c157aac7ad2439541f9babbd82f557 100644 (file)
@@ -172,3 +172,13 @@ void W_RandomWeapons(entity e, float n)
        }
        WEPSET_COPY_EA(e, result);
 }
+
+string W_Name(float weaponid)
+{
+       return (get_weaponinfo(weaponid)).message;
+}
+
+float W_AmmoItemCode(float wpn)
+{
+       return (get_weaponinfo(wpn)).items & IT_AMMO;
+}
index c20715d5852c3cbf09eae967424bf50d2a6754b2..ba42d55ac62ecfffe98b046e1465055bbf607ce2 100644 (file)
@@ -242,3 +242,7 @@ string W_FixWeaponOrder_AllowIncomplete(string order);
 string W_FixWeaponOrder_ForceComplete(string order);
 
 void W_RandomWeapons(entity e, float n);
+
+string W_Name(float weaponid);
+
+float W_AmmoItemCode(float wpn);
index 257e007ea1fe97f77c0f788ae8ab076f6fd65c25..140b4adef2b4ddd2440416583872f46030f5e3e3 100644 (file)
@@ -386,9 +386,11 @@ void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration,
        MSG_CENTER_NOTIF(1, CENTER_KEEPAWAY_DROPPED,                            1, 0, "s1",                     CPID_KEEPAWAY,                  "0 0", _("^BG%s^BG has dropped the ball!"), "") \
        MSG_CENTER_NOTIF(1, CENTER_KEEPAWAY_PICKUP,                                     1, 0, "s1",                     CPID_KEEPAWAY,                  "0 0", _("^BG%s^BG has picked up the ball!"), "") \
        MSG_CENTER_NOTIF(1, CENTER_KEEPAWAY_WARN,                                       0, 0, "",                               CPID_KA_WARN,                   "0 0", _("^BGKilling people while you don't have the ball gives no points!"), "") \
-       MSG_CENTER_NOTIF(1, CENTER_LMS_CAMPCHECK,                                       0, 0, "",                               CPID_LMS_CAMP,                  "0 0", _("^K1Don't camp!"), "") \
-       MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO,                                     0, 0, "",                               CPID_MINSTA_FINDAMMO,   "1 9", _("^K1^COUNT^BG left to find some ammo!"), "") \
-       MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO_FIRST,                       0, 0, "",                               CPID_MINSTA_FINDAMMO,   "1 10", _("Get some ammo or you'll be dead in ^K1^COUNT^BG!"), _("Get some ammo! ^K1^COUNT^BG left!")) \
+       MSG_CENTER_NOTIF(1, CENTER_LMS_CAMPCHECK,                                       0, 0, "",                               CPID_LMS_CAMP,                  "0 0", _("^F2Don't camp!"), "") \
+       MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO,                                     0, 0, "",                               CPID_MINSTA_FINDAMMO,   "1 9", _("^F4^COUNT^BG left to find some ammo!"), "") \
+       MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO_FIRST,                       0, 0, "",                               CPID_MINSTA_FINDAMMO,   "1 10", _("^BGGet some ammo or you'll be dead in ^F4^COUNT^BG!"), _("Get some ammo! ^F4^COUNT^BG left!")) \
+       MSG_CENTER_NOTIF(1, CENTER_NIX_COUNTDOWN,                                       0, 2, "weapon",                 CPID_NIX,                               "1 f2", _("^F2^COUNT^BG until weapon change...\nNext weapon: ^F1%s"), "") \
+       MSG_CENTER_NOTIF(1, CENTER_NIX_NEWWEAPON,                                       0, 1, "weapon",                 CPID_NIX,                               "0 0", _("^F2Active weapon: ^F1%s"), "") \
        MSG_CENTER_NOTIF(1, CENTER_JOIN_NOSPAWNS,                                       0, 0, "",                               CPID_PREVENT_JOIN,              "0 0", _("^K1No spawnpoints available!\nHope your team can fix it..."), "") \
        MSG_CENTER_NOTIF(1, CENTER_JOIN_PREVENT,                                        0, 0, "",                               CPID_PREVENT_JOIN,              "0 0", _("^K1You may not join the game at this time.\nThe player limit reached maximum capacity."), "") \
        MSG_CENTER_NOTIF(1, CENTER_OVERTIME_TIME,                                       0, 1, "f1time",                 CPID_OVERTIME,                  "0 0", _("^F2Now playing ^F4OVERTIME^F2!\nAdded ^F4%s ^F2minute(s) to the game!"), "") \
@@ -631,7 +633,7 @@ string arg_slot[NOTIF_MAX_ARGS];
        ARG_CASE(ARG_CS_SV,             "spree_inf",            (autocvar_notification_show_sprees ? notif_arg_spree_inf(1, input, s2, f2) : "")) \
        ARG_CASE(ARG_CS_SV,             "spree_end",            (autocvar_notification_show_sprees ? notif_arg_spree_inf(-1, "", "", f1) : "")) \
        ARG_CASE(ARG_CS_SV,             "spree_lost",           (autocvar_notification_show_sprees ? notif_arg_spree_inf(-2, "", "", f1) : "")) \
-       ARG_CASE(ARG_CS_SV,             "weapon_name",          ftos(f1)) \
+       ARG_CASE(ARG_CS_SV,             "weapon",                       W_Name(f1)) \
        ARG_CASE(ARG_SV,                        "death_team",           Team_ColoredFullName(f1)) \
        ARG_CASE(ARG_CS,                        "death_team",           Team_ColoredFullName(f1 - 1)) \
        ARG_CASE(ARG_CS_SV,                     "race_time",            mmssss(f2)) \
index 4df59a09afde775e7e73cca9fb0be6e248ad1205..cb40be9144d4281a39607ee49505530c8a4348cc 100644 (file)
@@ -158,16 +158,6 @@ float weapon_action(float wpn, float wrequest)
        return (get_weaponinfo(wpn)).weapon_func(wrequest);
 }
 
-string W_Name(float weaponid)
-{
-       return (get_weaponinfo(weaponid)).message;
-}
-
-float W_AmmoItemCode(float wpn)
-{
-       return (get_weaponinfo(wpn)).items & IT_AMMO;
-}
-
 .float savenextthink;
 void thrown_wep_think()
 {
index b492ee60eb48add1046b6278fb171783bc85dea8..d5f95bd3039465f4df277b7ec389f6909a37c549 100644 (file)
@@ -96,7 +96,7 @@ void NIX_GiveCurrentWeapon()
                if(dt >= 1 && dt <= 5)
                        self.nix_lastinfotime = -42;
                else
-                       Send_CSQC_Centerprint_Generic(self, CPID_NIX_WPNCHANGE, strcat("^2Active weapon: ^3", W_Name(nix_weapon)), 0, 0);
+                       Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_NIX_NEWWEAPON, nix_weapon);
 
                weapon_action(nix_weapon, WR_RESETPLAYER);
 
@@ -118,7 +118,7 @@ void NIX_GiveCurrentWeapon()
        {
                self.nix_lastinfotime = dt; // initial value 0 should count as "not seen"
                if(dt >= 1 && dt <= 5)
-                       Send_CSQC_Centerprint_Generic(self, CPID_NIX_WPNCHANGE, strcat("^3%d^2 seconds until weapon change...\n\nNext weapon: ^3", W_Name(nix_nextweapon)), 1, dt);
+                       Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_NIX_COUNTDOWN, nix_nextweapon, dt);
        }
 
        if(!(self.items & IT_UNLIMITED_WEAPON_AMMO) && time > self.nix_nextincr)