]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'Mario/notifications' into 'master'
authorMario <zacjardine@y7mail.com>
Sat, 20 Dec 2014 05:05:16 +0000 (05:05 +0000)
committerMario <zacjardine@y7mail.com>
Sat, 20 Dec 2014 05:05:16 +0000 (05:05 +0000)
Merge branch Mario/notifications (M merge request)

Moves some prints into the notifications system.

See merge request !63

14 files changed:
qcsrc/common/notifications.qh
qcsrc/common/weapons/w_minelayer.qc
qcsrc/common/weapons/w_porto.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_physics.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/g_triggers.qc
qcsrc/server/item_key.qc
qcsrc/server/mutators/gamemode_assault.qc
qcsrc/server/mutators/gamemode_onslaught.qc
qcsrc/server/mutators/mutator_superspec.qc
qcsrc/server/t_items.qc
qcsrc/server/t_plats.qc

index a17f703ff5fb5d76247e75acb37e58e8a42ee21e..0bfd2e5f3075f60746f5160b137ece590c4f43cc 100644 (file)
@@ -340,6 +340,11 @@ void Send_Notification_WOCOVA(
 
 #define MSG_INFO_NOTIFICATIONS \
     MSG_INFO_NOTIF(2, INFO_CHAT_NOSPECTATORS,              0, 0, "", "",                            "",                     _("^F4NOTE: ^BGSpectator chat is not sent to players during the match"), "") \
+    MSG_INFO_NOTIF(2, INFO_COINTOSS,                       1, 0, "s1", "",                          "",                     _("^F2Throwing coin... Result: %s^F2!"), "") \
+    MSG_INFO_NOTIF(1, INFO_JETPACK_NOFUEL,                 0, 0, "", "",                            "",                     _("^BGYou don't have any fuel for the ^F1Jetpack"), "") \
+    MSG_INFO_NOTIF(2, INFO_SUPERSPEC_MISSING_UID,          0, 0, "", "",                            "",                     _("^F2You lack a UID, superspec options will not be saved/restored"), "") \
+    MSG_INFO_NOTIF(1, INFO_CA_JOIN_LATE,                   0, 0, "", "",                            "",                     _("^F1Round already started, you will join the game in the next round"), "") \
+    MSG_INFO_NOTIF(1, INFO_CA_LEAVE,                       0, 0, "", "",                            "",                     _("^F2You will spectate in the next round"), "") \
     MULTITEAM_INFO(1, INFO_CTF_CAPTURE_, 2,                1, 0, "s1", "s1",                        "notify_%s_captured",   _("^BG%s^BG captured the ^TC^TT^BG flag"), "") \
     MULTITEAM_INFO(1, INFO_CTF_CAPTURE_BROKEN_, 2,         2, 2, "s1 f1p2dec s2 f2p2dec", "s1",     "notify_%s_captured",   _("^BG%s^BG captured the ^TC^TT^BG flag in ^F1%s^BG seconds, breaking ^BG%s^BG's previous record of ^F2%s^BG seconds"), "") \
     MULTITEAM_INFO(1, INFO_CTF_CAPTURE_TIME_, 2,           1, 1, "s1 f1p2dec", "s1",                "notify_%s_captured",   _("^BG%s^BG captured the ^TC^TT^BG flag in ^F1%s^BG seconds"), "") \
@@ -438,8 +443,6 @@ void Send_Notification_WOCOVA(
     MSG_INFO_NOTIF(1, INFO_DEATH_SELF_VH_WAKI_ROCKET,      2, 1, "s1 s2loc spree_lost", "s1",       "notify_death",         _("^BG%s^K1 couldn't find shelter from a Racer rocket%s%s"), "") \
     MSG_INFO_NOTIF(1, INFO_DEATH_SELF_VOID,                2, 1, "s1 s2loc spree_lost", "s1",       "notify_void",          _("^BG%s^K1 was in the wrong place%s%s"), "") \
     MULTITEAM_INFO(1, INFO_DEATH_TEAMKILL_, 4,             3, 1, "s1 s2 s3loc spree_end", "s2 s1",  "notify_teamkill_%s",   _("^BG%s^K1 was betrayed by ^BG%s^K1%s%s"), "") \
-    MSG_INFO_NOTIF(1, INFO_CA_JOIN_LATE,                   0, 0, "", "",                            "",                     _("^F1Round already started, you will join the game in the next round"), "") \
-    MSG_INFO_NOTIF(1, INFO_CA_LEAVE,                       0, 0, "", "",                            "",                     _("^F2You will spectate in the next round"), "") \
     MSG_INFO_NOTIF(1, INFO_DOMINATION_CAPTURE_TIME,        2, 2, "s1 s2 f1 f2", "",                 "",                     _("^BG%s^BG%s^BG (%s points every %s seconds)"), "") \
     MSG_INFO_NOTIF(1, INFO_FREEZETAG_FREEZE,               2, 0, "s1 s2", "",                       "",                     _("^BG%s^K1 was frozen by ^BG%s"), "") \
     MSG_INFO_NOTIF(1, INFO_FREEZETAG_REVIVED,              2, 0, "s1 s2", "",                       "",                     _("^BG%s^K3 was revived by ^BG%s"), "") \
@@ -530,6 +533,7 @@ void Send_Notification_WOCOVA(
     MSG_INFO_NOTIF(1, INFO_WEAPON_KLEINBOTTLE_SUICIDE,           2, 1, "s1 s2loc spree_lost", "s1",                 "weapontuba",             _("^BG%s^K1 hurt their own ears with the @!#%%'n Klein Bottle%s%s"), "") \
     MSG_INFO_NOTIF(1, INFO_WEAPON_MACHINEGUN_MURDER_SNIPE,       3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1",  "weaponuzi",              _("^BG%s%s^K1 was sniped by ^BG%s^K1's Machine Gun%s%s"), "") \
     MSG_INFO_NOTIF(1, INFO_WEAPON_MACHINEGUN_MURDER_SPRAY,       3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1",  "weaponuzi",              _("^BG%s%s^K1 was riddled full of holes by ^BG%s^K1's Machine Gun%s%s"), "") \
+    MSG_INFO_NOTIF(1, INFO_WEAPON_MINELAYER_LIMIT,               0, 1, "f1", "",                                    "",                       _("^BGYou cannot place more than ^F2%s^BG mines at a time"), "") \
     MSG_INFO_NOTIF(1, INFO_WEAPON_MINELAYER_MURDER,              3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1",  "weaponminelayer",        _("^BG%s%s^K1 got too close to ^BG%s^K1's mine%s%s"), "") \
     MSG_INFO_NOTIF(1, INFO_WEAPON_MINELAYER_SUICIDE,             2, 1, "s1 s2loc spree_lost", "s1",                 "weaponminelayer",        _("^BG%s^K1 forgot about their mine%s%s"), "") \
     MSG_INFO_NOTIF(1, INFO_WEAPON_MORTAR_MURDER_BOUNCE,          3, 2, "spree_inf s1 s2 s3loc spree_end", "s2 s1",  "weapongrenadelauncher",  _("^BG%s%s^K1 got too close to ^BG%s^K1's Mortar grenade%s%s"), "") \
@@ -583,6 +587,7 @@ void Send_Notification_WOCOVA(
     MSG_CENTER_NOTIF(1, CENTER_ROUND_TIED,                  0, 0, "",             CPID_ROUND,          "0 0", _("^BGRound tied"), "") \
     MSG_CENTER_NOTIF(1, CENTER_ROUND_OVER,                  0, 0, "",             CPID_ROUND,          "0 0", _("^BGRound over, there's no winner"), "") \
     MSG_CENTER_NOTIF(1, CENTER_CAMPCHECK,                   0, 0, "",             CPID_CAMPCHECK,      "0 0", _("^F2Don't camp!"), "") \
+    MSG_CENTER_NOTIF(1, CENTER_COINTOSS,                    1, 0, "s1",           NO_CPID,             "0 0", _("^F2Throwing coin... Result: %s^F2!"), "") \
     MSG_CENTER_NOTIF(1, CENTER_CTF_CAPTURESHIELD_FREE,      0, 0, "",             CPID_CTF_CAPSHIELD,  "0 0", _("^BGYou are now free.\n^BGFeel free to ^F2try to capture^BG the flag again\n^BGif you think you will succeed."), "") \
     MSG_CENTER_NOTIF(1, CENTER_CTF_CAPTURESHIELD_SHIELDED,  0, 0, "",             CPID_CTF_CAPSHIELD,  "0 0", _("^BGYou are now ^F1shielded^BG from the flag\n^BGfor ^F2too many unsuccessful attempts^BG to capture.\n^BGMake some defensive scores before trying again."), "") \
     MULTITEAM_CENTER(1, CENTER_CTF_CAPTURE_, 2,             0, 0, "",             CPID_CTF_LOWPRIO,    "0 0", _("^BGYou captured the ^TC^TT^BG flag!"), "") \
@@ -684,6 +689,7 @@ void Send_Notification_WOCOVA(
     MSG_CENTER_NOTIF(1, CENTER_KEYHUNT_SCAN,                0, 1, "",              CPID_KEYHUNT_OTHER,    "f1 0", _("^BGScanning frequency range..."), "") \
     MULTITEAM_CENTER(1, CENTER_KEYHUNT_START_, 4,           0, 0, "",              CPID_KEYHUNT,          "0 0", _("^BGYou are starting with the ^TC^TT Key"), "") \
     MSG_CENTER_NOTIF(1, CENTER_KEYHUNT_WAIT,                0, 1, "missing_teams", CPID_KEYHUNT_OTHER,    "0 0", _("^BGWaiting for players to join...\nNeed active players for: %s"), "") \
+    MSG_CENTER_NOTIF(1, CENTER_LMS_NOLIVES,                 0, 0, "",              CPID_LMS,              "0 0", _("^BGYou have no lives left, you must wait until the next match"), "") \
     MSG_CENTER_NOTIF(1, CENTER_MISSING_TEAMS,               0, 1, "missing_teams", CPID_MISSING_TEAMS,    "-1 0", _("^BGWaiting for players to join...\nNeed active players for: %s"), "") \
     MSG_CENTER_NOTIF(1, CENTER_MISSING_PLAYERS,             0, 1, "f1",            CPID_MISSING_PLAYERS,  "-1 0", _("^BGWaiting for %s player(s) to join..."), "") \
     MSG_CENTER_NOTIF(1, CENTER_INSTAGIB_FINDAMMO,           0, 0, "",              CPID_INSTAGIB_FINDAMMO,"1 9", _("^F4^COUNT^BG left to find some ammo!"), "") \
@@ -693,8 +699,13 @@ void Send_Notification_WOCOVA(
     MSG_CENTER_NOTIF(1, CENTER_NIX_COUNTDOWN,               0, 2, "item_wepname",  CPID_NIX,              "1 f2", _("^F2^COUNT^BG until weapon change...\nNext weapon: ^F1%s"), "") \
     MSG_CENTER_NOTIF(1, CENTER_NIX_NEWWEAPON,               0, 1, "item_wepname",  CPID_NIX,              "0 0", _("^F2Active weapon: ^F1%s"), "") \
     MSG_CENTER_NOTIF(1, CENTER_NADE,                        0, 0, "",              NO_CPID,               "0 0", _("^BGPress ^F2DROPWEAPON^BG again to toss the grenade!"), "") \
+    MSG_CENTER_NOTIF(1, CENTER_ONS_NOTSHIELDED,             0, 0, "",              CPID_ONSLAUGHT,        "0 0", _("^K1Your generator is NOT shielded!\n^BGRe-capture controlpoints to shield it!"), "") \
     MSG_CENTER_NOTIF(1, CENTER_OVERTIME_FRAG,               0, 0, "",              CPID_OVERTIME,         "0 0", _("^F2Now playing ^F4OVERTIME^F2!\nKeep fragging until we have a winner!"), _("^F2Now playing ^F4OVERTIME^F2!\nKeep scoring until we have a winner!")) \
+    MSG_CENTER_NOTIF(1, CENTER_OVERTIME_CONTROLPOINT,       0, 0, "",              CPID_OVERTIME,         "5 0", _("^F2Now playing ^F4OVERTIME^F2!\n\nGenerators are now decaying.\nThe more control points your team holds,\nthe faster the enemy generator decays"), "") \
     MSG_CENTER_NOTIF(1, CENTER_OVERTIME_TIME,               0, 1, "f1time",        CPID_OVERTIME,         "0 0", _("^F2Now playing ^F4OVERTIME^F2!\n^BGAdded ^F4%s^BG to the game!"), "") \
+    MSG_CENTER_NOTIF(1, CENTER_PORTO_CREATED_IN,            0, 0, "",              NO_CPID,               "0 0", _("^K1In^BG-portal created"), "") \
+    MSG_CENTER_NOTIF(1, CENTER_PORTO_CREATED_OUT,           0, 0, "",              NO_CPID,               "0 0", _("^F3Out^BG-portal created"), "") \
+    MSG_CENTER_NOTIF(1, CENTER_PORTO_FAILED,                0, 0, "",              NO_CPID,               "0 0", _("^K1Portal deployment failed.\n\n^F2Catch it to try again!"), "") \
     MSG_CENTER_NOTIF(1, CENTER_POWERDOWN_INVISIBILITY,      0, 0, "",              CPID_POWERUP,          "0 0", _("^F2Invisibility has worn off"), "") \
     MSG_CENTER_NOTIF(1, CENTER_POWERDOWN_SHIELD,            0, 0, "",              CPID_POWERUP,          "0 0", _("^F2Shield has worn off"), "") \
     MSG_CENTER_NOTIF(1, CENTER_POWERDOWN_SPEED,             0, 0, "",              CPID_POWERUP,          "0 0", _("^F2Speed has worn off"), "") \
@@ -716,7 +727,8 @@ void Send_Notification_WOCOVA(
     MSG_CENTER_NOTIF(1, CENTER_TEAMCHANGE_SPECTATE,         0, 1, "",              CPID_TEAMCHANGE,       "1 f1", _("^K1Spectating in ^COUNT"), "") \
     MSG_CENTER_NOTIF(1, CENTER_TEAMCHANGE_SUICIDE,          0, 1, "",              CPID_TEAMCHANGE,       "1 f1", _("^K1Suicide in ^COUNT"), "") \
     MSG_CENTER_NOTIF(1, CENTER_TIMEOUT_BEGINNING,           0, 1, "",              CPID_TIMEOUT,          "1 f1", _("^F4Timeout begins in ^COUNT"), "") \
-    MSG_CENTER_NOTIF(1, CENTER_TIMEOUT_ENDING,              0, 1, "",              CPID_TIMEOUT,          "1 f1", _("^F4Timeout ends in ^COUNT"), "")
+    MSG_CENTER_NOTIF(1, CENTER_TIMEOUT_ENDING,              0, 1, "",              CPID_TIMEOUT,          "1 f1", _("^F4Timeout ends in ^COUNT"), "") \
+    MSG_CENTER_NOTIF(1, CENTER_WEAPON_MINELAYER_LIMIT,      0, 1, "f1",            NO_CPID,               "0 0",  _("^BGYou cannot place more than ^F2%s^BG mines at a time"), "") 
 
 #define MULTITEAM_MULTI2(default,prefix,anncepre,infopre,centerpre) \
     MSG_MULTI_NOTIF(default, prefix##RED, anncepre##RED, infopre##RED, centerpre##RED) \
@@ -825,6 +837,7 @@ void Send_Notification_WOCOVA(
     MSG_MULTI_NOTIF(1, ITEM_WEAPON_NOAMMO,                   NO_MSG,        INFO_ITEM_WEAPON_NOAMMO,                   CENTER_ITEM_WEAPON_NOAMMO) \
     MSG_MULTI_NOTIF(1, ITEM_WEAPON_PRIMORSEC,                NO_MSG,        INFO_ITEM_WEAPON_PRIMORSEC,                CENTER_ITEM_WEAPON_PRIMORSEC) \
     MSG_MULTI_NOTIF(1, ITEM_WEAPON_UNAVAILABLE,              NO_MSG,        INFO_ITEM_WEAPON_UNAVAILABLE,              CENTER_ITEM_WEAPON_UNAVAILABLE) \
+    MSG_MULTI_NOTIF(1, MULTI_COINTOSS,                       NO_MSG,        INFO_COINTOSS,                             CENTER_COINTOSS) \
     MSG_MULTI_NOTIF(1, MULTI_COUNTDOWN_BEGIN,                ANNCE_BEGIN,   NO_MSG,                                    CENTER_COUNTDOWN_BEGIN) \
     MSG_MULTI_NOTIF(1, MULTI_INSTAGIB_FINDAMMO,              ANNCE_NUM_10,  NO_MSG,                                    CENTER_INSTAGIB_FINDAMMO_FIRST) \
     MSG_MULTI_NOTIF(1, WEAPON_ACCORDEON_MURDER,              NO_MSG,        INFO_WEAPON_ACCORDEON_MURDER,              NO_MSG) \
@@ -858,6 +871,7 @@ void Send_Notification_WOCOVA(
     MSG_MULTI_NOTIF(1, WEAPON_KLEINBOTTLE_SUICIDE,           NO_MSG,        INFO_WEAPON_KLEINBOTTLE_SUICIDE,           CENTER_DEATH_SELF_GENERIC) \
     MSG_MULTI_NOTIF(1, WEAPON_MACHINEGUN_MURDER_SNIPE,       NO_MSG,        INFO_WEAPON_MACHINEGUN_MURDER_SNIPE,       NO_MSG) \
     MSG_MULTI_NOTIF(1, WEAPON_MACHINEGUN_MURDER_SPRAY,       NO_MSG,        INFO_WEAPON_MACHINEGUN_MURDER_SPRAY,       NO_MSG) \
+    MSG_MULTI_NOTIF(1, WEAPON_MINELAYER_LIMIT,               NO_MSG,        INFO_WEAPON_MINELAYER_LIMIT,               CENTER_WEAPON_MINELAYER_LIMIT) \
     MSG_MULTI_NOTIF(1, WEAPON_MINELAYER_MURDER,              NO_MSG,        INFO_WEAPON_MINELAYER_MURDER,              NO_MSG) \
     MSG_MULTI_NOTIF(1, WEAPON_MINELAYER_SUICIDE,             NO_MSG,        INFO_WEAPON_MINELAYER_SUICIDE,             CENTER_DEATH_SELF_GENERIC) \
     MSG_MULTI_NOTIF(1, WEAPON_MORTAR_MURDER_BOUNCE,          NO_MSG,        INFO_WEAPON_MORTAR_MURDER_BOUNCE,          NO_MSG) \
index 970192e31c094bd648ff25264bc1373f0a688aa1..2dac41e1badd5a236b30bba74ebddbb4c2b84930 100644 (file)
@@ -318,7 +318,7 @@ void W_MineLayer_Attack(void)
                if(self.minelayer_mines >= WEP_CVAR(minelayer, limit))
                {
                        // the refire delay keeps this message from being spammed
-                       sprint(self, strcat("minelayer: You cannot place more than ^2", ftos(WEP_CVAR(minelayer, limit)), " ^7mines at a time\n") );
+                       Send_Notification(NOTIF_ONE, self, MSG_MULTI, WEAPON_MINELAYER_LIMIT, WEP_CVAR(minelayer, limit));
                        play2(self, "weapons/unavailable.wav");
                        return;
                }
index 49fb47e43e9d7626a31ffc4d5a1f3be82d6e5cd2..e1fb82f8f2bd427a0eb7767e43d5434f5fc7fb7d 100644 (file)
@@ -81,7 +81,7 @@ void W_Porto_Fail(float failhard)
                        if(vlen(trace_endpos - self.realowner.origin) < 128)
                        {
                                W_ThrowNewWeapon(self.realowner, WEP_PORTO, 0, self.origin, self.velocity);
-                               centerprint(self.realowner, "^1Portal deployment failed.\n\n^2Catch it to try again!");
+                               Send_Notification(NOTIF_ONE, self.realowner, MSG_CENTER, CENTER_PORTO_FAILED);
                        }
                }
        }
@@ -157,7 +157,7 @@ void W_Porto_Touch(void)
                {
                        sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTEN_NORM);
                        trace_plane_normal = norm;
-                       centerprint(self.realowner, "^1In^7-portal created.");
+                       Send_Notification(NOTIF_ONE, self.realowner, MSG_CENTER, CENTER_PORTO_CREATED_IN);
                        W_Porto_Success();
                }
                else
@@ -174,7 +174,7 @@ void W_Porto_Touch(void)
                {
                        sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTEN_NORM);
                        trace_plane_normal = norm;
-                       centerprint(self.realowner, "^4Out^7-portal created.");
+                       Send_Notification(NOTIF_ONE, self.realowner, MSG_CENTER, CENTER_PORTO_CREATED_OUT);
                        W_Porto_Success();
                }
                else
@@ -191,7 +191,7 @@ void W_Porto_Touch(void)
                {
                        sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTEN_NORM);
                        trace_plane_normal = norm;
-                       centerprint(self.realowner, "^1In^7-portal created.");
+                       Send_Notification(NOTIF_ONE, self.realowner, MSG_CENTER, CENTER_PORTO_CREATED_IN);
                        self.right_vector = self.right_vector - 2 * trace_plane_normal * (self.right_vector * norm);
                        self.angles = vectoangles(self.velocity - 2 * trace_plane_normal * (self.velocity * norm));
                        CSQCProjectile(self, TRUE, PROJECTILE_PORTO_BLUE, TRUE); // change type
@@ -212,7 +212,7 @@ void W_Porto_Touch(void)
                        {
                                sound(self, CH_SHOTS, "porto/create.wav", VOL_BASE, ATTEN_NORM);
                                trace_plane_normal = norm;
-                               centerprint(self.realowner, "^4Out^7-portal created.");
+                               Send_Notification(NOTIF_ONE, self.realowner, MSG_CENTER, CENTER_PORTO_CREATED_OUT);
                                W_Porto_Success();
                        }
                        else
index b1dccc7b5c3bc4e3e6517106fd7919eb5976f393..be379590aadb2fe23792509bdc46ef877d8bc8bc 100644 (file)
@@ -1558,7 +1558,7 @@ void player_regen (void)
                mina = autocvar_g_balance_armor_regenstable;
                limith = autocvar_g_balance_health_limit;
                limita = autocvar_g_balance_armor_limit;
-               
+
                max_mod = regen_mod_max;
                regen_mod = regen_mod_regen;
                rot_mod = regen_mod_rot;
@@ -1752,7 +1752,6 @@ float SpectateUpdate()
        return 1;
 }
 
-
 float SpectateSet()
 {
        if(self.enemy.classname != "player")
@@ -2623,8 +2622,6 @@ void PlayerPostThink (void)
        }
        */
 
-       //pointparticles(particleeffectnum("machinegun_impact"), self.origin + self.view_ofs + '0 0 7', '0 0 0', 1);
-
        if(self.waypointsprite_attachedforcarrier)
                WaypointSprite_UpdateHealth(self.waypointsprite_attachedforcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON));
 
index 1d47536608b3446f97663a2d4906b7091bb0412c..08f9dee9562f5c9d91c382236f3f0ea56e84e0bf 100644 (file)
@@ -1120,7 +1120,7 @@ void SV_PlayerPhysics()
        {
                // we get here if we ran out of ammo
                if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32) && self.ammo_fuel < 0.01)
-                       sprint(self, "You don't have any fuel for the ^2Jetpack\n");
+                       Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_JETPACK_NOFUEL);
 
                // walking
                makevectors(self.v_angle_y * '0 1 0');
@@ -1189,7 +1189,7 @@ void SV_PlayerPhysics()
                float wishspeed0;
                // we get here if we ran out of ammo
                if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32) && self.ammo_fuel < 0.01)
-                       sprint(self, "You don't have any fuel for the ^2Jetpack\n");
+                       Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_JETPACK_NOFUEL);
 
                if(maxspd_mod < 1)
                {
index 7d67c4f30d621c751f0cb5ed9c627451f9a71a77..898e7db18faf59a78afe5988320a8a21baa02ccb 100644 (file)
@@ -150,7 +150,7 @@ void ClientCommand_join(float request)
                {
                        if(IS_CLIENT(self))
                        {
-                               if(!IS_PLAYER(self) && !lockteams)
+                               if(!IS_PLAYER(self) && !lockteams && !gameover)
                                {
                                        if(self.caplayer)
                                                return;
@@ -468,7 +468,7 @@ void ClientCommand_selectteam(float request, float argc)
                                                                                        GetTeamCounts(self);
                                                                                        if(!TeamSmallerEqThanTeam(Team_TeamToNumber(selection), Team_TeamToNumber(self.team), self))
                                                                                        {
-                                                                                               sprint(self, "Cannot change to a larger/better/shinier team\n");
+                                                                                               Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_TEAMCHANGE_LARGERTEAM);
                                                                                                return;
                                                                                        }
                                                                                }
index edeb571c0dd62f0ec374699f2ac8c82e37233d01..27ed6b8694e16ce8406b98b76cb7d95f020a19f7 100644 (file)
@@ -478,14 +478,11 @@ void GameCommand_cointoss(float request, float argc)
        {
                case CMD_REQUEST_COMMAND:
                {
-                       entity client;
-                       string result1 = (argv(2) ? strcat("^7", argv(1), "^3!\n") : "^1HEADS^3!\n");
-                       string result2 = (argv(2) ? strcat("^7", argv(2), "^3!\n") : "^4TAILS^3!\n");
+                       string result1 = (argv(2) ? strcat("^7", argv(1)) : "^1HEADS");
+                       string result2 = (argv(2) ? strcat("^7", argv(2)) : "^4TAILS");
                        string choice = ((random() > 0.5) ? result1 : result2);
-
-                       FOR_EACH_CLIENT(client)
-                               centerprint(client, strcat("^3Throwing coin... Result: ", choice));
-                       bprint(strcat("^3Throwing coin... Result: ", choice));
+                       
+                       Send_Notification(NOTIF_ALL, world, MSG_MULTI, MULTI_COINTOSS, choice);
                        return;
                }
 
index 3a7bb364c5e9347eaf60f23cfbb1990eddba70f9..f203fdf4fa1ce3693f747f109e309fa0d200a70e 100644 (file)
@@ -61,14 +61,13 @@ void SUB_UseTargets()
 //
 // print the message
 //
-       if (IS_PLAYER(activator) && self.message != "")
+       if(self)
+       if(IS_PLAYER(activator) && self.message != "")
+       if(IS_REAL_CLIENT(activator))
        {
-               if(IS_REAL_CLIENT(activator))
-               {
-                       centerprint (activator, self.message);
-                       if (self.noise == "")
-                               play2(activator, "misc/talk.wav");
-               }
+               centerprint(activator, self.message);
+               if (self.noise == "")
+                       play2(activator, "misc/talk.wav");
        }
 
 //
@@ -205,8 +204,8 @@ void multi_use()
 
 void multi_touch()
 {
-       if (!(self.spawnflags & 2))
-               if (!other.iscreature)
+       if(!(self.spawnflags & 2))
+       if(!other.iscreature)
                        return;
 
        if(self.team)
@@ -378,32 +377,26 @@ void spawnfunc_trigger_delay()
 
 void counter_use()
 {
-       self.count = self.count - 1;
+       self.count -= 1;
        if (self.count < 0)
                return;
 
-       if (self.count != 0)
+       if (self.count == 0)
        {
-               if (IS_PLAYER(activator)
-               && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
-               {
-                       if (self.count >= 4)
-                               centerprint (activator, "There are more to go...");
-                       else if (self.count == 3)
-                               centerprint (activator, "Only 3 more to go...");
-                       else if (self.count == 2)
-                               centerprint (activator, "Only 2 more to go...");
-                       else
-                               centerprint (activator, "Only 1 more to go...");
-               }
-               return;
-       }
+               if(IS_PLAYER(activator) && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
+                       Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COMPLETED);
 
-       if (IS_PLAYER(activator)
-       && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
-               centerprint(activator, "Sequence completed!");
-       self.enemy = activator;
-       multi_trigger ();
+               self.enemy = activator;
+               multi_trigger ();
+       }
+       else
+       {
+               if(IS_PLAYER(activator) && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0)
+               if(self.count >= 4)
+                       Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COUNTER);
+               else
+                       Send_Notification(NOTIF_ONE, activator, MSG_CENTER, CENTER_SEQUENCE_COUNTER_FEWMORE, self.count);
+       }
 }
 
 void counter_reset()
@@ -2059,9 +2052,9 @@ string trigger_magicear_processmessage_forallears(entity source, float teamsay,
        for(ear = magicears; ear; ear = ear.enemy)
        {
                msgout = trigger_magicear_processmessage(ear, source, teamsay, privatesay, msgin);
-               if (!(ear.spawnflags & 64))
-                       if(magicear_matched)
-                               return msgout;
+               if(!(ear.spawnflags & 64))
+               if(magicear_matched)
+                       return msgout;
                msgin = msgout;
        }
        return msgin;
index f181f376448761b3aa8ffd169369d62ba84105c2..79003853a6deef93d6ce20e93f5beecfb183518e 100644 (file)
@@ -333,12 +333,12 @@ void trigger_keylock_touch(void) {
                if (key_used) {
                        // one or more keys were given, but others are still missing!
                        play2(other, self.noise1);
-                       centerprint(other, strcat("You also need ", item_keys_keylist(self.itemkeys), "!"));
+                       Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_LOCKED_ALSONEED, item_keys_keylist(self.itemkeys));
                        other.key_door_messagetime = time + 2;
                } else if (other.key_door_messagetime <= time) {
                        // no keys were given
                        play2(other, self.noise2);
-                       centerprint(other, strcat("You need ", item_keys_keylist(self.itemkeys), "!"));
+                       Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_LOCKED_NEED, item_keys_keylist(self.itemkeys));
                        other.key_door_messagetime = time + 2;
                }
 
index 1eb2b77cb7d97dca6f1273a3428e51bd57591d6e..8a8c50b38b8ab18ab31f40ee71b1fe39f4119937 100644 (file)
@@ -63,20 +63,13 @@ void assault_objective_decrease_use()
                        PlayerTeamScore_Add(activator, SP_ASSAULT_OBJECTIVES, ST_ASSAULT_OBJECTIVES, 1);
                        self.enemy.health = -1;
 
-                       entity oldself, oldactivator;
+                       entity oldself, oldactivator, head;
 
                        oldself = self;
                        self = oldself.enemy;
                        if(self.message)
-                       {
-                               entity player;
-                               string s;
-                               FOR_EACH_PLAYER(player)
-                               {
-                                       s = strcat(self.message, "\n");
-                                       centerprint(player, s);
-                               }
-                       }
+                       FOR_EACH_PLAYER(head)
+                               centerprint(head, self.message);
 
                        oldactivator = activator;
                        activator = oldself;
@@ -523,9 +516,9 @@ void havocbot_ast_reset_role(entity bot)
 MUTATOR_HOOKFUNCTION(assault_PlayerSpawn)
 {
        if(self.team == assault_attacker_team)
-               centerprint(self, "You are attacking!");
+               Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_ASSAULT_ATTACKING);
        else
-               centerprint(self, "You are defending!");
+               Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_ASSAULT_DEFENDING);
 
        return FALSE;
 }
index dc2398609f1d08e821514e7bd6b51ceaf813a871..74cba2897387862d8893b708cd263c1c8b8c8c69 100644 (file)
@@ -391,8 +391,7 @@ void onslaught_generator_think()
                {
                        if (!overtime_msg_time)
                        {
-                               FOR_EACH_PLAYER(e)
-                                       centerprint(e, "^3Now playing ^1OVERTIME^3!\n^3Generators start now to decay.\n^3The more control points your team holds,\n^3the faster the enemy generator decays.");
+                               Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_OVERTIME_CONTROLPOINT);
                                overtime_msg_time = time;
                        }
                        // self.max_health / 300 gives 5 minutes of overtime.
@@ -423,9 +422,9 @@ void onslaught_generator_think()
             self.wait = time + 5;
             FOR_EACH_REALPLAYER(e)
             {
-                if(e.team == self.team)
+                               if(SAME_TEAM(e, self))
                 {
-                    centerprint(e, "^1Your generator is NOT shielded!\n^7Re-capture controlpoints to shield it!");
+                                       Send_Notification(NOTIF_ONE, e, MSG_CENTER, CENTER_ONS_NOTSHIELDED);
                     soundto(MSG_ONE, e, CHAN_AUTO, "kh/alarm.wav", VOL_BASE, ATTEN_NONE);    // FIXME: Uniqe sound?
                 }
             }
index c323262f069b7a198f7e29ca75b20c4d186408cc..74e17a6a1422fb5b97bb989920dfdb8fa8a13891 100644 (file)
@@ -429,9 +429,7 @@ MUTATOR_HOOKFUNCTION(superspec_BuildMutatorsPrettyString)
 void superspec_hello()
 {
        if(self.enemy.crypto_idfp == "")
-               centerprint(self.enemy, "Your client have/allow no crypto id, superspec options will not be saved/restored.");
-       else
-               centerprint(self.enemy, sprintf("Hello %s\nSince your client has a Crypto ID, your superspec preferences will be persisted on this server.", self.enemy.netname));
+               Send_Notification(NOTIF_ONE_ONLY, self.enemy, MSG_INFO, INFO_SUPERSPEC_MISSING_UID);
 
        remove(self);
 }
index 03081ff4b1526e5f3cc0a486aec68f50c874ee23..8d705b363f8c72c84c20ce3d4a3b81f70608d4bf 100644 (file)
@@ -599,7 +599,7 @@ float Item_GiveTo(entity item, entity player)
        {
                pickedup = TRUE;
                player.items |= it;
-               sprint (player, strcat("You got the ^2", item.netname, "\n"));
+               Send_Notification(NOTIF_ONE, player, MSG_INFO, INFO_ITEM_WEAPON_GOT, item.netname);
        }
 
        if (item.strength_finished)
index 353e5e9feb4f4b64c146cb2f456c49181b13fa93..315abe152f50b2d9074b28d1e214fa8d1f199053 100644 (file)
@@ -1176,7 +1176,7 @@ void door_touch()
        if (!(self.owner.dmg) && (self.owner.message != ""))
        {
                if (IS_CLIENT(other))
-                       centerprint (other, self.owner.message);
+                       centerprint(other, self.owner.message);
                play2(other, "misc/talk.wav");
        }
 }
@@ -1849,7 +1849,7 @@ void secret_touch()
        if (self.message)
        {
                if (IS_CLIENT(other))
-                       centerprint (other, self.message);
+                       centerprint(other, self.message);
                play2(other, "misc/talk.wav");
        }
 }