]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/master' into samual/notification_rewrite
authorSamual Lenks <samual@xonotic.org>
Mon, 11 Feb 2013 17:02:16 +0000 (12:02 -0500)
committerSamual Lenks <samual@xonotic.org>
Mon, 11 Feb 2013 17:02:16 +0000 (12:02 -0500)
83 files changed:
_hud_common.cfg
commands.cfg
defaultXonotic.cfg
gamemodes.cfg
qcsrc/Makefile
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/damage.qc
qcsrc/client/hook.qc
qcsrc/client/hud.qc
qcsrc/client/main.qh
qcsrc/client/miscfunctions.qc
qcsrc/client/progs.src
qcsrc/client/scoreboard.qc
qcsrc/client/shownames.qc
qcsrc/client/teamplay.qc [deleted file]
qcsrc/client/teamplay.qh [deleted file]
qcsrc/client/tturrets.qc
qcsrc/client/waypointsprites.qc
qcsrc/common/command/generic.qc
qcsrc/common/constants.qh
qcsrc/common/deathtypes.qh [new file with mode: 0644]
qcsrc/common/notifications.qc [new file with mode: 0644]
qcsrc/common/notifications.qh [new file with mode: 0644]
qcsrc/common/teams.qh [new file with mode: 0644]
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/menu/progs.src
qcsrc/server/arena.qc
qcsrc/server/assault.qc
qcsrc/server/attic/ctf.qc
qcsrc/server/attic/domination.qc
qcsrc/server/attic/nexball.qc
qcsrc/server/autocvars.qh
qcsrc/server/bot/bot.qc
qcsrc/server/bot/havocbot/role_onslaught.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/constants.qh
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/server/mutators/gamemode_ctf.qh
qcsrc/server/mutators/gamemode_domination.qc
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/mutators/gamemode_keepaway.qc
qcsrc/server/mutators/gamemode_keyhunt.qc
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/gamemode_onslaught.qc
qcsrc/server/mutators/mutator_superspec.qc
qcsrc/server/progs.src
qcsrc/server/race.qc
qcsrc/server/scores.qc
qcsrc/server/teamplay.qc
qcsrc/server/vehicles/bumblebee.qc
qcsrc/server/vehicles/racer.qc
qcsrc/server/vehicles/raptor.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/vehicles/vehicles.qc
qcsrc/server/w_crylink.qc
qcsrc/server/w_electro.qc
qcsrc/server/w_fireball.qc
qcsrc/server/w_grenadelauncher.qc
qcsrc/server/w_hagar.qc
qcsrc/server/w_hlac.qc
qcsrc/server/w_hook.qc
qcsrc/server/w_laser.qc
qcsrc/server/w_minelayer.qc
qcsrc/server/w_minstanex.qc
qcsrc/server/w_nex.qc
qcsrc/server/w_porto.qc
qcsrc/server/w_rifle.qc
qcsrc/server/w_rocketlauncher.qc
qcsrc/server/w_seeker.qc
qcsrc/server/w_shotgun.qc
qcsrc/server/w_tuba.qc
qcsrc/server/w_uzi.qc

index ba88a2a4fa6fedcd4f2343caeb2e8b1445b1893e..1a412f399b68db993f38f76f3f6f968a16dac127 100644 (file)
@@ -8,6 +8,15 @@ seta hud_configure_grid_alpha 0.15 "alpha for visible grid when in configure mod
 seta hud_fontsize 11 "text fontsize for the hud"
 seta hud_width 560 "2D virtual width for the hud"
 
+seta hud_colorset_foreground_1 "2" "primary priority (important names, etc)"
+seta hud_colorset_foreground_2 "3" "secondary priority (items, locations, numbers, etc)"
+seta hud_colorset_foreground_3 "4" "tertiary priority or relatively inconsequential text"
+seta hud_colorset_foreground_4 "1" "notice/attention grabbing texting"
+seta hud_colorset_kill_1 "1" "'bad' or 'dangerous' text (death messages against you, kill notifications, etc)"
+seta hud_colorset_kill_2 "3" "similar to above, but less important... OR, a highlight out of above message type"
+seta hud_colorset_kill_3 "4" "'good' or 'beneficial' text (you fragging someone, etc)"
+seta hud_colorset_background "7" "neutral/unimportant text"
+
 // general hud panel cvars (i.e. shouldn't be adjusted by a skin config)
 seta hud_panel_weapons_ammo_full_shells 60 "show 100% of the status bar at this ammo count"
 seta hud_panel_weapons_ammo_full_nails 320 "show 100% of the status bar at this ammo count"
@@ -90,4 +99,4 @@ seta hud_shownames_mindistance 1000 "start fading alpha/size at this distance"
 seta hud_shownames_maxdistance 5000 "alpha/size is 0 at this distance"
 seta hud_shownames_antioverlap 1 "if two tags get too close to each other, fade out the one further away from you"
 seta hud_shownames_antioverlap_distance 50 "2d distance to other tag after which to fade out"
-seta hud_shownames_offset 52 "offset (along z-axis) tag from player origin by this many units"
\ No newline at end of file
+seta hud_shownames_offset 52 "offset (along z-axis) tag from player origin by this many units"
index 44fa671bd7f88e4ace9f1c4be2cf0e3929ad1542..0aece8a628129a88a898cef037fc4c75034f6224 100644 (file)
@@ -52,10 +52,11 @@ alias who                  "qc_cmd_svcmd  who                  ${* ?}" // Displa
 
 // generic commands (across all programs)
 alias addtolist            "qc_cmd_svmenu addtolist            ${* ?}" // Add a string to a cvar
-alias qc_curl              "qc_cmd_svmenu curl                 ${* ?}" // curl requests
 alias dumpcommands         "qc_cmd_svmenu dumpcommands         ${* ?}" // Dump all commands on the program to *_cmd_dump.txt
+alias dumpnotifs           "qc_cmd_svmenu dumpnotifs           ${* ?}" // Dump all notifications into notifications_dump.txt
 alias maplist              "qc_cmd_svmenu maplist              ${* ?}" // Automatic control of maplist
-alias nextframe            "qc_cmd_svmenu nextframe            ${* ?}" // do something next frame
+alias nextframe            "qc_cmd_svmenu nextframe            ${* ?}" // Execute the given command next frame of this VM
+alias qc_curl              "qc_cmd_svmenu qc_curl              ${* ?}" // Queries a URL
 alias removefromlist       "qc_cmd_svmenu removefromlist       ${* ?}" // Remove a string from a cvar
 alias rpn                  "qc_cmd_svmenu rpn                  ${* ?}" // RPN calculator
 //alias settemp            "qc_cmd_svmenu settemp              ${* ?}" // Temporarily set a value to a cvar which is restored later
index bf7d85eb7aae233e48a936267d4b2d46a34586a0..e07bca37254171d77aabc5cfabd70379b729b83d 100644 (file)
@@ -818,6 +818,7 @@ set g_chat_flood_lmax_tell 2        "private chat: maximum number of lines per chat mes
 set g_chat_flood_burst_tell 2  "private chat: allow bursts of so many chat lines"
 set g_chat_flood_notify_flooder 1      "when 0, the flooder still can see his own message"
 set g_chat_teamcolors 0        "colorize nicknames in team color for chat"
+set g_chat_tellprivacy 1 "when disabled, tell messages are also sent to the server console log... otherwise they're kept private between players."
 set g_nick_flood_timeout 120 "time after which nick flood protection resets (set to 0 to disable nick flood checking)"
 set g_nick_flood_penalty 0.5 "duration of the nick flood penalty"
 set g_nick_flood_penalty_yellow 3 "number of changes to allow before warning and movement blocking"
index 6cff7e5a42666ab32954c8ec8d5abb757b1a09f6..c1e3f43e3fd197ca884d530363ea55a367432dbc 100644 (file)
@@ -197,7 +197,6 @@ set g_ctf_flag_collect_delay 1
 set g_ctf_flag_health 0
 set g_ctf_flag_dropped_waypoint 2 "show dropped flag waypointsprite when a flag is lost. 1 = team only, 2 = for all players"
 set g_ctf_flag_dropped_floatinwater 200 "move upwards while in water at this velocity"
-set g_ctf_flag_pickup_verbosename 0 "show the name of the person who picked up the flag too"
 set g_ctf_throw 1 "throwing allows circumventing carrierkill score, so enable this with care!"
 set g_ctf_throw_angle_max 90 "maximum upwards angle you can throw the flag"
 set g_ctf_throw_angle_min -90 "minimum downwards angle you can throw the flag"
@@ -343,7 +342,6 @@ set g_lms 0 "Last Man Standing: everyone starts with a certain amount of lives,
 set g_lms_lives_override -1
 set g_lms_regenerate 0
 set g_lms_campcheck_interval 10
-set g_lms_campcheck_message "^1Don't camp!"
 set g_lms_campcheck_damage 100
 set g_lms_campcheck_distance 1800
 set g_lms_last_join 3  "if g_lms_join_anytime is false, new players can only join if the worst active player has more than (fraglimit - g_lms_last_join) lives"
index 5d079dcb05d7d62c96810b82204005d3a1f9543e..4f772589ba3eeaba45f157e742aac84a497f3b11 100644 (file)
@@ -33,6 +33,8 @@ QCCFLAGS ?= \
        -floop-labels \
        -funtyped-nil \
        -fno-permissive \
+       -fvariadic-args \
+       -DNOTIFICATIONS_DEBUG \
        $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
 else
 # this. is. fteqccccccccccccccccccc!
index 47d0e37d6a903f78268480795a1d1579d7fbe471..9bc8c3cd59e6898096781f8b4817929f69db1bed 100644 (file)
@@ -149,12 +149,14 @@ void CSQC_Init(void)
        teams = Sort_Spawn();
        players = Sort_Spawn();
 
-       GetTeam(COLOR_SPECTATOR, true); // add specs first
+       GetTeam(FL_SPECTATOR, true); // add specs first
 
        // needs to be done so early because of the constants they create
        CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
        CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
-
+       CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
+       CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
+       
        WaypointSprite_Load();
 
        // precaches
@@ -261,16 +263,16 @@ float SetTeam(entity o, float Team)
                switch(Team)
                {
                        case -1:
-                       case COLOR_TEAM1:
-                       case COLOR_TEAM2:
-                       case COLOR_TEAM3:
-                       case COLOR_TEAM4:
+                       case FL_TEAM_1:
+                       case FL_TEAM_2:
+                       case FL_TEAM_3:
+                       case FL_TEAM_4:
                                break;
                        default:
                                if(GetTeam(Team, false) == world)
                                {
                                        print(sprintf(_("trying to switch to unsupported team %d\n"), Team));
-                                       Team = COLOR_SPECTATOR;
+                                       Team = FL_SPECTATOR;
                                }
                                break;
                }
@@ -286,7 +288,7 @@ float SetTeam(entity o, float Team)
                                if(GetTeam(Team, false) == world)
                                {
                                        print(sprintf(_("trying to switch to unsupported team %d\n"), Team));
-                                       Team = COLOR_SPECTATOR;
+                                       Team = FL_SPECTATOR;
                                }
                                break;
                }
@@ -778,7 +780,8 @@ void CSQC_Ent_Update(float bIsNewEntity)
                case ENT_CLIENT_TURRET: ent_turret(); break; 
                case ENT_CLIENT_MODEL: CSQCModel_Read(bIsNewEntity); break;
                case ENT_CLIENT_ITEM: ItemRead(bIsNewEntity); break;  
-               case ENT_CLIENT_BUMBLE_RAYGUN: bumble_raygun_read(bIsNewEntity); break;  
+               case ENT_CLIENT_BUMBLE_RAYGUN: bumble_raygun_read(bIsNewEntity); break;
+               case ENT_CLIENT_NOTIFICATION: Read_Notification(bIsNewEntity); break;
                default:
                        //error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype));
                        error(sprintf(_("Unknown entity type in CSQC_Ent_Update (enttype: %d, edict: %d, classname: %s)\n"), self.enttype, num_for_edict(self), self.classname));
@@ -1197,10 +1200,6 @@ float CSQC_Parse_TempEntity()
                        HUD_KillNotify(ReadString(), ReadString(), ReadString(), ReadShort(), ReadByte());
                        bHandled = true;
                        break;
-               case TE_CSQC_KILLCENTERPRINT:
-                       HUD_KillCenterprint(ReadString(), ReadString(), ReadShort(), ReadByte());
-                       bHandled = true;
-                       break;
                case TE_CSQC_CENTERPRINT_GENERIC:
                        float id;
                        string s;
index dac205e723f0bd607b0313b495a1afedf52d4b11..c84d58b546fc043f3ce4a32ee0881c0db07b74c8 100644 (file)
@@ -249,7 +249,7 @@ float EnemyHitCheck()
        if(teamplay)
                if(t == myteam)
                        return SHOTTYPE_HITTEAM;
-       if(t == COLOR_SPECTATOR)
+       if(t == FL_SPECTATOR)
                return SHOTTYPE_HITWORLD;
        return SHOTTYPE_HITENEMY;
 }
index 3cafa396168872703431037871f6c5a0d48289ae..ebad5f0d6d4db4151af4b56ca55fc5e8ca498bd6 100644 (file)
@@ -254,7 +254,6 @@ float autocvar_hud_panel_notify;
 float autocvar_hud_panel_notify_fadetime;
 float autocvar_hud_panel_notify_flip;
 float autocvar_hud_panel_notify_fontsize;
-float autocvar_hud_panel_notify_print;
 float autocvar_hud_panel_notify_time;
 float autocvar_hud_panel_physics;
 float autocvar_hud_panel_physics_acceleration_progressbar_mode;
index 1d0c36ae9c1236302d77cc354511a88deeb3d31b..442fe0219d2fd630849876be0528dfc690b66193 100644 (file)
@@ -218,7 +218,7 @@ void CSQCPlayer_ForceModel_Apply(float islocalplayer)
                entity tm;
 
                for(tm = teams.sort_next; tm; tm = tm.sort_next)
-                       if(tm.team != COLOR_SPECTATOR)
+                       if(tm.team != FL_SPECTATOR)
                                ++teams_count;
 
                if(autocvar_cl_forcemyplayercolors)
index cc89b03d79d290420202ccdc083209617ddb0100..47d30926eacfc628a36b3cf9cddb6a0f47230d14 100644 (file)
@@ -211,43 +211,43 @@ void Ent_DamageInfo(float isNew)
                
                switch(w_deathtype)
                {
-                       case DEATH_VHCRUSH:
+                       case DEATH_VH_CRUSH:
                                break;
                                
                        // spiderbot
-                       case DEATH_SBMINIGUN:
+                       case DEATH_VH_SPID_MINIGUN:
                                string _snd;
                                _snd = strcat("weapons/ric", ftos(1 + rint(random() * 2)), ".waw");
                                sound(self, CH_SHOTS, _snd, VOL_BASE, ATTN_NORM);
                                pointparticles(particleeffectnum("spiderbot_minigun_impact"), self.origin, w_backoff * 1000, 1);
                                break;
-                       case DEATH_SBROCKET:
+                       case DEATH_VH_SPID_ROCKET:
                                sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
                                pointparticles(particleeffectnum("spiderbot_rocket_explode"), self.origin, w_backoff * 1000, 1);
                                break;
-                       case DEATH_SBBLOWUP:
+                       case DEATH_VH_SPID_DEATH:
                                sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_MIN);
                                pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
                                break;
             
-                       case DEATH_WAKIGUN:
+                       case DEATH_VH_WAKI_GUN:
                                sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
                                pointparticles(particleeffectnum("wakizashi_gun_impact"), self.origin, w_backoff * 1000, 1);
                                break;
-                       case DEATH_WAKIROCKET:
+                       case DEATH_VH_WAKI_ROCKET:
                                sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
                                pointparticles(particleeffectnum("wakizashi_rocket_explode"), self.origin, w_backoff * 1000, 1);
                                break;
-                       case DEATH_WAKIBLOWUP:
+                       case DEATH_VH_WAKI_DEATH:
                                sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_MIN);
                                pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
                                break;
                                
-                       case DEATH_RAPTOR_CANNON:
+                       case DEATH_VH_RAPT_CANNON:
                                sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_NORM);
                                pointparticles(particleeffectnum("raptor_cannon_impact"), self.origin, w_backoff * 1000, 1);
                                break;
-                       case DEATH_RAPTOR_BOMB_SPLIT:
+                       case DEATH_VH_RAPT_FRAGMENT:
                                float i;
                                vector ang, vel;
                                for(i = 1; i < 4; ++i)
@@ -259,15 +259,15 @@ void Ent_DamageInfo(float isNew)
                                sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
                                pointparticles(particleeffectnum("raptor_bomb_spread"), self.origin, w_backoff * 1000, 1);
                                break;
-                       case DEATH_RAPTOR_BOMB:
+                       case DEATH_VH_RAPT_BOMB:
                                sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
                                pointparticles(particleeffectnum("raptor_bomb_impact"), self.origin, w_backoff * 1000, 1);
                                break;
-                       case DEATH_RAPTOR_DEATH:
+                       case DEATH_VH_RAPT_DEATH:
                                sound(self, CH_SHOTS, "weapons/laserimpact.wav", VOL_BASE, ATTN_MIN);
                                pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
                                break;
-                       case DEATH_BUMB_GUN:
+                       case DEATH_VH_BUMB_GUN:
                                sound(self, CH_SHOTS, "weapons/fireball_impact2.wav", VOL_BASE, ATTN_NORM);
                                pointparticles(particleeffectnum("bigplasma_impact"), self.origin, w_backoff * 1000, 1);
                                break;
index 641d50d634fee10abbb0abacbef4d30943df4eb0..609a06bbca46ce9e3c95bb7914a1693e826111f7 100644 (file)
@@ -129,22 +129,22 @@ void Draw_GrapplingHook()
                case ENT_CLIENT_HOOK:
                        intensity = 1;
                        offset = 0;
-                       if(t == COLOR_TEAM1)
+                       if(t == FL_TEAM_1)
                        {
                                tex = "particles/hook_red";
                                rgb = '1 .3 .3';
                        }
-                       else if(t == COLOR_TEAM2)
+                       else if(t == FL_TEAM_2)
                        {
                                tex = "particles/hook_blue";
                                rgb = '.3 .3 1';
                        }
-                       else if(t == COLOR_TEAM3)
+                       else if(t == FL_TEAM_3)
                        {
                                tex = "particles/hook_yellow";
                                rgb = '1 1 .3';
                        }
-                       else if(t == COLOR_TEAM4)
+                       else if(t == FL_TEAM_4)
                        {
                                tex = "particles/hook_pink";
                                rgb = '1 .3 1';
index 7c1e256642295be34e8768beaf745027e61a4371..3e3663db5a90b99e95838e61b0180a61e5867577 100644 (file)
@@ -244,6 +244,30 @@ float race_CheckName(string net_name) {
        return 0;
 }
 
+float GetPlayerColorForce(float i)
+{
+       if(!teamplay)
+               return 0;
+       else
+               return stof(getplayerkeyvalue(i, "colors")) & 15;
+}
+
+float GetPlayerColor(float i)
+{
+       if not(playerslots[i].gotscores) // unconnected
+               return FL_SPECTATOR;
+       else if(stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR)
+               return FL_SPECTATOR;
+       else
+               return GetPlayerColorForce(i);
+}
+
+string GetPlayerName(float i)
+{
+       return ColorTranslateRGB(getplayerkeyvalue(i, "name"));
+}
+
+
 /*
 ==================
 HUD panels
@@ -1607,31 +1631,10 @@ string Weapon_KillMessage(float deathtype)
        return w_deathtypestring;
 }
 
-#define KN_MAX_ENTRIES 10
-float kn_index;
-float killnotify_times[KN_MAX_ENTRIES];
-float killnotify_deathtype[KN_MAX_ENTRIES];
-float killnotify_actiontype[KN_MAX_ENTRIES]; // 0 = "Y [used by] X", 1 = "X [did action to] Y"
-string killnotify_attackers[KN_MAX_ENTRIES];
-string killnotify_victims[KN_MAX_ENTRIES];
-void HUD_KillNotify_Push(string attacker, string victim, float actiontype, float wpn)
-{
-       --kn_index;
-       if (kn_index == -1)
-               kn_index = KN_MAX_ENTRIES-1;
-       killnotify_times[kn_index] = time;
-       killnotify_deathtype[kn_index] = wpn;
-       killnotify_actiontype[kn_index] = actiontype;
-       if(killnotify_attackers[kn_index])
-               strunzone(killnotify_attackers[kn_index]);
-       killnotify_attackers[kn_index] = strzone(attacker);
-       if(killnotify_victims[kn_index])
-               strunzone(killnotify_victims[kn_index]);
-       killnotify_victims[kn_index] = strzone(victim);
-}
 
 void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s1 = attacker, s2 = victim
 {
+       /*
        float w;
        float alsoprint, gentle;
        alsoprint = (autocvar_hud_panel_notify_print || !panel_enabled); // print message to console if: notify panel disabled, or cvar to do so enabled
@@ -2051,97 +2054,10 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s
                        if(alsoprint)
                                print(sprintf(_("%s^7 has dropped the ball!\n"), s1));
                }
-       }
+       }*/
 }
 
-void HUD_KillCenterprint(string s1, string s2, float type, float msg)
-{
-       float gentle;
-       gentle = (autocvar_cl_gentle || autocvar_cl_gentle_messages);
-       if(msg == MSG_SUICIDE) {
-               if (type == DEATH_TEAMCHANGE) {
-                       centerprint_hud(sprintf(_("You are now on: %s"), s1));
-               } else if (type == DEATH_AUTOTEAMCHANGE) {
-                       centerprint_hud(sprintf(_("You have been moved into a different team to improve team balance\nYou are now on: %s"), s1));
-               } else if (type == DEATH_CAMP) {
-                       if(gentle)
-                               centerprint_hud(_("^1Reconsider your tactics, camper!"));
-                       else
-                               centerprint_hud(_("^1Die camper!"));
-               } else if (type == DEATH_NOAMMO) {
-                       if(gentle)
-                               centerprint_hud(_("^1You are reinserted into the game for running out of ammo..."));
-                       else
-                               centerprint_hud(_("^1You were killed for running out of ammo..."));
-               } else if (type == DEATH_ROT) {
-                       if(gentle)
-                               centerprint_hud(_("^1You need to preserve your health"));
-                       else
-                               centerprint_hud(_("^1You grew too old without taking your medicine"));
-               } else if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) {
-                       if(gentle)
-                               centerprint_hud(_("^1Don't go against team mates!"));
-                       else
-                               centerprint_hud(_("^1Don't shoot your team mates!"));
-               } else if (type == DEATH_QUIET) {
-                       // do nothing
-               } else { // generic message
-                       if(gentle)
-                               centerprint_hud(_("^1You need to be more careful!"));
-                       else
-                               centerprint_hud(_("^1You killed your own dumb self!"));
-               }
-       } else if(msg == MSG_KILL) {
-               if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) {
-                       if(gentle) {
-                               centerprint_hud(sprintf(_("^1Moron! You went against ^7%s^1, a team mate!"), s1));
-                       } else {
-                               centerprint_hud(sprintf(_("^1Moron! You fragged ^7%s^1, a team mate!"), s1));
-                       }
-               } else if (type == KILL_FIRST_BLOOD) {
-                       if(gentle) {
-                               centerprint_hud(_("^1First score"));
-                       } else {
-                               centerprint_hud(_("^1First blood"));
-                       }
-               } else if (type == KILL_FIRST_VICTIM) {
-                       if(gentle) {
-                               centerprint_hud(_("^1First casualty"));
-                       } else {
-                               centerprint_hud(_("^1First victim"));
-                       }
-               } else if (type == KILL_TYPEFRAG) { // s2 contains "advanced kill messages" such as ping, handicap...
-                       if(gentle) {
-                               centerprint_hud(strcat(sprintf(_("^1You scored against ^7%s^1 who was typing!"), s1), s2));
-                       } else {
-                               centerprint_hud(strcat(sprintf(_("^1You typefragged ^7%s"), s1), s2));
-                       }
-               } else if (type == KILL_TYPEFRAGGED) {
-                       if(gentle) {
-                               centerprint_hud(strcat(sprintf(_("^1You were scored against by ^7%s^1 while you were typing!"), s1), s2));
-                       } else {
-                               centerprint_hud(strcat(sprintf(_("^1You were typefragged by ^7%s"), s1), s2));
-                       }
-               } else if (type == KILL_FRAG) {
-                       if(gentle) {
-                               centerprint_hud(strcat(sprintf(_("^4You scored against ^7%s"), s1), s2));
-                       } else {
-                               centerprint_hud(strcat(sprintf(_("^4You fragged ^7%s"), s1), s2));
-                       }
-               } else { // generic message
-                       if(gentle) {
-                               centerprint_hud(strcat(sprintf(_("^1You were scored against by ^7%s"), s1), s2));
-                       } else {
-                               centerprint_hud(strcat(sprintf(_("^1You were fragged by ^7%s"), s1), s2));
-                       }
-               }
-       } else if(msg == MSG_KILL_ACTION) {
-               // TODO: invent more centerprints here?
-               centerprint_hud(_("^1Watch your step!"));
-       }
-}
-
-void HUD_Notify (void)
+void HUD_Notify(void)
 {
        if(!autocvar__hud_configure)
        {
@@ -2177,14 +2093,11 @@ void HUD_Notify (void)
        float fadetime;
        fadetime = autocvar_hud_panel_notify_fadetime;
 
-       string s;
-
-       vector pos_attacker, pos_victim;
-       vector weap_pos;
+       vector pos_attacker, pos_victim, pos_icon;
        float width_attacker;
-       string attacker, victim;
+       string attacker, victim, icon;
 
-       float i, j, w, type, step, limit;
+       float i, j, step, limit;
        if(autocvar_hud_panel_notify_flip) //order items from the top down
        {
                i = 0;
@@ -2208,234 +2121,62 @@ void HUD_Notify (void)
                                a = entries - 1 - i;
                        attacker = textShortenToWidth(sprintf(_("Player %d"), a+1), 0.48 * mySize_x - height, fontsize, stringwidth_colors);
                        victim = textShortenToWidth(sprintf(_("Player %d"), a+2), 0.48 * mySize_x - height, fontsize, stringwidth_colors);
-                       s = strcat("weapon", get_weaponinfo(WEP_FIRST + mod(floor(a*2.4), WEP_LAST)).netname);
+                       icon = strcat("weapon", get_weaponinfo(WEP_FIRST + mod(floor(a*2.4), WEP_LAST)).netname);
                        a = bound(0, (when - a) / 4, 1);
                        goto hud_config_notifyprint;
                }
-
-               if (j == KN_MAX_ENTRIES)
-                       j = 0;
-
-               if(killnotify_times[j] + when > time)
-                       a = 1;
-               else if(fadetime)
-               {
-                       a = bound(0, (killnotify_times[j] + when + fadetime - time) / fadetime, 1);
-                       if(!a)
-                       {
-                               break;
-                       }
-               }
                else
                {
-                       break;
-               }
-
-               s = "";
-
-               type = killnotify_deathtype[j];
-               w = DEATH_WEAPONOF(type);
+                       if (j == KN_MAX_ENTRIES)
+                               j = 0;
 
-               // TODO: maybe print in team colors?
-               //
-               // Y [used by] X
-               if(killnotify_actiontype[j] == 0) 
-               {
-                       if(type == DEATH_GENERIC)
-                       {
-                               s = "notify_death";
-                       }
-                       else if(type == DEATH_NOAMMO)
-                       {
-                               s = "notify_outofammo";
-                       }
-                       else if(type == DEATH_KILL)
-                       {
-                               s = "notify_selfkill";
-                       }
-                       else if(type == DEATH_CAMP)
-                       {
-                               s = "notify_camping";
-                       }
-                       else if(type == KILL_TEAM_RED)
-                       {
-                               s = "notify_teamkill_red";
-                       }
-                       else if(type == KILL_TEAM_BLUE)
-                       {
-                               s = "notify_teamkill_blue";
-                       }
-                       else if(type == DEATH_DROWN)
-                       {
-                               s = "notify_water";
-                       }
-                       else if(type == DEATH_SLIME)
-                       {
-                               s = "notify_slime";
-                       }
-                       else if(type == DEATH_LAVA)
-                       {
-                               s = "notify_lava";
-                       }
-                       else if(type == DEATH_FALL)
-                       {
-                               s = "notify_fall";
-                       }
-                       else if(type == DEATH_SHOOTING_STAR)
-                       {
-                               s = "notify_shootingstar";
-                       }
-                       else if(type == DEATH_HURTTRIGGER || type == DEATH_CUSTOM)
-                       {
-                               s = "notify_death";
-                       }
-                       else if(type == INFO_GOTFLAG)
-                       {
-                               if(killnotify_victims[j] == "^1RED^7 flag")
-                               {
-                                       s = "notify_red_taken";
-                               }
-                               else
-                               {
-                                       s = "notify_blue_taken";
-                               }
-                       }
-                       else if(type == INFO_RETURNFLAG)
-                       {
-                               if(killnotify_victims[j] == "^1RED^7 flag")
-                               {
-                                       s = "notify_red_returned";
-                               }
-                               else
-                               {
-                                       s = "notify_blue_returned";
-                               }
-                       }
-                       else if(type == INFO_LOSTFLAG)
-                       {
-                               if(killnotify_victims[j] == "^1RED^7 flag")
-                               {
-                                       s = "notify_red_lost";
-                               }
-                               else
-                               {
-                                       s = "notify_blue_lost";
-                               }
-                       }
-                       else if(type == INFO_CAPTUREFLAG)
+                       if(killnotify_times[j] + when > time)
+                               a = 1;
+                       else if(fadetime)
                        {
-                               if(killnotify_victims[j] == "^1RED^7 flag")
+                               a = bound(0, (killnotify_times[j] + when + fadetime - time) / fadetime, 1);
+                               if(!a)
                                {
-                                       s = "notify_red_captured";
-                               }
-                               else
-                               {
-                                       s = "notify_blue_captured";
+                                       break;
                                }
                        }
-                       else if(type == KA_DROPBALL)
-                       {
-                               s = "notify_balldropped";
-                       }
-                       else if(type == KA_PICKUPBALL)
+                       else
                        {
-                               s = "notify_ballpickedup";
+                               break;
                        }
                        
-                       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) + (0.5 * (height - fontheight)));
-                       weap_pos = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height;
-
-                       if(s != "")
-                       {
-                               drawpic_aspect_skin(weap_pos, s, '2 1 0' * height, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
-                               drawcolorcodedstring(pos_attacker, attacker, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
-                       }
+                       attacker = killnotify_attackers[j];
+                       victim = killnotify_victims[j];
+                       icon = killnotify_icon[j];
                }
-               // X [did action to] Y
-               else
+
+               //type = killnotify_deathtype[j];
+               //w = DEATH_WEAPONOF(type);
+
+               if(icon != "")
                {
-                       if(type & HITTYPE_SECONDARY && w == WEP_LASER)
+                       if((attacker != "") && (victim == ""))
                        {
-                               s = "notify_melee_laser";
-                       }
-                       else if(type & HITTYPE_SECONDARY && w == WEP_SHOTGUN)
-                       {
-                               s = "notify_melee_shotgun";
-                       }
-                       else if(type & HITTYPE_HEADSHOT && (w == WEP_RIFLE || w == WEP_MINSTANEX)) // all headshot weapons go here
-                       {
-                               s = "notify_headshot";
-                       }
-                       else if(WEP_VALID(w))
-                       {
-                               self = get_weaponinfo(w);
-                               s = strcat("weapon", self.netname);
-                       }
-                       else if(type == KILL_TEAM_RED)
-                       {
-                               s = "notify_teamkill_red";
-                       }
-                       else if(type == KILL_TEAM_BLUE)
-                       {
-                               s = "notify_teamkill_red";
-                       }
-                       else if(type == DEATH_TELEFRAG)
-                       {
-                               s = "notify_telefrag";
-                       }
-                       else if(type == DEATH_DROWN)
-                       {
-                               s = "notify_water";
-                       }
-                       else if(type == DEATH_SLIME)
-                       {
-                               s = "notify_slime";
-                       }
-                       else if(type == DEATH_LAVA)
-                       {
-                               s = "notify_lava";
-                       }
-                       else if(type == DEATH_FALL)
-                       {
-                               s = "notify_fall";
-                       }
-                       else if(type == DEATH_SHOOTING_STAR)
-                       {
-                               s = "notify_shootingstar";
-                       }
-                       else if(type == DEATH_HURTTRIGGER || type == DEATH_CUSTOM) // DEATH_CUSTOM is also void, right?
-                       {
-                               s = "notify_void";
-                       }
-                       else if(type == RACE_SERVER_RECORD)
-                       {
-                               s = "race_newrecordserver";
-                       }
-                       else if(type == RACE_NEW_RANK)
-                       {
-                               s = "race_newrankyellow";
-                       }
-                       else if(type == RACE_NEW_TIME)
-                       {
-                               s = "race_newtime";
+                               // Y [used by] X
+                               attacker = textShortenToWidth(attacker, 0.73 * mySize_x - height, fontsize, stringwidth_colors);
+                               pos_attacker = pos + eX * (0.27 * mySize_x + height) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight)));
+                               pos_icon = pos + eX * 0.25 * mySize_x - eX * height + eY * i * height;
+
+                               drawpic_aspect_skin(pos_icon, icon, '2 1 0' * height, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                               drawcolorcodedstring(pos_attacker, attacker, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
                        }
-                       else if(type == RACE_FAIL)
+                       else if((attacker != "") && (victim != ""))
                        {
-                               s = "race_newfail";
-                       }
-
-                       attacker = textShortenToWidth(killnotify_attackers[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors);
-                       victim = textShortenToWidth(killnotify_victims[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors);
+                               // X [did action to] Y
+                               attacker = textShortenToWidth(attacker, 0.48 * mySize_x - height, fontsize, stringwidth_colors);
+                               victim = textShortenToWidth(victim, 0.48 * mySize_x - height, fontsize, stringwidth_colors);
 :hud_config_notifyprint
-                       width_attacker = stringwidth(attacker, TRUE, fontsize);
-                       pos_attacker = pos + eX * (0.48 * mySize_x - height - width_attacker) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight)));
-                       pos_victim = pos + eX * (0.52 * mySize_x + height) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight)));
-                       weap_pos = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height;
+                               width_attacker = stringwidth(attacker, TRUE, fontsize);
+                               pos_attacker = pos + eX * (0.48 * mySize_x - height - width_attacker) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight)));
+                               pos_victim = pos + eX * (0.52 * mySize_x + height) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight)));
+                               pos_icon = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height;
 
-                       if(s != "")
-                       {
-                               drawpic_aspect_skin(weap_pos, s, '2 1 0' * height, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                               drawpic_aspect_skin(pos_icon, icon, '2 1 0' * height, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
                                drawcolorcodedstring(pos_attacker, attacker, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
                                drawcolorcodedstring(pos_victim, victim, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
                        }
@@ -2656,8 +2397,8 @@ void HUD_Radar(void)
        for(tm = world; (tm = find(tm, classname, "entcs_receiver")); )
        {
                color2 = GetPlayerColor(tm.sv_entnum);
-               //if(color == COLOR_SPECTATOR || color == color2)
-                       draw_teamradar_player(tm.origin, tm.angles, GetTeamRGB(color2));
+               //if(color == FL_SPECTATOR || color == color2)
+                       draw_teamradar_player(tm.origin, tm.angles, Team_ColorRGB(color2));
        }
        draw_teamradar_player(view_origin, view_angles, '1 1 1');
 
@@ -2696,7 +2437,7 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me, float team_count)
                        for(i=0; i<team_count; ++i) {
                                if (i == floor((entries - 2) / players_per_team) || (entries == 1 && i == 0))
                                        HUD_Panel_DrawHighlight(pos + eX * score_size * i, eX * score_size + eY * fontsize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                               drawstring_aspect(pos + eX * score_size * i, ftos(175 - 23*i), eX * score_size + eY * fontsize_y, GetTeamRGB(ColorByTeam(i)) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawstring_aspect(pos + eX * score_size * i, ftos(175 - 23*i), eX * score_size + eY * fontsize_y, Team_ColorRGB(ColorByTeam(i)) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
                        }
                        first_pl = 1;
                        pos_y += fontsize_y;
@@ -2721,7 +2462,7 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me, float team_count)
                        }
 
                        if (team_count)
-                               score_color = GetTeamRGB(ColorByTeam(floor((i - first_pl) / players_per_team))) * 0.8;
+                               score_color = Team_ColorRGB(ColorByTeam(floor((i - first_pl) / players_per_team))) * 0.8;
                        s = textShortenToWidth(s, name_size, fontsize, stringwidth_colors);
                        drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, TRUE, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
                        drawstring(pos + eX * (name_size + spacing_size), ftos(score), fontsize, score_color, panel_fg_alpha, DRAWFLAG_NORMAL);
@@ -2737,11 +2478,11 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me, float team_count)
                // show team scores in the first line
                float score_size = mySize_x / team_count;
                for(tm = teams.sort_next; tm; tm = tm.sort_next) {
-                       if(tm.team == COLOR_SPECTATOR)
+                       if(tm.team == FL_SPECTATOR)
                                continue;
                        if (tm.team == myteam)
                                drawfill(pos + eX * score_size * i, eX * score_size + eY * fontsize_y, '1 1 1', highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                       drawstring_aspect(pos + eX * score_size * i, ftos(tm.(teamscores[ts_primary])), eX * score_size + eY * fontsize_y, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                       drawstring_aspect(pos + eX * score_size * i, ftos(tm.(teamscores[ts_primary])), eX * score_size + eY * fontsize_y, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
                        ++i;
                }
                first_pl = 1;
@@ -2753,14 +2494,14 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me, float team_count)
        do
        for (pl = players.sort_next; pl && i<entries; pl = pl.sort_next)
        {
-               if ((team_count && pl.team != tm.team) || pl.team == COLOR_SPECTATOR)
+               if ((team_count && pl.team != tm.team) || pl.team == FL_SPECTATOR)
                        continue;
 
                if (i == entries-1 && !me_printed && pl != me)
                if (autocvar_hud_panel_score_rankings == 1 && spectatee_status != -1)
                {
                        for (pl = me.sort_next; pl; pl = pl.sort_next)
-                               if (pl.team != COLOR_SPECTATOR)
+                               if (pl.team != FL_SPECTATOR)
                                        break;
 
                        if (pl)
@@ -2778,14 +2519,14 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me, float team_count)
                        drawfill(pos, eX * mySize_x + eY * fontsize_y, rgb, highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                }
                if (team_count)
-                       score_color = GetTeamRGB(pl.team) * 0.8;
+                       score_color = Team_ColorRGB(pl.team) * 0.8;
                s = textShortenToWidth(GetPlayerName(pl.sv_entnum), name_size, fontsize, stringwidth_colors);
                drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, TRUE, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
                drawstring(pos + eX * (name_size + spacing_size), ftos(pl.(scores[ps_primary])), fontsize, score_color, panel_fg_alpha, DRAWFLAG_NORMAL);
                pos_y += fontsize_y;
                ++i;
        }
-       while (i<entries && team_count && (tm = tm.sort_next) && (tm.team != COLOR_SPECTATOR || (tm = tm.sort_next)));
+       while (i<entries && team_count && (tm = tm.sort_next) && (tm.team != FL_SPECTATOR || (tm = tm.sort_next)));
 }
 
 void HUD_Score(void)
@@ -2906,7 +2647,7 @@ void HUD_Score(void)
                vector score_pos, score_size; //for scores other than myteam
                if (spectatee_status == -1 || autocvar_hud_panel_score_rankings)
                {
-                       for(tm = teams.sort_next; tm, tm.team != COLOR_SPECTATOR; tm = tm.sort_next)
+                       for(tm = teams.sort_next; tm, tm.team != FL_SPECTATOR; tm = tm.sort_next)
                                ++scores_count;
                        if (autocvar_hud_panel_score_rankings)
                        {
@@ -2945,7 +2686,7 @@ void HUD_Score(void)
                draw_beginBoldFont();
                row = column = 0;
                for(tm = teams.sort_next; tm; tm = tm.sort_next) {
-                       if(tm.team == COLOR_SPECTATOR)
+                       if(tm.team == FL_SPECTATOR)
                                continue;
                        score = tm.(teamscores[ts_primary]);
                        if(autocvar__hud_configure)
@@ -2959,7 +2700,7 @@ void HUD_Score(void)
                                score_pos = pos + eX * column * (score_size_x + offset_x) + eY * row * (score_size_y + offset_y);
                                if (max_fragcount == score)
                                        HUD_Panel_DrawHighlight(score_pos, score_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                               drawstring_aspect(score_pos, ftos(score), score_size, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawstring_aspect(score_pos, ftos(score), score_size, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
                                ++row;
                                if(row >= rows)
                                {
@@ -2970,11 +2711,11 @@ void HUD_Score(void)
                        else if(tm.team == myteam) {
                                if (max_fragcount == score)
                                        HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                               drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize_x + eY * mySize_y, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize_x + eY * mySize_y, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
                        } else {
                                if (max_fragcount == score)
                                        HUD_Panel_DrawHighlight(pos + eX * 0.75 * mySize_x + eY * (1/3) * rows * mySize_y, score_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                               drawstring_aspect(pos + eX * 0.75 * mySize_x + eY * (1/3) * rows * mySize_y, ftos(score), score_size, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawstring_aspect(pos + eX * 0.75 * mySize_x + eY * (1/3) * rows * mySize_y, ftos(score), score_size, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
                                ++rows;
                        }
                }
@@ -3388,7 +3129,7 @@ void HUD_Mod_CTF(vector pos, vector mySize)
                case 2: red_icon = "flag_red_lost"; break;
                case 3: red_icon = "flag_red_carrying"; red_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break;
                default:
-                       if((stat_items & IT_CTF_SHIELDED) && (myteam == COLOR_TEAM2))
+                       if((stat_items & IT_CTF_SHIELDED) && (myteam == FL_TEAM_2))
                                red_icon = "flag_red_shielded";
                        else
                                red_icon = string_null;
@@ -3401,7 +3142,7 @@ void HUD_Mod_CTF(vector pos, vector mySize)
                default:
                        if(redflag == 3)
                                red_icon_prevstatus = "flag_red_carrying"; // make it more visible
-                       else if((stat_items & IT_CTF_SHIELDED) && (myteam == COLOR_TEAM2))
+                       else if((stat_items & IT_CTF_SHIELDED) && (myteam == FL_TEAM_2))
                                red_icon_prevstatus = "flag_red_shielded";
                        else
                                red_icon_prevstatus = string_null;
@@ -3416,7 +3157,7 @@ void HUD_Mod_CTF(vector pos, vector mySize)
                case 2: blue_icon = "flag_blue_lost"; break;
                case 3: blue_icon = "flag_blue_carrying"; blue_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break;
                default:
-                       if((stat_items & IT_CTF_SHIELDED) && (myteam == COLOR_TEAM1))
+                       if((stat_items & IT_CTF_SHIELDED) && (myteam == FL_TEAM_1))
                                blue_icon = "flag_blue_shielded";
                        else
                                blue_icon = string_null;
@@ -3429,7 +3170,7 @@ void HUD_Mod_CTF(vector pos, vector mySize)
                default:
                        if(blueflag == 3)
                                blue_icon_prevstatus = "flag_blue_carrying"; // make it more visible
-                       else if((stat_items & IT_CTF_SHIELDED) && (myteam == COLOR_TEAM1))
+                       else if((stat_items & IT_CTF_SHIELDED) && (myteam == FL_TEAM_1))
                                blue_icon_prevstatus = "flag_blue_shielded";
                        else
                                blue_icon_prevstatus = string_null;
@@ -3437,7 +3178,7 @@ void HUD_Mod_CTF(vector pos, vector mySize)
        }
 
        if(mySize_x > mySize_y) {
-               if (myteam == COLOR_TEAM1) { // always draw own flag on left
+               if (myteam == FL_TEAM_1) { // always draw own flag on left
                        redflag_pos = pos;
                        blueflag_pos = pos + eX * 0.5 * mySize_x;
                } else {
@@ -3446,7 +3187,7 @@ void HUD_Mod_CTF(vector pos, vector mySize)
                }
                flag_size = eX * 0.5 * mySize_x + eY * mySize_y;
        } else {
-               if (myteam == COLOR_TEAM1) { // always draw own flag on left
+               if (myteam == FL_TEAM_1) { // always draw own flag on left
                        redflag_pos = pos;
                        blueflag_pos = pos + eY * 0.5 * mySize_y;
                } else {
@@ -3560,16 +3301,16 @@ void HUD_Mod_KH(vector pos, vector mySize)
                {
                        switch(keyteam)
                        {
-                               case COLOR_TEAM1:
+                               case FL_TEAM_1:
                                        drawpic_aspect_skin(pa, "kh_redarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL);  // show 30% theAlpha key
                                        break;
-                               case COLOR_TEAM2:
+                               case FL_TEAM_2:
                                        drawpic_aspect_skin(pa, "kh_bluearrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL);  // show 30% theAlpha key
                                        break;
-                               case COLOR_TEAM3:
+                               case FL_TEAM_3:
                                        drawpic_aspect_skin(pa, "kh_yellowarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL);  // show 30% theAlpha key
                                        break;
-                               case COLOR_TEAM4:
+                               case FL_TEAM_4:
                                        drawpic_aspect_skin(pa, "kh_pinkarrow", kh_asize, '1 1 1', aa, DRAWFLAG_NORMAL);  // show 30% theAlpha key
                                        break;
                                default:
@@ -3916,7 +3657,7 @@ void HUD_Mod_Dom(vector myPos, vector mySize)
        entity tm;
        float teams_count = 0;
        for(tm = teams.sort_next; tm; tm = tm.sort_next)
-               if(tm.team != COLOR_SPECTATOR)
+               if(tm.team != FL_SPECTATOR)
                        ++teams_count;
 
        float layout = autocvar_hud_panel_modicons_dom_layout;
@@ -4375,7 +4116,7 @@ void HUD_InfoMessages(void)
                        {
                                for(; tm.sort_next; tm = tm.sort_next)
                                {
-                                       if(!tm.team_size || tm.team == COLOR_SPECTATOR)
+                                       if(!tm.team_size || tm.team == FL_SPECTATOR)
                                                continue;
                                        if(!ts_min) ts_min = tm.team_size;
                                        else ts_min = min(ts_min, tm.team_size);
@@ -4387,7 +4128,7 @@ void HUD_InfoMessages(void)
                                        s = strcat(blinkcolor, _("Teamnumbers are unbalanced!"));
                                        tm = GetTeam(myteam, false);
                                        if (tm)
-                                       if (tm.team != COLOR_SPECTATOR)
+                                       if (tm.team != FL_SPECTATOR)
                                        if (tm.team_size == ts_max)
                                                s = strcat(s, sprintf(_(" Press ^3%s%s to adjust"), getcommandkey("team menu", "menu_showteamselect"), blinkcolor));
                                        drawInfoMessage(s)
index 28536c256b017f5f7a0397e86728c90fe0d4682f..8369a5ff20bc9ce399d0eef7c1a35d1063b4d8a9 100644 (file)
@@ -38,16 +38,6 @@ float gametype;
 //.float ctf_state;
 //.float health;
 
-// Constants
-const float COLOR_TEAM_RED = 64;
-const float COLOR_TEAM_BLUE = 208;
-
-const float COLOR_TEAM1       = 4;  // red
-const float COLOR_TEAM2       = 13; // blue
-const float COLOR_TEAM3       = 12; // yellow
-const float COLOR_TEAM4       = 9; // pink
-const float COLOR_SPECTATOR = 1337;
-
 #define FONT_DEFAULT 0
 #define FONT_USER 8
 
index 9e5505b0a5bb5c47c0b1af68e5ff225623332985..c56ee1d2ff67809a0ba6dc9c077bdbf0648edea6 100644 (file)
@@ -108,7 +108,7 @@ entity GetTeam(float Team, float add)
 {
        float num;
        entity tm;
-       num = (Team == COLOR_SPECTATOR) ? 16 : Team;
+       num = (Team == FL_SPECTATOR) ? 16 : Team;
        if(teamslots[num])
                return teamslots[num];
        if not(add)
@@ -164,20 +164,6 @@ string ColorTranslateRGB(string s)
                return s;
 }
 
-string Team_ColorCode(float teamid)
-{
-    if (teamid == COLOR_TEAM1)
-        return "^1";
-    else if (teamid == COLOR_TEAM2)
-        return "^4";
-    else if (teamid == COLOR_TEAM3)
-        return "^3";
-    else if (teamid == COLOR_TEAM4)
-        return "^6";
-    else
-        return "^7";
-}
-
 // decolorizes and team colors the player name when needed
 string playername(string thename, float teamid)
 {
index 9d968f1fe7d86e1ceeecf09b135c6dcc1e23d4f7..8b83daebeebdb30253b2722b70db4b71269eb9a4 100644 (file)
@@ -14,8 +14,11 @@ Defs.qc
 ../warpzonelib/common.qh
 ../warpzonelib/client.qh
 
+../common/teams.qh
 ../common/util.qh
 ../common/items.qh
+../common/deathtypes.qh
+../common/notifications.qh
 ../common/explosion_equation.qh
 ../common/mapinfo.qh
 ../common/command/markup.qh
@@ -39,7 +42,6 @@ movetypes.qh
 prandom.qh
 bgmscript.qh
 noise.qh
-teamplay.qh
 tturrets.qh
 ../server/tturrets/include/turrets_early.qh
 ../server/movelib.qc
@@ -54,7 +56,6 @@ player_skeleton.qh
 
 sortlist.qc
 miscfunctions.qc
-teamplay.qc
 ../server/t_items.qc
 
 teamradar.qc
@@ -97,6 +98,7 @@ bgmscript.qc
 noise.qc
 
 ../common/util.qc
+../common/notifications.qc
 ../common/command/markup.qc
 ../common/command/rpn.qc
 ../common/command/generic.qc
index 1aa1b6a435ac5d015e5c27f0d4cd24cbbfdc61bf..e4e3767f1c2a5207c107c13ea607d5df4d8d76fb 100644 (file)
@@ -152,16 +152,16 @@ float HUD_ComparePlayerScores(entity left, entity right)
        vr = GetPlayerColor(right.sv_entnum);
 
        if(!left.gotscores)
-               vl = COLOR_SPECTATOR;
+               vl = FL_SPECTATOR;
        if(!right.gotscores)
-               vr = COLOR_SPECTATOR;
+               vr = FL_SPECTATOR;
 
        if(vl > vr)
                return true;
        if(vl < vr)
                return false;
 
-       if(vl == COLOR_SPECTATOR)
+       if(vl == FL_SPECTATOR)
        {
                // FIRST the one with scores (spectators), THEN the ones without (downloaders)
                // no other sorting
@@ -207,9 +207,9 @@ float HUD_CompareTeamScores(entity left, entity right)
 {
        float i, r;
 
-       if(left.team == COLOR_SPECTATOR)
+       if(left.team == FL_SPECTATOR)
                return 1;
-       if(right.team == COLOR_SPECTATOR)
+       if(right.team == FL_SPECTATOR)
                return 0;
 
        r = HUD_CompareScore(left.teamscores[ts_primary], right.teamscores[ts_primary], teamscores_flags[ts_primary]);
@@ -669,11 +669,11 @@ string HUD_FixScoreboardColumnWidth(float i, string str)
 void HUD_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_number)
 {
        vector tmp, rgb;
-       rgb = GetTeamRGB(pl.team);
+       rgb = Team_ColorRGB(pl.team);
        string str;
        float i, field;
        float is_spec;
-       is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);
+       is_spec = (GetPlayerColor(pl.sv_entnum) == FL_SPECTATOR);
 
        if((rgb == '1 1 1') && (!is_spec)) {
                rgb_x = autocvar_scoreboard_color_bg_r + 0.5;
@@ -917,7 +917,7 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz
        else
                for(pl = players.sort_next; pl; pl = pl.sort_next)
                {
-                       if(pl.team == COLOR_SPECTATOR)
+                       if(pl.team == FL_SPECTATOR)
                                continue;
                        HUD_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localnum), i);
                        pos_y += 1.25 * hud_fontsize_y;
@@ -1120,7 +1120,7 @@ vector HUD_DrawScoreboardRankings(vector pos, entity pl,  vector rgb, vector bg_
                return pos;
 
        float is_spec;
-       is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);
+       is_spec = (GetPlayerColor(pl.sv_entnum) == FL_SPECTATOR);
        vector hl_rgb;
        hl_rgb_x = autocvar_scoreboard_color_bg_r + 0.5;
        hl_rgb_y = autocvar_scoreboard_color_bg_g + 0.5;
@@ -1237,11 +1237,11 @@ void HUD_DrawScoreboard()
                team_score_baseoffset = eY * (2 * autocvar_scoreboard_border_thickness + hud_fontsize_y) - eX * (autocvar_scoreboard_border_thickness + hud_fontsize_x * 0.25);
                for(tm = teams.sort_next; tm; tm = tm.sort_next)
                {
-                       if(tm.team == COLOR_SPECTATOR)
+                       if(tm.team == FL_SPECTATOR)
                                continue;
 
                        draw_beginBoldFont();
-                       rgb = GetTeamRGB(tm.team);
+                       rgb = Team_ColorRGB(tm.team);
                        str = ftos(tm.(teamscores[ts_primary]));
                        drawstring(pos + team_score_baseoffset - eX * stringwidth(str, FALSE, hud_fontsize * 1.5), str, hud_fontsize * 1.5, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
 
@@ -1273,7 +1273,7 @@ void HUD_DrawScoreboard()
 
                for(tm = teams.sort_next; tm; tm = tm.sort_next)
                {
-                       if(tm.team == COLOR_SPECTATOR)
+                       if(tm.team == FL_SPECTATOR)
                                continue;
 
                        pos = HUD_Scoreboard_MakeTable(pos, tm, rgb, bg_size);
@@ -1293,14 +1293,14 @@ void HUD_DrawScoreboard()
        }
        else if(autocvar_scoreboard_accuracy && spectatee_status != -1 && !warmup_stage) {
                if(teamplay)
-                       pos = HUD_DrawScoreboardAccuracyStats(pos, GetTeamRGB(myteam), bg_size);
+                       pos = HUD_DrawScoreboardAccuracyStats(pos, Team_ColorRGB(myteam), bg_size);
                else
                        pos = HUD_DrawScoreboardAccuracyStats(pos, rgb, bg_size);
        }
 
                
        if(teamplay)
-               pos = HUD_DrawMapStats(pos, GetTeamRGB(myteam), bg_size);
+               pos = HUD_DrawMapStats(pos, Team_ColorRGB(myteam), bg_size);
        else
                pos = HUD_DrawMapStats(pos, rgb, bg_size);
 
@@ -1310,7 +1310,7 @@ void HUD_DrawScoreboard()
        tmp = pos;
        for(pl = players.sort_next; pl; pl = pl.sort_next)
        {
-               if(pl.team != COLOR_SPECTATOR)
+               if(pl.team != FL_SPECTATOR)
                        continue;
                pos_y += 1.25 * hud_fontsize_y;
                HUD_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localnum), specs);
index 8b4f7a09f6996bbc22c5dcad8e9403e80908fe2e..3bc231c254ffa4991b6d59acd73286880a952aeb 100644 (file)
@@ -187,7 +187,7 @@ void Draw_ShowNames_All()
        {
                float t;
                t = GetPlayerColor(i);
-               if(t == COLOR_SPECTATOR)
+               if(t == FL_SPECTATOR)
                        continue;
 
                entity e;
diff --git a/qcsrc/client/teamplay.qc b/qcsrc/client/teamplay.qc
deleted file mode 100644 (file)
index 80d8931..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-float TeamByColor(float color)
-{
-       switch(color)
-       {
-       case COLOR_TEAM1: return 0;
-       case COLOR_TEAM2: return 1;
-       case COLOR_TEAM3: return 2;
-       case COLOR_TEAM4: return 3;
-       default: return 0;
-       }
-}
-float ColorByTeam(float i)
-{
-       switch(i)
-       {
-       case 0: return COLOR_TEAM1;
-       case 1: return COLOR_TEAM2;
-       case 2: return COLOR_TEAM3;
-       case 3: return COLOR_TEAM4;
-       default: return COLOR_TEAM1;
-       }
-}
-
-float GetPlayerColorForce(float i)
-{
-       if(!teamplay)
-               return 0;
-       else
-               return stof(getplayerkeyvalue(i, "colors")) & 15;
-}
-
-float GetPlayerColor(float i)
-{
-       if not(playerslots[i].gotscores) // unconnected
-               return COLOR_SPECTATOR;
-       else if(stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR)
-               return COLOR_SPECTATOR;
-       else
-               return GetPlayerColorForce(i);
-}
-
-string GetPlayerName(float i)
-{
-       return ColorTranslateRGB(getplayerkeyvalue(i, "name"));
-}
-
-vector GetTeamRGB(float color)
-{
-       switch(color)
-       {
-       default: return '1 1 1';
-       case COLOR_TEAM1: return '1 0 0'; // red
-       case COLOR_TEAM2: return '0 0 1'; // blue
-       case COLOR_TEAM3: return '1 1 0'; // yellow
-       case COLOR_TEAM4: return '1 0 1'; // pink
-       }
-}
-
-string GetTeamName(float color)
-{
-       switch(color)
-       {
-       default: return _("Spectators");
-       case COLOR_TEAM1: return _("Red Team");
-       case COLOR_TEAM2: return _("Blue Team");
-       case COLOR_TEAM3: return _("Yellow Team");
-       case COLOR_TEAM4: return _("Pink Team");
-       }
-}
diff --git a/qcsrc/client/teamplay.qh b/qcsrc/client/teamplay.qh
deleted file mode 100644 (file)
index 8335990..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-float teamplay;
-float myteam;
index 6f3b030502196171db72a24520b89fb7a9713979..6ac004c7b9e003b7cf445d22f15d4cbd3dcf2747 100644 (file)
@@ -163,22 +163,22 @@ void turret_changeteam()
 {      
        switch(self.team - 1)
        {
-        case COLOR_TEAM1: // Red
+        case FL_TEAM_1: // Red
             self.glowmod = '2 0 0';
             self.teamradar_color = '1 0 0';
             break;
 
-        case COLOR_TEAM2: // Blue
+        case FL_TEAM_2: // Blue
             self.glowmod = '0 0 2';
             self.teamradar_color = '0 0 1';
             break;
 
-        case COLOR_TEAM3: // Yellow
+        case FL_TEAM_3: // Yellow
             self.glowmod = '1 1 0';
             self.teamradar_color = '1 1 0';
             break;
 
-        case COLOR_TEAM4: // Pink
+        case FL_TEAM_4: // Pink
             self.glowmod = '1 0 1';
             self.teamradar_color = '1 0 1';
             break;
index 39b60a66b0c767d1342bec2dcb5e8645d6cd332a..8714383896d18163b0da5f25665b36cda85262c8 100644 (file)
@@ -423,7 +423,7 @@ void Draw_WaypointSprite()
                                spriteimage = self.netname;
                        break;
                case SPRITERULE_TEAMPLAY:
-                       if(t == COLOR_SPECTATOR + 1)
+                       if(t == FL_SPECTATOR + 1)
                                spriteimage = self.netname3;
                        else if(self.team == t)
                                spriteimage = self.netname2;
index fe176e3167da3d8dd916f4cd17afea04db7958de..766639856b6eb5a3520062e1143a594636378e81 100644 (file)
@@ -93,7 +93,7 @@ void GenericCommand_addtolist(float request, float argc)
        }
 }
 
-void GenericCommand_curl(float request, float argc)
+void GenericCommand_qc_curl(float request, float argc)
 {
        switch(request)
        {
@@ -166,7 +166,7 @@ void GenericCommand_curl(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " curl [--key N] [--cvar] [--exec] URL [postargs...]"));
+                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " qc_curl [--key N] [--cvar] [--exec] URL [postargs...]"));
                        return;
                }
        }
@@ -227,6 +227,55 @@ void GenericCommand_dumpcommands(float request)
        }
 }
 
+void GenericCommand_dumpnotifs(float request)
+{
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       float fh, alsoprint = FALSE;
+                       
+                       string filename = argv(1);
+                       
+                       if(filename == "")
+                       {
+                               filename = "notifications_dump.txt";
+                               alsoprint = FALSE;
+                       }
+                       else if(filename == "-")
+                       {
+                               filename = "notifications_dump.txt";
+                               alsoprint = TRUE;
+                       }
+                       fh = fopen(filename, FILE_WRITE);
+                       
+                       if(fh >= 0)
+                       {
+                               fputs(fh, "dump of notifications list:\n");
+                               if(alsoprint) { print("dump of notifications list:\n"); }
+                               Dump_Notifications(fh, alsoprint);
+                               print(sprintf("File located in ^2data/data/%s^7.\n", filename));
+                               fclose(fh);
+                       }
+                       else
+                       {
+                               print(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
+                       }
+                       return;
+               }
+                       
+               default:
+               case CMD_REQUEST_USAGE:
+               {
+                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]"));
+                       print("  Where 'filename' is the file to write (default is notifications_dump.txt),\n");
+                       print("  if supplied with '-' output to console as well as default,\n");
+                       print("  if left blank, it will only write to default.\n");
+                       return;
+               }
+       }
+}
+
 void GenericCommand_maplist(float request, float argc)
 {
        switch(request)
@@ -464,10 +513,11 @@ void GenericCommand_(float request)
 // Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
 #define GENERIC_COMMANDS(request,arguments,command) \
        GENERIC_COMMAND("addtolist", GenericCommand_addtolist(request, arguments), "Add a string to a cvar") \
-       GENERIC_COMMAND("curl", GenericCommand_curl(request, arguments), "Queries an URL") \
        GENERIC_COMMAND("dumpcommands", GenericCommand_dumpcommands(request), "Dump all commands on the program to *_cmd_dump.txt") \
+       GENERIC_COMMAND("dumpnotifs", GenericCommand_dumpnotifs(request), "Dump all notifications into notifications_dump.txt") \
        GENERIC_COMMAND("maplist", GenericCommand_maplist(request, arguments), "Automatic control of maplist") \
        GENERIC_COMMAND("nextframe", GenericCommand_nextframe(request, arguments, command), "Execute the given command next frame of this VM") \
+       GENERIC_COMMAND("qc_curl", GenericCommand_qc_curl(request, arguments), "Queries a URL") \
        GENERIC_COMMAND("removefromlist", GenericCommand_removefromlist(request, arguments), "Remove a string from a cvar") \
        GENERIC_COMMAND("rpn", GenericCommand_rpn(request, arguments, command), "RPN calculator") \
        GENERIC_COMMAND("settemp", GenericCommand_settemp(request, arguments), "Temporarily set a value to a cvar which is restored later") \
index 75f5a0bde762037387dbeb344989a47b1409bc01..a2562bc189987770d43e31a309c94f1185677aba 100644 (file)
@@ -39,14 +39,13 @@ const float TE_CSQC_PINGPLREPORT = 107;
 const float TE_CSQC_ANNOUNCE = 110;
 const float TE_CSQC_TARGET_MUSIC = 111;
 const float TE_CSQC_KILLNOTIFY = 112;
-const float TE_CSQC_KILLCENTERPRINT = 113;
-const float TE_CSQC_CENTERPRINT_GENERIC = 114;
-const float TE_CSQC_WEAPONCOMPLAIN = 115;
-const float TE_CSQC_NEX_SCOPE = 116;
-const float TE_CSQC_MINELAYER_MAXMINES = 117;
-const float TE_CSQC_HAGAR_MAXROCKETS = 118;
-const float TE_CSQC_VEHICLESETUP = 119;
-const float TE_CSQC_SVNOTICE = 120;
+const float TE_CSQC_CENTERPRINT_GENERIC = 113;
+const float TE_CSQC_WEAPONCOMPLAIN = 114;
+const float TE_CSQC_NEX_SCOPE = 115;
+const float TE_CSQC_MINELAYER_MAXMINES = 116;
+const float TE_CSQC_HAGAR_MAXROCKETS = 117;
+const float TE_CSQC_VEHICLESETUP = 118;
+const float TE_CSQC_SVNOTICE = 119;
 
 const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
 const float RACE_NET_CHECKPOINT_CLEAR = 1;
@@ -99,6 +98,7 @@ const float ENT_CLIENT_WARPZONE_TELEPORTED = 32;
 const float ENT_CLIENT_MODEL = 33;
 const float ENT_CLIENT_ITEM = 34;
 const float ENT_CLIENT_BUMBLE_RAYGUN = 35;
+const float ENT_CLIENT_NOTIFICATION = 36;
 
 const float ENT_CLIENT_TURRET = 40;
 const float ENT_CLIENT_AUXILIARYXHAIR = 50;
@@ -364,85 +364,6 @@ float SPECIES_ROBOT_RUSTY  =  4;
 float SPECIES_ROBOT_SHINY  =  5;
 float SPECIES_RESERVED     = 15;
 
-// Deathtypes (weapon deathtypes are the IT_* constants below)
-// NOTE: when adding death types, please add an explanation to Docs/spamlog.txt too.
-float DEATH_SPECIAL_START = 10000;
-float DEATH_FALL = 10000;
-float DEATH_TELEFRAG = 10001;
-float DEATH_DROWN = 10002;
-float DEATH_HURTTRIGGER = 10003;
-float DEATH_LAVA = 10004;
-float DEATH_SLIME = 10005;
-float DEATH_KILL = 10006;
-float DEATH_NOAMMO = 10007;
-float DEATH_SWAMP = 10008;
-float DEATH_TEAMCHANGE = 10009;
-float DEATH_AUTOTEAMCHANGE = 10010;
-float DEATH_CAMP = 10011;
-float DEATH_SHOOTING_STAR = 10012;
-float DEATH_ROT = 10013;
-float DEATH_MIRRORDAMAGE = 10014;
-float DEATH_TOUCHEXPLODE = 10015;
-float DEATH_CHEAT = 10016;
-float DEATH_FIRE = 10017;
-float DEATH_QUIET = 10021;
-
-float  DEATH_VHFIRST       = 10030;
-float  DEATH_VHCRUSH       = 10030;
-float  DEATH_SBMINIGUN     = 10031;
-float  DEATH_SBROCKET      = 10032;
-float  DEATH_SBBLOWUP      = 10033;
-float  DEATH_WAKIGUN       = 10034;
-float  DEATH_WAKIROCKET    = 10035;
-float  DEATH_WAKIBLOWUP    = 10036;
-float  DEATH_RAPTOR_CANNON = 10037;
-float  DEATH_RAPTOR_BOMB   = 10038;
-float  DEATH_RAPTOR_BOMB_SPLIT = 10039;
-float  DEATH_RAPTOR_DEATH   = 10040;
-float  DEATH_BUMB_GUN       = 10041;
-float  DEATH_BUMB_RAY       = 10042;
-float  DEATH_BUMB_RAY_HEAL  = 10043;
-float  DEATH_BUMB_DEATH     = 10044;
-float  DEATH_VHLAST         = 10044;
-#define DEATH_ISVEHICLE(t)  ((t) >= DEATH_VHFIRST && (t) <= DEATH_VHLAST)
-
-float DEATH_GENERIC = 10050;
-
-float DEATH_WEAPON = 10100;
-
-float DEATH_CUSTOM = 10300;
-
-float DEATH_TURRET                  = 10500;
-float DEATH_TURRET_EWHEEL           = 10501;
-float DEATH_TURRET_FLAC             = 10502;
-float DEATH_TURRET_MACHINEGUN       = 10503;
-float DEATH_TURRET_WALKER_GUN       = 10504;
-float DEATH_TURRET_WALKER_MEELE     = 10505;
-float DEATH_TURRET_WALKER_ROCKET    = 10506;
-float DEATH_TURRET_HELLION          = 10507;
-float DEATH_TURRET_HK               = 10508;
-float DEATH_TURRET_MLRS             = 10509;
-float DEATH_TURRET_PLASMA           = 10510;
-float DEATH_TURRET_PHASER           = 10511;
-float DEATH_TURRET_TESLA            = 10512;
-float DEATH_TURRET_LAST            = 10512;
-
-float DEATH_WEAPONMASK = 0xFF;
-float DEATH_HITTYPEMASK = 0x1F00; // which is WAY below 10000 used for normal deaths
-float HITTYPE_SECONDARY = 0x100;
-float HITTYPE_SPLASH = 0x200; // automatically set by RadiusDamage
-float HITTYPE_BOUNCE = 0x400;
-float HITTYPE_HEADSHOT = 0x800; // automatically set by Damage (if headshotbonus is set)
-float HITTYPE_RESERVED = 0x1000; // unused yet
-
-// macros to access these
-#define DEATH_ISTURRET(t)            ((t) >= DEATH_TURRET && (t) <= DEATH_TURRET_LAST)
-#define DEATH_ISSPECIAL(t)            ((t) >= DEATH_SPECIAL_START)
-#define DEATH_WEAPONOFWEAPONDEATH(t)  ((t) & DEATH_WEAPONMASK)
-#define DEATH_ISWEAPON(t,w)           (!DEATH_ISSPECIAL(t) && DEATH_WEAPONOFWEAPONDEATH(t) == (w))
-#define DEATH_WEAPONOF(t)             (DEATH_ISSPECIAL(t) ? 0 : DEATH_WEAPONOFWEAPONDEATH(t))
-#define WEP_VALID(w)                  ((w) >= WEP_FIRST && (w) <= WEP_LAST)
-
 #define FRAGS_PLAYER 0
 #define FRAGS_SPECTATOR -666
 #define FRAGS_LMS_LOSER -616
@@ -458,60 +379,14 @@ float WATERLEVEL_SUBMERGED = 3;
 float MAX_SHOT_DISTANCE = 32768;
 
 //centerprint ID list
-float CPID_TEAMCHANGE = 1;
 float CPID_CTF_CAPTURESHIELD = 2;
 float CPID_MINSTA_FINDAMMO = 3;
 float CPID_NIX_WPNCHANGE = 4;
-float CPID_DISCONNECT_IDLING = 5;
 float CPID_ROUND_STARTING = 6;
 float CPID_GAME_STARTING = 7;
 float CPID_TIMEOUT_COUNTDOWN = 8;
 float CPID_MOTD = 9;
 float CPID_KH_MSG = 10;
-float CPID_PREVENT_JOIN = 11;
-
-// CSQC centerprint/notify message types
-float MSG_SUICIDE = 0;
-float MSG_KILL = 1;
-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 = 12001;
-float KILL_TEAM_BLUE = 12002;
-float KILL_TEAM_SPREE = 12003;
-float KILL_FIRST_BLOOD = 12004;
-float KILL_FIRST_VICTIM = 12005;
-float KILL_TYPEFRAG = 12006;
-float KILL_TYPEFRAGGED = 12007;
-float KILL_FRAG = 12008;
-float KILL_FRAGGED = 12009;
-float KILL_SPREE = 12010;
-float KILL_END_SPREE = 12011;
-float KILL_SPREE_3 = 12012;
-float KILL_SPREE_5 = 12013;
-float KILL_SPREE_10 = 12014;
-float KILL_SPREE_15 = 12015;
-float KILL_SPREE_20 = 12016;
-float KILL_SPREE_25 = 12017;
-float KILL_SPREE_30 = 12018;
-
-float INFO_GOTFLAG = 13001;
-float INFO_PICKUPFLAG = 13002;
-float INFO_LOSTFLAG = 13003;
-float INFO_RETURNFLAG = 13004;
-float INFO_CAPTUREFLAG = 13005;
-
-float KA_PICKUPBALL = 14001;
-float KA_DROPBALL = 14002;
-
-float RACE_SERVER_RECORD = 15001;
-float RACE_NEW_TIME = 15002;
-float RACE_NEW_RANK = 15003;
-float RACE_FAIL = 15004;
 
 // weapon requests
 float WR_SETUP         = 1; // (SVQC) setup weapon data
diff --git a/qcsrc/common/deathtypes.qh b/qcsrc/common/deathtypes.qh
new file mode 100644 (file)
index 0000000..335b356
--- /dev/null
@@ -0,0 +1,101 @@
+// Deathtypes (weapon deathtypes are the IT_* constants below)
+// NOTE: when adding death types, please add an explanation to Docs/spamlog.txt too.
+#define DT_FIRST 10000
+#define DT_MAX 1024 // limit of recursive functions with ACCUMULATE_FUNCTION
+float DT_COUNT;
+
+#define DT_MATCH(a,b) if(min(DT_MAX, a) == b)
+
+#define DEATHTYPE(name,msg_death,msg_death_by,position) \
+       float name; \
+       float position; \
+       void RegisterDeathtype_##name() \
+       { \
+               SET_FIRST_OR_LAST(position, DT_FIRST, DT_COUNT) \
+               SET_FIELD_COUNT(name, DT_FIRST, DT_COUNT) \
+               CHECK_MAX_COUNT(name, DT_MAX, DT_COUNT, "deathtypes") \
+       } \
+       ACCUMULATE_FUNCTION(RegisterDeathtypes, RegisterDeathtype_##name)
+
+#define DEATHTYPES \
+       DEATHTYPE(DEATH_FALL,                                   DEATH_SELF_FALL,                                        DEATH_MURDER_FALL,                              DEATH_SPECIAL_START) \
+       DEATHTYPE(DEATH_TELEFRAG,                               NO_MSG,                                                         DEATH_MURDER_TELEFRAG,                  NORMAL_POS) \
+       DEATHTYPE(DEATH_DROWN,                                  DEATH_SELF_DROWN,                                       DEATH_MURDER_DROWN,                     NORMAL_POS) \
+       DEATHTYPE(DEATH_HURTTRIGGER,                    DEATH_SELF_VOID,                                        DEATH_MURDER_VOID,                              NORMAL_POS) \
+       DEATHTYPE(DEATH_LAVA,                                   DEATH_SELF_LAVA,                                        DEATH_MURDER_LAVA,                              NORMAL_POS) \
+       DEATHTYPE(DEATH_SLIME,                                  DEATH_SELF_SLIME,                                       DEATH_MURDER_SLIME,                             NORMAL_POS) \
+       DEATHTYPE(DEATH_KILL,                                   DEATH_SELF_SUICIDE,                             NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_NOAMMO,                                 DEATH_SELF_NOAMMO,                                      NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_SWAMP,                                  DEATH_SELF_SWAMP,                                       DEATH_MURDER_SWAMP,                     NORMAL_POS) \
+       DEATHTYPE(DEATH_TEAMCHANGE,                     DEATH_SELF_TEAMCHANGE,                          NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_AUTOTEAMCHANGE,                 DEATH_SELF_AUTOTEAMCHANGE,                      NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_CAMP,                                   DEATH_SELF_CAMP,                                        NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_SHOOTING_STAR,                  DEATH_SELF_SHOOTING_STAR,                       DEATH_MURDER_SHOOTING_STAR,     NORMAL_POS) \
+       DEATHTYPE(DEATH_ROT,                                    DEATH_SELF_ROT,                                         NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_MIRRORDAMAGE,                   DEATH_SELF_BETRAYAL,                            NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_TOUCHEXPLODE,                   DEATH_SELF_TOUCHEXPLODE,                        DEATH_MURDER_TOUCHEXPLODE,              NORMAL_POS) \
+       DEATHTYPE(DEATH_CHEAT,                                  DEATH_SELF_CHEAT,                                       DEATH_MURDER_CHEAT,                     NORMAL_POS) \
+       DEATHTYPE(DEATH_FIRE,                                   DEATH_SELF_FIRE,                                        DEATH_MURDER_FIRE,                              NORMAL_POS) \
+       DEATHTYPE(DEATH_VH_CRUSH,                               NO_MSG,                                                         DEATH_MURDER_VH_CRUSH,                  DEATH_VHFIRST) \
+       DEATHTYPE(DEATH_VH_SPID_MINIGUN,                NO_MSG,                                                         DEATH_MURDER_VH_SPID_MINIGUN,   NORMAL_POS) \
+       DEATHTYPE(DEATH_VH_SPID_ROCKET,                 NO_MSG,                                                         DEATH_MURDER_VH_SPID_ROCKET,    NORMAL_POS) \
+       DEATHTYPE(DEATH_VH_SPID_DEATH,                  NO_MSG,                                                         DEATH_MURDER_VH_SPID_DEATH,             NORMAL_POS) \
+       DEATHTYPE(DEATH_VH_WAKI_GUN,                    NO_MSG,                                                         DEATH_MURDER_VH_WAKI_GUN,               NORMAL_POS) \
+       DEATHTYPE(DEATH_VH_WAKI_ROCKET,                 NO_MSG,                                                         DEATH_MURDER_VH_WAKI_ROCKET,            NORMAL_POS) \
+       DEATHTYPE(DEATH_VH_WAKI_DEATH,                  NO_MSG,                                                         DEATH_MURDER_VH_WAKI_DEATH,             NORMAL_POS) \
+       DEATHTYPE(DEATH_VH_RAPT_CANNON,                 NO_MSG,                                                         DEATH_MURDER_VH_RAPT_CANNON,    NORMAL_POS) \
+       DEATHTYPE(DEATH_VH_RAPT_BOMB,                   NO_MSG,                                                         DEATH_MURDER_VH_RAPT_BOMB,              NORMAL_POS) \
+       DEATHTYPE(DEATH_VH_RAPT_FRAGMENT,               NO_MSG,                                                         DEATH_MURDER_VH_RAPT_FRAGMENT,  NORMAL_POS) \
+       DEATHTYPE(DEATH_VH_RAPT_DEATH,                  NO_MSG,                                                         DEATH_MURDER_VH_RAPT_DEATH,             NORMAL_POS) \
+       DEATHTYPE(DEATH_VH_BUMB_GUN,                    NO_MSG,                                                         DEATH_MURDER_VH_BUMB_GUN,               NORMAL_POS) \
+       DEATHTYPE(DEATH_VH_BUMB_RAY,                    NO_MSG,                                                         DEATH_MURDER_VH_BUMB_RAY,               NORMAL_POS) \
+       DEATHTYPE(DEATH_VH_BUMB_RAY_HEAL,               NO_MSG,                                                         DEATH_MURDER_VH_BUMB_RAY_HEAL,  NORMAL_POS) \
+       DEATHTYPE(DEATH_VH_BUMB_DEATH,                  NO_MSG,                                                         DEATH_MURDER_VH_BUMB_DEATH,             DEATH_VHLAST) \
+       DEATHTYPE(DEATH_TURRET,                                 DEATH_SELF_TURRET,                                      NO_MSG,                                                 DEATH_TURRET_FIRST) \
+       DEATHTYPE(DEATH_TURRET_EWHEEL,                  DEATH_SELF_TURRET_EWHEEL,                       NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_TURRET_FLAC,                    DEATH_SELF_TURRET_FLAC,                         NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_TURRET_MACHINEGUN,              DEATH_SELF_TURRET_MACHINEGUN,           NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_TURRET_WALKER_GUN,              DEATH_SELF_TURRET_WALKER_GUN,           NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_TURRET_WALKER_MEELE,    DEATH_SELF_TURRET_WALKER_MEELE,         NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_TURRET_WALKER_ROCKET,   DEATH_SELF_TURRET_WALKER_ROCKET,        NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_TURRET_HELLION,                 DEATH_SELF_TURRET_HELLION,                      NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_TURRET_HK,                              DEATH_SELF_TURRET_HK,                           NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_TURRET_MLRS,                    DEATH_SELF_TURRET_MLRS,                         NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_TURRET_PLASMA,                  DEATH_SELF_TURRET_PLASMA,                       NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_TURRET_PHASER,                  DEATH_SELF_TURRET_PHASER,                       NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_TURRET_TESLA,                   DEATH_SELF_TURRET_TESLA,                        NO_MSG,                                                 DEATH_TURRET_LAST) \
+       DEATHTYPE(DEATH_GENERIC,                                DEATH_SELF_GENERIC,                             NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_WEAPON,                                 NO_MSG,                                                         NO_MSG,                                                 NORMAL_POS) \
+       DEATHTYPE(DEATH_CUSTOM,                                 DEATH_SELF_CUSTOM,                                      NO_MSG,                                                 NORMAL_POS)
+
+DEATHTYPES
+#undef DEATHTYPE
+
+#define DEATH_ISSPECIAL(t)                             ((t) >= DEATH_SPECIAL_START)
+#define DEATH_ISVEHICLE(t)                             ((t) >= DEATH_VHFIRST && (t) <= DEATH_VHLAST)
+#define DEATH_ISTURRET(t)                              ((t) >= DEATH_TURRET_FIRST && (t) <= DEATH_TURRET_LAST)
+#define DEATH_WEAPONOFWEAPONDEATH(t)   ((t) & DEATH_WEAPONMASK)
+#define DEATH_ISWEAPON(t,w)                            (!DEATH_ISSPECIAL(t) && DEATH_WEAPONOFWEAPONDEATH(t) == (w))
+#define DEATH_WEAPONOF(t)                              (DEATH_ISSPECIAL(t) ? 0 : DEATH_WEAPONOFWEAPONDEATH(t))
+#define WEP_VALID(w)                                   ((w) >= WEP_FIRST && (w) <= WEP_LAST)
+
+string Deathtype_Name(float deathtype)
+{
+       if(DEATH_ISSPECIAL(deathtype))
+       {
+               #define DEATHTYPE(name,msg_death,msg_death_by,position) \
+                       { if(deathtype == max(0, name)) return VAR_TO_TEXT(name); }
+
+               DEATHTYPES
+               #undef DEATHTYPE
+       }
+       return "foobar";
+}
+
+float DEATH_WEAPONMASK = 0xFF;
+float DEATH_HITTYPEMASK = 0x1F00; // which is WAY below 10000 used for normal deaths
+float HITTYPE_SECONDARY = 0x100;
+float HITTYPE_SPLASH = 0x200; // automatically set by RadiusDamage
+float HITTYPE_BOUNCE = 0x400;
+float HITTYPE_HEADSHOT = 0x800; // automatically set by Damage (if headshotbonus is set)
+float HITTYPE_RESERVED = 0x1000; // unused yet
diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc
new file mode 100644 (file)
index 0000000..035eb91
--- /dev/null
@@ -0,0 +1,572 @@
+// ================================================
+//  Unified notification system, written by Samual
+//  Last updated: February, 2013
+// ================================================
+
+#ifndef MENUQC
+string arg_slot[8];
+string Fill_Notif_Args(string args, string input,
+       string s1, string s2, string s3, string s4,
+       float f1, float f2, float f3, float f4)
+{
+       dprint(sprintf("Fill_Notif_Args('%s', '%s', %s, %s, %s, %s, %d, %d, %d, %d);\n",
+               args, input, s1, s2, s3, s4, f1, f2, f3, f4));
+
+       string selected, remaining = args;
+       float sel_num = 0;
+
+       #ifdef CSQC
+       string tmp_s;
+       #endif
+       
+       if((remaining != "") && (input != ""))
+       {
+               for(;remaining;)
+               {
+                       selected = car(remaining); remaining = cdr(remaining);
+
+                       switch(strtolower(selected))
+                       {
+                               #define ADD_ARG_CASE(selected,result) case selected: { arg_slot[sel_num] = result; ++sel_num; break; }
+                               
+                               ADD_ARG_CASE("s1", s1)
+                               ADD_ARG_CASE("s2", s2)
+                               ADD_ARG_CASE("s3", s3)
+                               ADD_ARG_CASE("s4", s4)
+                               ADD_ARG_CASE("f1", ftos(f1))
+                               ADD_ARG_CASE("f2", ftos(f2))
+                               ADD_ARG_CASE("f3", ftos(f3))
+                               ADD_ARG_CASE("f4", ftos(f4))
+
+                               #ifdef CSQC // CSQC replacements
+                               ADD_ARG_CASE("pass_key",                ((((tmp_s = getcommandkey("pass", "+use")) != "pass") && !(strstrofs(tmp_s, "not bound", 0) >= 0)) ? sprintf(CCR(_(" ^F1(Press %s)")), tmp_s) : ""))
+                               ADD_ARG_CASE("frag_ping",               ((f2 != BOT_PING) ? sprintf(CCR(_("\n(Ping ^2%d^BG)")), f2) : ""))
+                               ADD_ARG_CASE("frag_stats",              sprintf(CCR(_("\n(Health ^1%d^BG / Armor ^2%d^BG)%s")), f1, f2, ((f3 != BOT_PING) ? sprintf(CCR(_(" (Ping ^2%d^BG)")), f3) : "")))
+                               //ADD_ARG_CASE("frag_pos",              ((Should_Print_Score_Pos(f1)) ? sprintf("\n^BG%s", Read_Score_Pos(f1)) : ""))
+                               ADD_ARG_CASE("spree_cen",               (((f1 == 3) || (f1 == 5) || (f1 == 10) || (f1 == 15) || (f1 == 20) || (f1 == 25) || (f1 == 30)) ? sprintf(normal_or_gentle(_("%d frag spree! "), _("%d score spree! ")), f1) : ""))
+                               ADD_ARG_CASE("spree_inf",               (((f1 == 3) || (f1 == 5) || (f1 == 10) || (f1 == 15) || (f1 == 20) || (f1 == 25) || (f1 == 30)) ? sprintf(normal_or_gentle(_("%d frag spree! "), _("%d score spree! ")), f1) : ""))
+                               ADD_ARG_CASE("spree_end",               ((f1 >= 3) ? sprintf(normal_or_gentle(_(", ending their %d frag spree"), _(", ending their %d score spree")), f1) : ""))
+                               ADD_ARG_CASE("spree_lost",              ((f1 >= 3) ? sprintf(normal_or_gentle(_(", losing their %d frag spree"), _(", losing their %d score spree")), f1) : ""))
+                               ADD_ARG_CASE("death_team",              Team_ColoredFullName(f1 - 1))
+                               ADD_ARG_CASE("weapon_name",     ftos(f1)) // weaponorder[f1].netname
+
+                               #else // SVQC replacements
+                               ADD_ARG_CASE("spree_inf",               (((f1 == 3) || (f1 == 5) || (f1 == 10) || (f1 == 15) || (f1 == 20) || (f1 == 25) || (f1 == 30)) ? sprintf(normal_or_gentle(_("%d frag spree! "), _("%d score spree! ")), f1) : ""))
+                               ADD_ARG_CASE("spree_end",               ((f1 >= 3) ? sprintf(normal_or_gentle(_(", ending their %d frag spree"), _(", ending their %d score spree")), f1) : ""))
+                               ADD_ARG_CASE("spree_lost",              ((f1 >= 3) ? sprintf(normal_or_gentle(_(", losing their %d frag spree"), _(", losing their %d score spree")), f1) : ""))
+                               ADD_ARG_CASE("death_team",              Team_ColoredFullName(f1))
+                               ADD_ARG_CASE("weapon_name",             ftos(f1)) // weaponorder[f1].netname
+                               #endif
+
+                               #undef ADD_ARG_CASE
+                               default: { print("Hit unknown token in selected string! '", selected, "'\n"); break; }
+                       }
+                       if(sel_num == 7) { print("Hit maximum arguments!\n"); break; }
+               }
+
+               return sprintf(CCR(input), arg_slot[0], arg_slot[1], arg_slot[2], arg_slot[3], arg_slot[4], arg_slot[5], arg_slot[6], arg_slot[7]);
+       }
+
+       return "";
+}
+
+// get the actual name of a notification and return it as a string
+string Get_Field_Value(float field, float net_type, float net_name)
+{
+       #ifdef NOTIFICATIONS_DEBUG
+               dprint(sprintf("Get_Field_Value(%d, %d, %d);\n", field, net_type, net_name));
+       #endif
+       
+       #define GET_FIELD_VALUE_OUTPUT(field,name,strnum,flnum) switch(field) { \
+                       case F_NAME: { return VAR_TO_TEXT(name); } \
+                       case F_STRNUM: { return ftos(strnum); } \
+                       case F_FLNUM: { return ftos(flnum); } }
+
+       #define GET_FIELD_VALUE_OUTPUT_PAIR(field,name,infoname,centername,strnum,flnum) switch(field) { \
+                       case F_NAME: { return VAR_TO_TEXT(name); } \
+                       case F_INFNAME: { return VAR_TO_TEXT(infoname); } \
+                       case F_CENNAME: { return VAR_TO_TEXT(centername); } \
+                       case F_INFVAL: { return ftos(infoname); } \
+                       case F_CENVAL: { return ftos(centername); } \
+                       case F_STRNUM: { return ftos(strnum); } \
+                       case F_FLNUM: { return ftos(flnum); } }
+
+       #define CLPSE_GETVALUE(name,arg,earg) \
+               #if name != NO_MSG \
+                       arg \
+               #else \
+                       earg \
+               #endif
+
+       switch(net_type)
+       {
+               case MSG_INFO:
+               {
+                       #define MSG_INFO_NOTIF(name,strnum,flnum,args,hudargs,icon,normal,gentle) case name: { GET_FIELD_VALUE_OUTPUT(field,name,strnum,flnum) }
+                       NOTIF_SWITCH_LIST(MSG_INFO, net_name, return "")
+                       #undef MSG_INFO_NOTIF
+                       break;
+               }
+               case MSG_CENTER:
+               {
+                       #define MSG_CENTER_NOTIF(name,strnum,flnum,args,cpid,durcnt,normal,gentle) case name: { GET_FIELD_VALUE_OUTPUT(field,name,strnum,flnum) }
+                       NOTIF_SWITCH_LIST(MSG_CENTER, net_name, return "")
+                       #undef MSG_CENTER_NOTIF
+                       break;
+               }
+               case MSG_WEAPON:
+               {
+                       #define MSG_WEAPON_NOTIF(name,infoname,centername) case name: { GET_FIELD_VALUE_OUTPUT_PAIR(field,name, \
+                               CLPSE_GETVALUE(infoname, infoname, NO_MSG), CLPSE_GETVALUE(centername, centername, NO_MSG), \
+                               max(CLPSE_GETVALUE(infoname, stof(Get_Field_Value(F_STRNUM, MSG_INFO, infoname)), 0), CLPSE_GETVALUE(centername, stof(Get_Field_Value(F_STRNUM, MSG_CENTER, centername)), 0)), \
+                               max(CLPSE_GETVALUE(infoname, stof(Get_Field_Value(F_FLNUM, MSG_INFO, infoname)), 0), CLPSE_GETVALUE(centername, stof(Get_Field_Value(F_FLNUM, MSG_CENTER, centername)), 0))) }
+                       NOTIF_SWITCH_LIST(MSG_WEAPON, net_name, return "")
+                       #undef MSG_WEAPON_NOTIF
+                       break;
+               }
+               case MSG_DEATH:
+               {
+                       #define MSG_DEATH_NOTIF(name,infoname,centername) case name: { GET_FIELD_VALUE_OUTPUT_PAIR(field,name, \
+                               CLPSE_GETVALUE(infoname, infoname, NO_MSG), CLPSE_GETVALUE(centername, centername, NO_MSG), \
+                               max(CLPSE_GETVALUE(infoname, stof(Get_Field_Value(F_STRNUM, MSG_INFO, infoname)), 0), CLPSE_GETVALUE(centername, stof(Get_Field_Value(F_STRNUM, MSG_CENTER, centername)), 0)), \
+                               max(CLPSE_GETVALUE(infoname, stof(Get_Field_Value(F_FLNUM, MSG_INFO, infoname)), 0), CLPSE_GETVALUE(centername, stof(Get_Field_Value(F_FLNUM, MSG_CENTER, centername)), 0))) }
+                       NOTIF_SWITCH_LIST(MSG_DEATH, net_name, return "")
+                       #undef MSG_DEATH_NOTIF
+                       break;
+               }
+       }
+
+       #undef GET_FIELD_VALUE_OUTPUT
+       #undef GET_FIELD_VALUE_OUTPUT_PAIR
+       #undef CLPSE_GETVALUE
+       return "";
+}
+#endif // ifndef MENUQC
+
+
+// ===============================
+//  Frontend Notification Pushing
+// ===============================
+
+void Dump_Notifications(float fh, float alsoprint)
+{
+       float MSG_INFO_NOTIFS = 0, MSG_CENTER_NOTIFS = 0, MSG_WEAPON_NOTIFS = 0, MSG_DEATH_NOTIFS = 0;
+       string notif_msg;
+
+       #define NOTIF_WRITE(type,name,text) { \
+               ++##type##_NOTIFS; \
+               notif_msg = sprintf("seta %s 1 // %s - %s\n", #name, #type, strreplace("\n", "\\n", text)); \
+               fputs(fh, notif_msg); \
+               if(alsoprint) { print(strreplace("^", "^^", notif_msg)); } }
+       
+       #define MSG_INFO_NOTIF(name,strnum,flnum,args,hudargs,icon,normal,gentle) NOTIF_WRITE(MSG_INFO, name, normal)
+       MSG_INFO_NOTIFICATIONS
+       #undef MSG_INFO_NOTIF
+       
+       #define MSG_CENTER_NOTIF(name,strnum,flnum,args,cpid,durcnt,normal,gentle) NOTIF_WRITE(MSG_CENTER, name, normal)
+       MSG_CENTER_NOTIFICATIONS
+       #undef MSG_CENTER_NOTIF
+       
+       #define MSG_WEAPON_NOTIF(name,infoname,centername) NOTIF_WRITE(MSG_WEAPON, name, \
+               sprintf("infoname: %s, centername: %s", VAR_TO_TEXT(infoname), VAR_TO_TEXT(centername)))
+       MSG_WEAPON_NOTIFICATIONS
+       #undef MSG_WEAPON_NOTIF
+       
+       #define MSG_DEATH_NOTIF(name,infoname,centername) NOTIF_WRITE(MSG_DEATH, name, \
+               sprintf("infoname: %s, centername: %s", VAR_TO_TEXT(infoname), VAR_TO_TEXT(centername)))
+       MSG_DEATH_NOTIFICATIONS
+       #undef MSG_DEATH_NOTIF
+       
+       print(sprintf("Notification counts: MSG_INFO = %d, MSG_CENTER = %d, MSG_WEAPON = %d, MSG_DEATH = %d\n",
+               MSG_INFO_NOTIFS, MSG_CENTER_NOTIFS, MSG_WEAPON_NOTIFS, MSG_DEATH_NOTIFS));
+       
+       return;
+       #undef NOTIF_WRITE
+}
+
+#ifndef MENUQC
+#ifdef CSQC
+void HUD_Notify_Push(string icon, string attacker, string victim)
+{
+       if(icon != "")
+       {
+               --kn_index;
+               if (kn_index == -1) { kn_index = KN_MAX_ENTRIES-1; }
+               killnotify_times[kn_index] = time;
+
+               // icon
+               if(killnotify_icon[kn_index]) { strunzone(killnotify_icon[kn_index]); }
+               killnotify_icon[kn_index] = strzone(icon);
+
+               // attacker
+               if(killnotify_attackers[kn_index]) { strunzone(killnotify_attackers[kn_index]); }
+               killnotify_attackers[kn_index] = strzone(attacker);
+
+               // victim
+               if(killnotify_victims[kn_index]) { strunzone(killnotify_victims[kn_index]); }
+               killnotify_victims[kn_index] = strzone(victim);
+       }
+}
+#endif // ifdef CSQC
+
+void Local_Notification(float net_type, float net_name, ...count)
+{
+       // check supplied type and name for errors
+       #ifdef NOTIFICATIONS_DEBUG
+       {
+               #define CHECKARG_TYPENAME(type) case MSG_##type##: \
+                       { if(!net_name || (net_name > NOTIF_##type##_COUNT)) \
+                       { checkargs = sprintf("Improper name: %d!", net_name); } break; }
+                       
+               string checkargs = "";
+               switch(net_type)
+               {
+                       CHECKARG_TYPENAME(INFO)
+                       CHECKARG_TYPENAME(CENTER)
+                       CHECKARG_TYPENAME(WEAPON)
+                       CHECKARG_TYPENAME(DEATH)
+                       
+                       default: { checkargs = sprintf("Improper type: %d!", checkargs, net_type); break; }
+               }
+               #undef CHECKARG_TYPENAME
+
+               if(checkargs != "") { backtrace(sprintf("Incorrect usage of Local_Notification: %s\n", checkargs)); return; }
+       }
+       #endif
+       
+       float stringcount = stof(Get_Field_Value(F_STRNUM, net_type, net_name));
+       float floatcount = stof(Get_Field_Value(F_FLNUM, net_type, net_name));
+
+       string s1 = ((0 < stringcount) ? ...(0, string) : NO_STR_ARG);
+       string s2 = ((1 < stringcount) ? ...(1, string) : NO_STR_ARG);
+       string s3 = ((2 < stringcount) ? ...(2, string) : NO_STR_ARG);
+       string s4 = ((3 < stringcount) ? ...(3, string) : NO_STR_ARG);
+       float f1 = ((stringcount < count) ? ...(stringcount, float) : NO_FL_ARG);
+       float f2 = (((stringcount + 1) < count) ? ...((stringcount + 1), float) : NO_FL_ARG);
+       float f3 = (((stringcount + 2) < count) ? ...((stringcount + 2), float) : NO_FL_ARG);
+       float f4 = (((stringcount + 3) < count) ? ...((stringcount + 3), float) : NO_FL_ARG);
+
+       #ifdef NOTIFICATIONS_DEBUG
+       {
+               dprint(sprintf("Local_Notification(%d, %s, %s, %s, %s, %s, %d, %d, %d, %d);\n",
+                       net_type, Get_Field_Value(F_NAME, net_type, net_name),
+                       s1, s2, s3, s4, f1, f2, f3, f4));
+
+               if((stringcount + floatcount) > count)
+                       { backtrace(sprintf("Not enough arguments for Local_Notification! stringcount(%d) + floatcount(%d) > count(%d) \
+                       \nCheck the notification definition and function call for accuracy...?\n", stringcount, floatcount, count)); return; }
+               else if((stringcount + floatcount) < count)
+                       { backtrace(sprintf("Too many arguments for Local_Notification! stringcount(%d) + floatcount(%d) < count(%d) \
+                       \nCheck the notification definition and function call for accuracy...?\n", stringcount, floatcount, count)); return; }
+       }
+       #endif
+       
+
+       switch(net_type)
+       {
+               case MSG_INFO:
+               {
+                       #define MSG_INFO_NOTIF(name,strnum,flnum,args,hudargs,icon,normal,gentle) \
+                               case name: { CHECK_AUTOCVAR(name) \
+                               { \
+                                       print(sprintf(CCR(normal_or_gentle(normal, gentle)), args)); \
+                                       #ifdef CSQC \
+                                               if(icon != "") { HUD_Notify_Push(icon, hudargs); } \
+                                       #endif \
+                               } return; }
+                               
+                       NOTIF_SWITCH_LIST(MSG_INFO, net_name, return)
+                       
+                       #undef MSG_INFO_NOTIF
+                       break;
+               }
+               #ifdef CSQC
+               case MSG_CENTER:
+               {
+                       #define MSG_CENTER_NOTIF(name,strnum,flnum,args,cpid,durcnt,normal,gentle) \
+                               case name: { CHECK_AUTOCVAR(name) \
+                               { \
+                                       centerprint_generic(HANDLE_CPID(cpid), sprintf(CCR(normal_or_gentle(normal, gentle)), args), durcnt); \
+                               } return; }
+
+                       NOTIF_SWITCH_LIST(MSG_CENTER, net_name, return)
+                       
+                       #undef MSG_CENTER_NOTIF
+                       break;
+               }
+               #endif
+               case MSG_WEAPON:
+               {
+                       #define MSG_WEAPON_NOTIF(name,infoname,centername) \
+                               case name: { CHECK_AUTOCVAR(name) \
+                               { \
+                                       #if infoname != NO_MSG \
+                                               Local_Notification_Without_VarArgs(MSG_INFO, infoname, \
+                                                       stof(Get_Field_Value(F_STRNUM, MSG_INFO, infoname)), \
+                                                       stof(Get_Field_Value(F_FLNUM, MSG_INFO, infoname)), \
+                                                       s1, s2, s3, s4, f1, f2, f3, f4); \
+                                       #endif \
+                                       #ifdef CSQC \
+                                               #if centername != NO_MSG \
+                                                       Local_Notification_Without_VarArgs(MSG_CENTER, centername, \
+                                                               stof(Get_Field_Value(F_STRNUM, MSG_CENTER, centername)), \
+                                                               stof(Get_Field_Value(F_FLNUM, MSG_CENTER, centername)), \
+                                                               s1, s2, s3, s4, f1, f2, f3, f4); \
+                                               #endif \
+                                       #endif \
+                               } return; }
+
+                       NOTIF_SWITCH_LIST(MSG_WEAPON, net_name, return)
+                       
+                       #undef MSG_WEAPON_NOTIF
+                       break;
+               }
+               case MSG_DEATH:
+               {
+                       #define MSG_DEATH_NOTIF(name,infoname,centername) \
+                               case name: { CHECK_AUTOCVAR(name) \
+                               { \
+                                       #if infoname != NO_MSG \
+                                               Local_Notification_Without_VarArgs(MSG_INFO, infoname, \
+                                                       stof(Get_Field_Value(F_STRNUM, MSG_INFO, infoname)), \
+                                                       stof(Get_Field_Value(F_FLNUM, MSG_INFO, infoname)), \
+                                                       s1, s2, s3, s4, f1, f2, f3, f4); \
+                                       #endif \
+                                       #ifdef CSQC \
+                                               #if centername != NO_MSG \
+                                                       Local_Notification_Without_VarArgs(MSG_CENTER, centername, \
+                                                               stof(Get_Field_Value(F_STRNUM, MSG_CENTER, centername)), \
+                                                               stof(Get_Field_Value(F_FLNUM, MSG_CENTER, centername)), \
+                                                               s1, s2, s3, s4, f1, f2, f3, f4); \
+                                               #endif \
+                                       #endif \
+                               } return; } 
+
+                       NOTIF_SWITCH_LIST(MSG_DEATH, net_name, return)
+                       
+                       #undef MSG_DEATH_NOTIF
+                       break;
+               }
+       }
+}
+
+void Local_Notification_Without_VarArgs(float net_type, float net_name,
+       float stringcount, float floatcount,
+       string s1, string s2, string s3, string s4,
+       float f1, float f2, float f3, float f4)
+{
+       #define VARITEM(stringc,floatc,args) if((stringcount == stringc) && (floatcount == floatc)) { Local_Notification(net_type, net_name, args); return; }
+       EIGHT_VARS_TO_VARARGS_VARLIST
+       #undef VARITEM
+
+       Local_Notification(net_type, net_name); // some notifications don't have any arguments at all
+}
+
+
+// =========================
+//  Notification Networking
+// =========================
+
+#ifdef CSQC
+void Read_Notification(float is_new)
+{
+       float net_type = ReadByte();
+       float net_name = ReadShort();
+
+       float stringcount = stof(Get_Field_Value(F_STRNUM, net_type, net_name));
+       float floatcount = stof(Get_Field_Value(F_FLNUM, net_type, net_name));
+
+       string s1 = ((stringcount >= 1) ? ReadString() : NO_STR_ARG);
+       string s2 = ((stringcount >= 2) ? ReadString() : NO_STR_ARG);
+       string s3 = ((stringcount >= 3) ? ReadString() : NO_STR_ARG);
+       string s4 = ((stringcount == 4) ? ReadString() : NO_STR_ARG);
+       float f1 = ((floatcount >= 1) ? ReadLong() : NO_FL_ARG);
+       float f2 = ((floatcount >= 2) ? ReadLong() : NO_FL_ARG);
+       float f3 = ((floatcount >= 3) ? ReadLong() : NO_FL_ARG);
+       float f4 = ((floatcount == 4) ? ReadLong() : NO_FL_ARG);
+
+       #ifdef NOTIFICATIONS_DEBUG
+               dprint(sprintf("Read_Notification(%d) at %d: net_name = %s.\n", is_new, time, Get_Field_Value(F_NAME, net_type, net_name)));
+       #endif
+       
+       if(is_new) { Local_Notification_Without_VarArgs(net_type, net_name, stringcount, floatcount, s1, s2, s3, s4, f1, f2, f3, f4); }
+}
+#endif
+
+#ifdef SVQC
+void Notification_Remove()
+{
+       float i;
+       for(i = 0; i < 4; ++i) { if(self.nent_strings[i]) { strunzone(self.nent_strings[i]); } }
+       remove(self);
+}
+
+float Write_Notification(entity client, float sf)
+{
+       float i, send = FALSE;
+       
+       switch(self.nent_broadcast)
+       {
+               case NOTIF_ONE: { if((client == self.nent_client) || (client.classname == STR_SPECTATOR && client.enemy == self.nent_client)) { send = TRUE; } break; }
+               case NOTIF_ONE_ONLY: { if(client == self.nent_client) { send = TRUE; } break; }
+               case NOTIF_TEAM: { if((client.team == self.nent_client.team) || (client.classname == STR_SPECTATOR && client.enemy.team == self.nent_client.team)) { send = TRUE; } break; }
+               case NOTIF_TEAM_EXCEPT: { if(((client != self.nent_client) && (client.team == self.nent_client.team) && !(client.classname == STR_SPECTATOR && client.enemy == self.nent_client))) { send = TRUE; } break; }
+               case NOTIF_ANY: { send = TRUE; break; }
+               case NOTIF_ANY_EXCEPT: { if((client != self.nent_client) && !(client.classname == STR_SPECTATOR && client.enemy == self.nent_client)) { send = TRUE; } break; }
+               default: { send = FALSE; break; }
+       }
+
+       if(send)
+       {               
+               WriteByte(MSG_ENTITY, ENT_CLIENT_NOTIFICATION);
+               WriteByte(MSG_ENTITY, self.nent_net_type);
+               WriteShort(MSG_ENTITY, self.nent_net_name);
+               for(i = 0; i < self.nent_stringcount; ++i) { WriteString(MSG_ENTITY, self.nent_strings[i]); } 
+               for(i = 0; i < self.nent_floatcount; ++i) { WriteLong(MSG_ENTITY, self.nent_floats[i]); }
+       }
+
+       return send; 
+}
+
+void Send_Notification(float broadcast, entity client,
+       float net_type, float net_name, ...count)
+{
+       // check supplied broadcast, target, type, and name for errors
+       #ifdef NOTIFICATIONS_DEBUG
+       {
+               #define CHECKARG_TYPENAME(type) case MSG_##type##: \
+                       { if(!net_name || (net_name > NOTIF_##type##_COUNT)) \
+                       { checkargs = sprintf("Improper name: %d!", net_name); } break; }
+                       
+               string checkargs = "";
+               switch(net_type)
+               {
+                       CHECKARG_TYPENAME(INFO)
+                       CHECKARG_TYPENAME(CENTER)
+                       CHECKARG_TYPENAME(WEAPON)
+                       CHECKARG_TYPENAME(DEATH)
+                       
+                       default: { checkargs = sprintf("Improper type: %d!", checkargs, net_type); break; }
+               }
+               #undef CHECKARG_TYPENAME
+               
+               if(checkargs != "") { checkargs = strcat(checkargs, " "); }
+               switch(broadcast)
+               {
+                       case NOTIF_ONE:
+                       case NOTIF_ONE_ONLY: { if(clienttype(client) == CLIENTTYPE_NOTACLIENT) { checkargs = sprintf("%sNo client provided!", checkargs); } break; }
+                       case NOTIF_ANY_EXCEPT: { if(clienttype(client) == CLIENTTYPE_NOTACLIENT) { checkargs = sprintf("%sException can't be a non-client!", checkargs); } break; }
+                       case NOTIF_ANY: { if(client) { checkargs = sprintf("%sEntity provided when world was required!", checkargs); } break; }
+                       
+                       case NOTIF_TEAM:
+                       case NOTIF_TEAM_EXCEPT:
+                       {
+                               if not(teamplay) { checkargs = sprintf("%sTeamplay not active!", checkargs); }
+                               else if(clienttype(client) == CLIENTTYPE_NOTACLIENT)
+                               {
+                                       if(broadcast == NOTIF_TEAM) { checkargs = sprintf("%sNo client provided!", checkargs); }
+                                       else { checkargs = sprintf("%sException can't be a non-client!", checkargs); }
+                               }
+                               break;
+                       }
+                       
+                       default: { checkargs = sprintf("%sImproper broadcast: %d!", checkargs, broadcast); break; }
+               }
+               
+               if(checkargs != "") { backtrace(sprintf("Incorrect usage of Send_Notification: %s\n", checkargs)); return; }
+       }
+       #endif
+
+       // retreive counts for the arguments of this notification
+       float stringcount = stof(Get_Field_Value(F_STRNUM, net_type, net_name));
+       float floatcount = stof(Get_Field_Value(F_FLNUM, net_type, net_name));
+
+       #ifdef NOTIFICATIONS_DEBUG
+       {
+               dprint(sprintf("Send_Notification(%d, %d, %s, stringcount: %d, floatcount: %d, varargs: %d);\n",
+                       broadcast, net_type, Get_Field_Value(F_NAME, net_type, net_name), stringcount, floatcount, count));
+
+               if((stringcount + floatcount) > count)
+                       { backtrace(sprintf("Not enough arguments for Send_Notification! stringcount(%d) + floatcount(%d) > count(%d) \
+                       \nCheck the notification definition and function call for accuracy...?\n", stringcount, floatcount, count)); return; }
+               else if((stringcount + floatcount) < count)
+                       { backtrace(sprintf("Too many arguments for Send_Notification! stringcount(%d) + floatcount(%d) < count(%d) \
+                       \nCheck the notification definition and function call for accuracy...?\n", stringcount, floatcount, count)); return; }
+       }
+       #endif
+
+       entity notif = spawn();
+       notif.nent_broadcast = broadcast;
+       notif.nent_client = client;
+       notif.nent_net_type = net_type;
+       notif.nent_net_name = net_name;
+       notif.nent_stringcount = stringcount;
+       notif.nent_floatcount = floatcount;
+       
+       float i;
+       
+       for(i = 0; i < stringcount; ++i) { notif.nent_strings[i] = strzone(...(i, string)); }
+       for(i = 0; i < floatcount; ++i) { notif.nent_floats[i] = ...((stringcount + i), float); }
+       
+       notif.think = Notification_Remove;
+       notif.nextthink = (time + 0.5); 
+
+       Net_LinkEntity(notif, FALSE, 0, Write_Notification);
+
+       if((!server_is_local) && (broadcast == NOTIF_ANY || broadcast == NOTIF_ANY_EXCEPT) && (net_type != MSG_CENTER))
+               { Local_Notification_Without_VarArgs(net_type, net_name, stringcount, floatcount,
+                       IFSTR(0), IFSTR(1), IFSTR(2), IFSTR(3), IFFL(0), IFFL(1), IFFL(2), IFFL(3)); }
+}
+
+void Send_Notification_Without_VarArgs(float broadcast, entity client,
+       float net_type, float net_name,
+       float stringcount, float floatcount,
+       string s1, string s2, string s3, string s4,
+       float f1, float f2, float f3, float f4)
+{              
+       #define VARITEM(stringc,floatc,args) if((stringcount == stringc) && (floatcount == floatc)) { Send_Notification(broadcast, client, net_type, net_name, args); return; }
+       EIGHT_VARS_TO_VARARGS_VARLIST
+       #undef VARITEM
+
+       Send_Notification(broadcast, client, net_type, net_name); // some notifications don't have any arguments at all
+}
+
+void Send_Notification_Legacy_Wrapper(float broadcast, entity client,
+       float net_type, float net_name,
+       string s1, string s2,
+       float f1, float f2, float f3)
+{
+       float stringcount = stof(Get_Field_Value(F_STRNUM, net_type, net_name));
+       float floatcount = stof(Get_Field_Value(F_FLNUM, net_type, net_name));
+       Send_Notification_Without_VarArgs(broadcast, client, net_type, net_name, stringcount, floatcount, s1, s2, NO_STR_ARG, NO_STR_ARG, f1, f2, f3, NO_FL_ARG);
+}
+
+
+// =============================
+//  LEGACY NOTIFICATION SYSTEMS
+// =============================
+
+void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, float countdown_num)
+{
+       if ((clienttype(e) == CLIENTTYPE_REAL) && (e.flags & FL_CLIENT))
+       {
+               msg_entity = e;
+               WRITESPECTATABLE_MSG_ONE({
+                       WriteByte(MSG_ONE, SVC_TEMPENTITY);
+                       WriteByte(MSG_ONE, TE_CSQC_CENTERPRINT_GENERIC);
+                       WriteByte(MSG_ONE, id);
+                       WriteString(MSG_ONE, s);
+                       if (id != 0 && s != "")
+                       {
+                               WriteByte(MSG_ONE, duration);
+                               WriteByte(MSG_ONE, countdown_num);
+                       }
+               });
+       }
+}
+void Send_CSQC_Centerprint_Generic_Expire(entity e, float id)
+{
+       Send_CSQC_Centerprint_Generic(e, id, "", 1, 0);
+}
+#endif // ifdef SVQC
+#endif // ifndef MENUQC
diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh
new file mode 100644 (file)
index 0000000..6f7350c
--- /dev/null
@@ -0,0 +1,740 @@
+// ================================================
+//  Unified notification system, written by Samual
+//  Last updated: February, 2013
+// ================================================
+
+// main types/groups of notifications
+#define MSG_INFO 1 // "Global" information messages (sent to console, and notify panel if it has an icon)
+#define MSG_CENTER 2 // "Personal" centerprint messages
+#define MSG_WEAPON 3 // "Personal" weapon messages (like "You got the Nex", sent to weapon notify panel)
+#define MSG_DEATH 4 // "Personal" AND "Global" death messages 
+
+#ifndef MENUQC // SERVER AND CLIENT ONLY
+// notification system nullified arguments
+#define NO_STR_ARG ""
+#define NO_FL_ARG -12345
+#define NO_MSG -12345
+
+// field identifiers for Get_Field_Value()
+#define F_NAME 1
+#define F_INFNAME 2
+#define F_CENNAME 3
+#define F_INFVAL 4
+#define F_CENVAL 5
+#define F_STRNUM 6
+#define F_FLNUM 7
+
+// ping of bots defined for extra frag message notification information
+#define BOT_PING -1
+
+#define EIGHT_VARS_TO_VARARGS_VARLIST \
+       VARITEM(1, 0, s1) \
+       VARITEM(2, 0, XPD(s1, s2)) \
+       VARITEM(3, 0, XPD(s1, s2, s3)) \
+       VARITEM(4, 0, XPD(s1, s2, s3, s4)) \
+       VARITEM(0, 1, f1) \
+       VARITEM(1, 1, XPD(s1, f1)) \
+       VARITEM(2, 1, XPD(s1, s2, f1)) \
+       VARITEM(3, 1, XPD(s1, s2, s3, f1)) \
+       VARITEM(4, 1, XPD(s1, s2, s3, s4, f1)) \
+       VARITEM(0, 2, XPD(f1, f2)) \
+       VARITEM(1, 2, XPD(s1, f1, f2)) \
+       VARITEM(2, 2, XPD(s1, s2, f1, f2)) \
+       VARITEM(3, 2, XPD(s1, s2, s3, f1, f2)) \
+       VARITEM(4, 2, XPD(s1, s2, s3, s4, f1, f2)) \
+       VARITEM(0, 3, XPD(f1, f2, f3)) \
+       VARITEM(1, 3, XPD(s1, f1, f2, f3)) \
+       VARITEM(2, 3, XPD(s1, s2, f1, f2, f3)) \
+       VARITEM(3, 3, XPD(s1, s2, s3, f1, f2, f3)) \
+       VARITEM(4, 3, XPD(s1, s2, s3, s4, f1, f2, f3)) \
+       VARITEM(0, 4, XPD(f1, f2, f3, f4)) \
+       VARITEM(1, 4, XPD(s1, f1, f2, f3, f4)) \
+       VARITEM(2, 4, XPD(s1, s2, f1, f2, f3, f4)) \
+       VARITEM(3, 4, XPD(s1, s2, s3, f1, f2, f3, f4)) \
+       VARITEM(4, 4, XPD(s1, s2, s3, s4, f1, f2, f3, f4))
+
+/*
+ Acquire special information to generate for display in the
+ notification from variables networked to the client.
+ Macro descriptions:
+       PASS_KEY: find the keybind for "passing" or "dropping" in CTF game mode
+       FRAG_PING: show the ping of a player
+       FRAG_STATS: show health/armor/ping of a player
+       FRAG_POS: show score status and position in the match of a player
+       SPREE_CEN: centerprint notif for kill spree/how many kills they have
+       SPREE_INF: info notif for kill spree/how many kills they have
+       SPREE_END: placed at the end of murder messages to show ending of sprees
+       SPREE_LOST: placed at the end of suicide messages to show losing of sprees
+       DEATH_TEAM: show the full name of the team a player is switching from
+       WEAPON_NAME: return the full name of a weapon from a weaponid
+*/
+
+#ifdef CSQC // CSQC replacements
+string got_commandkey;
+#define PASS_KEY ((((got_commandkey = getcommandkey("pass", "+use")) != "pass") && !(strstrofs(got_commandkey, "not bound", 0) >= 0)) ? sprintf(CCR(_(" ^F1(Press %s)")), got_commandkey) : "")
+#define FRAG_PING ((f2 != BOT_PING) ? sprintf(CCR(_("\n(Ping ^2%d^BG)")), f2) : "")
+#define FRAG_STATS sprintf(CCR(_("\n(Health ^1%d^BG / Armor ^2%d^BG)%s")), f1, f2, ((f3 != BOT_PING) ? sprintf(CCR(_(" (Ping ^2%d^BG)")), f3) : ""))
+#define FRAG_POS ((Should_Print_Score_Pos(f1)) ? sprintf("\n^BG%s", Read_Score_Pos(f1)) : "")
+#define SPREE_CEN (((f1 == 3) || (f1 == 5) || (f1 == 10) || (f1 == 15) || (f1 == 20) || (f1 == 25) || (f1 == 30)) ? sprintf(normal_or_gentle(_("%d frag spree! "), _("%d score spree! ")), f1) : "")
+#define SPREE_INF (((f1 == 3) || (f1 == 5) || (f1 == 10) || (f1 == 15) || (f1 == 20) || (f1 == 25) || (f1 == 30)) ? sprintf(normal_or_gentle(_("%d frag spree! "), _("%d score spree! ")), f1) : "")
+#define SPREE_END ((f1 >= 3) ? sprintf(normal_or_gentle(_(", ending their %d frag spree"), _(", ending their %d score spree")), f1) : "")
+#define SPREE_LOST ((f1 >= 3) ? sprintf(normal_or_gentle(_(", losing their %d frag spree"), _(", losing their %d score spree")), f1) : "")
+#define DEATH_TEAM Team_ColoredFullName(f1 - 1)
+#define WEAPON_NAME f1 // weaponorder[f1].netname
+
+#else // SVQC replacements
+#define SPREE_INF (((f1 == 3) || (f1 == 5) || (f1 == 10) || (f1 == 15) || (f1 == 20) || (f1 == 25) || (f1 == 30)) ? sprintf(normal_or_gentle(_("%d frag spree! "), _("%d score spree! ")), f1) : "")
+#define SPREE_END ((f1 >= 3) ? sprintf(normal_or_gentle(_(", ending their %d frag spree"), _(", ending their %d score spree")), f1) : "")
+#define SPREE_LOST ((f1 >= 3) ? sprintf(normal_or_gentle(_(", losing their %d frag spree"), _(", losing their %d score spree")), f1) : "")
+#define DEATH_TEAM Team_ColoredFullName(f1)
+#define WEAPON_NAME f1 // weaponorder[f1].netname
+#endif
+
+#define NOTIF_SWITCH_LIST(net_type,net_name,returnv) \
+       switch(net_name) \
+       { \
+               ##net_type##_NOTIFICATIONS \
+               default: { backtrace(strcat("^1NOTIFICATION HAD NO MATCH: ^7net_type = ", VAR_TO_TEXT(net_type), ", net_name = ", ftos(net_name), ".\n")); returnv; } \
+       }
+
+string Get_Field_Value(float field, float net_type, float net_name); // get the actual name of a notification and return it as a string
+void Local_Notification(float net_type, float net_name, ...count);
+void Local_Notification_Without_VarArgs(float net_type, float net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4);
+
+#ifdef CSQC // CLIENT ONLY
+// NO_CPID normally has a variable value, so we need to check and see
+// whether a notification uses it. If so, cancel out the centerprint ID.
+#define HANDLE_CPID(cpid) ((min(NOTIF_MAX, cpid) == NO_CPID) ? FALSE : cpid)
+#define KN_MAX_ENTRIES 10
+
+float kn_index;
+float killnotify_times[KN_MAX_ENTRIES];
+string killnotify_icon[KN_MAX_ENTRIES];
+string killnotify_attackers[KN_MAX_ENTRIES];
+string killnotify_victims[KN_MAX_ENTRIES];
+void HUD_Notify_Push(string icon, string attacker, string victim);
+void Read_Notification(float is_new);
+#endif // ifdef CSQC
+
+#ifdef SVQC // SERVER ONLY
+#define NOTIF_ONE 1
+#define NOTIF_ONE_ONLY 2
+#define NOTIF_TEAM 3
+#define NOTIF_TEAM_EXCEPT 4
+#define NOTIF_ANY 5
+#define NOTIF_ANY_EXCEPT 6
+
+#define IFSTR(num) ((num < stringcount) ? ...(num, string) : NO_STR_ARG)
+#define IFFL(num) ((((stringcount-1) + num) < count) ? ...(((stringcount-1) + num), float) : NO_FL_ARG)
+
+void Send_Notification(float broadcast, entity client, float net_type, float net_name, ...count);
+void Send_Notification_Without_VarArgs(float broadcast, entity client, float net_type, float net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4);
+void Send_Notification_Legacy_Wrapper(float broadcast, entity client, float net_type, float net_name, string s1, string s2, float f1, float f2, float f3);
+
+void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, float countdown_num);
+void Send_CSQC_Centerprint_Generic_Expire(entity e, float id);
+#endif // ifdef SVQC
+#endif // ifndef MENUQC
+
+// MENU, SERVER, AND CLIENT
+void Dump_Notifications(float fh, float alsoprint);
+
+
+// ====================================
+//  Notifications List and Information
+// ====================================
+/*
+ List of all notifications (including identifiers and display information)
+ Possible Tokens: name, infoname, centername, strnum, flnum, args, hudargs, icon, cpid, durcnt, normal, gentle
+ Format Specifications:
+    MSG_INFO:
+      name: VAR: Name of notification
+      strnum: FLOAT: Number of STRING arguments (so that networking knows how many to send/receive)
+      flnum: FLOAT: Number of FLOAT arguments (so that networking knows how many to send/receive)
+      args: MISC: Arguments for sprintf(string, args), if no args needed then use ""
+      hudargs: XPD(STRING, STRING): arguments for names in notify messages 
+      icon: STRING: icon string name for the hud notify panel, "" if no icon is used
+      normal: STRING: Normal message (string for sprintf when gentle messages are NOT enabled)
+      gentle: STRING: Gentle message (string for sprintf when gentle messages ARE enabled)
+    MSG_CENTER:
+      name: VAR: Name of notification
+      strnum: FLOAT: Number of STRING arguments (so that networking knows how many to send/receive)
+      flnum: FLOAT: Number of FLOAT arguments (so that networking knows how many to send/receive)
+      args: MISC: Arguments for sprintf(string, args), if no args needed then use ""
+      cpid: FLOAT: centerprint ID number (CPID_*), NO_CPID if no CPID is needed
+      durcnt: XPD(FLOAT, FLOAT): Duration/Countdown: extra arguments for centerprint messages
+      normal: STRING: Normal message (string for sprintf when gentle messages are NOT enabled)
+      gentle: STRING: Gentle message (string for sprintf when gentle messages ARE enabled)
+    MSG_WEAPON:
+    MSG_DEATH:
+      name: VAR: Name of chaining notification
+      infoname: VAR: Name of info notification for reference
+      centername: VAR: Name of centerprint notification for reference
+
+ Messages with ^F1, ^BG, ^TC, etc etc in them will replace those strings
+ with colors according to the cvars the user has chosen. This allows for
+ users to create unique color profiles for their HUD, giving more customization
+ options to HUD designers and end users who want such a feature.
+
+ Check out the definitions in util.qc/util.qh/teams.qh for string CCR(...) and
+ string TCR(...) to better understand how these code replacements work.
+
+ Guidlines for notification declaration (please try and follow these):
+  Specific rules:
+    -ALWAYS start the string with a color, preferably background.
+    -ALWAYS reset a color after a name (this way they don't set it for the whole string).
+    -NEVER re-declare an event twice.
+    -NEVER add or remove tokens from the format, it SHOULD already work.
+    -MSG_INFO messages must ALWAYS end with a new line: \n
+    -MSG_INFO hudargs must always be ATTACKER -> VICTIM
+    -MSG_CENTER should NOT end with a new line
+
+ General rules:
+    -Be clean and simple with your notification naming,
+     nothing too long for the name field... Abbreviations are your friend. :D
+    -Keep the spacing as clean as possible... if the arguments are abnormally long,
+      it's okay to go out of line a bit... but try and keep it clean still.
+    -Sort the notifications in the most appropriate order for their tasks.
+    -ARIRE unir frk jvgu lbhe bja zbgure. (gvc sbe zvxrrhfn) -- Don't pay attention to this ^_^
+
+ Final note: DO NOT PROVIDE MORE ARGUMENTS THAN NECESSARY FOR THE NOTIFICATION YOU'RE CALLING!
+      The system is designed to save as much networking bandwidth as possible,
+      so please dynamically control your argument sending to fit *exactly* what is required.
+      If you send a notification with mismatching arguments, Send_Notification() will error.
+*/
+
+#define MULTITEAM_INFO(prefix,teams,strnum,flnum,args,hudargs,icon,normal,gentle) \
+       MSG_INFO_NOTIF(prefix##RED, strnum, flnum, args, hudargs, sprintf(icon, strtolower(STR_TEAM_1)), TCR(normal, COL_TEAM_1, strtoupper(STR_TEAM_1)), TCR(gentle, COL_TEAM_1, strtoupper(STR_TEAM_1))) \
+       MSG_INFO_NOTIF(prefix##BLUE, strnum, flnum, args, hudargs, sprintf(icon, strtolower(STR_TEAM_2)), TCR(normal, COL_TEAM_2, strtoupper(STR_TEAM_2)), TCR(gentle, COL_TEAM_2, strtoupper(STR_TEAM_2))) \
+       #if teams >= 3 \
+               MSG_INFO_NOTIF(prefix##YELLOW, strnum, flnum, args, hudargs, sprintf(icon, strtolower(STR_TEAM_3)), TCR(normal, COL_TEAM_3, strtoupper(STR_TEAM_3)), TCR(gentle, COL_TEAM_3, strtoupper(STR_TEAM_3))) \
+       #endif \
+       #if teams >= 4 \
+               MSG_INFO_NOTIF(prefix##PINK, strnum, flnum, args, hudargs, sprintf(icon, strtolower(STR_TEAM_4)), TCR(normal, COL_TEAM_4, strtoupper(STR_TEAM_4)), TCR(gentle, COL_TEAM_4, strtoupper(STR_TEAM_4))) \
+       #endif
+#define MSG_INFO_NOTIFICATIONS \
+       /*MSG_INFO_NOTIF(INFO_EMPTY,                                            0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             "", "")*/ \
+       MULTITEAM_INFO(INFO_CTF_FLAGRETURN_DROPPED_, 2,         0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^BGThe ^TC^TT^BG flag was dropped in the base and returned itself\n"), "") \
+       MULTITEAM_INFO(INFO_CTF_FLAGRETURN_DAMAGED_, 2,         0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^BGThe ^TC^TT^BG flag was destroyed and returned to base\n"), "") \
+       MULTITEAM_INFO(INFO_CTF_FLAGRETURN_SPEEDRUN_, 2,        0, 1, f1/100, XPD("", ""),                                                      "",                                             _("^BGThe ^TC^TT^BG flag became impatient after ^F1%.2f^BG seconds and returned itself\n"), "") \
+       MULTITEAM_INFO(INFO_CTF_FLAGRETURN_NEEDKILL_, 2,        0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^BGThe ^TC^TT^BG flag fell somewhere it couldn't be reached and returned to base\n"), "") \
+       MULTITEAM_INFO(INFO_CTF_FLAGRETURN_ABORTRUN_, 2,        0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^BGThe ^TC^TT^BG flag was returned to base by its owner\n"), "") \
+       MULTITEAM_INFO(INFO_CTF_FLAGRETURN_TIMEOUT_, 2,         0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^BGThe ^TC^TT^BG flag has returned to the base\n"), "") \
+       MULTITEAM_INFO(INFO_CTF_PICKUP_, 2,                                     1, 0, s1, XPD(s1, ""),                                                          "notify_%s_taken",              _("^BG%s^BG got the ^TC^TT^BG flag\n"), "") \
+       MULTITEAM_INFO(INFO_CTF_RETURN_, 2,                                     1, 0, s1, XPD(s1, ""),                                                          "notify_%s_returned",   _("^BG%s^BG returned the ^TC^TT^BG flag\n"), "") \
+       MULTITEAM_INFO(INFO_CTF_LOST_, 2,                                       1, 0, s1, XPD(s1, ""),                                                          "notify_%s_lost",               _("^BG%s^BG lost the ^TC^TT^BG flag\n"), "") \
+       MULTITEAM_INFO(INFO_CTF_CAPTURE_, 2,                            1, 0, s1, XPD(s1, ""),                                                          "notify_%s_captured",   _("^BG%s^BG captured the ^TC^TT^BG flag\n"), "") \
+       MULTITEAM_INFO(INFO_CTF_CAPTURE_TIME_, 2,                       1, 1, XPD(s1, f1/100), XPD(s1, ""),                                     "notify_%s_captured",   _("^BG%s^BG captured the ^TC^TT^BG flag in ^F1%.2f^BG seconds\n"), "") \
+       MULTITEAM_INFO(INFO_CTF_CAPTURE_BROKEN_, 2,                     2, 2, XPD(s1, f1/100, s2, f2/100), XPD(s1, ""),         "notify_%s_captured",   _("^BG%s^BG captured the ^TC^TT^BG flag in ^F1%.2f^BG seconds, breaking ^BG%s^BG's previous record of ^F2%.2f^BG seconds\n"), "") \
+       MULTITEAM_INFO(INFO_CTF_CAPTURE_UNBROKEN_, 2,           2, 2, XPD(s1, f1/100, s2, f2/100), XPD(s1, ""),         "notify_%s_captured",   _("^BG%s^BG captured the ^TC^TT^BG flag in ^F2%.2f^BG seconds, failing to break ^BG%s^BG's previous record of ^F1%.2f^BG seconds\n"), "") \
+       MULTITEAM_INFO(INFO_DEATH_TEAMKILL_, 4,                         2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_teamkill_%s",   _("^BG%s^K1 was betrayed by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_FIRSTBLOOD,                           2, 0, s2, XPD("", ""),                                                          "",                                             _("^BG%s^K1 drew first blood\n"), _("^F1%s^K1 got the first score\n")) \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_CUSTOM,                          2, 1, XPD(s1, s2, SPREE_LOST), XPD(s1, ""),                     "notify_void",                  _("^BG%s^K1 %s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_GENERIC,                         1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                         "notify_selfkill",              _("^BG%s^K1 died%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_VOID,                            1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                         "notify_void",                  _("^BG%s^K1 was in the wrong place%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_SUICIDE,                         1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                         "notify_selfkill",              _("^BG%s^K1 couldn't take it anymore%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_NOAMMO,                          1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                         "notify_outofammo",             _("^BG%s^K1 died%s. What's the point of living without ammo?\n"), _("^F1%s^K1 ran out of ammo%s\n")) \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_ROT,                                     1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                         "notify_death",                 _("^BG%s^K1 rotted away%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_CAMP,                            1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                         "notify_camping",               _("^BG%s^K1 thought they found a nice camping ground%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_BETRAYAL,                        1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                         "notify_teamkill_red",  _("^BG%s^K1 became enemies with the Lord of Teamplay%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_TEAMCHANGE,                      1, 1, XPD(s1, DEATH_TEAM), XPD("", ""),                         "",                                             _("^BG%s^K1 switched to the %s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_AUTOTEAMCHANGE,          1, 1, XPD(s1, DEATH_TEAM), XPD("", ""),                         "",                                             _("^BG%s^K1 was moved into the %s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_FALL,                            1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                         "notify_fall",                  _("^BG%s^K1 hit the ground with a crunch%s\n"), _("^F1%s^K1 hit the ground with a bit too much force%s\n")) \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_DROWN,                           1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                         "notify_water",                 _("^BG%s^K1 couldn't catch their breath%s\n"), _("^F1%s^K1 was in the water for too long%s\n")) \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_FIRE,                            1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                         "notify_death",                 _("^BG%s^K1 became a bit too crispy%s\n"), _("^F1%s^K1 felt a little hot%s\n")) \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_LAVA,                            1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                         "notify_lava",                  _("^BG%s^K1 turned into hot slag%s\n"), _("^F1%s^K1 found a hot place%s\n")) \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_SLIME,                           1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                         "notify_slime",                 _("^BG%s^K1 was slimed%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_SHOOTING_STAR,           1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                         "notify_shootingstar",  _("^BG%s^K1 became a shooting star%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_SWAMP,                           1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                         "notify_slime",                 _("^BG%s^K1 is now preserved for centuries to come%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_CHEAT,                           1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                         "notify_selfkill",              _("^BG%s^K1 unfairly eliminated themself%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_TOUCHEXPLODE,            1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                         "notify_death",                 _("^BG%s^K1 died in an accident%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_TURRET,                                  1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                 "notify_death",                 _("^BG%s^K1 ran into a turret%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_TURRET_EWHEEL,                   1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                 "notify_death",                 _("^BG%s^K1 was blasted away by an eWheel turret%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_TURRET_FLAC,                             1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                 "notify_death",                 _("^BG%s^K1 got caught up in the FLAC turret fire%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_TURRET_MACHINEGUN,               1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                 "notify_death",                 _("^BG%s^K1 was riddled full of holes by a Machinegun turret%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_TURRET_WALKER_GUN,               1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                 "notify_death",                 _("^BG%s^K1 got served a lead enrichment by a Walker turret%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_TURRET_WALKER_MEELE,             1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                 "notify_death",                 _("^BG%s^K1 was impaled by a Walker turret%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_TURRET_WALKER_ROCKET,    1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                 "notify_death",                 _("^BG%s^K1 was blasted away by a Walker turret%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_TURRET_HELLION,                  1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                 "notify_death",                 _("^BG%s^K1 was blasted away by a Hellion turret%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_TURRET_HK,                               1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                 "notify_death",                 _("^BG%s^K1 could not hide from the Hunter turret%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_TURRET_MLRS,                             1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                 "notify_death",                 _("^BG%s^K1 got turned into smoldering gibs by an MLRS turret%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_TURRET_PLASMA,                   1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                 "notify_death",                 _("^BG%s^K1 got served some superheated plasma from a turret%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_TURRET_PHASER,                   1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                 "notify_death",                 _("^BG%s^K1 was phased out by a turret%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_SELF_TURRET_TESLA,                    1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),                 "notify_death",                 _("^BG%s^K1 was electrocuted by a Tesla turret%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_TELEFRAG,                      2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_telefrag",              _("^BG%s^K1 was telefragged by ^BG%s^K1%s\n"), _("^F1%s^K1 tried to occupy ^BG%s^K1's teleport destination space\n")) \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_FALL,                          2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_fall",                  _("^BG%s^K1 was grounded by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_DROWN,                         2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_water",                 _("^BG%s^K1 was drowned by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_LAVA,                          2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_lava",                  _("^BG%s^K1 was cooked by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_SLIME,                         2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_slime",                 _("^BG%s^K1 was slimed by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_SHOOTING_STAR,         2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_shootingstar",  _("^BG%s^K1 was shot into space by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_SWAMP,                         2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_slime",                 _("^BG%s^K1 was preserved by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_VOID,                          2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_void",                  _("^BG%s^K1 was thrown into a world of hurt by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_TOUCHEXPLODE,          2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 died in an accident with ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_CHEAT,                         2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 was unfairly eliminated by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_FIRE,                          2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 was burnt up into a crisp by ^BG%s^K1%s\n"), _("^F1%s^K1 felt a little hot from ^BG%s^K1's fire^K1%s\n")) \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_VH_CRUSH,                      2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 was crushed by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_VH_SPID_MINIGUN,       2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 got shredded by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_VH_SPID_ROCKET,        2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 was blasted to bits by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_VH_SPID_DEATH,         2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 got caught in the blast when ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_VH_WAKI_GUN,           2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 was bolted down by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_VH_WAKI_ROCKET,        2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 couldn't find shelter from ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_VH_WAKI_DEATH,         2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 got caught in the blast when ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_VH_RAPT_CANNON,        2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 couldn't resist ^BG%s^K1 purple blobs%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_VH_RAPT_BOMB,          2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 was cluster bombed by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_VH_RAPT_FRAGMENT,      2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 was cluster bombed by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_VH_RAPT_DEATH,         2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 got caught in the blast when ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_VH_BUMB_GUN,           2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 foobar by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_VH_BUMB_RAY,           2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 foobar by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_VH_BUMB_RAY_HEAL,      2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 foobar by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_DEATH_MURDER_VH_BUMB_DEATH,         2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),                      "notify_death",                 _("^BG%s^K1 foobar by ^BG%s^K1%s\n"), "") \
+       MULTITEAM_INFO(INFO_FREEZETAG_ROUND_WIN_, 4,            0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^TC^TT^BG team wins the round, all other teams were frozen\n"), "") \
+       MSG_INFO_NOTIF(INFO_FREEZETAG_REVIVE,                           2, 0, XPD(s1, s2), XPD("", ""),                                         "",                                             _("^BG%s^K3 was revived by ^BG%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_FREEZETAG_FREEZE,                           2, 0, XPD(s1, s2), XPD("", ""),                                         "",                                             _("^BG%s^K1 was frozen by ^BG%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_FREEZETAG_SELF,                                     1, 0, s1, XPD("", ""),                                                          "",                                             _("^BG%s^K1 froze themself\n"), "") \
+       MSG_INFO_NOTIF(INFO_GODMODE_OFF,                                        0, 1, f1, XPD("", ""),                                                          "",                                             _("^BGGodmode saved you %d units of damage, cheater!\n"), "") \
+       MSG_INFO_NOTIF(INFO_JOIN_CONNECT,                                       1, 0, s1, XPD("", ""),                                                          "",                                             _("^BG%s^F3 connected%s\n"), "") \
+       MULTITEAM_INFO(INFO_JOIN_CONNECT_TEAM_, 4,                      1, 0, s1, XPD("", ""),                                                          "",                                             _("^BG%s^F3 connected and joined the ^TC^TT\n"), "") \
+       MSG_INFO_NOTIF(INFO_JOIN_PLAY,                                          1, 0, s1, XPD("", ""),                                                          "",                                             _("^BG%s^F3 is now playing\n"), "") \
+       MSG_INFO_NOTIF(INFO_KEEPAWAY_DROPPED,                           1, 0, s1, XPD(s1, ""),                                                          "notify_balldropped",   _("^BG%s^BG has dropped the ball!\n"), "") \
+       MSG_INFO_NOTIF(INFO_KEEPAWAY_PICKUP,                            1, 0, s1, XPD(s1, ""),                                                          "notify_ballpickedup",  _("^BG%s^BG has picked up the ball!\n"), "") \
+       MSG_INFO_NOTIF(INFO_LMS_NOLIVES,                                        1, 0, s1, XPD(s1, ""),                                                          "",                                             _("^BG%s^F3 has no more lives left\n"), "") \
+       MSG_INFO_NOTIF(INFO_LMS_FORFEIT,                                        1, 0, s1, XPD(s1, ""),                                                          "",                                             _("^BG%s^F3 forfeited\n"), "") \
+       MSG_INFO_NOTIF(INFO_POWERDOWN_INVISIBILITY,                     0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^F2Invisibility has worn off\n"), "") \
+       MSG_INFO_NOTIF(INFO_POWERDOWN_SHIELD,                           0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^F2Shield has worn off\n"), "") \
+       MSG_INFO_NOTIF(INFO_POWERDOWN_SPEED,                            0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^F2Speed has worn off\n"), "") \
+       MSG_INFO_NOTIF(INFO_POWERDOWN_STRENGTH,                         0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^F2Strength has worn off\n"), "") \
+       MSG_INFO_NOTIF(INFO_POWERUP_INVISIBILITY,                       0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^F2You are invisible\n"), "") \
+       MSG_INFO_NOTIF(INFO_POWERUP_SHIELD,                                     0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^F2Shield surrounds you\n"), "") \
+       MSG_INFO_NOTIF(INFO_POWERUP_SPEED,                                      0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^F2You are on speed\n"), "") \
+       MSG_INFO_NOTIF(INFO_POWERUP_STRENGTH,                           0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^F2Strength infuses your weapons with devastating power\n"), "") \
+       MSG_INFO_NOTIF(INFO_QUIT_DISCONNECT,                            1, 0, s1, XPD(s1, ""),                                                          "",                                             _("^BG%s^F3 disconnected\n"), "") \
+       MSG_INFO_NOTIF(INFO_QUIT_KICK_IDLING,                           1, 0, s1, XPD(s1, ""),                                                          "",                                             _("^BG%s^F3 was kicked for idling\n"), "") \
+       MSG_INFO_NOTIF(INFO_QUIT_KICK_SPECTATING,                       0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^F2You were kicked from the server because you are a spectator and spectators aren't allowed at the moment.\n"), "") \
+       MSG_INFO_NOTIF(INFO_QUIT_SPECTATE,                                      1, 0, s1, XPD(s1, ""),                                                          "",                                             _("^BG%s^F3 is now spectating\n"), "") \
+       MSG_INFO_NOTIF(INFO_RACE_FAIL,                                          2, 0, XPD(s1, s2), XPD(s1, ""),                                         "race_newfail",                 "", "") \
+       MSG_INFO_NOTIF(INFO_RACE_NEW_RECORD,                            2, 0, XPD(s1, s2), XPD(s1, ""),                                         "race_newrecordserver", "", "") \
+       MSG_INFO_NOTIF(INFO_RACE_NEW_TIME,                                      2, 0, XPD(s1, s2), XPD(s1, ""),                                         "race_newtime",                 "", "") \
+       MSG_INFO_NOTIF(INFO_RACE_NEW_RANK,                                      2, 0, XPD(s1, s2), XPD(s1, ""),                                         "race_newrankyellow",   "", "") \
+       MULTITEAM_INFO(INFO_SCORES_, 4,                                         0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^TC^TT ^BGteam scores!\n"), "") \
+       MSG_INFO_NOTIF(INFO_SPECTATE_WARNING,                           0, 1, f1, XPD("", ""),                                                          "",                                             _("^F2You have to become a player within the next %d seconds, otherwise you will be kicked, because spectating isn't allowed at this time!\n"), "") \
+       MSG_INFO_NOTIF(INFO_SUPERWEAPON_BROKEN,                         0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^F2Superweapons have broken down\n"), "") \
+       MSG_INFO_NOTIF(INFO_SUPERWEAPON_PICKUP,                         0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^F2You now have a superweapon\n"), "") \
+       MSG_INFO_NOTIF(INFO_SUPERWEAPON_LOST,                           0, 0, NO_STR_ARG, XPD("", ""),                                          "",                                             _("^F2Superweapons have been lost\n"), "") \
+       MSG_INFO_NOTIF(INFO_VERSION_BETA,                                       2, 0, XPD(s1, s2), XPD("", ""),                                         "",                                             _("\{1}^F4NOTE: ^BGThe server is running ^F1Xonotic %s (beta)^BG, you have ^F2Xonotic %s\n"), "") \
+       MSG_INFO_NOTIF(INFO_VERSION_OLD,                                        2, 0, XPD(s1, s2), XPD("", ""),                                         "",                                             _("\{1}^F4NOTE: ^BGThe server is running ^F1Xonotic %s^BG, you have ^F2Xonotic %s\n"), "") \
+       MSG_INFO_NOTIF(INFO_VERSION_OUTDATED,                           2, 0, XPD(s1, s2), XPD("", ""),                                         "",                                             _("\{1}^F4NOTE: ^F1Xonotic %s^BG is out, and you still have ^F2Xonotic %s^BG - get the update from ^F3http://www.xonotic.org/^BG!\n"), "") \
+       MSG_INFO_NOTIF(INFO_WATERMARK,                                          1, 0, s1, XPD("", ""),                                                          "",                                             _("^F3SVQC Build information: ^F4%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_THINKING_WITH_PORTALS,                       1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "notify_selfkill", _("^BG%s^K1 is now thinking with portals%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_CRYLINK_SUICIDE,                             1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "weaponcrylink", _("^BG%s^K1 felt the strong pull of their Crylink%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_CRYLINK_MURDER,                                      2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponcrylink", _("^BG%s^K1 felt the strong pull of ^BG%s^K1's Crylink%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_ELECTRO_SUICIDE_ORBS,                        1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "weaponelectro", _("^BG%s^K1 could not remember where they put their Electro plasma%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_ELECTRO_SUICIDE_BOLT,                        1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "weaponelectro", _("^BG%s^K1 played with Electro plasma%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_ELECTRO_MURDER_BOLT,                         2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponelectro", _("^BG%s^K1 was blasted by ^BG%s^K1's Electro bolt%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_ELECTRO_MURDER_ORBS,                         2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponelectro", _("^BG%s^K1 got too close to ^BG%s^K1's Electro plasma%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_ELECTRO_MURDER_COMBO,                        2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponelectro", _("^BG%s^K1 felt the electrifying air of ^BG%s^K1's Electro combo%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_FIREBALL_SUICIDE_FIREMINE,           1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "weaponfireball", _("^BG%s^K1 forgot about their firemine%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_FIREBALL_SUICIDE_BLAST,                      1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "weaponfireball", _("^BG%s^K1 should have used a smaller gun%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_FIREBALL_MURDER_FIREMINE,            2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponfireball", _("^BG%s^K1 got burnt by ^BG%s^K1's firemine%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_FIREBALL_MURDER_BLAST,                       2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponfireball", _("^BG%s^K1 got too close to ^BG%s^K1's fireball%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_MORTAR_SUICIDE_EXPLODE,                      1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "weapongrenadelauncher", _("^BG%s^K1 blew themself up with their own Mortar%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_MORTAR_SUICIDE_BOUNCE,                       1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "weapongrenadelauncher", _("^BG%s^K1 didn't see their own Mortar grenade%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_MORTAR_MURDER_EXPLODE,                       2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weapongrenadelauncher", _("^BG%s^K1 ate ^BG%s^K1's Mortar grenade%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_MORTAR_MURDER_BOUNCE,                        2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weapongrenadelauncher", _("^BG%s^K1 got too close to ^BG%s^K1's Mortar grenade%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_HAGAR_SUICIDE,                                       1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "weaponhagar", _("^BG%s^K1 played with tiny Hagar rockets%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_HAGAR_MURDER_BURST,                          2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponhagar", _("^BG%s^K1 was pummeled by a burst of ^BG%s^K1's Hagar rockets%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_HAGAR_MURDER_SPRAY,                          2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponhagar", _("^BG%s^K1 was pummeled by ^BG%s^K1's Hagar rockets%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_HLAC_SUICIDE,                                        1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "weaponhlac", _("^BG%s^K1 got a little jumpy with their HLAC%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_HLAC_MURDER,                                         2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponhlac", _("^BG%s^K1 was cut down with ^BG%s^K1's HLAC%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_HOOK_MURDER,                                         2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponhook", _("^BG%s^K1 was caught in ^BG%s^K1's Hook gravity bomb%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_LASER_SUICIDE,                                       1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "weaponlaser", _("^BG%s^K1 shot themself to hell with their Laser%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_LASER_MURDER,                                        2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponlaser", _("^BG%s^K1 was shot to death by ^BG%s^K1's Laser%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_MINELAYER_SUICIDE,                           1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "weaponminelayer", _("^BG%s^K1 forgot about their mine%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_MINELAYER_MURDER,                            2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponminelayer", _("^BG%s^K1 got too close to ^BG%s^K1's mine%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_MINSTANEX_MURDER,                            2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponminstanex", _("^BG%s^K1 has been vaporized by ^BG%s^K1's Minstanex%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_NEX_MURDER,                                          2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponnex", _("^BG%s^K1 has been vaporized by ^BG%s^K1's Nex%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_RIFLE_MURDER_HAIL_PIERCING,          2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponrifle", _("^BG%s^K1 failed to hide from ^BG%s^K1's Rifle bullet hail%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_RIFLE_MURDER_HAIL,                           2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponrifle", _("^BG%s^K1 died in ^BG%s^K1's Rifle bullet hail%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_RIFLE_MURDER_PIERCING,                       2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponrifle", _("^BG%s^K1 failed to hide from ^BG%s^K1's Rifle%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_RIFLE_MURDER,                                        2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponrifle", _("^BG%s^K1 was sniped with a Rifle by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_RIFLE_MURDER_HEADSHOT,                       2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "notify_headshot", _("^BG%s^K1 was shot in the head with a Rifle by ^BG%s^K1%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_ROCKETLAUNCHER_SUICIDE,                      1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "weaponrocketlauncher", _("^BG%s^K1 blew themself up with their Rocketlauncher%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_ROCKETLAUNCHER_MURDER_DIRECT,        2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponrocketlauncher", _("^BG%s^K1 ate ^BG%s^K1's rocket%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_ROCKETLAUNCHER_MURDER_SPLASH,        2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponrocketlauncher", _("^BG%s^K1 got too close ^BG%s^K1's rocket%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_SEEKER_SUICIDE,                                      1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "weaponseeker", _("^BG%s^K1 played with tiny Seeker rockets%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_SEEKER_MURDER_TAG,                           2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponseeker", _("^BG%s^K1 was tagged by ^BG%s^K1's Seeker%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_SEEKER_MURDER_SPRAY,                         2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponseeker", _("^BG%s^K1 was pummeled by ^BG%s^K1's Seeker rockets%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_SHOTGUN_MURDER_SLAP,                         2, 1, XPD(s2, s1, SPREE_END), XPD(s2, s1),      "notify_melee_shotgun", _("^BG%s^K1 slapped ^BG%s^K1 around a bit with a large Shotgun%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_SHOTGUN_MURDER,                                      2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponshotgun", _("^BG%s^K1 was gunned down by ^BG%s^K1's Shotgun%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_TUBA_SUICIDE,                                        1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "weapontuba", _("^BG%s^K1 hurt their own ears with the @!#%%'n Tuba%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_TUBA_MURDER,                                         2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weapontuba", _("^BG%s^K1 died of ^BG%s^K1's great playing on the @!#%%'n Tuba%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_ACCORDEON_SUICIDE,                           1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "weapontuba", _("^BG%s^K1 hurt their own ears with the @!#%%'n Accordeon%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_ACCORDEON_MURDER,                            2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weapontuba", _("^BG%s^K1 died of ^BG%s^K1's great playing on the @!#%%'n Accordeon%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_KLEINBOTTLE_SUICIDE,                         1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""),         "weapontuba", _("^BG%s^K1 hurt their own ears with the @!#%%'n Klein Bottle%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_KLEINBOTTLE_MURDER,                          2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weapontuba", _("^BG%s^K1 died of ^BG%s^K1's great playing on the @!#%%'n Klein Bottle%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_UZI_MURDER_SNIPE,                            2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponuzi", _("^BG%s^K1 was sniped by ^BG%s^K1's Machine Gun%s\n"), "") \
+       MSG_INFO_NOTIF(INFO_WEAPON_UZI_MURDER_SPRAY,                            2, 1, XPD(s1, s2, SPREE_END), XPD(s2, s1),      "weaponuzi", _("^BG%s^K1 was riddled full of holes by ^BG%s^K1's Machine Gun%s\n"), "") 
+
+#define MULTITEAM_CENTER(prefix,teams,strnum,flnum,args,cpid,durcnt,normal,gentle) \
+       MSG_CENTER_NOTIF(prefix##RED, strnum, flnum, args, cpid, durcnt, TCR(normal, COL_TEAM_1, strtoupper(STR_TEAM_1)), TCR(gentle, COL_TEAM_1, strtoupper(STR_TEAM_1))) \
+       MSG_CENTER_NOTIF(prefix##BLUE, strnum, flnum, args, cpid, durcnt, TCR(normal, COL_TEAM_2, strtoupper(STR_TEAM_2)), TCR(gentle, COL_TEAM_2, strtoupper(STR_TEAM_2))) \
+       #if teams >= 3 \
+               MSG_CENTER_NOTIF(prefix##YELLOW, strnum, flnum, args, cpid, durcnt, TCR(normal, COL_TEAM_3, strtoupper(STR_TEAM_3)), TCR(gentle, COL_TEAM_3, strtoupper(STR_TEAM_3))) \
+       #endif \
+       #if teams >= 4 \
+               MSG_CENTER_NOTIF(prefix##PINK, strnum, flnum, args, cpid, durcnt, TCR(normal, COL_TEAM_4, strtoupper(STR_TEAM_4)), TCR(gentle, COL_TEAM_4, strtoupper(STR_TEAM_4))) \
+       #endif
+#define MSG_CENTER_NOTIFICATIONS \
+       /*MSG_CENTER_NOTIF(CENTER_EMPTY,                                                0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), "null", "")*/ \
+       MSG_CENTER_NOTIF(CENTER_ASSAULT_ATTACKING,                              0, 0, NO_STR_ARG,                               CPID_ASSAULT_ROLE,              XPD(0, 0), _("^BGYou are attacking!"), "") \
+       MSG_CENTER_NOTIF(CENTER_ASSAULT_DEFENDING,                              0, 0, NO_STR_ARG,                               CPID_ASSAULT_ROLE,              XPD(0, 0), _("^BGYou are defending!"), "") \
+       MSG_CENTER_NOTIF(CENTER_CTF_CAPTURESHIELD_SHIELDED,             0, 0, NO_STR_ARG,                               CPID_CTF_CAPSHIELD,             XPD(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."), "") \
+       MSG_CENTER_NOTIF(CENTER_CTF_CAPTURESHIELD_FREE,                 0, 0, NO_STR_ARG,                               CPID_CTF_CAPSHIELD,             XPD(0, 0), _("^BGYou are now free.\n^BGFeel free to ^F2try to capture^BG the flag again\n^BGif you think you will succeed."), "") \
+       MULTITEAM_CENTER(CENTER_CTF_PASS_OTHER_, 2,                             2, 0, XPD(s1, s2),                              CPID_CTF_PASS,                  XPD(0, 0), _("^BG%s^BG passed the ^TC^TT^BG flag to %s"), "") \
+       MULTITEAM_CENTER(CENTER_CTF_PASS_SENT_, 2,                              1, 0, s1,                                               CPID_CTF_PASS,                  XPD(0, 0), _("^BGYou passed the ^TC^TT^BG flag to %s"), "") \
+       MULTITEAM_CENTER(CENTER_CTF_PASS_RECEIVED_, 2,                  1, 0, s1,                                               CPID_CTF_PASS,                  XPD(0, 0), _("^BGYou received the ^TC^TT^BG flag from %s"), "") \
+       MSG_CENTER_NOTIF(CENTER_CTF_PASS_REQUESTING,                    1, 0, s1,                                               CPID_CTF_PASS,                  XPD(0, 0), _("^BGRequesting %s^BG to pass you the flag"), "") \
+       MSG_CENTER_NOTIF(CENTER_CTF_PASS_REQUESTED,                     1, 0, XPD(s1, PASS_KEY),                CPID_CTF_PASS,                  XPD(0, 0), _("^BG%s^BG requests you to pass the flag%s"), "") \
+       MULTITEAM_CENTER(CENTER_CTF_RETURN_, 2,                                 0, 0, NO_STR_ARG,                               CPID_CTF_LOWPRIO,               XPD(0, 0), _("^BGYou returned the ^TC^TT^BG flag!"), "") \
+       MULTITEAM_CENTER(CENTER_CTF_CAPTURE_, 2,                                0, 0, NO_STR_ARG,                               CPID_CTF_LOWPRIO,               XPD(0, 0), _("^BGYou captured the ^TC^TT^BG flag!"), "") \
+       MULTITEAM_CENTER(CENTER_CTF_PICKUP_, 2,                                 0, 0, NO_STR_ARG,                               CPID_CTF_LOWPRIO,               XPD(0, 0), _("^BGYou got the ^TC^TT^BG flag!"), "") \
+       MSG_CENTER_NOTIF(CENTER_CTF_PICKUP_TEAM,                                1, 0, s1,                                               CPID_CTF_LOWPRIO,               XPD(0, 0), _("^BGYour %steam mate^BG got the flag! Protect them!"), "") \
+       MSG_CENTER_NOTIF(CENTER_CTF_PICKUP_TEAM_VERBOSE,                2, 0, XPD(s1, s2, s1),                  CPID_CTF_LOWPRIO,               XPD(0, 0), _("^BGYour %steam mate (^BG%s%s)^BG got the flag! Protect them!"), "") \
+       MSG_CENTER_NOTIF(CENTER_CTF_PICKUP_ENEMY,                               1, 0, s1,                                               CPID_CTF_LOWPRIO,               XPD(0, 0), _("^BGThe %senemy^BG got your flag! Retrieve it!"), "") \
+       MSG_CENTER_NOTIF(CENTER_CTF_PICKUP_ENEMY_VERBOSE,               2, 0, XPD(s1, s2, s1),                  CPID_CTF_LOWPRIO,               XPD(0, 0), _("^BGThe %senemy (^BG%s%s)^BG got your flag! Retrieve it!"), "") \
+       MSG_CENTER_NOTIF(CENTER_CTF_STALEMATE_CARRIER,                  0, 0, NO_STR_ARG,                               CPID_STALEMATE,                 XPD(0, 0), _("^BGStalemate! Enemies can now see you on radar!"), "") \
+       MSG_CENTER_NOTIF(CENTER_CTF_STALEMATE_OTHER,                    0, 0, NO_STR_ARG,                               CPID_STALEMATE,                 XPD(0, 0), _("^BGStalemate! Flag carriers can now be seen by enemies on radar!"), "") \
+       MSG_CENTER_NOTIF(CENTER_CTF_FLAG_THROW_PUNISH,                  0, 1, f1,                                               CPID_CTF_LOWPRIO,               XPD(0, 0), _("^BGToo many flag throws! Throwing disabled for %d seconds."), "") \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_CUSTOM,                              2, 0, s2,                                               NO_CPID,                                XPD(0, 0), _("^K1You were %s"), "") \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_GENERIC,                             0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You killed your own dumb self!"), _("^K1You need to be more careful!")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_VOID,                                0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1Watch your step!"), "") \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_SUICIDE,                             0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You committed suicide!"), _("^K1You ended it all!")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_NOAMMO,                              0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You were killed for running out of ammo..."), _("^K1You are respawning for running out of ammo...")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_ROT,                                 0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You grew too old without taking your medicine"), _("^K1You need to preserve your health")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_CAMP,                                0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1Die camper!"), _("^K1Reconsider your tactics, camper!")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_BETRAYAL,                    0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1Don't shoot your team mates!"), _("^K1Don't go against your team mates!")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_TEAMCHANGE,                  0, 1, DEATH_TEAM,                               NO_CPID,                                XPD(0, 0), _("^BGYou are now on: %s"), "") \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_AUTOTEAMCHANGE,              0, 1, DEATH_TEAM,                               NO_CPID,                                XPD(0, 0), _("^BGYou have been moved into a different team\nYou are now on: %s"), "") \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_FALL,                                0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You hit the ground with a crunch!"), "") \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_DROWN,                               0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You couldn't catch your breath in time!"), "") \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_FIRE,                                0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You got a little bit too crispy!"), _("^K1You felt a little too hot!")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_LAVA,                                0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You couldn't stand the heat!"), "") \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_SLIME,                               0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You melted away in slime!"), "") \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_SHOOTING_STAR,               0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You became a shooting star!"), "") \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_SWAMP,                               0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You got stuck in a swamp!"), "") \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_CHEAT,                               0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You unfairly eliminated yourself!"), "") \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_TOUCHEXPLODE,                0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You died in an accident!"), "") \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_TURRET,                              0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You were fragged by a turret!"), _("^K1You had an unfortunate run in with a turret!")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_TURRET_EWHEEL,               0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You were fragged by an eWheel turret!"), _("^K1You had an unfortunate run in with an eWheel turret!")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_SELF_TURRET_WALKER,               0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You were fragged by a Walker turret!"), _("^K1You had an unfortunate run in with a Walker turret!")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_FRAG,                                              1, 1, XPD(SPREE_CEN, s1),                                                               NO_CPID, XPD(0, 0), _("^K3%sYou fragged ^BG%s"), _("^K3%sYou scored against ^BG%s")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_FRAGGED,                                   1, 0, s1,                                                                                               NO_CPID, XPD(0, 0), _("^K1You were fragged by ^BG%s"), _("^K1You were scored against by ^BG%s")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_TYPEFRAG,                                  1, 1, XPD(SPREE_CEN, s1),                                                               NO_CPID, XPD(0, 0), _("^K1%sYou typefragged ^BG%s"), _("^K1%sYou scored against ^BG%s^K1 while they were typing")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_TYPEFRAGGED,                               1, 0, s1,                                                                                               NO_CPID, XPD(0, 0), _("^K1You were typefragged by ^BG%s"), _("^K1You were scored against by ^BG%s^K1 while typing!")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_FRAG_FIRST,                                1, 0, s1,                                                                                               NO_CPID, XPD(0, 0), _("^K3First blood! You fragged ^BG%s"), _("^K3First score! You scored against ^BG%s")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_FRAGGED_FIRST,                             1, 0, s1,                                                                                               NO_CPID, XPD(0, 0), _("^K1First victim! You were fragged by ^BG%s"), _("^K1First casualty! You were scored against by ^BG%s")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_TYPEFRAG_FIRST,                    1, 0, s1,                                                                                               NO_CPID, XPD(0, 0), _("^K1First blood! You typefragged ^BG%s"), _("^K1First score! You scored against ^BG%s^K1 while they were typing")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_TYPEFRAGGED_FIRST,                 1, 0, s1,                                                                                               NO_CPID, XPD(0, 0), _("^K1First victim! You were typefragged by ^BG%s"), _("^K1First casualty! You were scored against by ^BG%s^K1 while typing!")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_FRAG_VERBOSE,                              1, 2, XPD(SPREE_CEN, s1, FRAG_PING),                                    NO_CPID, XPD(0, 0), _("^K3%sYou fragged ^BG%s^BG%s"), _("^K3%sYou scored against ^BG%s^BG%s")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_FRAGGED_VERBOSE,                   1, 3, XPD(s1, FRAG_STATS),                                                              NO_CPID, XPD(0, 0), _("^K1You were fragged by ^BG%s^BG%s"), _("^K1You were scored against by ^BG%s^BG%s")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_TYPEFRAG_VERBOSE,                  1, 2, XPD(SPREE_CEN, s1, FRAG_PING),                                    NO_CPID, XPD(0, 0), _("^K1%sYou typefragged ^BG%s^BG%s"), _("^K1%sYou scored against ^BG%s^K1 while they were typing^BG%s")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_TYPEFRAGGED_VERBOSE,               1, 3, XPD(s1, FRAG_STATS),                                                              NO_CPID, XPD(0, 0), _("^K1You were typefragged by ^BG%s^BG%s"), _("^K1You were scored against by ^BG%s^K1 while typing^BG%s")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_FRAG_FIRST_VERBOSE,                1, 1, s1,                                                                                               NO_CPID, XPD(0, 0), _("^K3First blood! You fragged ^BG%s"), _("^K3First score! You scored against ^BG%s")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_FRAGGED_FIRST_VERBOSE,             1, 3, s1,                                                                                               NO_CPID, XPD(0, 0), _("^K1First victim! You were fragged by ^BG%s"), _("^K1First casualty! You were scored against by ^BG%s")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_TYPEFRAG_FIRST_VERBOSE,    1, 1, s1,                                                                                               NO_CPID, XPD(0, 0), _("^K1First blood! You typefragged ^BG%s"), _("^K1First score! You scored against ^BG%s^K1 while they were typing")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_TYPEFRAGGED_FIRST_VERBOSE, 1, 3, s1,                                                                                               NO_CPID, XPD(0, 0), _("^K1First victim! You were typefragged by ^BG%s"), _("^K1First casualty! You were scored against by ^BG%s^K1 while typing!")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_TEAMKILL_FRAG,                                    1, 0, s1,                                                                                               NO_CPID, XPD(0, 0), _("^K1Moron! You fragged ^BG%s^K1, a team mate!"), _("^K1Moron! You went against ^BG%sK1, a team mate!")) \
+       MSG_CENTER_NOTIF(CENTER_DEATH_TEAMKILL_FRAGGED,                                 1, 0, s1,                                                                                               NO_CPID, XPD(0, 0), _("^K1You were fragged by ^BG%s^K1, a team mate"), _("^K1You were scored against by ^BG%s^K1, a team mate")) \
+       MSG_CENTER_NOTIF(CENTER_DISCONNECT_IDLING,                              0, 1, NO_STR_ARG,                               CPID_IDLING,                    XPD(0, f1), _("^K1Stop idling!\n^BGDisconnecting in ^COUNT..."), "") \
+       MULTITEAM_CENTER(CENTER_FREEZETAG_ROUND_WIN_, 4,                0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^TC^TT^BG team wins the round, all other teams were frozen"), "") \
+       MSG_CENTER_NOTIF(CENTER_FREEZETAG_SPAWN_LATE,                   0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You spawned after the round started, you'll spawn as frozen"), "") \
+       MSG_CENTER_NOTIF(CENTER_FREEZETAG_REVIVE,                               1, 0, s1,                                               NO_CPID,                                XPD(0, 0), _("^K3You revived ^BG%s"), "") \
+       MSG_CENTER_NOTIF(CENTER_FREEZETAG_REVIVED,                              1, 0, s1,                                               NO_CPID,                                XPD(0, 0), _("^K3You were revived by ^BG%s"), "") \
+       MSG_CENTER_NOTIF(CENTER_FREEZETAG_SELF,                                 0, 0, NO_STR_ARG,                               NO_CPID,                                XPD(0, 0), _("^K1You froze yourself"), "") \
+       MSG_CENTER_NOTIF(CENTER_FREEZETAG_FREEZE,                               1, 0, s1,                                               NO_CPID,                                XPD(0, 0), _("^K3You froze ^BG%s"), "") \
+       MSG_CENTER_NOTIF(CENTER_FREEZETAG_FROZEN,                               1, 0, s1,                                               NO_CPID,                                XPD(0, 0), _("^K1You were frozen by ^BG%s"), "") \
+       MSG_CENTER_NOTIF(CENTER_KEEPAWAY_DROPPED,                               1, 0, s1,                                               CPID_KEEPAWAY,                  XPD(0, 0), _("^BG%s^BG has dropped the ball!"), "") \
+       MSG_CENTER_NOTIF(CENTER_KEEPAWAY_PICKUP,                                1, 0, s1,                                               CPID_KEEPAWAY,                  XPD(0, 0), _("^BG%s^BG has picked up the ball!"), "") \
+       MSG_CENTER_NOTIF(CENTER_KEEPAWAY_WARN,                                  0, 0, NO_STR_ARG,                               CPID_KA_WARN,                   XPD(0, 0), _("^BGKilling people while you don't have the ball gives no points!"), "") \
+       MSG_CENTER_NOTIF(CENTER_LMS_CAMPCHECK,                                  0, 0, NO_STR_ARG,                               CPID_LMS_CAMP,                  XPD(0, 0), _("^K1Don't camp!"), "") \
+       MSG_CENTER_NOTIF(CENTER_JOIN_NOSPAWNS,                                  0, 0, NO_STR_ARG,                               CPID_PREVENT_JOIN,              XPD(0, 0), _("^K1No spawnpoints available!\nHope your team can fix it..."), "") \
+       MSG_CENTER_NOTIF(CENTER_JOIN_PREVENT,                                   0, 0, NO_STR_ARG,                               CPID_PREVENT_JOIN,              XPD(0, 0), _("^K1You may not join the game at this time.\nThe player limit reached maximum capacity."), "") \
+       MULTITEAM_CENTER(CENTER_TEAMCHANGE_, 4,                                 0, 1, NO_STR_ARG,                               CPID_TEAMCHANGE,                XPD(0, f1), _("^BGChanging to ^TC^TT^BG in ^COUNT"), "") \
+       MSG_CENTER_NOTIF(CENTER_TEAMCHANGE_SPECTATE,                    0, 1, NO_STR_ARG,                               CPID_TEAMCHANGE,                XPD(0, f1), _("^BGSpectating in ^COUNT"), "") \
+       MSG_CENTER_NOTIF(CENTER_TEAMCHANGE_AUTO,                                0, 1, NO_STR_ARG,                               CPID_TEAMCHANGE,                XPD(0, f1), _("^BGChanging team in ^COUNT"), "") \
+       MSG_CENTER_NOTIF(CENTER_TEAMCHANGE_SUICIDE,                             0, 1, NO_STR_ARG,                               CPID_TEAMCHANGE,                XPD(0, f1), _("^K1Suicide in ^COUNT"), "") \
+       MSG_CENTER_NOTIF(CENTER_WEAPON_MARBLES_LOST,                    1, 1, XPD(s1, WEAPON_NAME),             NO_CPID,                                XPD(0, 0), _("^K1You lost your marbles against ^BG%s^K1 using the ^BG%s!"), "")
+
+#define MSG_WEAPON_NOTIFICATIONS \
+       /*MSG_WEAPON_NOTIF(WEAPON_EMPTY,                                                NO_MSG,                                                                         NO_MSG)*/ \
+       MSG_WEAPON_NOTIF(WEAPON_THINKING_WITH_PORTALS,                  INFO_WEAPON_THINKING_WITH_PORTALS,                      CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_CRYLINK_SUICIDE,                                INFO_WEAPON_CRYLINK_SUICIDE,                            CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_CRYLINK_MURDER,                                 INFO_WEAPON_CRYLINK_MURDER,                             NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_ELECTRO_SUICIDE_ORBS,                   INFO_WEAPON_ELECTRO_SUICIDE_ORBS,                       CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_ELECTRO_SUICIDE_BOLT,                   INFO_WEAPON_ELECTRO_SUICIDE_BOLT,                       CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_ELECTRO_MURDER_BOLT,                    INFO_WEAPON_ELECTRO_MURDER_BOLT,                        NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_ELECTRO_MURDER_ORBS,                    INFO_WEAPON_ELECTRO_MURDER_ORBS,                        NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_ELECTRO_MURDER_COMBO,                   INFO_WEAPON_ELECTRO_MURDER_COMBO,                       NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_FIREBALL_SUICIDE_FIREMINE,              INFO_WEAPON_FIREBALL_SUICIDE_FIREMINE,          CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_FIREBALL_SUICIDE_BLAST,                 INFO_WEAPON_FIREBALL_SUICIDE_BLAST,             CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_FIREBALL_MURDER_FIREMINE,               INFO_WEAPON_FIREBALL_MURDER_FIREMINE,           NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_FIREBALL_MURDER_BLAST,                  INFO_WEAPON_FIREBALL_MURDER_BLAST,                      NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_MORTAR_SUICIDE_EXPLODE,                 INFO_WEAPON_MORTAR_SUICIDE_EXPLODE,             CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_MORTAR_SUICIDE_BOUNCE,                  INFO_WEAPON_MORTAR_SUICIDE_BOUNCE,                      CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_MORTAR_MURDER_EXPLODE,                  INFO_WEAPON_MORTAR_MURDER_EXPLODE,                      NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_MORTAR_MURDER_BOUNCE,                   INFO_WEAPON_MORTAR_MURDER_BOUNCE,                       NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_HAGAR_SUICIDE,                                  INFO_WEAPON_HAGAR_SUICIDE,                                      CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_HAGAR_MURDER_BURST,                     INFO_WEAPON_HAGAR_MURDER_BURST,                         NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_HAGAR_MURDER_SPRAY,                     INFO_WEAPON_HAGAR_MURDER_SPRAY,                         NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_HLAC_SUICIDE,                                   INFO_WEAPON_HLAC_SUICIDE,                                       CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_HLAC_MURDER,                                    INFO_WEAPON_HLAC_MURDER,                                        NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_HOOK_MURDER,                                    INFO_WEAPON_HOOK_MURDER,                                        NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_LASER_SUICIDE,                                  INFO_WEAPON_LASER_SUICIDE,                                      CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_LASER_MURDER,                                   INFO_WEAPON_LASER_MURDER,                                       NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_MINELAYER_SUICIDE,                              INFO_WEAPON_MINELAYER_SUICIDE,                          CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_MINELAYER_MURDER,                               INFO_WEAPON_MINELAYER_MURDER,                           NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_MINSTANEX_MURDER,                               INFO_WEAPON_MINSTANEX_MURDER,                           NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_NEX_MURDER,                                     INFO_WEAPON_NEX_MURDER,                                         NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_RIFLE_MURDER_HAIL_PIERCING,             INFO_WEAPON_RIFLE_MURDER_HAIL_PIERCING,         NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_RIFLE_MURDER_HAIL,                              INFO_WEAPON_RIFLE_MURDER_HAIL,                          NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_RIFLE_MURDER_PIERCING,                  INFO_WEAPON_RIFLE_MURDER_PIERCING,                      NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_RIFLE_MURDER,                                   INFO_WEAPON_RIFLE_MURDER,                                       NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_RIFLE_MURDER_HEADSHOT,                  INFO_WEAPON_RIFLE_MURDER_HEADSHOT,                      NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_ROCKETLAUNCHER_SUICIDE,                 INFO_WEAPON_ROCKETLAUNCHER_SUICIDE,             CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_ROCKETLAUNCHER_MURDER_DIRECT,   INFO_WEAPON_ROCKETLAUNCHER_MURDER_DIRECT,       NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_ROCKETLAUNCHER_MURDER_SPLASH,   INFO_WEAPON_ROCKETLAUNCHER_MURDER_SPLASH,       NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_SEEKER_SUICIDE,                                 INFO_WEAPON_SEEKER_SUICIDE,                             CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_SEEKER_MURDER_TAG,                              INFO_WEAPON_SEEKER_MURDER_TAG,                          NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_SEEKER_MURDER_SPRAY,                    INFO_WEAPON_SEEKER_MURDER_SPRAY,                        NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_SHOTGUN_MURDER_SLAP,                    INFO_WEAPON_SHOTGUN_MURDER_SLAP,                        NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_SHOTGUN_MURDER,                                 INFO_WEAPON_SHOTGUN_MURDER,                             NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_TUBA_SUICIDE,                                   INFO_WEAPON_TUBA_SUICIDE,                                       CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_TUBA_MURDER,                                    INFO_WEAPON_TUBA_MURDER,                                        NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_ACCORDEON_SUICIDE,                              INFO_WEAPON_ACCORDEON_SUICIDE,                          CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_ACCORDEON_MURDER,                               INFO_WEAPON_ACCORDEON_MURDER,                           NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_KLEINBOTTLE_SUICIDE,                    INFO_WEAPON_KLEINBOTTLE_SUICIDE,                        CENTER_DEATH_SELF_GENERIC) \
+       MSG_WEAPON_NOTIF(WEAPON_KLEINBOTTLE_MURDER,                     INFO_WEAPON_KLEINBOTTLE_MURDER,                         NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_UZI_MURDER_SNIPE,                               INFO_WEAPON_UZI_MURDER_SNIPE,                           NO_MSG) \
+       MSG_WEAPON_NOTIF(WEAPON_UZI_MURDER_SPRAY,                               INFO_WEAPON_UZI_MURDER_SPRAY,                           NO_MSG) 
+
+#define MSG_DEATH_NOTIFICATIONS \
+       /*MSG_DEATH_NOTIF(DEATH_EMPTY,                                          NO_MSG,                                                                 NO_MSG)*/ \
+       MSG_DEATH_NOTIF(DEATH_SELF_CUSTOM,                                      INFO_DEATH_SELF_GENERIC,                                CENTER_DEATH_SELF_CUSTOM) \
+       MSG_DEATH_NOTIF(DEATH_SELF_GENERIC,                                     INFO_DEATH_SELF_GENERIC,                                CENTER_DEATH_SELF_GENERIC) \
+       MSG_DEATH_NOTIF(DEATH_SELF_VOID,                                        INFO_DEATH_SELF_VOID,                                   CENTER_DEATH_SELF_VOID) \
+       MSG_DEATH_NOTIF(DEATH_SELF_SUICIDE,                                     INFO_DEATH_SELF_SUICIDE,                                CENTER_DEATH_SELF_SUICIDE) \
+       MSG_DEATH_NOTIF(DEATH_SELF_NOAMMO,                                      INFO_DEATH_SELF_NOAMMO,                                 CENTER_DEATH_SELF_NOAMMO) \
+       MSG_DEATH_NOTIF(DEATH_SELF_ROT,                                         INFO_DEATH_SELF_ROT,                                    CENTER_DEATH_SELF_ROT) \
+       MSG_DEATH_NOTIF(DEATH_SELF_CAMP,                                        INFO_DEATH_SELF_CAMP,                                   CENTER_DEATH_SELF_CAMP) \
+       MSG_DEATH_NOTIF(DEATH_SELF_BETRAYAL,                            INFO_DEATH_SELF_BETRAYAL,                               CENTER_DEATH_SELF_BETRAYAL) \
+       MSG_DEATH_NOTIF(DEATH_SELF_TEAMCHANGE,                          INFO_DEATH_SELF_TEAMCHANGE,                             CENTER_DEATH_SELF_TEAMCHANGE) \
+       MSG_DEATH_NOTIF(DEATH_SELF_AUTOTEAMCHANGE,                      INFO_DEATH_SELF_AUTOTEAMCHANGE,                 CENTER_DEATH_SELF_AUTOTEAMCHANGE) \
+       MSG_DEATH_NOTIF(DEATH_SELF_FALL,                                        INFO_DEATH_SELF_FALL,                                   CENTER_DEATH_SELF_FALL) \
+       MSG_DEATH_NOTIF(DEATH_SELF_DROWN,                                       INFO_DEATH_SELF_DROWN,                                  CENTER_DEATH_SELF_DROWN) \
+       MSG_DEATH_NOTIF(DEATH_SELF_FIRE,                                        INFO_DEATH_SELF_FIRE,                                   CENTER_DEATH_SELF_FIRE) \
+       MSG_DEATH_NOTIF(DEATH_SELF_LAVA,                                        INFO_DEATH_SELF_LAVA,                                   CENTER_DEATH_SELF_LAVA) \
+       MSG_DEATH_NOTIF(DEATH_SELF_SLIME,                                       INFO_DEATH_SELF_SLIME,                                  CENTER_DEATH_SELF_SLIME) \
+       MSG_DEATH_NOTIF(DEATH_SELF_SHOOTING_STAR,                       INFO_DEATH_SELF_SHOOTING_STAR,                  CENTER_DEATH_SELF_SHOOTING_STAR) \
+       MSG_DEATH_NOTIF(DEATH_SELF_SWAMP,                                       INFO_DEATH_SELF_SWAMP,                                  CENTER_DEATH_SELF_SWAMP) \
+       MSG_DEATH_NOTIF(DEATH_SELF_CHEAT,                                       INFO_DEATH_SELF_CHEAT,                                  CENTER_DEATH_SELF_CHEAT) \
+       MSG_DEATH_NOTIF(DEATH_SELF_TOUCHEXPLODE,                        INFO_DEATH_SELF_TOUCHEXPLODE,                   CENTER_DEATH_SELF_TOUCHEXPLODE) \
+       MSG_DEATH_NOTIF(DEATH_SELF_TURRET,                                      INFO_DEATH_SELF_TURRET,                                 CENTER_DEATH_SELF_TURRET) \
+       MSG_DEATH_NOTIF(DEATH_SELF_TURRET_EWHEEL,                       INFO_DEATH_SELF_TURRET_EWHEEL,                  CENTER_DEATH_SELF_TURRET_EWHEEL) \
+       MSG_DEATH_NOTIF(DEATH_SELF_TURRET_FLAC,                         INFO_DEATH_SELF_TURRET_FLAC,                    CENTER_DEATH_SELF_TURRET) \
+       MSG_DEATH_NOTIF(DEATH_SELF_TURRET_MACHINEGUN,           INFO_DEATH_SELF_TURRET_MACHINEGUN,              CENTER_DEATH_SELF_TURRET) \
+       MSG_DEATH_NOTIF(DEATH_SELF_TURRET_WALKER_GUN,           INFO_DEATH_SELF_TURRET_WALKER_GUN,              CENTER_DEATH_SELF_TURRET_WALKER) \
+       MSG_DEATH_NOTIF(DEATH_SELF_TURRET_WALKER_MEELE,         INFO_DEATH_SELF_TURRET_WALKER_MEELE,    CENTER_DEATH_SELF_TURRET_WALKER) \
+       MSG_DEATH_NOTIF(DEATH_SELF_TURRET_WALKER_ROCKET,        INFO_DEATH_SELF_TURRET_WALKER_ROCKET,   CENTER_DEATH_SELF_TURRET_WALKER) \
+       MSG_DEATH_NOTIF(DEATH_SELF_TURRET_HELLION,                      INFO_DEATH_SELF_TURRET_HELLION,                 CENTER_DEATH_SELF_TURRET) \
+       MSG_DEATH_NOTIF(DEATH_SELF_TURRET_HK,                           INFO_DEATH_SELF_TURRET_HK,                              CENTER_DEATH_SELF_TURRET) \
+       MSG_DEATH_NOTIF(DEATH_SELF_TURRET_MLRS,                         INFO_DEATH_SELF_TURRET_MLRS,                    CENTER_DEATH_SELF_TURRET) \
+       MSG_DEATH_NOTIF(DEATH_SELF_TURRET_PLASMA,                       INFO_DEATH_SELF_TURRET_PLASMA,                  CENTER_DEATH_SELF_TURRET) \
+       MSG_DEATH_NOTIF(DEATH_SELF_TURRET_PHASER,                       INFO_DEATH_SELF_TURRET_PHASER,                  CENTER_DEATH_SELF_TURRET) \
+       MSG_DEATH_NOTIF(DEATH_SELF_TURRET_TESLA,                        INFO_DEATH_SELF_TURRET_TESLA,                   CENTER_DEATH_SELF_TURRET) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_TELEFRAG,                          INFO_DEATH_MURDER_TELEFRAG,                             NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_FALL,                                      INFO_DEATH_MURDER_FALL,                                 NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_DROWN,                                     INFO_DEATH_MURDER_DROWN,                                NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_LAVA,                                      INFO_DEATH_MURDER_LAVA,                                 NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_SLIME,                                     INFO_DEATH_MURDER_SLIME,                                NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_SHOOTING_STAR,                     INFO_DEATH_MURDER_SHOOTING_STAR,                NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_SWAMP,                                     INFO_DEATH_MURDER_SWAMP,                                NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_VOID,                                      INFO_DEATH_MURDER_VOID,                                 NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_TOUCHEXPLODE,                      INFO_DEATH_MURDER_TOUCHEXPLODE,                 NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_CHEAT,                                     INFO_DEATH_MURDER_CHEAT,                                NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_FIRE,                                      INFO_DEATH_MURDER_FIRE,                                 NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_VH_CRUSH,                          INFO_DEATH_MURDER_VH_CRUSH,                             NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_VH_SPID_MINIGUN,           INFO_DEATH_MURDER_VH_SPID_MINIGUN,              NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_VH_SPID_ROCKET,            INFO_DEATH_MURDER_VH_SPID_ROCKET,               NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_VH_SPID_DEATH,                     INFO_DEATH_MURDER_VH_SPID_DEATH,                NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_VH_WAKI_GUN,                       INFO_DEATH_MURDER_VH_WAKI_GUN,                  NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_VH_WAKI_ROCKET,            INFO_DEATH_MURDER_VH_WAKI_ROCKET,               NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_VH_WAKI_DEATH,                     INFO_DEATH_MURDER_VH_WAKI_DEATH,                NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_VH_RAPT_CANNON,            INFO_DEATH_MURDER_VH_RAPT_CANNON,               NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_VH_RAPT_BOMB,                      INFO_DEATH_MURDER_VH_RAPT_BOMB,                 NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_VH_RAPT_FRAGMENT,          INFO_DEATH_MURDER_VH_RAPT_FRAGMENT,             NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_VH_RAPT_DEATH,                     INFO_DEATH_MURDER_VH_RAPT_DEATH,                NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_VH_BUMB_GUN,                       INFO_DEATH_MURDER_VH_BUMB_GUN,                  NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_VH_BUMB_RAY,                       INFO_DEATH_MURDER_VH_BUMB_RAY,                  NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_VH_BUMB_RAY_HEAL,          INFO_DEATH_MURDER_VH_BUMB_RAY_HEAL,             NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_VH_BUMB_DEATH,                     INFO_DEATH_MURDER_VH_BUMB_DEATH,                NO_MSG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_FRAG,                                                      NO_MSG,                                                 CENTER_DEATH_MURDER_FRAG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_FRAGGED,                                           NO_MSG,                                                 CENTER_DEATH_MURDER_FRAGGED) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_TYPEFRAG,                                          NO_MSG,                                                 CENTER_DEATH_MURDER_TYPEFRAG) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_TYPEFRAGGED,                                       NO_MSG,                                                 CENTER_DEATH_MURDER_TYPEFRAGGED) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_FRAG_FIRST,                                        INFO_DEATH_FIRSTBLOOD,                  CENTER_DEATH_MURDER_FRAG_FIRST) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_FRAGGED_FIRST,                                     NO_MSG,                                                 CENTER_DEATH_MURDER_FRAGGED_FIRST) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_TYPEFRAG_FIRST,                            INFO_DEATH_FIRSTBLOOD,                  CENTER_DEATH_MURDER_TYPEFRAG_FIRST) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_TYPEFRAGGED_FIRST,                         NO_MSG,                                                 CENTER_DEATH_MURDER_TYPEFRAGGED_FIRST) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_FRAG_VERBOSE,                                      NO_MSG,                                                 CENTER_DEATH_MURDER_FRAG_VERBOSE) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_FRAGGED_VERBOSE,                           NO_MSG,                                                 CENTER_DEATH_MURDER_FRAGGED_VERBOSE) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_TYPEFRAG_VERBOSE,                          NO_MSG,                                                 CENTER_DEATH_MURDER_TYPEFRAG_VERBOSE) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_TYPEFRAGGED_VERBOSE,                       NO_MSG,                                                 CENTER_DEATH_MURDER_TYPEFRAGGED_VERBOSE) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_FRAG_FIRST_VERBOSE,                        INFO_DEATH_FIRSTBLOOD,                  CENTER_DEATH_MURDER_FRAG_FIRST_VERBOSE) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_FRAGGED_FIRST_VERBOSE,                     NO_MSG,                                                 CENTER_DEATH_MURDER_FRAGGED_FIRST_VERBOSE) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_TYPEFRAG_FIRST_VERBOSE,            INFO_DEATH_FIRSTBLOOD,                  CENTER_DEATH_MURDER_TYPEFRAG_FIRST_VERBOSE) \
+       MSG_DEATH_NOTIF(DEATH_MURDER_TYPEFRAGGED_FIRST_VERBOSE,         NO_MSG,                                                 CENTER_DEATH_MURDER_TYPEFRAGGED_FIRST_VERBOSE) \
+       MSG_DEATH_NOTIF(DEATH_TEAMKILL_FRAG,                                            NO_MSG,                                                 CENTER_DEATH_TEAMKILL_FRAG) \
+       MSG_DEATH_NOTIF(DEATH_TEAMKILL_FRAGGED,                                         NO_MSG,                                                 CENTER_DEATH_TEAMKILL_FRAGGED)
+
+
+// ====================================
+//  Initialization/Create Declarations
+// ====================================
+
+#ifndef MENUQC // Menu doesn't need init
+
+#define NOTIF_FIRST 1
+#define NOTIF_MAX 1024 // limit of recursive functions with ACCUMULATE_FUNCTION
+
+#define ADD_AUTOCVAR(name) var float autocvar_notification_##name = TRUE;
+#define CHECK_AUTOCVAR(name) if(autocvar_notification_##name)
+
+float NOTIF_INFO_COUNT;
+float NOTIF_CENTER_COUNT;
+float NOTIF_WEAPON_COUNT;
+float NOTIF_DEATH_COUNT;
+float NOTIF_CPID_COUNT;
+
+entity msg_info_notifs[NOTIF_MAX];
+entity msg_center_notifs[NOTIF_MAX];
+entity msg_weapon_notifs[NOTIF_MAX];
+entity msg_death_notifs[NOTIF_MAX];
+
+.float nent_broadcast;
+.entity nent_client;
+.float nent_net_type;
+.float nent_net_name;
+.float nent_stringcount;
+.float nent_floatcount; 
+.string nent_strings[4];
+.float nent_floats[4];
+
+.string nent_name;
+.string nent_args;
+.string nent_hudargs;
+.string nent_icon;
+.string nent_durcnt;
+.string nent_normal;
+.string nent_gentle;
+
+.float nent_cpid;
+.float nent_durcnt;
+
+//     notif.nent_args = strzone(args); \
+//     notif.nent_hudargs = strzone(hudargs); \
+// if(durcnt != "") { notif.nent_durcnt = durcnt; } \
+
+#define CREATE_NOTIF_ENTITY(type,name,infoname,centername,strnum,flnum,args,hudargs,icon,cpid,durcnt,normal,gentle,check_newline,subcalls) \
+       entity notif = spawn(); \
+       msg_##type##_notifs[name - 1] = notif; \
+       notif.classname = "msg_##type##_notification"; \
+       notif.nent_name = strzone(#name); \
+       #if subcalls \
+               #if (infoname == NO_MSG) && (centername == NO_MSG) \
+                       print(sprintf("^1NOTIFICATION WITH NO SUBCALLS: ^7net_type = MSG_%s, net_name = %s.\n", strtoupper(#type), #name)); \
+               #else \
+                       if(infoname) { notif.nent_infoname = infoname; } \
+                       if(centername) { notif.nent_centername = centername; } \
+               #endif \
+       #else \
+               notif.nent_stringcount = strnum; \
+               notif.nent_floatcount = flnum; \
+               if(icon != "") { notif.nent_icon = strzone(icon); } \
+               if(normal != "") { notif.nent_normal = strzone(normal); } \
+               else { print(sprintf("^1EMPTY NOTIFICATION: ^7net_type = MSG_%s, net_name = %s.\n", strtoupper(#type), #name)); } \
+               if(gentle != "") { notif.nent_gentle = strzone(gentle); } \
+               #if check_newline \
+                       if(normal != "") { if not(substring(normal, (strlen(normal) - 1), 1) == "\n") { print(sprintf("^1MISSING/BROKEN NEW LINE AT END OF NOTIFICATION: ^7net_type = MSG_%s, net_name = %s, NORMAL string.\n", strtoupper(#type), #name)); } } \
+                       if(gentle != "") { if not(substring(gentle, (strlen(gentle) - 1), 1) == "\n") { print(sprintf("^1MISSING/BROKEN NEW LINE AT END OF NOTIFICATION: ^7net_type = MSG_%s, net_name = %s, GENTLE string.\n", strtoupper(#type), #name)); } } \
+               #else \
+                       if(cpid != NO_MSG) { notif.nent_cpid = cpid; } \
+               #endif \
+       #endif
+
+
+#define MSG_INFO_NOTIF(name,strnum,flnum,args,hudargs,icon,normal,gentle) \
+       ADD_AUTOCVAR(name) \
+       float name; \
+       void RegisterNotification_##name() \
+       { \
+               SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_INFO_COUNT) \
+               CHECK_MAX_COUNT(name, NOTIF_MAX, NOTIF_INFO_COUNT, "notifications") \
+               CREATE_NOTIF_ENTITY(info, name, NO_MSG, NO_MSG, \
+                       strnum, flnum, args, hudargs, icon, NO_MSG, NO_MSG, \
+                       normal, gentle, TRUE, FALSE) \
+       } \
+       ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
+
+#define MSG_CENTER_NOTIF(name,strnum,flnum,args,cpid,durcnt,normal,gentle) \
+       ADD_AUTOCVAR(name) \
+       float name; \
+       float cpid; \
+       void RegisterNotification_##name() \
+       { \
+               SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_CENTER_COUNT) \
+               SET_FIELD_COUNT(cpid, NOTIF_FIRST, NOTIF_CPID_COUNT) \
+               CHECK_MAX_COUNT(name, NOTIF_MAX, NOTIF_CENTER_COUNT, "notifications") \
+               CREATE_NOTIF_ENTITY(center, name, NO_MSG, NO_MSG, \
+                       strnum, flnum, args, "", "", cpid, durcnt, \
+                       normal, gentle, FALSE, FALSE) \
+       } \
+       ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
+
+#define MSG_WEAPON_NOTIF(name,infoname,centername) \
+       ADD_AUTOCVAR(name) \
+       float name; \
+       void RegisterNotification_##name() \
+       { \
+               SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_WEAPON_COUNT) \
+               CHECK_MAX_COUNT(name, NOTIF_MAX, NOTIF_WEAPON_COUNT, "notifications") \
+               CREATE_NOTIF_ENTITY(weapon, name, infoname, centername, \
+                       NO_MSG, NO_MSG, "", "", "", NO_MSG, NO_MSG, \
+                       "", "", FALSE, TRUE) \
+       } \
+       ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
+
+#define MSG_DEATH_NOTIF(name,infoname,centername) \
+       ADD_AUTOCVAR(name) \
+       float name; \
+       void RegisterNotification_##name() \
+       { \
+               SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_DEATH_COUNT) \
+               CHECK_MAX_COUNT(name, NOTIF_MAX, NOTIF_DEATH_COUNT, "notifications") \
+               CREATE_NOTIF_ENTITY(death, name, infoname, centername, \
+                       NO_MSG, NO_MSG, "", "", "", NO_MSG, NO_MSG, \
+                       "", "", FALSE, TRUE) \
+       } \
+       ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
+
+// NOW we actually activate the declarations
+MSG_INFO_NOTIFICATIONS
+MSG_CENTER_NOTIFICATIONS
+MSG_WEAPON_NOTIFICATIONS
+MSG_DEATH_NOTIFICATIONS
+#undef MSG_INFO_NOTIF
+#undef MSG_CENTER_NOTIF
+#undef MSG_WEAPON_NOTIF
+#undef MSG_DEATH_NOTIF
+
+#undef ADD_AUTOCVAR
+
+#endif // ifndef MENUQC
diff --git a/qcsrc/common/teams.qh b/qcsrc/common/teams.qh
new file mode 100644 (file)
index 0000000..c15f461
--- /dev/null
@@ -0,0 +1,145 @@
+#ifdef TEAMNUMBERS_THAT_ARENT_STUPID
+const float FL_TEAM_1 = 1;  // red
+const float FL_TEAM_2 = 2; // blue
+const float FL_TEAM_3 = 3; // yellow
+const float FL_TEAM_4 = 4; // pink
+const float FL_SPECTATOR = 5;
+#else
+#ifdef CSQC
+const float FL_TEAM_1 = 4;  // red
+const float FL_TEAM_2 = 13; // blue
+const float FL_TEAM_3 = 12; // yellow
+const float FL_TEAM_4 = 9; // pink
+#else
+const float FL_TEAM_1 = 5;  // red
+const float FL_TEAM_2 = 14; // blue
+const float FL_TEAM_3 = 13; // yellow
+const float FL_TEAM_4 = 10; // pink
+#endif
+const float FL_SPECTATOR = 1337;
+#endif
+
+const string COL_TEAM_1 = "^1";
+const string COL_TEAM_2 = "^4";
+const string COL_TEAM_3 = "^3";
+const string COL_TEAM_4 = "^6";
+const string STR_TEAM_1 = _("Red");
+const string STR_TEAM_2 = _("Blue");
+const string STR_TEAM_3 = _("Yellow");
+const string STR_TEAM_4 = _("Pink");
+const string STR_TEAM = _("Team");
+const string STR_NEUTRAL = _("Neutral");
+
+#define APP_TEAM_NUM_2(num,prefix) ((num == FL_TEAM_1) ? prefix##RED : prefix##BLUE)
+#define APP_TEAM_NUM_4(num,prefix) ((num == FL_TEAM_1) ? prefix##RED : ((num == FL_TEAM_2) ? prefix##BLUE : ((num == FL_TEAM_3) ? prefix##YELLOW : prefix##PINK)))
+#define APP_TEAM_ENT_2(ent,prefix) ((ent.team == FL_TEAM_1) ? prefix##RED : prefix##BLUE)
+#define APP_TEAM_ENT_4(ent,prefix) ((ent.team == FL_TEAM_1) ? prefix##RED : ((ent.team == FL_TEAM_2) ? prefix##BLUE : ((ent.team == FL_TEAM_3) ? prefix##YELLOW : prefix##PINK)))
+
+#ifdef CSQC
+float teamplay;
+float myteam;
+#endif
+
+string Team_ColorCode(float teamid)
+{
+    switch(teamid)
+    {
+               case FL_TEAM_1: return COL_TEAM_1;
+       case FL_TEAM_2: return COL_TEAM_2;
+       case FL_TEAM_3: return COL_TEAM_3;
+       case FL_TEAM_4: return COL_TEAM_4;
+       }
+       
+       return "^7";
+}
+
+vector Team_ColorRGB(float teamid)
+{
+       switch(teamid)
+       {
+               #ifdef TEAMNUMBERS_THAT_ARENT_STUPID
+               case FL_TEAM_1: return '1 0 0'; // red
+               case FL_TEAM_2: return '0 0 1'; // blue
+               case FL_TEAM_3: return '1 1 0'; // yellow
+               case FL_TEAM_4: return '1 0 1'; // pink
+               #else
+               case FL_TEAM_1: return '1 0.0625 0.0625';
+               case FL_TEAM_2: return '0.0625 0.0625 1';
+               case FL_TEAM_3: return '1 1 0.0625';
+               case FL_TEAM_4: return '1 0.0625 1';
+               #endif
+       }
+
+    return '0 0 0';
+}
+
+string Team_ColorName(float teamid)
+{
+    switch(teamid)
+    {
+               case FL_TEAM_1: return STR_TEAM_1;
+       case FL_TEAM_2: return STR_TEAM_2;
+       case FL_TEAM_3: return STR_TEAM_3;
+       case FL_TEAM_4: return STR_TEAM_4;
+       }
+       
+    return STR_NEUTRAL;
+}
+
+float Team_ColorToTeam(string team_color)
+{
+       switch(strtolower(team_color))
+       {
+               case "red": return FL_TEAM_1;
+       case "blue": return FL_TEAM_2;
+       case "yellow": return FL_TEAM_3;
+       case "pink": return FL_TEAM_4;
+       case "auto": return 0;
+       }
+       
+       return -1;
+}
+
+float Team_NumberToTeam(float number)
+{
+       switch(number)
+       {
+               case 1: return FL_TEAM_1;
+               case 2: return FL_TEAM_2;
+               case 3: return FL_TEAM_3;
+               case 4: return FL_TEAM_4;
+       }
+       
+       return -1;
+}
+
+float Team_TeamToNumber(float teamid)
+{
+       switch(teamid)
+       {
+               case FL_TEAM_1: return 1;
+               case FL_TEAM_2: return 2;
+               case FL_TEAM_3: return 3;
+               case FL_TEAM_4: return 4;
+       }
+       
+       return -1;
+}
+
+
+// legacy aliases for shitty code
+#define TeamByColor(teamid) (Team_TeamToNumber(teamid) - 1)
+#define ColorByTeam(number) Team_NumberToTeam(number + 1)
+
+// useful aliases
+#define Team_ColorName_Lower(teamid) strtolower(Team_ColorName(teamid))
+#define Team_ColorName_Upper(teamid) strtoupper(Team_ColorName(teamid))
+
+#define Team_FullName(teamid) strcat(Team_ColorName(teamid), " ", STR_TEAM, "^7")
+#define Team_ColoredFullName(teamid) strcat(Team_ColorCode(teamid), Team_ColorName(teamid), " ", STR_TEAM, "^7")
+
+#define Team_NumberToFullName(number) Team_FullName(Team_NumberToTeam(number))
+#define Team_NumberToColoredFullName(number) Team_ColoredFullName(Team_NumberToTeam(number))
+
+// replace these flags in a string with the strings provided
+#define TCR(input,teamcolor,teamtext) strreplace("^TC", teamcolor, strreplace("^TT", teamtext, input))
index 404bd7e5a486012deec784cb14be934f0c5cd85c..e781a4dcbebbef25a54035aefa85893ec8996831 100644 (file)
@@ -2480,6 +2480,79 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t
                queue_start.FindConnectedComponent_processing = 0;
 }
 
+float Count_Proper_Strings(string improper, string...count)
+{
+       float i, total = 0;
+       string tmp;
+       
+       for(i = 0; i < count; ++i)
+       {
+               tmp = ...(i, string);
+               if((tmp) && (tmp != improper)) { ++total; }
+       }
+       
+       return total;
+}
+
+float Count_Proper_Floats(float improper, float...count)
+{
+       float i, total = 0;
+       
+       for(i = 0; i < count; ++i)
+       {
+               if(...(i, float) != improper) { ++total; }
+       }
+       
+       return total;
+}
+
+// todo: this sucks, lets find a better way to do backtraces?
+#ifndef MENUQC
+void backtrace(string msg)
+{
+       float dev, war;
+       #ifdef SVQC
+       dev = autocvar_developer;
+       war = autocvar_prvm_backtraceforwarnings;
+       #else
+       dev = cvar("developer");
+       war = cvar("prvm_backtraceforwarnings");
+       #endif
+       cvar_set("developer", "1");
+       cvar_set("prvm_backtraceforwarnings", "1");
+       print("\n");
+       print("--- CUT HERE ---\nWARNING: ");
+       print(msg);
+       print("\n");
+       remove(world); // isn't there any better way to cause a backtrace?
+       print("\n--- CUT UNTIL HERE ---\n");
+       cvar_set("developer", ftos(dev));
+       cvar_set("prvm_backtraceforwarnings", ftos(war));
+}
+#endif
+
+// color code replace, place inside of sprintf and parse the string
+string CCR(string input)
+{
+       // See the autocvar declarations in util.qh for default values
+       
+       // foreground/normal colors
+       input = strreplace("^F1", strcat("^", autocvar_hud_colorset_foreground_1), input); 
+       input = strreplace("^F2", strcat("^", autocvar_hud_colorset_foreground_2), input); 
+       input = strreplace("^F3", strcat("^", autocvar_hud_colorset_foreground_3), input); 
+       input = strreplace("^F4", strcat("^", autocvar_hud_colorset_foreground_4), input); 
+
+       // "kill" colors
+       input = strreplace("^K1", strcat("^", autocvar_hud_colorset_kill_1), input);
+       input = strreplace("^K2", strcat("^", autocvar_hud_colorset_kill_2), input);
+       input = strreplace("^K3", strcat("^", autocvar_hud_colorset_kill_3), input);
+
+       // background colors
+       input = strreplace("^BG", strcat("^", autocvar_hud_colorset_background), input);
+       input = strreplace("^N", "^7", input); // "none"-- reset to white...
+       return input;
+}
+
 vector vec3(float x, float y, float z)
 {
        vector v;
index 4e553e4ba5d1611fc73fa83289c45b0d0de27b57..f5fa6eaabfe417f27a9c10bb546a463e6255b2c4 100644 (file)
@@ -1,6 +1,9 @@
 // a dummy macro that prevents the "hanging ;" warning
 #define ENDS_WITH_CURLY_BRACE
 
+// return the actual code name of a var as a string
+#define VAR_TO_TEXT(var) #var
+
 #ifdef HAVE_YO_DAWG_CPP
 // TODO make ascii art pic of xzibit
 // YO DAWG!
@@ -37,6 +40,11 @@ void ACCUMULATE_call(string func)
        ACCUMULATE_call(#func)
 #endif
 
+// used for simplifying ACCUMULATE_FUNCTIONs
+#define SET_FIRST_OR_LAST(input,first,count) if(!input) { input = (first + count); }
+#define SET_FIELD_COUNT(field,first,count) if(!field) { field = (first + count); ++count; }
+#define CHECK_MAX_COUNT(name,max,count,type) if(count == max) { error(strcat("Maximum ", type, " hit: ", VAR_TO_TEXT(name), ": ", ftos(count), ".\n")); }
+
 // this returns a tempstring containing a copy of s with additional \n newlines added, it also replaces \n in the text with a real newline
 // NOTE: s IS allowed to be a tempstring
 string wordwrap(string s, float l);
@@ -365,6 +373,45 @@ typedef entity(entity cur, entity near, entity pass) findNextEntityNearFunction_
 typedef float(entity a, entity b, entity pass) isConnectedFunction_t;
 void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t nxt, isConnectedFunction_t iscon, entity pass);
 
+// expand multiple arguments into one argument by stripping parenthesis
+#define XPD(...) __VA_ARGS__
+
+float Count_Proper_Strings(string improper, string...count);
+float Count_Proper_Floats(float improper, float...count);
+
+#ifndef MENUQC
+void backtrace(string msg);
+#endif
+
+// color code replace, place inside of sprintf and parse the string... defaults described as constants
+// foreground/normal colors
+var string autocvar_hud_colorset_foreground_1 = "2"; // F1 - Green  // primary priority (important names, etc)
+var string autocvar_hud_colorset_foreground_2 = "3"; // F2 - Yellow // secondary priority (items, locations, numbers, etc)
+var string autocvar_hud_colorset_foreground_3 = "4"; // F3 - Blue   // tertiary priority or relatively inconsequential text
+var string autocvar_hud_colorset_foreground_4 = "1"; // F4 - Red    // notice/attention grabbing texting
+// "kill" colors
+var string autocvar_hud_colorset_kill_1 = "1"; // K1 - Red    // "bad" or "dangerous" text (death messages against you, kill notifications, etc)
+var string autocvar_hud_colorset_kill_2 = "3"; // K2 - Yellow // similar to above, but less important... OR, a highlight out of above message type
+var string autocvar_hud_colorset_kill_3 = "4"; // K3 - Blue   // "good" or "beneficial" text (you fragging someone, etc)
+// background color
+var string autocvar_hud_colorset_background = "7"; // BG - White // neutral/unimportant text
+
+string CCR(string input);
+
+#ifndef MENUQC
+#ifdef CSQC
+#define GENTLE (autocvar_cl_gentle || autocvar_cl_gentle_messages)
+#else
+#define GENTLE autocvar_sv_gentle
+#endif
+#define normal_or_gentle(normal,gentle) (GENTLE ? ((gentle != "") ? gentle : normal) : normal)
+#endif
+
+// allow writing to also pass through to spectators (like so spectators see the same centerprints as players for example)
+#define WRITESPECTATABLE_MSG_ONE_VARNAME(varname,statement) entity varname; varname = msg_entity; FOR_EACH_REALCLIENT(msg_entity) if(msg_entity == varname || (msg_entity.classname == STR_SPECTATOR && msg_entity.enemy == varname)) statement msg_entity = varname
+#define WRITESPECTATABLE_MSG_ONE(statement) WRITESPECTATABLE_MSG_ONE_VARNAME(oldmsg_entity, statement)
+#define WRITESPECTATABLE(msg,statement) if(msg == MSG_ONE) { WRITESPECTATABLE_MSG_ONE(statement); } else statement float WRITESPECTATABLE_workaround = 0
+
 vector vec3(float x, float y, float z);
 
 #ifndef MENUQC
index e45a4813a6d257bc512e10dbae643c0db61500fa..313fc4639bd1c76f35e1ad65ae347a25287e0e30 100644 (file)
@@ -13,6 +13,8 @@ config.qh
 
 oo/base.h
 
+../common/teams.qh
+../common/notifications.qh
 ../common/constants.qh
 ../common/mapinfo.qh
 ../common/campaign_common.qh
@@ -35,6 +37,7 @@ oo/implementation.h
        classes.c
 
 ../common/util.qc
+../common/notifications.qc
 ../common/command/markup.qc
 ../common/command/rpn.qc
 ../common/command/generic.qc
index ef81fd92bad7db138edb2fa1e1067d252bae875b..bb52a4ae25505d7ba4ec9de4914ecae2fa6299f8 100644 (file)
@@ -293,22 +293,22 @@ void count_players()
        // count amount of players in each team
        total_players = red_players = blue_players = yellow_players = pink_players = 0;
        FOR_EACH_PLAYER(self) {
-               if (self.team == COLOR_TEAM1)
+               if (self.team == FL_TEAM_1)
                {
                        red_players += 1;
                        total_players += 1;
                }
-               else if (self.team == COLOR_TEAM2)
+               else if (self.team == FL_TEAM_2)
                {
                        blue_players += 1;
                        total_players += 1;
                }
-               else if (self.team == COLOR_TEAM3)
+               else if (self.team == FL_TEAM_3)
                {
                        yellow_players += 1;
                        total_players += 1;
                }
-               else if (self.team == COLOR_TEAM4)
+               else if (self.team == FL_TEAM_4)
                {
                        pink_players += 1;
                        total_players += 1;
@@ -322,12 +322,12 @@ void count_alive_players()
        if(g_ca)
        {
                FOR_EACH_PLAYER(self) {
-                       if (self.team == COLOR_TEAM1 && self.health >= 1)
+                       if (self.team == FL_TEAM_1 && self.health >= 1)
                        {
                                redalive += 1;
                                totalalive += 1;
                        }
-                       else if (self.team == COLOR_TEAM2 && self.health >= 1)
+                       else if (self.team == FL_TEAM_2 && self.health >= 1)
                        {
                                bluealive += 1;
                                totalalive += 1;
@@ -342,22 +342,22 @@ void count_alive_players()
        {
                // count amount of alive players in each team
                FOR_EACH_PLAYER(self) {
-                       if (self.team == COLOR_TEAM1 && self.freezetag_frozen == 0 && self.health >= 1)
+                       if (self.team == FL_TEAM_1 && self.freezetag_frozen == 0 && self.health >= 1)
                        {
                                redalive += 1;
                                totalalive += 1;
                        }
-                       else if (self.team == COLOR_TEAM2 && self.freezetag_frozen == 0 && self.health >= 1)
+                       else if (self.team == FL_TEAM_2 && self.freezetag_frozen == 0 && self.health >= 1)
                        {
                                bluealive += 1;
                                totalalive += 1;
                        }
-                       else if (self.team == COLOR_TEAM3 && self.freezetag_frozen == 0 && self.health >= 1)
+                       else if (self.team == FL_TEAM_3 && self.freezetag_frozen == 0 && self.health >= 1)
                        {
                                yellowalive += 1;
                                totalalive += 1;
                        }
-                       else if (self.team == COLOR_TEAM4 && self.freezetag_frozen == 0 && self.health >= 1)
+                       else if (self.team == FL_TEAM_4 && self.freezetag_frozen == 0 && self.health >= 1)
                        {
                                pinkalive += 1;
                                totalalive += 1;
@@ -400,12 +400,12 @@ void Spawnqueue_Check()
                                if(redalive) {
                                        play2all("ctf/red_capture.wav");
                                        FOR_EACH_CLIENT(self) centerprint(self, "^1RED ^7team wins the round");
-                                       TeamScore_AddToTeam(COLOR_TEAM1, ST_SCORE, +1);
+                                       TeamScore_AddToTeam(FL_TEAM_1, ST_SCORE, +1);
                                }
                                else if(bluealive) {
                                        play2all("ctf/blue_capture.wav");
                                        FOR_EACH_CLIENT(self) centerprint(self, "^4BLUE ^7team wins the round");
-                                       TeamScore_AddToTeam(COLOR_TEAM2, ST_SCORE, +1);
+                                       TeamScore_AddToTeam(FL_TEAM_2, ST_SCORE, +1);
                                }
                                else
                                        FOR_EACH_CLIENT(self) centerprint(self, "^7Round tied");
index 2562dca3df803fa93725204eb01f7059ef1cd189..b4ac4a1eea33ef75b19532a339ac53aa418741a2 100644 (file)
@@ -9,7 +9,7 @@ void spawnfunc_info_player_attacker() {
                remove(self);
                return;
        }
-       self.team = COLOR_TEAM1; // red, gets swapped every round
+       self.team = FL_TEAM_1; // red, gets swapped every round
        spawnfunc_info_player_deathmatch();
 }
 
@@ -19,7 +19,7 @@ void spawnfunc_info_player_defender() {
                remove(self);
                return;
        }
-       self.team = COLOR_TEAM2; // blue, gets swapped every round
+       self.team = FL_TEAM_2; // blue, gets swapped every round
        spawnfunc_info_player_deathmatch();
 }
 
@@ -216,10 +216,10 @@ void spawnfunc_func_assault_destructible() {
        }
        self.spawnflags = 3;
        self.classname = "func_assault_destructible";
-       if(assault_attacker_team == COLOR_TEAM1) {
-               self.team = COLOR_TEAM2;
+       if(assault_attacker_team == FL_TEAM_1) {
+               self.team = FL_TEAM_2;
        } else {
-               self.team = COLOR_TEAM1;
+               self.team = FL_TEAM_1;
        }
        spawnfunc_func_breakable();
 }
@@ -289,10 +289,10 @@ void assault_roundstart_use() {
        ent = find(world, classname, "turret_main");
        while(ent) {
                // Swap turret teams
-               if(ent.team == COLOR_TEAM1)
-                       ent.team = COLOR_TEAM2;
+               if(ent.team == FL_TEAM_1)
+                       ent.team = FL_TEAM_2;
                else
-                       ent.team = COLOR_TEAM1;
+                       ent.team = FL_TEAM_1;
 
                self = ent;
 
@@ -313,7 +313,7 @@ void spawnfunc_target_assault_roundstart() {
                remove(self);
                return;
        }
-       assault_attacker_team = COLOR_TEAM1;
+       assault_attacker_team = FL_TEAM_1;
        self.classname = "target_assault_roundstart";
        self.use = assault_roundstart_use;
        self.reset2 = assault_roundstart_use;
@@ -351,10 +351,10 @@ void assault_new_round()
        self.winning = self.winning + 1;
 
        // swap attacker/defender roles
-       if(assault_attacker_team == COLOR_TEAM1) {
-               assault_attacker_team = COLOR_TEAM2;
+       if(assault_attacker_team == FL_TEAM_1) {
+               assault_attacker_team = FL_TEAM_2;
        } else {
-               assault_attacker_team = COLOR_TEAM1;
+               assault_attacker_team = FL_TEAM_1;
        }
 
 
@@ -363,10 +363,10 @@ void assault_new_round()
        {
                if(clienttype(ent) == CLIENTTYPE_NOTACLIENT)
                {
-                       if(ent.team_saved == COLOR_TEAM1)
-                               ent.team_saved = COLOR_TEAM2;
-                       else if(ent.team_saved == COLOR_TEAM2)
-                               ent.team_saved = COLOR_TEAM1;
+                       if(ent.team_saved == FL_TEAM_1)
+                               ent.team_saved = FL_TEAM_2;
+                       else if(ent.team_saved == FL_TEAM_2)
+                               ent.team_saved = FL_TEAM_1;
                }
        }
 
index d65d866ca60132011470f2a058dcd407ed2db2f4..9d514da5ac6fe5561c3aa4977169e395d7a72cdd 100644 (file)
@@ -127,10 +127,10 @@ void ctf_flag_spawnstuff()
        self.nearestwaypointtimeout = 0; // activate waypointing again
        self.basewaypoint = self.nearestwaypoint;
 
-       if(self.team == COLOR_TEAM1)
-               WaypointSprite_SpawnFixed("redbase", self.origin + '0 0 61', self, sprite, RADARICON_FLAG, colormapPaletteColor(COLOR_TEAM1 - 1, FALSE));
+       if(self.team == FL_TEAM_1)
+               WaypointSprite_SpawnFixed("redbase", self.origin + '0 0 61', self, sprite, RADARICON_FLAG, colormapPaletteColor(FL_TEAM_1 - 1, FALSE));
        else
-               WaypointSprite_SpawnFixed("bluebase", self.origin + '0 0 61', self, sprite, RADARICON_FLAG, colormapPaletteColor(COLOR_TEAM2 - 1, FALSE));
+               WaypointSprite_SpawnFixed("bluebase", self.origin + '0 0 61', self, sprite, RADARICON_FLAG, colormapPaletteColor(FL_TEAM_2 - 1, FALSE));
 }
 
 float ctf_score_value(string parameter)
@@ -290,7 +290,7 @@ void DropFlag(entity e, entity penalty_receiver, entity attacker)
        ctf_captureshield_update(p, 0); // shield only
        e.playerid = attacker.playerid;
        e.ctf_droptime = time;
-       WaypointSprite_Spawn("flagdropped", 0, 0, e, '0 0 1' * 61, world, COLOR_TEAM1 + COLOR_TEAM2 - e.team, e, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAG, '0 1 1');
+       WaypointSprite_Spawn("flagdropped", 0, 0, e, '0 0 1' * 61, world, FL_TEAM_1 + FL_TEAM_2 - e.team, e, waypointsprite_attachedforcarrier, FALSE, RADARICON_FLAG, '0 1 1');
        WaypointSprite_Ping(e.waypointsprite_attachedforcarrier);
        
        if(p.waypointsprite_attachedforcarrier)
@@ -494,11 +494,11 @@ void FlagTouch()
                UpdateFrags(other, ctf_score_value("score_capture"));
 
                if (autocvar_g_ctf_flag_capture_effects) {
-                       if (other.team == COLOR_TEAM1) { // red team scores effect
+                       if (other.team == FL_TEAM_1) { // red team scores effect
                                pointparticles(particleeffectnum("red_ground_quake"), self.origin, '0 0 0', 1);
                                flag_cap_ring_spawn(self.origin);
                        }
-                       if (other.team == COLOR_TEAM2) { // blue team scores effect
+                       if (other.team == FL_TEAM_2) { // blue team scores effect
                                pointparticles(particleeffectnum("blue_ground_quake"), self.origin, '0 0 0', 1);
                                flag_cap_ring_spawn(self.origin);
                        }
@@ -513,7 +513,7 @@ void FlagTouch()
                other.next_take_time = time + 1;
        }
        if (self.cnt == FLAG_BASE)
-       if (other.team == COLOR_TEAM1 || other.team == COLOR_TEAM2) // only red and blue team can steal flags
+       if (other.team == FL_TEAM_1 || other.team == FL_TEAM_2) // only red and blue team can steal flags
        if (other.team != self.team)
        if (!other.flagcarried)
        if (!other.ctf_captureshielded)
@@ -563,7 +563,7 @@ void FlagTouch()
        if (self.cnt == FLAG_DROPPED)
        {
                self.flags = FL_ITEM | FL_NOTARGET; // clear FL_ONGROUND and any other junk
-               if (other.team == self.team || (other.team != COLOR_TEAM1 && other.team != COLOR_TEAM2))
+               if (other.team == self.team || (other.team != FL_TEAM_1 && other.team != FL_TEAM_2))
                {
                        // return flag
                        Send_KillNotification (other.netname, self.netname, "", INFO_RETURNFLAG, MSG_INFO);
@@ -578,22 +578,22 @@ void FlagTouch()
                                }
 
                        // punish the team who was last carrying it
-                       if(self.team == COLOR_TEAM1)
-                               TeamScore_AddToTeam(COLOR_TEAM2, ST_SCORE, -ctf_score_value("penalty_returned"));
+                       if(self.team == FL_TEAM_1)
+                               TeamScore_AddToTeam(FL_TEAM_2, ST_SCORE, -ctf_score_value("penalty_returned"));
                        else
-                               TeamScore_AddToTeam(COLOR_TEAM1, ST_SCORE, -ctf_score_value("penalty_returned"));
+                               TeamScore_AddToTeam(FL_TEAM_1, ST_SCORE, -ctf_score_value("penalty_returned"));
 
                        // reward the player who returned it
                        if(other.playerid == self.playerid) // is this the guy who killed the FC last?
                        {
-                               if (other.team == COLOR_TEAM1 || other.team == COLOR_TEAM2)
+                               if (other.team == FL_TEAM_1 || other.team == FL_TEAM_2)
                                        UpdateFrags(other, ctf_score_value("score_return_by_killer"));
                                else
                                        UpdateFrags(other, ctf_score_value("score_return_rogue_by_killer"));
                        }
                        else
                        {
-                               if (other.team == COLOR_TEAM1 || other.team == COLOR_TEAM2)
+                               if (other.team == FL_TEAM_1 || other.team == FL_TEAM_2)
                                        UpdateFrags(other, ctf_score_value("score_return"));
                                else
                                        UpdateFrags(other, ctf_score_value("score_return_rogue"));
@@ -663,7 +663,7 @@ void spawnfunc_info_player_team1()
                remove(self);
                return;
        }
-       self.team = COLOR_TEAM1; // red
+       self.team = FL_TEAM_1; // red
        spawnfunc_info_player_deathmatch();
 }
 //self.team = 4;self.classname = "info_player_start";spawnfunc_info_player_start();}
@@ -683,7 +683,7 @@ void spawnfunc_info_player_team2()
                remove(self);
                return;
        }
-       self.team = COLOR_TEAM2; // blue
+       self.team = FL_TEAM_2; // blue
        spawnfunc_info_player_deathmatch();
 }
 //self.team = 13;self.classname = "info_player_start";spawnfunc_info_player_start();}
@@ -703,7 +703,7 @@ void spawnfunc_info_player_team3()
                remove(self);
                return;
        }
-       self.team = COLOR_TEAM3; // yellow
+       self.team = FL_TEAM_3; // yellow
        spawnfunc_info_player_deathmatch();
 }
 
@@ -723,7 +723,7 @@ void spawnfunc_info_player_team4()
                remove(self);
                return;
        }
-       self.team = COLOR_TEAM4; // purple
+       self.team = FL_TEAM_4; // purple
        spawnfunc_info_player_deathmatch();
 }
 
@@ -741,11 +741,11 @@ void item_flag_postspawn()
        // Flag Glow Trail Support
        if(autocvar_g_ctf_flag_glowtrails)
        { // Provide Flag Glow Trail
-               if(self.team == COLOR_TEAM1)
+               if(self.team == FL_TEAM_1)
                        // Red
                        self.glow_color = 251;
                else
-               if(self.team == COLOR_TEAM2)
+               if(self.team == FL_TEAM_2)
                        // Blue
                        self.glow_color = 210;
 
@@ -802,7 +802,7 @@ void spawnfunc_item_flag_team1()
        ctf_worldflaglist = self;
 
        self.classname = "item_flag_team";
-       self.team = COLOR_TEAM1; // color 4 team (red)
+       self.team = FL_TEAM_1; // color 4 team (red)
        self.items = IT_KEY2; // gold key (redish enough)
        self.netname = "^1RED^7 flag";
        self.target = "###item###";
@@ -901,7 +901,7 @@ void spawnfunc_item_flag_team2()
        ctf_worldflaglist = self;
 
        self.classname = "item_flag_team";
-       self.team = COLOR_TEAM2; // color 13 team (blue)
+       self.team = FL_TEAM_2; // color 13 team (blue)
        self.items = IT_KEY1; // silver key (bluish enough)
        self.netname = "^4BLUE^7 flag";
        self.target = "###item###";
@@ -1002,8 +1002,8 @@ void ctf_spawnteams()
 
        numteams = 2;//cvar("g_ctf_default_teams");
 
-       ctf_spawnteam("Red", COLOR_TEAM1 - 1);
-       ctf_spawnteam("Blue", COLOR_TEAM2 - 1);
+       ctf_spawnteam("Red", FL_TEAM_1 - 1);
+       ctf_spawnteam("Blue", FL_TEAM_2 - 1);
 }
 
 void ctf_delayedinit()
@@ -1089,7 +1089,7 @@ void ctf_setstatus()
 entity ctf_team_has_commander(float cteam)
 {
        entity pl;
-       if(cteam != COLOR_TEAM1 || cteam != COLOR_TEAM2)
+       if(cteam != FL_TEAM_1 || cteam != FL_TEAM_2)
                return world;
 
        FOR_EACH_REALPLAYER(pl) {
index 6a0dcdf8b4e01679d23dfd1576c581e2c061e3ce..e0bad53d39f3fecb7975a22d7837d8a6e0db8728 100644 (file)
@@ -131,16 +131,16 @@ void dompoint_captured ()
 
        switch(self.goalentity.team)
        {
-               case COLOR_TEAM1:
+               case FL_TEAM_1:
                        WaypointSprite_UpdateSprites(self.sprite, "dom-red", "", "");
                        break;
-               case COLOR_TEAM2:
+               case FL_TEAM_2:
                        WaypointSprite_UpdateSprites(self.sprite, "dom-blue", "", "");
                        break;
-               case COLOR_TEAM3:
+               case FL_TEAM_3:
                        WaypointSprite_UpdateSprites(self.sprite, "dom-yellow", "", "");
                        break;
-               case COLOR_TEAM4:
+               case FL_TEAM_4:
                        WaypointSprite_UpdateSprites(self.sprite, "dom-pink", "", "");
        }
 
@@ -157,16 +157,16 @@ void dompoint_captured ()
                        wait_time = head.wait;
                switch(head.goalentity.team)
                {
-                       case COLOR_TEAM1:
+                       case FL_TEAM_1:
                                pps_red += points/wait_time;
                                break;
-                       case COLOR_TEAM2:
+                       case FL_TEAM_2:
                                pps_blue += points/wait_time;
                                break;
-                       case COLOR_TEAM3:
+                       case FL_TEAM_3:
                                pps_yellow += points/wait_time;
                                break;
-                       case COLOR_TEAM4:
+                       case FL_TEAM_4:
                                pps_pink += points/wait_time;
                }
                total_pps += points/wait_time;
@@ -469,12 +469,12 @@ void dom_spawnteams()
        else
                numteams = autocvar_g_domination_teams_override;
        // LordHavoc: edit this if you want to change defaults
-       dom_spawnteam("Red", COLOR_TEAM1-1, "models/domination/dom_red.md3", 0, "domination/claim.wav", "", "Red team has captured a control point");
-       dom_spawnteam("Blue", COLOR_TEAM2-1, "models/domination/dom_blue.md3", 0, "domination/claim.wav", "", "Blue team has captured a control point");
+       dom_spawnteam("Red", FL_TEAM_1-1, "models/domination/dom_red.md3", 0, "domination/claim.wav", "", "Red team has captured a control point");
+       dom_spawnteam("Blue", FL_TEAM_2-1, "models/domination/dom_blue.md3", 0, "domination/claim.wav", "", "Blue team has captured a control point");
        if(numteams > 2)
-               dom_spawnteam("Yellow", COLOR_TEAM3-1, "models/domination/dom_yellow.md3", 0, "domination/claim.wav", "", "Yellow team has captured a control point");
+               dom_spawnteam("Yellow", FL_TEAM_3-1, "models/domination/dom_yellow.md3", 0, "domination/claim.wav", "", "Yellow team has captured a control point");
        if(numteams > 3)
-               dom_spawnteam("Pink", COLOR_TEAM4-1, "models/domination/dom_pink.md3", 0, "domination/claim.wav", "", "Pink team has captured a control point");
+               dom_spawnteam("Pink", FL_TEAM_4-1, "models/domination/dom_pink.md3", 0, "domination/claim.wav", "", "Pink team has captured a control point");
        dom_spawnteam("", 0, "models/domination/dom_unclaimed.md3", 0, "", "", "");
 }
 
index a0e4dc097d8585cfc1e88e9f7ffebc0eb9800471..6f267426146f61a0e46426e4986c82fe66bc3c06 100644 (file)
@@ -427,10 +427,10 @@ void nb_spawnteams (void)
        {
                switch(e.team)
                {
-                       case COLOR_TEAM1: if(!t_r) { nb_spawnteam ("Red", e.team-1)   ; t_r = 1; } break;
-                       case COLOR_TEAM2: if(!t_b) { nb_spawnteam ("Blue", e.team-1)  ; t_b = 1; } break;
-                       case COLOR_TEAM3: if(!t_y) { nb_spawnteam ("Yellow", e.team-1); t_y = 1; } break;
-                       case COLOR_TEAM4: if(!t_p) { nb_spawnteam ("Pink", e.team-1)  ; t_p = 1; } break;
+                       case FL_TEAM_1: if(!t_r) { nb_spawnteam ("Red", e.team-1)   ; t_r = 1; } break;
+                       case FL_TEAM_2: if(!t_b) { nb_spawnteam ("Blue", e.team-1)  ; t_b = 1; } break;
+                       case FL_TEAM_3: if(!t_y) { nb_spawnteam ("Yellow", e.team-1); t_y = 1; } break;
+                       case FL_TEAM_4: if(!t_p) { nb_spawnteam ("Pink", e.team-1)  ; t_p = 1; } break;
                }
        }
 }
@@ -541,22 +541,22 @@ void SpawnGoal (void)
 
 void spawnfunc_nexball_redgoal (void)
 {
-       self.team = COLOR_TEAM1;
+       self.team = FL_TEAM_1;
        SpawnGoal();
 }
 void spawnfunc_nexball_bluegoal (void)
 {
-       self.team = COLOR_TEAM2;
+       self.team = FL_TEAM_2;
        SpawnGoal();
 }
 void spawnfunc_nexball_yellowgoal (void)
 {
-       self.team = COLOR_TEAM3;
+       self.team = FL_TEAM_3;
        SpawnGoal();
 }
 void spawnfunc_nexball_pinkgoal (void)
 {
-       self.team = COLOR_TEAM4;
+       self.team = FL_TEAM_4;
        SpawnGoal();
 }
 
index efd5303dd10c8730c6186b15d5a4e67f9772d233..5f7f46a9072c124f59b81448a3d6a655df7ba08c 100644 (file)
@@ -761,6 +761,7 @@ float autocvar_g_chat_flood_spl_team;
 float autocvar_g_chat_flood_spl_tell;
 float autocvar_g_chat_nospectators;
 float autocvar_g_chat_teamcolors;
+float autocvar_g_chat_tellprivacy;
 float autocvar_g_ctf_allow_vehicle_carry;
 float autocvar_g_ctf_allow_vehicle_touch;
 float autocvar_g_ctf_throw;
@@ -786,7 +787,6 @@ float autocvar_g_ctf_pass_request;
 float autocvar_g_ctf_pass_turnrate;
 float autocvar_g_ctf_pass_timelimit;
 float autocvar_g_ctf_pass_velocity;
-float autocvar_g_ctf_captimerecord_always;
 float autocvar_g_ctf_dynamiclights;
 string autocvar_g_ctf_flag_blue_model;
 float autocvar_g_ctf_flag_blue_skin;
@@ -796,7 +796,6 @@ float autocvar_g_ctf_flag_dropped_waypoint;
 float autocvar_g_ctf_flag_dropped_floatinwater;
 float autocvar_g_ctf_flag_glowtrails;
 float autocvar_g_ctf_flag_health;
-float autocvar_g_ctf_flag_pickup_verbosename;
 string autocvar_g_ctf_flag_red_model;
 float autocvar_g_ctf_flag_red_skin;
 float autocvar_g_ctf_flag_return_time;
@@ -897,7 +896,6 @@ float autocvar_g_keyhunt_teams_override;
 float autocvar_g_lms_campcheck_damage;
 float autocvar_g_lms_campcheck_distance;
 float autocvar_g_lms_campcheck_interval;
-string autocvar_g_lms_campcheck_message;
 float autocvar_g_lms_join_anytime;
 float autocvar_g_lms_last_join;
 #define autocvar_g_lms_lives_override cvar("g_lms_lives_override")
@@ -1167,13 +1165,10 @@ float autocvar_sv_eventlog_files_counter;
 string autocvar_sv_eventlog_files_nameprefix;
 string autocvar_sv_eventlog_files_namesuffix;
 float autocvar_sv_eventlog_files_timestamps;
-float autocvar_sv_fraginfo;
-float autocvar_sv_fraginfo_handicap;
-float autocvar_sv_fraginfo_ping;
-float autocvar_sv_fraginfo_stats;
 float autocvar_sv_friction;
 float autocvar_sv_friction_on_land;
 float autocvar_sv_gameplayfix_q2airaccelerate;
+float autocvar_sv_gentle;
 #define autocvar_sv_gravity cvar("sv_gravity")
 string autocvar_sv_intermission_cdtrack;
 string autocvar_sv_jumpspeedcap_max;
index 45107b833a1b16221b8082da7c55c143d7b9244b..b2e20e776435478bf7454d3eadef79ce5e989e5f 100644 (file)
@@ -398,13 +398,13 @@ void bot_clientconnect()
                bot_setnameandstuff();
 
        if(self.bot_forced_team==1)
-               self.team = COLOR_TEAM1;
+               self.team = FL_TEAM_1;
        else if(self.bot_forced_team==2)
-               self.team = COLOR_TEAM2;
+               self.team = FL_TEAM_2;
        else if(self.bot_forced_team==3)
-               self.team = COLOR_TEAM3;
+               self.team = FL_TEAM_3;
        else if(self.bot_forced_team==4)
-               self.team = COLOR_TEAM4;
+               self.team = FL_TEAM_4;
        else
                JoinBestTeam(self, FALSE, TRUE);
 
@@ -425,13 +425,13 @@ void bot_removefromlargestteam()
        bestcount = 0;
        while (head)
        {
-               if(head.team == COLOR_TEAM1)
+               if(head.team == FL_TEAM_1)
                        thiscount = c1;
-               else if(head.team == COLOR_TEAM2)
+               else if(head.team == FL_TEAM_2)
                        thiscount = c2;
-               else if(head.team == COLOR_TEAM3)
+               else if(head.team == FL_TEAM_3)
                        thiscount = c3;
-               else if(head.team == COLOR_TEAM4)
+               else if(head.team == FL_TEAM_4)
                        thiscount = c4;
                else
                        thiscount = 0;
index 6b0ccaa0d51764431871b3161247290072dae46d..f50a87fc7a97a0ca6121c8212899c60215524c32 100644 (file)
@@ -127,12 +127,12 @@ void havocbot_goalrating_ons_controlpoints_attack(float ratingscale)
                        continue;
 
                // Ignore owned controlpoints
-               if(self.team == COLOR_TEAM1)
+               if(self.team == FL_TEAM_1)
                {
                        if( (cp2.isgenneighbor_blue || cp2.iscpneighbor_blue) && !(cp2.isgenneighbor_red || cp2.iscpneighbor_red) )
                                continue;
                }
-               else if(self.team == COLOR_TEAM2)
+               else if(self.team == FL_TEAM_2)
                {
                        if( (cp2.isgenneighbor_red || cp2.iscpneighbor_red) && !(cp2.isgenneighbor_blue || cp2.iscpneighbor_blue) )
                                continue;
index 1078eea1308df0c90c4d2f00b07710568894a118..23405484e0730ba162ebea5cf19b2426e74b0782 100644 (file)
@@ -425,12 +425,11 @@ void PutObserverInServer (void)
 
        if(self.killcount != -666) {
                if(g_lms) {
-                       if(PlayerScore_Add(self, SP_LMS_RANK, 0) > 0)
-                               bprint ("^4", self.netname, "^4 has no more lives left\n");
+                       if(PlayerScore_Add(self, SP_LMS_RANK, 0) > 0 && self.lms_spectate_warning != 2)
+                               Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_LMS_NOLIVES, self.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                        else
-                               bprint ("^4", self.netname, "^4 is spectating now\n"); // TODO turn this into a proper forfeit?
-               } else
-                       bprint ("^4", self.netname, "^4 is spectating now\n");
+                               Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_LMS_FORFEIT, self.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+               } else { Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_QUIT_SPECTATE, self.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); }
 
                if(self.just_joined == FALSE) {
                        LogTeamchange(self.playerid, -1, 4);
@@ -564,7 +563,7 @@ void FixPlayermodel()
                if(teamplay)
                {
                        string s;
-                       s = Team_ColorNameLowerCase(self.team);
+                       s = Team_ColorName_Lower(self.team);
                        if(s != "neutral")
                        {
                                defaultmodel = cvar_string(strcat("sv_defaultplayermodel_", s));
@@ -696,7 +695,7 @@ void PutClientInServer (void)
                spot = SelectSpawnPoint (FALSE);
                if(!spot)
                {
-                       centerprint(self, "Sorry, no spawnpoints available!\nHope your team can fix it...");
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_JOIN_NOSPAWNS, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                        return; // spawn failed
                }
 
@@ -878,9 +877,9 @@ void PutClientInServer (void)
 
                if(g_assault) {
                        if(self.team == assault_attacker_team)
-                               centerprint(self, "You are attacking!");
+                               Send_Notification_Legacy_Wrapper(NOTIF_TEAM, self, MSG_CENTER, CENTER_ASSAULT_ATTACKING, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                        else
-                               centerprint(self, "You are defending!");
+                               Send_Notification_Legacy_Wrapper(NOTIF_TEAM, self, MSG_CENTER, CENTER_ASSAULT_DEFENDING, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                }
 
                target_voicescript_clear(self);
@@ -1083,7 +1082,7 @@ void ClientKill_Now_TeamChange()
                if(g_ca)
                        self.caplayer = 0;
                if(blockSpectators)
-                       sprint(self, strcat("^7You have to become a player within the next ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_SPECTATE_WARNING, NO_STR_ARG, NO_STR_ARG, autocvar_g_maxplayers_spectator_blocktime, NO_FL_ARG, NO_FL_ARG);
                PutObserverInServer();
        }
        else
@@ -1234,28 +1233,28 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2
                        self.killindicator.colormod = '0 0 0';
                        if(clienttype(self) == CLIENTTYPE_REAL)
                        if(self.killindicator.cnt > 0)
-                               Send_CSQC_Centerprint_Generic(self, CPID_TEAMCHANGE, "^1Suicide in %d seconds", 1, self.killindicator.cnt);
+                               Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_TEAMCHANGE_SUICIDE, NO_STR_ARG, NO_STR_ARG, self.killindicator.cnt, NO_FL_ARG, NO_FL_ARG);
                }
                else if(targetteam == -1) // auto
                {
                        self.killindicator.colormod = '0 1 0';
                        if(clienttype(self) == CLIENTTYPE_REAL)
                        if(self.killindicator.cnt > 0)
-                               Send_CSQC_Centerprint_Generic(self, CPID_TEAMCHANGE, "Changing team in %d seconds", 1, self.killindicator.cnt);
+                               Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_TEAMCHANGE_AUTO, NO_STR_ARG, NO_STR_ARG, self.killindicator.cnt, NO_FL_ARG, NO_FL_ARG);
                }
                else if(targetteam == -2) // spectate
                {
                        self.killindicator.colormod = '0.5 0.5 0.5';
                        if(clienttype(self) == CLIENTTYPE_REAL)
                        if(self.killindicator.cnt > 0)
-                               Send_CSQC_Centerprint_Generic(self, CPID_TEAMCHANGE, "Spectating in %d seconds", 1, self.killindicator.cnt);
+                               Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_TEAMCHANGE_SPECTATE, NO_STR_ARG, NO_STR_ARG, self.killindicator.cnt, NO_FL_ARG, NO_FL_ARG);
                }
                else
                {
-                       self.killindicator.colormod = TeamColor(targetteam);
+                       self.killindicator.colormod = Team_ColorRGB(targetteam);
                        if(clienttype(self) == CLIENTTYPE_REAL)
                        if(self.killindicator.cnt > 0)
-                               Send_CSQC_Centerprint_Generic(self, CPID_TEAMCHANGE, strcat("Changing to ", ColoredTeamName(targetteam), " in %d seconds"), 1, self.killindicator.cnt);
+                               Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, APP_TEAM_NUM_4(targetteam, CENTER_TEAMCHANGE_), NO_STR_ARG, NO_STR_ARG, self.killindicator.cnt, NO_FL_ARG, NO_FL_ARG);
                }
        }
 
@@ -1297,7 +1296,7 @@ void FixClientCvars(entity e)
                stuffcmd(e, "cl_cmd settemp cl_movecliptokeyboard 2\n");
        if(autocvar_g_antilag == 3) // client side hitscan
                stuffcmd(e, "cl_cmd settemp cl_prydoncursor_notrace 0\n");
-       if(sv_gentle)
+       if(autocvar_sv_gentle)
                stuffcmd(e, "cl_cmd settemp cl_gentle 1\n");
        /*
         * we no longer need to stuff this. Remove this comment block if you feel
@@ -1346,7 +1345,6 @@ ClientConnect
 Called when a client connects to the server
 =============
 */
-string ColoredTeamName(float t);
 void DecodeLevelParms (void);
 //void dom_player_join_team(entity pl);
 void set_dom_state(entity e);
@@ -1366,7 +1364,7 @@ void ClientConnect (void)
        DecodeLevelParms();
 
 #ifdef WATERMARK
-       sprint(self, strcat("^4SVQC Build information: ^1", WATERMARK, "\n"));
+       Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_WATERMARK, WATERMARK, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
 #endif
 
        self.classname = "player_joining";
@@ -1374,6 +1372,16 @@ void ClientConnect (void)
        self.flags = FL_CLIENT;
        self.version_nagtime = time + 10 + random() * 10;
 
+       if(self.netaddress == "local")
+       {
+               //print("^3server is local!\n");
+
+               if(server_is_local)
+                       error("Multiple local clients???");
+               else
+                       server_is_local = TRUE;
+       }
+
        if(player_count<0)
        {
                dprint("BUG player count is lower than zero, this cannot happen!\n");
@@ -1399,30 +1407,30 @@ void ClientConnect (void)
                {
                        switch(autocvar_g_campaign_forceteam)
                        {
-                               case 1: self.team_forced = COLOR_TEAM1; break;
-                               case 2: self.team_forced = COLOR_TEAM2; break;
-                               case 3: self.team_forced = COLOR_TEAM3; break;
-                               case 4: self.team_forced = COLOR_TEAM4; break;
+                               case 1: self.team_forced = FL_TEAM_1; break;
+                               case 2: self.team_forced = FL_TEAM_2; break;
+                               case 3: self.team_forced = FL_TEAM_3; break;
+                               case 4: self.team_forced = FL_TEAM_4; break;
                                default: self.team_forced = 0;
                        }
                }
        }
        else if(PlayerInIDList(self, autocvar_g_forced_team_red))
-               self.team_forced = COLOR_TEAM1;
+               self.team_forced = FL_TEAM_1;
        else if(PlayerInIDList(self, autocvar_g_forced_team_blue))
-               self.team_forced = COLOR_TEAM2;
+               self.team_forced = FL_TEAM_2;
        else if(PlayerInIDList(self, autocvar_g_forced_team_yellow))
-               self.team_forced = COLOR_TEAM3;
+               self.team_forced = FL_TEAM_3;
        else if(PlayerInIDList(self, autocvar_g_forced_team_pink))
-               self.team_forced = COLOR_TEAM4;
+               self.team_forced = FL_TEAM_4;
        else if(autocvar_g_forced_team_otherwise == "red")
-               self.team_forced = COLOR_TEAM1;
+               self.team_forced = FL_TEAM_1;
        else if(autocvar_g_forced_team_otherwise == "blue")
-               self.team_forced = COLOR_TEAM2;
+               self.team_forced = FL_TEAM_2;
        else if(autocvar_g_forced_team_otherwise == "yellow")
-               self.team_forced = COLOR_TEAM3;
+               self.team_forced = FL_TEAM_3;
        else if(autocvar_g_forced_team_otherwise == "pink")
-               self.team_forced = COLOR_TEAM4;
+               self.team_forced = FL_TEAM_4;
        else if(autocvar_g_forced_team_otherwise == "spectate")
                self.team_forced = -1;
        else if(autocvar_g_forced_team_otherwise == "spectator")
@@ -1474,12 +1482,10 @@ void ClientConnect (void)
 
        self.netname_previous = strzone(self.netname);
 
-       bprint("^4", self.netname, "^4 connected");
-
-       if(self.classname != "observer" && (g_domination || g_ctf))
-               bprint(" and joined the ", ColoredTeamName(self.team));
-
-       bprint("\n");
+       if((self.classname == STR_PLAYER && teamplay))
+               Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_4(self, INFO_JOIN_CONNECT_TEAM_), self.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+       else
+               Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_JOIN_CONNECT, self.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
 
        stuffcmd(self, strcat(clientstuff, "\n"));
        stuffcmd(self, "cl_particles_reloadeffects\n"); // TODO do we still need this?
@@ -1522,7 +1528,7 @@ void ClientConnect (void)
        self.spectatortime = time;
        if(blockSpectators)
        {
-               sprint(self, strcat("^7You have to become a player within the next ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
+               Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_SPECTATE_WARNING, NO_STR_ARG, NO_STR_ARG, autocvar_g_maxplayers_spectator_blocktime, NO_FL_ARG, NO_FL_ARG);
        }
 
        self.jointime = time;
@@ -1635,8 +1641,8 @@ void ClientDisconnect (void)
 
        if(autocvar_sv_eventlog)
                GameLogEcho(strcat(":part:", ftos(self.playerid)));
-       bprint ("^4",self.netname);
-       bprint ("^4 disconnected\n");
+               
+       Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_QUIT_DISCONNECT, self.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
 
        DropAllRunes(self);
        MUTATOR_CALLHOOK(ClientDisconnect);
@@ -1807,7 +1813,7 @@ void player_powerups (void)
                                self.alpha = default_player_alpha;
                                self.exteriorweaponentity.alpha = default_weapon_alpha;
                                self.items &~= IT_STRENGTH;
-                               sprint(self, "^3Invisibility has worn off\n");
+                               Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_POWERDOWN_INVISIBILITY, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                        }
                }
                else
@@ -1817,7 +1823,7 @@ void player_powerups (void)
                                self.alpha = g_minstagib_invis_alpha;
                                self.exteriorweaponentity.alpha = g_minstagib_invis_alpha;
                                self.items |= IT_STRENGTH;
-                               sprint(self, "^3You are invisible\n");
+                               Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_POWERUP_INVISIBILITY, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                        }
                }
 
@@ -1827,7 +1833,7 @@ void player_powerups (void)
                        if (time > self.invincible_finished)
                        {
                                self.items = self.items - (self.items & IT_INVINCIBLE);
-                               sprint(self, "^3Speed has worn off\n");
+                               Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_POWERDOWN_SPEED, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                        }
                }
                else
@@ -1835,7 +1841,7 @@ void player_powerups (void)
                        if (time < self.invincible_finished)
                        {
                                self.items = self.items | IT_INVINCIBLE;
-                               sprint(self, "^3You are on speed\n");
+                               Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_POWERUP_SPEED, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                        }
                }
        }
@@ -1848,7 +1854,7 @@ void player_powerups (void)
                        if (time > self.strength_finished)
                        {
                                self.items = self.items - (self.items & IT_STRENGTH);
-                               sprint(self, "^3Strength has worn off\n");
+                               Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_POWERDOWN_STRENGTH, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                        }
                }
                else
@@ -1856,7 +1862,7 @@ void player_powerups (void)
                        if (time < self.strength_finished)
                        {
                                self.items = self.items | IT_STRENGTH;
-                               sprint(self, "^3Strength infuses your weapons with devastating power\n");
+                               Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_POWERUP_STRENGTH, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                        }
                }
                if (self.items & IT_INVINCIBLE)
@@ -1866,7 +1872,7 @@ void player_powerups (void)
                        if (time > self.invincible_finished)
                        {
                                self.items = self.items - (self.items & IT_INVINCIBLE);
-                               sprint(self, "^3Shield has worn off\n");
+                               Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_POWERDOWN_SHIELD, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                        }
                }
                else
@@ -1874,7 +1880,7 @@ void player_powerups (void)
                        if (time < self.invincible_finished)
                        {
                                self.items = self.items | IT_INVINCIBLE;
-                               sprint(self, "^3Shield surrounds you\n");
+                               Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_POWERUP_SHIELD, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                        }
                }
                if (self.items & IT_SUPERWEAPON)
@@ -1883,7 +1889,7 @@ void player_powerups (void)
                        {
                                self.superweapons_finished = 0;
                                self.items = self.items - (self.items & IT_SUPERWEAPON);
-                               sprint(self, "^3Superweapons have been lost\n");
+                               Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_SUPERWEAPON_LOST, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                        }
                        else if (self.items & IT_UNLIMITED_SUPERWEAPONS)
                        {
@@ -1896,7 +1902,7 @@ void player_powerups (void)
                                {
                                        self.items = self.items - (self.items & IT_SUPERWEAPON);
                                        WEPSET_ANDNOT_EA(self, WEPBIT_SUPERWEAPONS);
-                                       sprint(self, "^3Superweapons have broken down\n");
+                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_SUPERWEAPON_BROKEN, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                                }
                        }
                }
@@ -1905,7 +1911,7 @@ void player_powerups (void)
                        if (time < self.superweapons_finished || (self.items & IT_UNLIMITED_SUPERWEAPONS))
                        {
                                self.items = self.items | IT_SUPERWEAPON;
-                               sprint(self, "^3You now have a superweapon\n");
+                               Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_INFO, INFO_SUPERWEAPON_PICKUP, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                        }
                        else
                        {
@@ -2326,8 +2332,8 @@ void LeaveSpectatorMode()
 
                        PutClientInServer();
 
-                       if(self.classname == "player")
-                               bprint ("^4", self.netname, "^4 is playing now\n");
+                       if(self.classname == STR_PLAYER)
+                               Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_JOIN_PLAY, self.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
 
                        if(!autocvar_g_campaign)
                        if (time < self.jointime + autocvar_welcome_message_time)
@@ -2335,7 +2341,7 @@ void LeaveSpectatorMode()
 
                        if (self.prevent_join_msgtime)
                        {
-                               Send_CSQC_Centerprint_Generic_Expire(self, CPID_PREVENT_JOIN);
+                               Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_JOIN_PREVENT, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                                self.prevent_join_msgtime = 0;
                        }
 
@@ -2405,7 +2411,7 @@ float nJoinAllowed(entity ignore) {
 void checkSpectatorBlock() {
        if(self.classname == "spectator" || self.classname == "observer") {
                if( time > (self.spectatortime + autocvar_g_maxplayers_spectator_blocktime) ) {
-                       sprint(self, "^7You were kicked from the server because you are spectator and spectators aren't allowed at the moment.\n");
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_QUIT_KICK_SPECTATING, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                        dropclient(self);
                }
        }
@@ -2592,7 +2598,7 @@ void PlayerPreThink (void)
                                        {
                                                // notify release users if connecting to git
                                                dprint("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
-                                               sprint(self, strcat("\{1}^1NOTE: ^7the server is running ^3Xonotic ", autocvar_g_xonoticversion, " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n"));
+                                               Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_VERSION_BETA, autocvar_g_xonoticversion, self.cvar_g_xonoticversion, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                                        }
                                        else
                                        {
@@ -2602,13 +2608,13 @@ void PlayerPreThink (void)
                                                {
                                                        // give users new version
                                                        dprint("^1NOTE^7 to ", self.netname, "^7 - ^3Xonotic ", autocvar_g_xonoticversion, "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.org/^1!\n");
-                                                       sprint(self, strcat("\{1}^1NOTE: ^3Xonotic ", autocvar_g_xonoticversion, "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.org/^1!\n"));
+                                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_VERSION_OUTDATED, autocvar_g_xonoticversion, self.cvar_g_xonoticversion, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                                                }
                                                else if(r > 0)
                                                {
                                                        // notify users about old server version
                                                        print("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
-                                                       sprint(self, strcat("\{1}^1NOTE: ^7the server is running ^3Xonotic ", autocvar_g_xonoticversion, "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n"));
+                                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_VERSION_OLD, autocvar_g_xonoticversion, self.cvar_g_xonoticversion, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                                                }
                                        }
                                }
@@ -2618,7 +2624,7 @@ void PlayerPreThink (void)
        // GOD MODE info
        if(!(self.flags & FL_GODMODE)) if(self.max_armorvalue)
        {
-               sprint(self, strcat("godmode saved you ", ftos(self.max_armorvalue), " units of damage, cheater!\n"));
+               Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_GODMODE_OFF, NO_STR_ARG, NO_STR_ARG, self.max_armorvalue, NO_FL_ARG, NO_FL_ARG);
                self.max_armorvalue = 0;
        }
 
@@ -2778,7 +2784,7 @@ void PlayerPreThink (void)
                                //sprint(self, "distance: ", ftos(self.lms_traveled_distance), "\n");
                                if(self.lms_traveled_distance < autocvar_g_lms_campcheck_distance)
                                {
-                                       centerprint(self, autocvar_g_lms_campcheck_message);
+                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_CENTER, CENTER_LMS_CAMPCHECK, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                                        // FIXME KadaverJack: gibbing player here causes playermodel to bounce around, instead of eye.md3
                                        // I wasn't able to find out WHY that happens, so I put a workaround in place that shall prevent players from being gibbed :(
                                        Damage(self, self, self, bound(0, autocvar_g_lms_campcheck_damage, self.health + self.armorvalue * autocvar_g_balance_armor_blockpercent + 5), DEATH_CAMP, self.origin, '0 0 0');
@@ -2989,11 +2995,7 @@ void PlayerPostThink (void)
        {
                if (time - self.parm_idlesince < 1) // instead of (time == self.parm_idlesince) to support sv_maxidle <= 10
                {
-                       if(self.idlekick_lasttimeleft)
-                       {
-                               Send_CSQC_Centerprint_Generic_Expire(self, CPID_DISCONNECT_IDLING);
-                               self.idlekick_lasttimeleft = 0;
-                       }
+                       if(self.idlekick_lasttimeleft) { self.idlekick_lasttimeleft = 0; }
                }
                else
                {
@@ -3002,12 +3004,11 @@ void PlayerPostThink (void)
                        if(timeleft == min(10, sv_maxidle - 1)) // - 1 to support sv_maxidle <= 10
                        {
                                if(!self.idlekick_lasttimeleft)
-                                       Send_CSQC_Centerprint_Generic(self, CPID_DISCONNECT_IDLING, "^3Stop idling!\n^3Disconnecting in %d seconds...", 1, timeleft);
+                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_DISCONNECT_IDLING, NO_STR_ARG, NO_STR_ARG, timeleft, NO_FL_ARG, NO_FL_ARG);
                        }
                        if(timeleft <= 0)
                        {
-                               bprint("^3", self.netname, "^3 was kicked for idling.\n");
-                               AnnounceTo(self, "terminated");
+                               Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_QUIT_KICK_IDLING, self.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                                dropclient(self);
                                return;
                        }
index 03347a9c86d2cb718abae96a77c1eb855feb38a6..10ca2ccab33c23c9586f505af261300474b5fd41 100644 (file)
@@ -472,7 +472,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                        {
                                self.pain_finished = time + 0.5;        //Supajoe
 
-                               if(sv_gentle < 1) {
+                               if(autocvar_sv_gentle < 1) {
                                        if(self.classname != "body") // pain anim is BORKED on our ZYMs, FIXME remove this once we have good models
                                        {
                                                if (!self.animstate_override)
@@ -559,7 +559,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                if(valid_damage_for_weaponstats)
                        WeaponStats_LogKill(awep, abot, self.weapon, vbot);
 
-               if(sv_gentle < 1) // TODO make a "gentle" version?
+               if(autocvar_sv_gentle < 1) // TODO make a "gentle" version?
                if(sound_allowed(MSG_BROADCAST, attacker))
                {
                        if(deathtype == DEATH_DROWN)
@@ -701,7 +701,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                // set up to fade out later
                SUB_SetFade (self, time + 6 + random (), 1);
 
-               if(sv_gentle > 0 || autocvar_ekg) {
+               if(autocvar_sv_gentle > 0 || autocvar_ekg) {
                        // remove corpse
                        PlayerCorpseDamage (inflictor, attacker, autocvar_sv_gibhealth+1.0, deathtype, hitloc, force);
                }
@@ -938,17 +938,18 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
                        if(sourcecmsgstr != "" && !privatesay)
                                centerprint(source, sourcecmsgstr);
                }
-               else if(privatesay) // private message, between 2 people only, not sent to server console
+               else if(privatesay) // private message, between 2 people only
                {
                        sprint(source, sourcemsgstr);
                        sprint(privatesay, msgstr);
+                       if not(autocvar_g_chat_tellprivacy) { dedicated_print(msgstr); } // send to server console too if "tellprivacy" is disabled
                        if(cmsgstr != "")
                                centerprint(privatesay, cmsgstr);
                }
                else if(teamsay > 0) // team message, only sent to team mates
                {
                        sprint(source, sourcemsgstr);
-                       //print(msgstr); // send to server console too
+                       dedicated_print(msgstr); // send to server console too
                        if(sourcecmsgstr != "")
                                centerprint(source, sourcecmsgstr);
                        FOR_EACH_REALPLAYER(head) if(head.team == source.team)
@@ -962,7 +963,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
                else if(teamsay < 0) // spectator message, only sent to spectators
                {
                        sprint(source, sourcemsgstr);
-                       //print(msgstr); // send to server console too
+                       dedicated_print(msgstr); // send to server console too
                        FOR_EACH_REALCLIENT(head) if(head.classname != "player")
                                if(head != source)
                                        sprint(head, msgstr);
@@ -970,7 +971,7 @@ float Say(entity source, float teamsay, entity privatesay, string msgin, float f
                else if(sourcemsgstr != msgstr) // trimmed/server fixed message, sent to all players
                {
                        sprint(source, sourcemsgstr);
-                       //print(msgstr); // send to server console too
+                       dedicated_print(msgstr); // send to server console too
                        FOR_EACH_REALCLIENT(head)
                                if(head != source)
                                        sprint(head, msgstr);
@@ -1152,7 +1153,7 @@ void FakeGlobalSound(string sample, float chan, float voicetype)
                                break;
                        if(!sv_taunt)
                                break;
-                       if(sv_gentle)
+                       if(autocvar_sv_gentle)
                                break;
                        tauntrand = random();
                        msg_entity = self;
@@ -1170,7 +1171,7 @@ void FakeGlobalSound(string sample, float chan, float voicetype)
                                        animdecide_setaction(self, ANIMACTION_TAUNT, TRUE);
                        if(!sv_taunt)
                                break;
-                       if(sv_gentle)
+                       if(autocvar_sv_gentle)
                                break;
                        msg_entity = self;
                        if (msg_entity.cvar_cl_voice_directional >= 1)
@@ -1249,7 +1250,7 @@ void GlobalSound(string sample, float chan, float voicetype)
                                break;
                        if(!sv_taunt)
                                break;
-                       if(sv_gentle)
+                       if(autocvar_sv_gentle)
                                break;
                        tauntrand = random();
                        FOR_EACH_REALCLIENT(msg_entity)
@@ -1267,7 +1268,7 @@ void GlobalSound(string sample, float chan, float voicetype)
                                        animdecide_setaction(self, ANIMACTION_TAUNT, TRUE);
                        if(!sv_taunt)
                                break;
-                       if(sv_gentle)
+                       if(autocvar_sv_gentle)
                                break;
                        FOR_EACH_REALCLIENT(msg_entity)
                        {
@@ -1315,14 +1316,8 @@ void VoiceMessage(string type, string msg)
                FakeGlobalSound(self.sample, CH_VOICE, voicetype);
 }
 
-void MoveToTeam(entity client, float team_colour, float type, float show_message)
+void MoveToTeam(entity client, float team_colour, float type)
 {
-//     show_message
-//     0 (00) automove centerprint, admin message
-//     1 (01) automove centerprint, no admin message
-//     2 (10) no centerprint, admin message
-//     3 (11) no centerprint, no admin message
-
        float lockteams_backup;
 
        lockteams_backup = lockteams;  // backup any team lock
@@ -1331,14 +1326,9 @@ void MoveToTeam(entity client, float team_colour, float type, float show_message
 
        TeamchangeFrags(client);  // move the players frags
        SetPlayerColors(client, team_colour - 1);  // set the players colour
-       Damage(client, client, client, 100000, ((show_message & 2) ? DEATH_QUIET : DEATH_AUTOTEAMCHANGE), client.origin, '0 0 0');  // kill the player
+       Damage(client, client, client, 100000, DEATH_AUTOTEAMCHANGE, client.origin, '0 0 0');  // kill the player
 
        lockteams = lockteams_backup;  // restore the team lock
 
        LogTeamchange(client.playerid, client.team, type);
-
-       if not(show_message & 1) // admin message
-               sprint(client, strcat("\{1}\{13}^3", admin_name(), "^7: You have been moved to the ", Team_ColorNameLowerCase(team_colour), " team\n"));  // send a chat message
-
-       bprint(strcat(client.netname, " joined the ", ColoredTeamName(client.team), "\n"));
 }
index 530646afd2ec8fbb105dc8a080b41dadaaa25d0f..2b52d0f7b65a3490ce265bd4f514990536cef437 100644 (file)
@@ -284,10 +284,10 @@ void ClientCommand_selectteam(float request, float argc)
                                                                
                                                                switch(argv(1))
                                                                {
-                                                                       case "red": selection = COLOR_TEAM1; break;
-                                                                       case "blue": selection = COLOR_TEAM2; break;
-                                                                       case "yellow": selection = COLOR_TEAM3; break;
-                                                                       case "pink": selection = COLOR_TEAM4; break;
+                                                                       case "red": selection = FL_TEAM_1; break;
+                                                                       case "blue": selection = FL_TEAM_2; break;
+                                                                       case "yellow": selection = FL_TEAM_3; break;
+                                                                       case "pink": selection = FL_TEAM_4; break;
                                                                        case "auto": selection = (-1); break;
                                                                        
                                                                        default: selection = 0; break;
@@ -397,6 +397,8 @@ void ClientCommand_spectate(float request)
                                {
                                        if(self.lms_spectate_warning)
                                        {
+                                               // for the forfeit message...
+                                               self.lms_spectate_warning = 2;
                                                // mark player as spectator
                                                PlayerScore_Add(self, SP_LMS_RANK, 666 - PlayerScore_Add(self, SP_LMS_RANK, 0));
                                        }
index 8f3ea869d49e24bcdf0febd74dc5564c1002f7b6..4cd73e175e79e7bf19ec7cfb70e302d49724518e 100644 (file)
@@ -972,7 +972,6 @@ void GameCommand_moveplayer(float request, float argc)
                        string targets = strreplace(",", " ", argv(1));
                        string original_targets = strreplace(" ", ", ", targets);
                        string destination = argv(2);
-                       string notify = argv(3);
                        
                        string successful, t;
                        successful = string_null;
@@ -1017,21 +1016,21 @@ void GameCommand_moveplayer(float request, float argc)
                                                        if(teamplay)
                                                        {
                                                                // set up
-                                                               float team_color;
+                                                               float team_id;
                                                                float save = client.team_forced;
                                                                client.team_forced = 0;
 
                                                                // find the team to move the player to
-                                                               team_color = ColourToNumber(destination);
-                                                               if(team_color == client.team) // already on the destination team
+                                                               team_id = Team_ColorToTeam(destination);
+                                                               if(team_id == client.team) // already on the destination team
                                                                {
                                                                        // keep the forcing undone
-                                                                       print("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") is already on the ", ColoredTeamName(client.team), (targets ? ", skipping to next player.\n" : ".\n"));
+                                                                       print("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") is already on the ", Team_ColoredFullName(client.team), (targets ? "^7, skipping to next player.\n" : "^7.\n"));
                                                                        continue;
                                                                } 
-                                                               else if(team_color == 0)  // auto team
+                                                               else if(team_id == 0)  // auto team
                                                                {
-                                                                       team_color = NumberToTeamNumber(FindSmallestTeam(client, FALSE));
+                                                                       team_id = Team_NumberToTeam(FindSmallestTeam(client, FALSE));
                                                                }
                                                                else
                                                                {
@@ -1040,21 +1039,21 @@ void GameCommand_moveplayer(float request, float argc)
                                                                client.team_forced = save;
                                                                
                                                                // Check to see if the destination team is even available
-                                                               switch(team_color
+                                                               switch(team_id
                                                                {
-                                                                       case COLOR_TEAM1: if(c1 == -1) { print("Sorry, can't move player to red team if it doesn't exist.\n"); return; } break;
-                                                                       case COLOR_TEAM2: if(c2 == -1) { print("Sorry, can't move player to blue team if it doesn't exist.\n"); return; } break;
-                                                                       case COLOR_TEAM3: if(c3 == -1) { print("Sorry, can't move player to yellow team if it doesn't exist.\n"); return; } break;
-                                                                       case COLOR_TEAM4: if(c4 == -1) { print("Sorry, can't move player to pink team if it doesn't exist.\n"); return; } break;
+                                                                       case FL_TEAM_1: if(c1 == -1) { print("Sorry, can't move player to red team if it doesn't exist.\n"); return; } break;
+                                                                       case FL_TEAM_2: if(c2 == -1) { print("Sorry, can't move player to blue team if it doesn't exist.\n"); return; } break;
+                                                                       case FL_TEAM_3: if(c3 == -1) { print("Sorry, can't move player to yellow team if it doesn't exist.\n"); return; } break;
+                                                                       case FL_TEAM_4: if(c4 == -1) { print("Sorry, can't move player to pink team if it doesn't exist.\n"); return; } break;
                                                                        
                                                                        default: print("Sorry, can't move player here if team ", destination, " doesn't exist.\n"); return;
                                                                }
                                                                
                                                                // If so, lets continue and finally move the player
                                                                client.team_forced = 0;
-                                                               MoveToTeam(client, team_color, 6, stof(notify));
+                                                               MoveToTeam(client, team_id, 6);
                                                                successful = strcat(successful, (successful ? ", " : ""), client.netname);
-                                                               print("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") has been moved to the ", ColoredTeamName(team_color), ".\n");
+                                                               print("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") has been moved to the ", Team_ColoredFullName(team_id), "^7.\n");
                                                                continue;
                                                        }
                                                        else
@@ -1084,13 +1083,10 @@ void GameCommand_moveplayer(float request, float argc)
                        print("Incorrect parameters for ^2moveplayer^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 sv_cmd moveplayer clients destination [notify]\n");
+                       print("\nUsage:^3 sv_cmd moveplayer clients destination\n");
                        print("  'clients' is a list (separated by commas) of player entity ID's or nicknames\n");
                        print("  'destination' is what to send the player to, be it team or spectating\n");
                        print("  Full list of destinations here: \"spec, spectator, red, blue, yellow, pink, auto.\"\n");
-                       print("  'notify' is whether or not to send messages notifying of the move. Detail below.\n");
-                       print("    0 (00) automove centerprint, admin message; 1 (01) automove centerprint, no admin message\n");
-                       print("    2 (10) no centerprint, admin message; 3 (11) no centerprint, no admin message\n");
                        print("Examples: sv_cmd moveplayer 1,3,5 red 3\n");
                        print("          sv_cmd moveplayer 2 spec \n");
                        print("See also: ^2allspec, shuffleteams^7\n");
@@ -1112,7 +1108,7 @@ void GameCommand_nospectators(float request)
                                if(plr.classname == "spectator" || plr.classname == "observer")
                                {
                                        plr.spectatortime = time;
-                                       sprint(plr, strcat("^7You have to become a player within the next ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
+                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, plr, MSG_INFO, INFO_SPECTATE_WARNING, NO_STR_ARG, NO_STR_ARG, autocvar_g_maxplayers_spectator_blocktime, NO_FL_ARG, NO_FL_ARG);
                                }
                        }
                        bprint(strcat("^7All spectators will be automatically kicked when not joining the game after ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds!\n"));
@@ -1354,7 +1350,7 @@ void GameCommand_shuffleteams(float request)
                                        x = (t_players / t_teams);
                                        x = ((i == 1) ? ceil(x) : floor(x));
                                        
-                                       team_color = NumberToTeamNumber(i);
+                                       team_color = Team_NumberToTeam(i);
                                        
                                        // sort through the random list of players made earlier 
                                        for(z = 1; z <= maxclients; ++z)
@@ -1368,7 +1364,7 @@ void GameCommand_shuffleteams(float request)
                                                                self = edict_num(shuffleteams_players[z]);
 
                                                        if(self.team != team_color) 
-                                                               MoveToTeam(self, team_color, 6, 0);
+                                                               MoveToTeam(self, team_color, 6);
 
                                                        shuffleteams_players[z] = 0;
                                                        shuffleteams_teams[i] = shuffleteams_teams[i] + 1;
@@ -1413,7 +1409,7 @@ void GameCommand_stuffto(float request, float argc)
        // This... is a fairly dangerous and powerful command... - It allows any arguments to be sent to a client via rcon.
        // Because of this, it is disabled by default and must be enabled by the server owner when doing compilation. That way,
        // we can be certain they understand the risks of it... So to enable, compile server with -DSTUFFTO_ENABLED argument.
-       
+
        #ifdef STUFFTO_ENABLED
        #message "stuffto command enabled"
        switch(request)
index aec1e3256b020878305579b179dfeea42a18e67e..522bb2ffca0dc94174ef97e50321431a9c113e62 100644 (file)
@@ -106,6 +106,7 @@ float       TE_KNIGHTSPIKE                          = 8;
 float  TE_LIGHTNING3                           = 9;
 float  TE_LAVASPLASH                           = 10;
 float  TE_TELEPORT                             = 11;
+float TE_BEAM                                  = 13;           // grappling hook
 
 float  UPDATE_GENERAL                          = 0;
 float  UPDATE_STATIC                           = 1;
@@ -139,14 +140,6 @@ float      MSG_ENTITY                              = 5; // csqc
 
 //float        POWERUP_INVINCIBLE_TAKEDAMAGE           = 0.2; // received damage multiplier for invincible powerup
 
-
-float TE_BEAM                                  = 13;           // grappling hook
-
-float COLOR_TEAM1      = 5;  // red
-float COLOR_TEAM2      = 14; // blue
-float COLOR_TEAM3      = 13; // yellow
-float COLOR_TEAM4      = 10; // pink
-
 float NUM_PLAYERSKINS_TEAMPLAY = 3;
 
 float ASSAULT_VALUE_INACTIVE = 1000;
index ca01caf9ca3098c855a0d716c01fdba697488ad4..58fb8a086972201443f5a9c8df68156c771c0d2e 100644 (file)
@@ -39,7 +39,6 @@ float g_pickup_respawntimejitter_powerup;
 float g_jetpack;
 
 float sv_clones;
-float sv_gentle;
 float sv_foginterval;
 
 entity activator;
@@ -58,6 +57,8 @@ float team1_score, team2_score, team3_score, team4_score;
 
 float maxclients;
 
+float server_is_local; // innocent until proven guilty by ClientConnect() in cl_client.qc
+
 // Fields
 
 .void(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) event_damage;
index a3eeefb73033ce71cfa2532ce575378af314904e..03222e09cd598c32e0f1508b96d62c81140be413 100644 (file)
@@ -227,7 +227,7 @@ void GiveFrags (entity attacker, entity targ, float f, float deathtype)
                UpdateFrags(attacker, f);
 }
 
-string Obituary_ExtraFragInfo(entity player) // Extra fragmessage information
+/*string Obituary_ExtraFragInfo(entity player) // Extra fragmessage information
 {
        string health_output = string_null;
        string ping_output = string_null;
@@ -263,7 +263,7 @@ string Obituary_ExtraFragInfo(entity player) // Extra fragmessage information
        }
        
        return output;
-}
+}*/
 
 string AppendItemcodes(string s, entity player)
 {
@@ -297,7 +297,7 @@ void LogDeath(string mode, float deathtype, entity killer, entity killed)
        s = strcat(":kill:", mode);
        s = strcat(s, ":", ftos(killer.playerid));
        s = strcat(s, ":", ftos(killed.playerid));
-       s = strcat(s, ":type=", ftos(deathtype));
+       s = strcat(s, ":type=", Deathtype_Name(deathtype));
        s = strcat(s, ":items=");
        s = AppendItemcodes(s, killer);
        if(killed != killer)
@@ -308,225 +308,292 @@ void LogDeath(string mode, float deathtype, entity killer, entity killed)
        GameLogEcho(s);
 }
 
-void Send_KillNotification (string s1, string s2, string s3, float msg, float type)
-{
-       WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
-       WriteByte(MSG_BROADCAST, TE_CSQC_KILLNOTIFY);
-       WriteString(MSG_BROADCAST, s1);
-       WriteString(MSG_BROADCAST, s2);
-       WriteString(MSG_BROADCAST, s3);
-       WriteShort(MSG_BROADCAST, msg);
-       WriteByte(MSG_BROADCAST, type);
-}
+#define INFO_NO_MSG 0
 
-// Function is used to send a generic centerprint whose content CSQC gets to decide (gentle version or not in the below cases)
-void Send_CSQC_KillCenterprint(entity e, string s1, string s2, float msg, float type)
+void Obituary_SpecialDeath(entity notif_target, float murder, float deathtype, string s1, string s2, float f1, float f2, float f3)
 {
-       if (clienttype(e) == CLIENTTYPE_REAL)
+       float handled = 0, hits = 0;
+       if(DEATH_ISSPECIAL(deathtype))
        {
-               msg_entity = e;
-               WRITESPECTATABLE_MSG_ONE({
-                       WriteByte(MSG_ONE, SVC_TEMPENTITY);
-                       WriteByte(MSG_ONE, TE_CSQC_KILLCENTERPRINT);
-                       WriteString(MSG_ONE, s1);
-                       WriteString(MSG_ONE, s2);
-                       WriteShort(MSG_ONE, msg);
-                       WriteByte(MSG_ONE, type);
-               });
+               #define DEATHTYPE(name,msg_death,msg_death_by,position) \
+                       { if(deathtype == max(0, name)) \
+                       { \
+                               #if msg_death != NO_MSG \
+                                       if not(murder) \
+                                       { \
+                                               Send_Notification_Legacy_Wrapper(NOTIF_ONE, notif_target, MSG_DEATH, msg_death, s1, s2, f1, f2, f3); \
+                                               Send_Notification_Legacy_Wrapper(NOTIF_ANY_EXCEPT, notif_target, MSG_INFO, INFO_##msg_death, s1, s2, f1, f2, f3); \
+                                               ++handled; \
+                                       } \
+                               #endif \
+                               #if msg_death_by != NO_MSG \
+                                       if(murder) \
+                                       { \
+                                               Send_Notification_Legacy_Wrapper(NOTIF_ONE, notif_target, MSG_DEATH, msg_death_by, s1, s2, f1, f2, f3); \
+                                               Send_Notification_Legacy_Wrapper(NOTIF_ANY_EXCEPT, notif_target, MSG_INFO, INFO_##msg_death_by, s1, s2, f1, f2, f3); \
+                                               ++handled; \
+                                       } \
+                               #endif \
+                               ++hits; \
+                       } }
+
+               DEATHTYPES
+               #undef DEATHTYPE
+               
+               if not(hits)
+               {
+                       backtrace("Obituary_SpecialDeath(): Unhandled deathtype- Please notify Samual!\n");
+               }
+               if not(handled)
+               {
+                       dprint(sprintf("Obituary_SpecialDeath(): ^1Deathtype ^7(%s-%d)^1 has no notification!\n", Deathtype_Name(deathtype), deathtype));
+                       return;
+               }
        }
 }
 
-void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
+float w_deathtype;
+float Obituary_WeaponDeath(entity notif_target, float murder, float deathtype, string s1, string s2, float f1)
 {
-       string  s, a, msg;
-       float type;
+       float death_weapon = DEATH_WEAPONOF(deathtype);
 
-       if (targ.classname == "player")
+       if(death_weapon)
        {
-               s = targ.netname;
-               a = attacker.netname;
+               w_deathtype = deathtype;
+               float death_message = weapon_action(death_weapon, ((murder) ? WR_KILLMESSAGE : WR_SUICIDEMESSAGE));
+               w_deathtype = FALSE;
 
-               if (targ == attacker) // suicides
+               if(death_message)
                {
-                       if (deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
-                               msg = ColoredTeamName(targ.team); // TODO: check if needed?
-                       else
-                               msg = "";
-            if(!g_cts) // no "killed your own dumb self" message in CTS
-                Send_CSQC_KillCenterprint(targ, msg, "", deathtype, MSG_SUICIDE);
-
-                       if(deathtype != DEATH_TEAMCHANGE && deathtype != DEATH_QUIET)
-                       {
-                               LogDeath("suicide", deathtype, targ, targ);
-                               GiveFrags(attacker, targ, -1, deathtype);
-                       }
-
-                       if (targ.killcount > 2)
-                               msg = ftos(targ.killcount);
-                       else
-                               msg = "";
-                       if(teamplay && deathtype == DEATH_MIRRORDAMAGE)
-                       {
-                               if(attacker.team == COLOR_TEAM1)
-                                       deathtype = KILL_TEAM_RED;
-                               else
-                                       deathtype = KILL_TEAM_BLUE;
-                       }
-
-                       Send_KillNotification(s, msg, "", deathtype, MSG_SUICIDE);
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, notif_target, MSG_WEAPON, death_message, s1, s2, f1, NO_FL_ARG, NO_FL_ARG);
+                       Send_Notification_Legacy_Wrapper(NOTIF_ANY_EXCEPT, notif_target, MSG_INFO, stof(Get_Field_Value(F_INFVAL, MSG_WEAPON, death_message)), s1, s2, f1, NO_FL_ARG, NO_FL_ARG);
+                       //print(Get_Field_Value(F_INFVAL, MSG_WEAPON, death_message), "\n");
                }
-               else if (attacker.classname == "player")
-               {
-                       if(!IsDifferentTeam(attacker, targ))
-                       {
-                               if(attacker.team == COLOR_TEAM1)
-                                       type = KILL_TEAM_RED;
-                               else
-                                       type = KILL_TEAM_BLUE;
-
-                               GiveFrags(attacker, targ, -1, deathtype);
+               else { dprint(sprintf("Obituary_WeaponDeath(): ^1Deathtype ^7(%s-%d)^1 has no notification for weapon %d!\n", Deathtype_Name(deathtype), deathtype, death_weapon)); }
 
-                               Send_CSQC_KillCenterprint(attacker, s, "", type, MSG_KILL);
+               return TRUE;
+       }
+       return FALSE;
+}
 
-                               if (targ.killcount > 2)
-                                       msg = ftos(targ.killcount);
-                               else
-                                       msg = "";
+.float FRAG_VERBOSE;
+void Obituary(entity attacker, entity inflictor, entity targ, float deathtype)
+{
+       // Sanity check
+       if not(targ.classname == STR_PLAYER) { backtrace("Obituary called on non-player?!\n"); return; }
 
-                               if (attacker.killcount > 2) {
-                                       msg = ftos(attacker.killcount);
-                                       type = KILL_TEAM_SPREE;
-                               }
-                               Send_KillNotification(a, s, msg, type, MSG_KILL);
+       // Declarations
+       string s1 = NO_STR_ARG, s2 = NO_STR_ARG;
+       float f1 = NO_FL_ARG, f2 = NO_FL_ARG, f3 = NO_FL_ARG;
+       float notif_firstblood = FALSE;
 
-                               attacker.killcount = 0;
+       //dprint(sprintf("Obituary(): Deathtype = %s (%d), Attacker = %s, Inflictor = %s, Target = %s...\n", Deathtype_Name(deathtype), deathtype, attacker.netname, inflictor.netname, targ.netname));
 
-                               LogDeath("tk", deathtype, attacker, targ);
+       // =======
+       // SUICIDE
+       // =======
+       if(targ == attacker)
+       {
+               if(DEATH_ISSPECIAL(deathtype))
+               {
+                       if(deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
+                       {
+                               s1 = targ.netname;
+                               f1 = targ.team;
                        }
                        else
                        {
-                               if (!checkrules_firstblood)
+                               switch(deathtype)
                                {
-                                       checkrules_firstblood = TRUE;
-                                       Send_KillNotification(a, "", "", KILL_FIRST_BLOOD, MSG_KILL);
-                                       // TODO: make these print a newline if they dont
-                                       Send_CSQC_KillCenterprint(attacker, "", "", KILL_FIRST_BLOOD, MSG_KILL);
-                                       Send_CSQC_KillCenterprint(targ, "", "", KILL_FIRST_VICTIM, MSG_KILL);
-                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD, 1);
-                                       PlayerStats_Event(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
-                               }
-
-                               if(targ.istypefrag) {
-                                       Send_CSQC_KillCenterprint(attacker, s, Obituary_ExtraFragInfo(targ), KILL_TYPEFRAG, MSG_KILL);
-                                       Send_CSQC_KillCenterprint(targ, a, Obituary_ExtraFragInfo(attacker), KILL_TYPEFRAGGED, MSG_KILL);
-                               } else {
-                                       Send_CSQC_KillCenterprint(attacker, s, Obituary_ExtraFragInfo(targ), KILL_FRAG, MSG_KILL);
-                                       Send_CSQC_KillCenterprint(targ, a, Obituary_ExtraFragInfo(attacker), KILL_FRAGGED, MSG_KILL);
+                                       case DEATH_MIRRORDAMAGE:
+                                       {
+                                               s1 = targ.netname;
+                                               f1 = targ.killcount;
+                                               break;
+                                       }
+                                       
+                                       default:
+                                       {
+                                               s1 = targ.netname;
+                                               f1 = targ.killcount;
+                                               s2 = NO_STR_ARG;
+                                               f2 = f3 = NO_FL_ARG;
+                                               break;
+                                       }
                                }
+                               LogDeath("suicide", deathtype, targ, targ);
+                               GiveFrags(attacker, targ, -1, deathtype);
+                       }
+                       
+                       Obituary_SpecialDeath(targ, FALSE, deathtype, s1, s2, f1, f2, NO_FL_ARG);
+               }
+               else if not(Obituary_WeaponDeath(targ, FALSE, deathtype, targ.netname, NO_STR_ARG, targ.killcount))
+               {
+                       backtrace("SUICIDE: what the hell happened here?\n");
+               }
+       }
 
-                               attacker.taunt_soundtime = time + 1;
-
-                               if (deathtype == DEATH_HURTTRIGGER && inflictor.message2 != "")
-                                       msg = inflictor.message2;
-                               else if (deathtype == DEATH_CUSTOM)
-                                       msg = deathmessage;
-                               else
-                                       msg = "";
+       // ======
+       // MURDER
+       // ======
+       else if(attacker.classname == "player")
+       {
+               s1 = attacker.netname;
+               s2 = targ.netname;
 
-                               if(strstrofs(msg, "%", 0) < 0)
-                                       msg = strcat("%s ", msg, " by %s");
+               // TODO: ADD REAL CHECK HERE!
+               attacker.FRAG_VERBOSE = TRUE;
+               targ.FRAG_VERBOSE = TRUE;
+               
+               if(!IsDifferentTeam(attacker, targ))
+               {
+                       LogDeath("tk", deathtype, attacker, targ);
+                       GiveFrags(attacker, targ, -1, deathtype);
 
-                               Send_KillNotification(a, s, msg, deathtype, MSG_KILL);
+                       attacker.killcount = 0;
+                       
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, attacker, MSG_DEATH, DEATH_TEAMKILL_FRAG, s2, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, targ, MSG_DEATH, DEATH_TEAMKILL_FRAGGED, s1, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+                       Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_NUM_4(targ.team, INFO_DEATH_TEAMKILL_), s2, s1, targ.killcount, NO_FL_ARG, NO_FL_ARG);
 
-                               GiveFrags(attacker, targ, 1, deathtype);
+                       // In this case, the death message will ALWAYS be "foo was betrayed by bar"
+                       // No need for specific death/weapon messages...
+               }
+               else
+               {
+                       LogDeath("frag", deathtype, attacker, targ);
+                       GiveFrags(attacker, targ, 1, deathtype);
 
-                               if (targ.killcount > 2) {
-                                       Send_KillNotification(s, ftos(targ.killcount), a, KILL_END_SPREE, MSG_SPREE);
+                       attacker.taunt_soundtime = time + 1;
+                       attacker.killcount = attacker.killcount + 1;
+                       
+                       #define ADD_ACHIEVEMENT_CASE(numa,numb) \
+                               case numa: \
+                               { \
+                                       AnnounceTo(attacker, strcat(#numb, "kills")); \
+                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_##numa, 1); \
+                                       break; \
                                }
+                       switch(attacker.killcount)
+                       {
+                               ADD_ACHIEVEMENT_CASE(3, 03)
+                               ADD_ACHIEVEMENT_CASE(5, 05)
+                               ADD_ACHIEVEMENT_CASE(10, 10)
+                               ADD_ACHIEVEMENT_CASE(15, 15)
+                               ADD_ACHIEVEMENT_CASE(20, 20)
+                               ADD_ACHIEVEMENT_CASE(25, 25)
+                               ADD_ACHIEVEMENT_CASE(30, 30)
+                               default: break;
+                       }
+                       #undef ADD_ACHIEVEMENT_CASE
 
-                               attacker.killcount = attacker.killcount + 1;
+                       if(!checkrules_firstblood)
+                       {
+                               checkrules_firstblood = TRUE;
+                               notif_firstblood = TRUE; // modify the current messages so that they too show firstblood information
+                               PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD, 1);
+                               PlayerStats_Event(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
+                       }
 
-                               if (attacker.killcount == 3)
-                               {
-                                       Send_KillNotification(a, "", "", KILL_SPREE_3, MSG_SPREE);
-                                       AnnounceTo(attacker, "03kills");
-                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3, 1);
-                               }
-                               else if (attacker.killcount == 5)
-                               {
-                                       Send_KillNotification(a, "", "", KILL_SPREE_5, MSG_SPREE);
-                                       AnnounceTo(attacker, "05kills");
-                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5, 1);
-                               }
-                               else if (attacker.killcount == 10)
-                               {
-                                       Send_KillNotification(a, "", "", KILL_SPREE_10, MSG_SPREE);
-                                       AnnounceTo(attacker, "10kills");
-                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10, 1);
-                               }
-                               else if (attacker.killcount == 15)
+                       if(notif_firstblood) // first blood, no kill sprees yet
+                       {
+                               if(targ.istypefrag)
                                {
-                                       Send_KillNotification(a, "", "", KILL_SPREE_15, MSG_SPREE);
-                                       AnnounceTo(attacker, "15kills");
-                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15, 1);
+                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, attacker, MSG_DEATH, (attacker.FRAG_VERBOSE ? DEATH_MURDER_TYPEFRAG_FIRST_VERBOSE : DEATH_MURDER_TYPEFRAG_FIRST),
+                                               s2, s1, (attacker.FRAG_VERBOSE ? ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping) : NO_FL_ARG), NO_FL_ARG, NO_FL_ARG);
+                                               
+                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, targ, MSG_DEATH, (targ.FRAG_VERBOSE ? DEATH_MURDER_TYPEFRAGGED_FIRST_VERBOSE : DEATH_MURDER_TYPEFRAGGED_FIRST),
+                                               s1, NO_STR_ARG, (targ.FRAG_VERBOSE ? attacker.health : NO_FL_ARG), (targ.FRAG_VERBOSE ? attacker.armorvalue : NO_FL_ARG), (targ.FRAG_VERBOSE ? ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping) : NO_FL_ARG));
                                }
-                               else if (attacker.killcount == 20)
+                               else
                                {
-                                       Send_KillNotification(a, "", "", KILL_SPREE_20, MSG_SPREE);
-                                       AnnounceTo(attacker, "20kills");
-                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20, 1);
+                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, attacker, MSG_DEATH, (attacker.FRAG_VERBOSE ? DEATH_MURDER_FRAG_FIRST_VERBOSE : DEATH_MURDER_FRAG_FIRST),
+                                               s2, s1, (attacker.FRAG_VERBOSE ? ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping) : NO_FL_ARG), NO_FL_ARG, NO_FL_ARG);
+                                               
+                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, targ, MSG_DEATH, (targ.FRAG_VERBOSE ? DEATH_MURDER_FRAGGED_FIRST_VERBOSE : DEATH_MURDER_FRAGGED_FIRST),
+                                               s1, NO_STR_ARG, (targ.FRAG_VERBOSE ? attacker.health : NO_FL_ARG), (targ.FRAG_VERBOSE ? attacker.armorvalue : NO_FL_ARG), (targ.FRAG_VERBOSE ? ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping) : NO_FL_ARG));
                                }
-                               else if (attacker.killcount == 25)
+                       }
+                       else // normal frags, kill sprees listed
+                       {
+                               if(targ.istypefrag)
                                {
-                                       Send_KillNotification(a, "", "", KILL_SPREE_25, MSG_SPREE);
-                                       AnnounceTo(attacker, "25kills");
-                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25, 1);
+                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, attacker, MSG_DEATH, (attacker.FRAG_VERBOSE ? DEATH_MURDER_TYPEFRAG_VERBOSE : DEATH_MURDER_TYPEFRAG),
+                                               s2, NO_STR_ARG, attacker.killcount, (attacker.FRAG_VERBOSE ? ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping) : NO_FL_ARG), NO_FL_ARG);
+                                               
+                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, targ, MSG_DEATH, (targ.FRAG_VERBOSE ? DEATH_MURDER_TYPEFRAGGED_VERBOSE : DEATH_MURDER_TYPEFRAGGED),
+                                               s1, NO_STR_ARG, (targ.FRAG_VERBOSE ? attacker.health : NO_FL_ARG), (targ.FRAG_VERBOSE ? attacker.armorvalue : NO_FL_ARG), (targ.FRAG_VERBOSE ? ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping) : NO_FL_ARG));
                                }
-                               else if (attacker.killcount == 30)
+                               else
                                {
-                                       Send_KillNotification(a, "", "", KILL_SPREE_30, MSG_SPREE);
-                                       AnnounceTo(attacker, "30kills");
-                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30, 1);
-                               }
-                               else if (attacker.killcount > 2) {
-                                       Send_KillNotification(a, ftos(attacker.killcount), "", KILL_SPREE, MSG_SPREE);
+                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, attacker, MSG_DEATH, (attacker.FRAG_VERBOSE ? DEATH_MURDER_FRAG_VERBOSE : DEATH_MURDER_FRAG),
+                                               s2, NO_STR_ARG, attacker.killcount, (attacker.FRAG_VERBOSE ? ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping) : NO_FL_ARG), NO_FL_ARG);
+                                               
+                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, targ, MSG_DEATH, (targ.FRAG_VERBOSE ? DEATH_MURDER_FRAGGED_VERBOSE : DEATH_MURDER_FRAGGED),
+                                               s1, NO_STR_ARG, (targ.FRAG_VERBOSE ? attacker.health : NO_FL_ARG), (targ.FRAG_VERBOSE ? attacker.armorvalue : NO_FL_ARG), (targ.FRAG_VERBOSE ? ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping) : NO_FL_ARG));
                                }
-                               LogDeath("frag", deathtype, attacker, targ);
                        }
+
+                       //print("targ_killcount = ", ftos(targ.killcount), ", attacker_killcount = ", ftos(attacker.killcount), ".\n");
+                       if not(Obituary_WeaponDeath(targ, TRUE, deathtype, targ.netname, attacker.netname, targ.killcount))
+                               Obituary_SpecialDeath(targ, TRUE, deathtype, s2, s1, targ.killcount, NO_FL_ARG, NO_FL_ARG);
                }
-               else
+       }
+
+       // =============
+       // ACCIDENT/TRAP
+       // =============
+       else
+       {
+               switch(deathtype)
                {
-                       Send_CSQC_KillCenterprint(targ, "", "", deathtype, MSG_KILL_ACTION);
-                       if (deathtype == DEATH_HURTTRIGGER && inflictor.message != "")
-                               msg = inflictor.message;
-                       else if (deathtype == DEATH_CUSTOM)
-                               msg = deathmessage;
-                       else
-                               msg = "";
-                       if(strstrofs(msg, "%", 0) < 0)
-                               msg = strcat("%s ", msg);
-
-                       GiveFrags(targ, targ, -1, deathtype);
-                       if(PlayerScore_Add(targ, SP_SCORE, 0) == -5) {
-                               AnnounceTo(targ, "botlike");
-                               PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_BOTLIKE, 1);
+                       // For now, we're just forcing HURTTRIGGER to behave as "DEATH_VOID" and giving it no special options...
+                       // Later on you will only be able to make custom messages using DEATH_CUSTOM,
+                       // and there will be a REAL DEATH_VOID implementation which mappers will use.
+                       /*case DEATH_HURTTRIGGER:
+                       {
+                               s1 = targ.netname;
+                               s2 = inflictor.message;
+                               if(strstrofs(s2, "%", 0) < 0) { s2 = strcat("%s ", s2); }
+                               break;
+                       }*/
+
+                       case DEATH_CUSTOM:
+                       {
+                               s1 = targ.netname;
+                               s2 = deathmessage;
+                               f1 = targ.killcount;
+                               if(strstrofs(s2, "%", 0) < 0) { s2 = strcat("%s ", s2); }
+                               f2 = f3 = NO_FL_ARG;
+                               break;
+                       }
+                       
+                       default:
+                       {
+                               s1 = targ.netname;
+                               f1 = targ.killcount;
+                               s2 = NO_STR_ARG;
+                               f2 = f3 = NO_FL_ARG;
+                               break;
                        }
-                       Send_KillNotification(s, msg, "", deathtype, MSG_KILL_ACTION);
+               }
 
-                       if (targ.killcount > 2)
-                               Send_KillNotification(s, ftos(targ.killcount), "", 0, MSG_KILL_ACTION_SPREE);
+               LogDeath("accident", deathtype, targ, targ);
+               GiveFrags(targ, targ, -1, deathtype);
 
-                       LogDeath("accident", deathtype, targ, targ);
+               if(PlayerScore_Add(targ, SP_SCORE, 0) == -5)
+               {
+                       AnnounceTo(targ, "botlike");
+                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_BOTLIKE, 1);
                }
 
-               targ.death_origin = targ.origin;
-               if(targ != attacker)
-                       targ.killer_origin = attacker.origin;
-
-               // FIXME: this should go in PutClientInServer
-               if (targ.killcount)
-                       targ.killcount = 0;
+               Obituary_SpecialDeath(targ, FALSE, deathtype, s1, s2, f1, f2, f3);
        }
+
+       // Set final information for the death
+       targ.death_origin = targ.origin;
+       if(targ != attacker) { targ.killer_origin = attacker.origin; }
+       if(targ.killcount) { targ.killcount = 0; }
 }
 
 // these are updated by each Damage call for use in button triggering and such
@@ -571,7 +638,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                        }
        }
 
-       if(deathtype == DEATH_KILL || deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE || deathtype == DEATH_QUIET)
+       if(deathtype == DEATH_KILL || deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
        {
                // These are ALWAYS lethal
                // No damage modification here
index 680afbc8909a2ffeaa9d3880a0bf48f5ad16aba6..d924c018e89d795b3789c819a0ca2c3034a2675b 100644 (file)
@@ -553,6 +553,8 @@ void spawnfunc___init_dedicated_server(void)
        // needs to be done so early because of the constants they create
        CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
        CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
+       CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
+       CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
 
        MapInfo_Enumerate();
        MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
@@ -599,6 +601,8 @@ void spawnfunc_worldspawn (void)
        // needs to be done so early because of the constants they create
        CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
        CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
+       CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
+       CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
 
        ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid));
 
@@ -1756,10 +1760,10 @@ float WinningCondition_Onslaught()
        {
                if (head.health > 0)
                {
-                       if (head.team == COLOR_TEAM1) t1 = 1;
-                       if (head.team == COLOR_TEAM2) t2 = 1;
-                       if (head.team == COLOR_TEAM3) t3 = 1;
-                       if (head.team == COLOR_TEAM4) t4 = 1;
+                       if (head.team == FL_TEAM_1) t1 = 1;
+                       if (head.team == FL_TEAM_2) t2 = 1;
+                       if (head.team == FL_TEAM_3) t3 = 1;
+                       if (head.team == FL_TEAM_4) t4 = 1;
                }
                head = find(head, classname, "onslaught_generator");
        }
@@ -1767,10 +1771,10 @@ float WinningCondition_Onslaught()
        {
                // game over, only one team remains (or none)
                ClearWinners();
-               if (t1) SetWinners(team, COLOR_TEAM1);
-               if (t2) SetWinners(team, COLOR_TEAM2);
-               if (t3) SetWinners(team, COLOR_TEAM3);
-               if (t4) SetWinners(team, COLOR_TEAM4);
+               if (t1) SetWinners(team, FL_TEAM_1);
+               if (t2) SetWinners(team, FL_TEAM_2);
+               if (t3) SetWinners(team, FL_TEAM_3);
+               if (t4) SetWinners(team, FL_TEAM_4);
                dprint("Have a winner, ending game.\n");
                return WINNING_YES;
        }
@@ -1808,13 +1812,13 @@ float WinningCondition_Assault()
 
        status = WINNING_NO;
        // as the timelimit has not yet passed just assume the defending team will win
-       if(assault_attacker_team == COLOR_TEAM1)
+       if(assault_attacker_team == FL_TEAM_1)
        {
-               SetWinners(team, COLOR_TEAM2);
+               SetWinners(team, FL_TEAM_2);
        }
        else
        {
-               SetWinners(team, COLOR_TEAM1);
+               SetWinners(team, FL_TEAM_1);
        }
 
        entity ent;
@@ -1940,10 +1944,10 @@ float WinningCondition_Scores(float limit, float leadlimit)
 
        if(teamplay)
        {
-               team1_score = TeamScore_GetCompareValue(COLOR_TEAM1);
-               team2_score = TeamScore_GetCompareValue(COLOR_TEAM2);
-               team3_score = TeamScore_GetCompareValue(COLOR_TEAM3);
-               team4_score = TeamScore_GetCompareValue(COLOR_TEAM4);
+               team1_score = TeamScore_GetCompareValue(FL_TEAM_1);
+               team2_score = TeamScore_GetCompareValue(FL_TEAM_2);
+               team3_score = TeamScore_GetCompareValue(FL_TEAM_3);
+               team4_score = TeamScore_GetCompareValue(FL_TEAM_4);
        }
 
        ClearWinners();
@@ -2059,25 +2063,25 @@ float WinningCondition_RanOutOfSpawns()
 
        FOR_EACH_PLAYER(head) if(head.deadflag == DEAD_NO)
        {
-               if(head.team == COLOR_TEAM1)
+               if(head.team == FL_TEAM_1)
                        team1_score = 1;
-               else if(head.team == COLOR_TEAM2)
+               else if(head.team == FL_TEAM_2)
                        team2_score = 1;
-               else if(head.team == COLOR_TEAM3)
+               else if(head.team == FL_TEAM_3)
                        team3_score = 1;
-               else if(head.team == COLOR_TEAM4)
+               else if(head.team == FL_TEAM_4)
                        team4_score = 1;
        }
 
        for(head = world; (head = find(head, classname, "info_player_deathmatch")) != world; )
        {
-               if(head.team == COLOR_TEAM1)
+               if(head.team == FL_TEAM_1)
                        team1_score = 1;
-               else if(head.team == COLOR_TEAM2)
+               else if(head.team == FL_TEAM_2)
                        team2_score = 1;
-               else if(head.team == COLOR_TEAM3)
+               else if(head.team == FL_TEAM_3)
                        team3_score = 1;
-               else if(head.team == COLOR_TEAM4)
+               else if(head.team == FL_TEAM_4)
                        team4_score = 1;
        }
 
@@ -2091,20 +2095,20 @@ float WinningCondition_RanOutOfSpawns()
        {
                float t, i;
                if(team1_score)
-                       t = COLOR_TEAM1;
+                       t = FL_TEAM_1;
                else if(team2_score)
-                       t = COLOR_TEAM2;
+                       t = FL_TEAM_2;
                else if(team3_score)
-                       t = COLOR_TEAM3;
+                       t = FL_TEAM_3;
                else // if(team4_score)
-                       t = COLOR_TEAM4;
+                       t = FL_TEAM_4;
                CheckAllowedTeams(world);
                for(i = 0; i < MAX_TEAMSCORE; ++i)
                {
-                       if(t != COLOR_TEAM1) if(c1 >= 0) TeamScore_AddToTeam(COLOR_TEAM1, i, -1000);
-                       if(t != COLOR_TEAM2) if(c2 >= 0) TeamScore_AddToTeam(COLOR_TEAM2, i, -1000);
-                       if(t != COLOR_TEAM3) if(c3 >= 0) TeamScore_AddToTeam(COLOR_TEAM3, i, -1000);
-                       if(t != COLOR_TEAM4) if(c4 >= 0) TeamScore_AddToTeam(COLOR_TEAM4, i, -1000);
+                       if(t != FL_TEAM_1) if(c1 >= 0) TeamScore_AddToTeam(FL_TEAM_1, i, -1000);
+                       if(t != FL_TEAM_2) if(c2 >= 0) TeamScore_AddToTeam(FL_TEAM_2, i, -1000);
+                       if(t != FL_TEAM_3) if(c3 >= 0) TeamScore_AddToTeam(FL_TEAM_3, i, -1000);
+                       if(t != FL_TEAM_4) if(c4 >= 0) TeamScore_AddToTeam(FL_TEAM_4, i, -1000);
                }
 
                AddWinners(team, t);
index 7f8931bffe648c90d3bd4a7b3eada671725f66e6..9965d5232e1c0c36de49006239656ccb13e4572a 100644 (file)
@@ -32,7 +32,6 @@ void WarpZone_crosshair_trace(entity pl)
 void() spawnfunc_info_player_deathmatch; // needed for the other spawnpoints
 void() spawnpoint_use;
 string GetMapname();
-string ColoredTeamName(float t);
 
 string admin_name(void)
 {
@@ -594,102 +593,6 @@ void GetCvars(float f)
        }
 }
 
-void backtrace(string msg)
-{
-    float dev, war;
-    dev = autocvar_developer;
-    war = autocvar_prvm_backtraceforwarnings;
-    cvar_set("developer", "1");
-    cvar_set("prvm_backtraceforwarnings", "1");
-    print("\n");
-    print("--- CUT HERE ---\nWARNING: ");
-    print(msg);
-    print("\n");
-    remove(world); // isn't there any better way to cause a backtrace?
-    print("\n--- CUT UNTIL HERE ---\n");
-    cvar_set("developer", ftos(dev));
-    cvar_set("prvm_backtraceforwarnings", ftos(war));
-}
-
-string Team_ColorCode(float teamid)
-{
-    if (teamid == COLOR_TEAM1)
-        return "^1";
-    else if (teamid == COLOR_TEAM2)
-        return "^4";
-    else if (teamid == COLOR_TEAM3)
-        return "^3";
-    else if (teamid == COLOR_TEAM4)
-        return "^6";
-    else
-        return "^7";
-}
-
-string Team_ColorName(float t)
-{
-    // fixme: Search for team entities and get their .netname's!
-    if (t == COLOR_TEAM1)
-        return "Red";
-    if (t == COLOR_TEAM2)
-        return "Blue";
-    if (t == COLOR_TEAM3)
-        return "Yellow";
-    if (t == COLOR_TEAM4)
-        return "Pink";
-    return "Neutral";
-}
-
-string Team_ColorNameLowerCase(float t)
-{
-    // fixme: Search for team entities and get their .netname's!
-    if (t == COLOR_TEAM1)
-        return "red";
-    if (t == COLOR_TEAM2)
-        return "blue";
-    if (t == COLOR_TEAM3)
-        return "yellow";
-    if (t == COLOR_TEAM4)
-        return "pink";
-    return "neutral";
-}
-
-float ColourToNumber(string team_colour)
-{
-       if (team_colour == "red")
-               return COLOR_TEAM1;
-
-       if (team_colour == "blue")
-               return COLOR_TEAM2;
-
-       if (team_colour == "yellow")
-               return COLOR_TEAM3;
-
-       if (team_colour == "pink")
-               return COLOR_TEAM4;
-
-       if (team_colour == "auto")
-               return 0;
-
-       return -1;
-}
-
-float NumberToTeamNumber(float number)
-{
-       if (number == 1)
-               return COLOR_TEAM1;
-
-       if (number == 2)
-               return COLOR_TEAM2;
-
-       if (number == 3)
-               return COLOR_TEAM3;
-
-       if (number == 4)
-               return COLOR_TEAM4;
-
-       return -1;
-}
-
 // decolorizes and team colors the player name when needed
 string playername(entity p)
 {
@@ -1173,7 +1076,6 @@ void readlevelcvars(void)
 #endif
 
        sv_clones = cvar("sv_clones");
-       sv_gentle = cvar("sv_gentle");
        sv_foginterval = cvar("sv_foginterval");
        g_cloaked = cvar("g_cloaked");
     if(g_cts)
@@ -1656,34 +1558,6 @@ void precache()
 #endif
 }
 
-// sorry, but using \ in macros breaks line numbers
-#define WRITESPECTATABLE_MSG_ONE_VARNAME(varname,statement) entity varname; varname = msg_entity; FOR_EACH_REALCLIENT(msg_entity) if(msg_entity == varname || (msg_entity.classname == STR_SPECTATOR && msg_entity.enemy == varname)) statement msg_entity = varname
-#define WRITESPECTATABLE_MSG_ONE(statement) WRITESPECTATABLE_MSG_ONE_VARNAME(oldmsg_entity, statement)
-#define WRITESPECTATABLE(msg,statement) if(msg == MSG_ONE) { WRITESPECTATABLE_MSG_ONE(statement); } else statement float WRITESPECTATABLE_workaround = 0
-
-
-void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, float countdown_num)
-{
-       if ((clienttype(e) == CLIENTTYPE_REAL) && (e.flags & FL_CLIENT))
-       {
-               msg_entity = e;
-               WRITESPECTATABLE_MSG_ONE({
-                       WriteByte(MSG_ONE, SVC_TEMPENTITY);
-                       WriteByte(MSG_ONE, TE_CSQC_CENTERPRINT_GENERIC);
-                       WriteByte(MSG_ONE, id);
-                       WriteString(MSG_ONE, s);
-                       if (id != 0 && s != "")
-                       {
-                               WriteByte(MSG_ONE, duration);
-                               WriteByte(MSG_ONE, countdown_num);
-                       }
-               });
-       }
-}
-void Send_CSQC_Centerprint_Generic_Expire(entity e, float id)
-{
-       Send_CSQC_Centerprint_Generic(e, id, "", 1, 0);
-}
 // WARNING: this kills the trace globals
 #define EXACTTRIGGER_TOUCH if(WarpZoneLib_ExactTrigger_Touch()) return
 #define EXACTTRIGGER_INIT  WarpZoneLib_ExactTrigger_Init()
@@ -2777,3 +2651,8 @@ float isPushable(entity e)
                return TRUE;
        return FALSE;
 }
+
+void dedicated_print(string input) // print(), but only print if the server is not local
+{
+       if not(server_is_local) { print(input); }
+}
index 134e979d1c17d0b09da3b1658b0fd724a791b55e..132896d32c95cfcd902e71cf1ee685a2c8e328cf 100644 (file)
@@ -20,36 +20,43 @@ void ctf_EventLog(string mode, float flagteam, entity actor) // use an alias for
                GameLogEcho(strcat(":ctf:", mode, ":", ftos(flagteam), ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
 }
 
-string ctf_CaptureRecord(entity flag, entity player)
+void ctf_CaptureRecord(entity flag, entity player)
 {
-       float cap_time, cap_record, success;
-       string cap_message = string_null, refername;
-       
-       if((autocvar_g_ctf_captimerecord_always) || (player_count - currentbots)) 
-       {
-               cap_record = ctf_captimerecord;
-               cap_time = (time - flag.ctf_pickuptime);
+       entity tmp_entity;
+       float notification, success;
+       float cap_record = ctf_captimerecord;
+       float cap_time = (time - flag.ctf_pickuptime);
+       float f1, f2 = NO_FL_ARG;
+       string s1, s2 = NO_STR_ARG;
+       string refername = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"));
+       
+       // figure shit out
+       if(!ctf_captimerecord) 
+               { notification = APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_TIME_); s1 = player.netname; f1 = (cap_time * 100); success = TRUE; }
+       else if(cap_time < cap_record) 
+               { notification = APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_BROKEN_); s1 = player.netname; s2 = refername; f1 = (cap_time * 100); f2 = (cap_record * 100); success = TRUE; }
+       else
+               { notification = APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_UNBROKEN_); s1 = player.netname; s2 = refername; f1 = (cap_time * 100); f2 = (cap_record * 100); success = FALSE; }
 
-               refername = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"));
-               refername = ((refername == player.netname) ? "their" : strcat(refername, "^7's"));
+       // notify about shit
+       FOR_EACH_REALCLIENT(tmp_entity)
+       {
+               if not(tmp_entity.CAPTURE_VERBOSE) { notification = APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_); s2 = NO_STR_ARG; f1 = f2 = NO_FL_ARG; }
+               Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, tmp_entity, MSG_INFO, notification, s1, s2, f1, f2, NO_FL_ARG);
+       }
 
-               if(!ctf_captimerecord) 
-                       { cap_message = strcat(" in ", ftos_decimals(cap_time, 2), " seconds"); success = TRUE; }
-               else if(cap_time < cap_record) 
-                       { cap_message = strcat(" in ", ftos_decimals(cap_time, 2), " seconds, breaking ", refername, " previous record of ", ftos_decimals(cap_record, 2), " seconds"); success = TRUE; }
-               else
-                       { cap_message = strcat(" in ", ftos_decimals(cap_time, 2), " seconds, failing to break ", refername, " record of ", ftos_decimals(cap_record, 2), " seconds"); success = FALSE; }
+       // notify server log too
+       if not(autocvar_notification_ctf_capture_verbose) { notification = APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_); s2 = NO_STR_ARG; f1 = f2 = NO_FL_ARG; }
+       Local_Notification_Without_VarArgs(MSG_INFO, notification, stof(Get_Field_Value(F_STRNUM, MSG_INFO, notification)), stof(Get_Field_Value(F_FLNUM, MSG_INFO, notification)), s1, s2, NO_STR_ARG, NO_STR_ARG, f1, f2, NO_FL_ARG, NO_FL_ARG);
 
-               if(success) 
-               {
-                       ctf_captimerecord = cap_time;
-                       db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"), ftos(cap_time));
-                       db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"), player.netname);
-                       write_recordmarker(player, (time - cap_time), cap_time); 
-               } 
-       }
-       
-       return cap_message;
+       // write that shit in the database
+       if(success) 
+       {
+               ctf_captimerecord = cap_time;
+               db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"), ftos(cap_time));
+               db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"), player.netname);
+               write_recordmarker(player, (time - cap_time), cap_time); 
+       } 
 }
 
 void ctf_FlagcarrierWaypoints(entity player)
@@ -166,9 +173,9 @@ void ctf_CaptureShield_Update(entity player, float wanted_status)
        if((wanted_status == player.ctf_captureshielded) && (updated_status != wanted_status)) // 0: shield only, 1: unshield only
        {
                if(updated_status) // TODO csqc notifier for this // Samual: How?
-                       Send_CSQC_Centerprint_Generic(player, CPID_CTF_CAPTURESHIELD, "^3You are now ^4shielded^3 from the flag\n^3for ^1too many unsuccessful attempts^3 to capture.\n\n^3Make some defensive scores before trying again.", 5, 0);
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_SHIELDED, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                else
-                       Send_CSQC_Centerprint_Generic(player, CPID_CTF_CAPTURESHIELD, "^3You are now free.\n\n^3Feel free to ^1try to capture^3 the flag again\n^3if you think you will succeed.", 5, 0);
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_FREE, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                        
                player.ctf_captureshielded = updated_status;
        }
@@ -191,7 +198,7 @@ void ctf_CaptureShield_Touch()
        vector othermid = (other.absmin + other.absmax) * 0.5;
 
        Damage(other, self, self, 0, DEATH_HURTTRIGGER, mymid, normalize(othermid - mymid) * ctf_captureshield_force);
-       Send_CSQC_Centerprint_Generic(other, CPID_CTF_CAPTURESHIELD, "^3You are ^4shielded^3 from the flag\n^3for ^1too many unsuccessful attempts^3 to capture.\n\n^3Get some defensive scores before trying again.", 5, 0);
+       Send_Notification_Legacy_Wrapper(NOTIF_ONE, other, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_SHIELDED, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
 }
 
 void ctf_CaptureShield_Spawn(entity flag)
@@ -234,7 +241,7 @@ void ctf_Handle_Drop(entity flag, entity player, float droptype)
        flag.ctf_status = FLAG_DROPPED;
        
        // messages and sounds
-       Send_KillNotification(player.netname, flag.netname, "", INFO_LOSTFLAG, MSG_INFO);
+       Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_LOST_), player.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
        sound(flag, CH_TRIGGER, flag.snd_flag_dropped, VOL_BASE, ATTN_NONE);
        ctf_EventLog("dropped", player.team, player);
 
@@ -287,11 +294,11 @@ void ctf_Handle_Retrieve(entity flag, entity player)
        FOR_EACH_REALPLAYER(tmp_player)
        {
                if(tmp_player == sender)
-                       centerprint(tmp_player, strcat("You passed the ", flag.netname, " to ", player.netname));
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, tmp_player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PASS_SENT_), player.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                else if(tmp_player == player)
-                       centerprint(tmp_player, strcat("You received the ", flag.netname, " from ", sender.netname));
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, tmp_player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PASS_RECEIVED_), sender.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                else if(!IsDifferentTeam(tmp_player, sender))
-                       centerprint(tmp_player, strcat(sender.netname, " passed the ", flag.netname, " to ", player.netname));
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, tmp_player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PASS_OTHER_), sender.netname, player.netname, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
        }
        
        // create new waypoint
@@ -404,7 +411,7 @@ void ctf_Handle_Capture(entity flag, entity toucher, float capturetype)
        if not(player) { return; } // without someone to give the reward to, we can't possibly cap
        
        // messages and sounds
-       Send_KillNotification(player.netname, enemy_flag.netname, ctf_CaptureRecord(enemy_flag, player), INFO_CAPTUREFLAG, MSG_INFO);
+       ctf_CaptureRecord(enemy_flag, player);
        sound(player, CH_TRIGGER, flag.snd_flag_capture, VOL_BASE, ATTN_NONE);
        
        switch(capturetype)
@@ -445,8 +452,8 @@ void ctf_Handle_Capture(entity flag, entity toucher, float capturetype)
 void ctf_Handle_Return(entity flag, entity player)
 {
        // messages and sounds
-       //centerprint(player, strcat("You returned the ", flag.netname));
-       Send_KillNotification(player.netname, flag.netname, "", INFO_RETURNFLAG, MSG_INFO);
+       Send_Notification_Legacy_Wrapper(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_RETURN_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+       Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_RETURN_), player.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
        sound(player, CH_TRIGGER, flag.snd_flag_returned, VOL_BASE, ATTN_NONE);
        ctf_EventLog("return", flag.team, player);
 
@@ -471,7 +478,6 @@ void ctf_Handle_Pickup(entity flag, entity player, float pickuptype)
 {
        // declarations
        entity tmp_player; // temporary entity which the FOR_EACH_PLAYER loop uses to scan players
-       string verbosename; // holds the name of the player OR no name at all for printing in the centerprints
        float pickup_dropped_score; // used to calculate dropped pickup score
        
        // attach the flag to the player
@@ -495,21 +501,20 @@ void ctf_Handle_Pickup(entity flag, entity player, float pickuptype)
        }
 
        // messages and sounds
-       Send_KillNotification (player.netname, flag.netname, "", INFO_GOTFLAG, MSG_INFO);
+       Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_PICKUP_), player.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
        sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTN_NONE);
-       verbosename = ((autocvar_g_ctf_flag_pickup_verbosename) ? strcat(Team_ColorCode(player.team), "(^7", player.netname, Team_ColorCode(player.team), ") ") : "");
-       
+
        FOR_EACH_REALPLAYER(tmp_player)
        {
                if(tmp_player == player)
                {
-                       centerprint(tmp_player, strcat("You got the ", flag.netname, "!"));
-                       //if(ctf_stalemate) { centerprint(tmp_player, "Stalemate! Enemies can see you on radar!"); }
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, tmp_player, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PICKUP_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+                       if(ctf_stalemate) { Send_Notification_Legacy_Wrapper(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); }
                }
-               //else if(!IsDifferentTeam(tmp_player, player))
-               //      centerprint(tmp_player, strcat("Your ", Team_ColorCode(player.team), "team mate ", verbosename, "^7got the flag! Protect them!"));
-               else if(!IsDifferentTeam(tmp_player, flag))
-                       centerprint(tmp_player, strcat("The ", Team_ColorCode(player.team), "enemy ", verbosename, "^7got your flag! Retrieve it!"));
+               else if(!IsDifferentTeam(tmp_player, player) && tmp_player != player)
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, tmp_player, MSG_CENTER, (tmp_player.PICKUP_TEAM_VERBOSE ? CENTER_CTF_PICKUP_TEAM_VERBOSE : CENTER_CTF_PICKUP_TEAM), Team_ColorCode(player.team), (tmp_player.PICKUP_TEAM_VERBOSE ? player.netname : NO_STR_ARG), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+               else if(IsDifferentTeam(tmp_player, player))
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, tmp_player, MSG_CENTER, (tmp_player.PICKUP_ENEMY_VERBOSE ? CENTER_CTF_PICKUP_ENEMY_VERBOSE : CENTER_CTF_PICKUP_ENEMY), Team_ColorCode(player.team), (tmp_player.PICKUP_ENEMY_VERBOSE ? player.netname : NO_STR_ARG), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
        }
        
        // scoring
@@ -568,14 +573,14 @@ void ctf_CheckFlagReturn(entity flag, float returntype)
                {
                        switch(returntype)
                        {
-                               case RETURN_DROPPED: bprint("The ", flag.netname, " was dropped in the base and returned itself\n"); break;
-                               case RETURN_DAMAGE: bprint("The ", flag.netname, " was destroyed and returned to base\n"); break;
-                               case RETURN_SPEEDRUN: bprint("The ", flag.netname, " became impatient after ", ftos_decimals(ctf_captimerecord, 2), " seconds and returned itself\n"); break;
-                               case RETURN_NEEDKILL: bprint("The ", flag.netname, " fell somewhere it couldn't be reached and returned to base\n"); break;
+                               case RETURN_DROPPED: Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_DROPPED_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); break;
+                               case RETURN_DAMAGE: Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_DAMAGED_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); break;
+                               case RETURN_SPEEDRUN: Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_SPEEDRUN_), NO_STR_ARG, NO_STR_ARG, ctf_captimerecord, NO_FL_ARG, NO_FL_ARG); break;
+                               case RETURN_NEEDKILL: Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_NEEDKILL_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); break;
                                
                                default:
                                case RETURN_TIMEOUT:
-                                       { bprint("The ", flag.netname, " has returned to base\n"); break; }
+                                       { Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_TIMEOUT_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); break; }
                        }
                        sound(flag, CH_TRIGGER, flag.snd_flag_respawn, VOL_BASE, ATTN_NONE);
                        ctf_EventLog("returned", flag.team, world);
@@ -604,8 +609,8 @@ void ctf_CheckStalemate(void)
                        
                        switch(tmp_entity.team)
                        {
-                               case COLOR_TEAM1: ++stale_red_flags; break;
-                               case COLOR_TEAM2: ++stale_blue_flags; break;
+                               case FL_TEAM_1: ++stale_red_flags; break;
+                               case FL_TEAM_2: ++stale_blue_flags; break;
                        }
                }
        }
@@ -630,9 +635,9 @@ void ctf_CheckStalemate(void)
                {
                        FOR_EACH_REALPLAYER(tmp_entity)
                                if(tmp_entity.flagcarried)
-                                       centerprint(tmp_entity, "Stalemate! Enemies can now see you on radar!");
+                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, tmp_entity, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                                else
-                                       centerprint(tmp_entity, "Stalemate! Flag carriers can now be seen by enemies on radar!");
+                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, tmp_entity, MSG_CENTER, CENTER_CTF_STALEMATE_OTHER, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                        
                        wpforenemy_announced = TRUE;
                }
@@ -931,7 +936,7 @@ void ctf_DelayedFlagSetup(void) // called after a flag is placed on a map by ctf
        self.bot_basewaypoint = self.nearestwaypoint;
 
        // waypointsprites
-       WaypointSprite_SpawnFixed(((self.team == COLOR_TEAM1) ? "redbase" : "bluebase"), self.origin + FLAG_WAYPOINT_OFFSET, self, wps_flagbase, RADARICON_FLAG, colormapPaletteColor(self.team - 1, FALSE));
+       WaypointSprite_SpawnFixed(((self.team == FL_TEAM_1) ? "redbase" : "bluebase"), self.origin + FLAG_WAYPOINT_OFFSET, self, wps_flagbase, RADARICON_FLAG, colormapPaletteColor(self.team - 1, FALSE));
        WaypointSprite_UpdateTeamRadar(self.wps_flagbase, RADARICON_FLAG, colormapPaletteColor(self.team - 1, FALSE));
 
        // captureshield setup
@@ -948,10 +953,10 @@ void ctf_FlagSetup(float teamnumber, entity flag) // called when spawning a flag
        flag.ctf_worldflagnext = ctf_worldflaglist; // link flag into ctf_worldflaglist
        ctf_worldflaglist = flag;
 
-       setattachment(flag, world, ""); 
+       setattachment(flag, world, "");
 
-       flag.netname = ((teamnumber) ? "^1RED^7 flag" : "^4BLUE^7 flag");
-       flag.team = ((teamnumber) ? COLOR_TEAM1 : COLOR_TEAM2); // COLOR_TEAM1: color 4 team (red) - COLOR_TEAM2: color 13 team (blue)
+       flag.netname = ((teamnumber) ? "^1REPLACETHIS^7" : "^4REPLACETHIS^7"); // ((teamnumber) ? "^1RED^7 flag" : "^4BLUE^7 flag");
+       flag.team = ((teamnumber) ? FL_TEAM_1 : FL_TEAM_2); // FL_TEAM_1: color 4 team (red) - FL_TEAM_2: color 13 team (blue)
        flag.items = ((teamnumber) ? IT_KEY2 : IT_KEY1); // IT_KEY2: gold key (redish enough) - IT_KEY1: silver key (bluish enough)
        flag.classname = "item_flag_team";
        flag.target = "###item###"; // wut?
@@ -1762,6 +1767,7 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerDamage) // for changing damage and force values t
                        frag_target.wps_helpme_time = time;
                        WaypointSprite_HelpMePing(frag_target.wps_flagcarrier);
                }
+               // todo: add notification for when flag carrier needs help?
        }
        return FALSE;
 }
@@ -1842,13 +1848,13 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey)
                                                { 
                                                        if(clienttype(head) == CLIENTTYPE_BOT)
                                                        {
-                                                               centerprint(player, strcat("Requesting ", head.netname, " to pass you the ", head.flagcarried.netname)); 
+                                                               Send_Notification_Legacy_Wrapper(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_PASS_REQUESTING, head.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                                                                ctf_Handle_Throw(head, player, DROP_PASS);
                                                        }
                                                        else
                                                        {
-                                                               centerprint(head, strcat(player.netname, " requests you to pass the ", head.flagcarried.netname)); 
-                                                               centerprint(player, strcat("Requesting ", head.netname, " to pass you the ", head.flagcarried.netname)); 
+                                                               Send_Notification_Legacy_Wrapper(NOTIF_ONE, head, MSG_CENTER, CENTER_CTF_PASS_REQUESTED, player.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+                                                               Send_Notification_Legacy_Wrapper(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_PASS_REQUESTING, head.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                                                        }
                                                        player.throw_antispam = time + autocvar_g_ctf_pass_wait; 
                                                        return TRUE; 
@@ -1885,7 +1891,7 @@ MUTATOR_HOOKFUNCTION(ctf_PlayerUseKey)
                                }
                                else
                                {
-                                       centerprint(player, strcat("Too many flag throws, throwing disabled for ", ftos(rint((player.throw_prevtime + autocvar_g_ctf_throw_punish_delay) - time)), " seconds."));
+                                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, player, MSG_CENTER, CENTER_CTF_FLAG_THROW_PUNISH, NO_STR_ARG, NO_STR_ARG, rint((player.throw_prevtime + autocvar_g_ctf_throw_punish_delay) - time), NO_FL_ARG, NO_FL_ARG);
                                        return FALSE;
                                }
                        }
@@ -1960,8 +1966,8 @@ MUTATOR_HOOKFUNCTION(ctf_AbortSpeedrun)
 {
        if(self.flagcarried)
        {
-               bprint("The ", self.flagcarried.netname, " was returned to base by its carrier\n");
-               ctf_RespawnFlag(self);
+               Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_ENT_2(self.flagcarried, INFO_CTF_FLAGRETURN_ABORTRUN_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+               ctf_RespawnFlag(self.flagcarried);
                return TRUE;
        }
        
@@ -2008,6 +2014,14 @@ MUTATOR_HOOKFUNCTION(ctf_BotRoles)
        return TRUE;
 }
 
+MUTATOR_HOOKFUNCTION(ctf_GetCvars)
+{
+       GetCvars_handleFloat(get_cvars_s, get_cvars_f, CAPTURE_VERBOSE, "notification_ctf_capture_verbose");
+       GetCvars_handleFloat(get_cvars_s, get_cvars_f, PICKUP_TEAM_VERBOSE, "notification_ctf_pickup_team_verbose");
+       GetCvars_handleFloat(get_cvars_s, get_cvars_f, PICKUP_ENEMY_VERBOSE, "notification_ctf_pickup_enemy_verbose");
+       return TRUE;
+}
+
 
 // ==========
 // Spawnfuncs
@@ -2020,7 +2034,7 @@ void spawnfunc_info_player_team1()
 {
        if(g_assault) { remove(self); return; }
        
-       self.team = COLOR_TEAM1; // red
+       self.team = FL_TEAM_1; // red
        spawnfunc_info_player_deathmatch();
 }
 
@@ -2032,7 +2046,7 @@ void spawnfunc_info_player_team2()
 {
        if(g_assault) { remove(self); return; }
        
-       self.team = COLOR_TEAM2; // blue
+       self.team = FL_TEAM_2; // blue
        spawnfunc_info_player_deathmatch();
 }
 
@@ -2043,7 +2057,7 @@ void spawnfunc_info_player_team3()
 {
        if(g_assault) { remove(self); return; }
        
-       self.team = COLOR_TEAM3; // yellow
+       self.team = FL_TEAM_3; // yellow
        spawnfunc_info_player_deathmatch();
 }
 
@@ -2055,7 +2069,7 @@ void spawnfunc_info_player_team4()
 {
        if(g_assault) { remove(self); return; }
        
-       self.team = COLOR_TEAM4; // purple
+       self.team = FL_TEAM_4; // purple
        spawnfunc_info_player_deathmatch();
 }
 
@@ -2157,8 +2171,8 @@ void ctf_DelayedInit() // Do this check with a delay so we can wait for teams to
        if(find(world, classname, "ctf_team") == world)
        {
                print("No ""ctf_team"" entities found on this map, creating them anyway.\n");
-               ctf_SpawnTeam("Red", COLOR_TEAM1 - 1);
-               ctf_SpawnTeam("Blue", COLOR_TEAM2 - 1);
+               ctf_SpawnTeam("Red", FL_TEAM_1 - 1);
+               ctf_SpawnTeam("Blue", FL_TEAM_2 - 1);
        }
        
        ctf_ScoreRules();
@@ -2192,6 +2206,7 @@ MUTATOR_DEFINITION(gamemode_ctf)
        MUTATOR_HOOK(VehicleExit, ctf_VehicleExit, CBC_ORDER_ANY);
        MUTATOR_HOOK(AbortSpeedrun, ctf_AbortSpeedrun, CBC_ORDER_ANY);
        MUTATOR_HOOK(HavocBot_ChooseRule, ctf_BotRoles, CBC_ORDER_ANY);
+       MUTATOR_HOOK(GetCvars, ctf_GetCvars, CBC_ORDER_ANY);
        
        MUTATOR_ONADD
        {
index 1c5898bd1ad99afc1e3d773984620de82a2f288d..4a9164a22ba0fc261ddf05dc9e86af1add87612b 100644 (file)
@@ -1,5 +1,6 @@
 // these are needed since mutators are compiled last
 
+#ifdef SVQC
 // used in cheats.qc
 void ctf_RespawnFlag(entity flag);
 
@@ -130,3 +131,13 @@ vector havocbot_ctf_middlepoint;
 float havocbot_ctf_middlepoint_radius;
 
 void havocbot_role_ctf_setrole(entity bot, float role);
+
+// client notification stuff
+.float CAPTURE_VERBOSE;
+.float PICKUP_TEAM_VERBOSE;
+.float PICKUP_ENEMY_VERBOSE;
+#else
+var float autocvar_notification_ctf_pickup_team_verbose = TRUE;
+var float autocvar_notification_ctf_pickup_enemy_verbose = TRUE;
+#endif
+var float autocvar_notification_ctf_capture_verbose = TRUE;
index 852fb90c05dc287c0fdfeedeb31b61f6f9f4aa23..1c2ded2dbf893984ee3936e960a5febdabb017f3 100644 (file)
@@ -75,21 +75,8 @@ void dompoint_captured ()
        self.delay = old_delay;
        self.team = old_team;
 
-       switch(self.goalentity.team)
-       {
-               case COLOR_TEAM1:
-                       WaypointSprite_UpdateSprites(self.sprite, "dom-red", "", "");
-                       break;
-               case COLOR_TEAM2:
-                       WaypointSprite_UpdateSprites(self.sprite, "dom-blue", "", "");
-                       break;
-               case COLOR_TEAM3:
-                       WaypointSprite_UpdateSprites(self.sprite, "dom-yellow", "", "");
-                       break;
-               case COLOR_TEAM4:
-                       WaypointSprite_UpdateSprites(self.sprite, "dom-pink", "", "");
-       }
-
+       WaypointSprite_UpdateSprites(self.sprite, strcat("dom-", Team_ColorName_Lower(self.goalentity.team)), "", "");
+       
        total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0;
        for(head = world; (head = find(head, classname, "dom_controlpoint")) != world; )
        {
@@ -103,16 +90,16 @@ void dompoint_captured ()
                        wait_time = head.wait;
                switch(head.goalentity.team)
                {
-                       case COLOR_TEAM1:
+                       case FL_TEAM_1:
                                pps_red += points/wait_time;
                                break;
-                       case COLOR_TEAM2:
+                       case FL_TEAM_2:
                                pps_blue += points/wait_time;
                                break;
-                       case COLOR_TEAM3:
+                       case FL_TEAM_3:
                                pps_yellow += points/wait_time;
                                break;
-                       case COLOR_TEAM4:
+                       case FL_TEAM_4:
                                pps_pink += points/wait_time;
                }
                total_pps += points/wait_time;
@@ -454,12 +441,12 @@ void dom_spawnteams()
 {
        float numteams = ((autocvar_g_domination_teams_override < 2) ? autocvar_g_domination_default_teams : autocvar_g_domination_teams_override);
 
-       dom_spawnteam("Red", COLOR_TEAM1-1, "models/domination/dom_red.md3", 0, "domination/claim.wav", "", "Red team has captured a control point");
-       dom_spawnteam("Blue", COLOR_TEAM2-1, "models/domination/dom_blue.md3", 0, "domination/claim.wav", "", "Blue team has captured a control point");
+       dom_spawnteam("Red", FL_TEAM_1-1, "models/domination/dom_red.md3", 0, "domination/claim.wav", "", "Red team has captured a control point");
+       dom_spawnteam("Blue", FL_TEAM_2-1, "models/domination/dom_blue.md3", 0, "domination/claim.wav", "", "Blue team has captured a control point");
        if(numteams > 2)
-               dom_spawnteam("Yellow", COLOR_TEAM3-1, "models/domination/dom_yellow.md3", 0, "domination/claim.wav", "", "Yellow team has captured a control point");
+               dom_spawnteam("Yellow", FL_TEAM_3-1, "models/domination/dom_yellow.md3", 0, "domination/claim.wav", "", "Yellow team has captured a control point");
        if(numteams > 3)
-               dom_spawnteam("Pink", COLOR_TEAM4-1, "models/domination/dom_pink.md3", 0, "domination/claim.wav", "", "Pink team has captured a control point");
+               dom_spawnteam("Pink", FL_TEAM_4-1, "models/domination/dom_pink.md3", 0, "domination/claim.wav", "", "Pink team has captured a control point");
        dom_spawnteam("", 0, "models/domination/dom_unclaimed.md3", 0, "", "", "");
 }
 
index 116eecbbf6b773613f7b299568df3ee31a5817d6..8f48ec379fa500dcfa4ab42679226bd526711975 100644 (file)
@@ -22,7 +22,6 @@ void freezetag_CheckWinner()
                return; // we still have active players on two or more teams, nobody won yet
 
        entity e, winner;
-       string teamname;
        winner = world;
 
        FOR_EACH_PLAYER(e)
@@ -36,18 +35,8 @@ void freezetag_CheckWinner()
 
        if(winner != world) // just in case a winner wasn't found
        {
-               if(winner.team == COLOR_TEAM1)
-                       teamname = "^1Red Team";
-               else if(winner.team == COLOR_TEAM2)
-                       teamname = "^4Blue Team";
-               else if(winner.team == COLOR_TEAM3)
-                       teamname = "^3Yellow Team";
-               else
-                       teamname = "^6Pink Team";
-               FOR_EACH_PLAYER(e) {
-                       centerprint(e, strcat(teamname, "^5 wins the round, all other teams were frozen.\n"));
-               }
-               bprint(teamname, "^5 wins the round since all the other teams were frozen.\n");
+               Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_CENTER, APP_TEAM_NUM_4(winner.team, CENTER_FREEZETAG_ROUND_WIN_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+               Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, APP_TEAM_NUM_4(winner.team, INFO_FREEZETAG_ROUND_WIN_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                TeamScore_AddToTeam(winner.team, ST_SCORE, +1);
        }
 
@@ -242,13 +231,13 @@ MUTATOR_HOOKFUNCTION(freezetag_RemovePlayer)
 {
        if(self.freezetag_frozen == 0 && self.health >= 1)
        {
-               if(self.team == COLOR_TEAM1)
+               if(self.team == FL_TEAM_1)
                        --redalive;
-               else if(self.team == COLOR_TEAM2)
+               else if(self.team == FL_TEAM_2)
                        --bluealive;
-               else if(self.team == COLOR_TEAM3)
+               else if(self.team == FL_TEAM_3)
                        --yellowalive;
-               else if(self.team == COLOR_TEAM4)
+               else if(self.team == FL_TEAM_4)
                        --pinkalive;
                --totalalive;
        }
@@ -265,13 +254,13 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDies)
 {
        if(self.freezetag_frozen == 0)
        {
-               if(self.team == COLOR_TEAM1)
+               if(self.team == FL_TEAM_1)
                        --redalive;
-               else if(self.team == COLOR_TEAM2)
+               else if(self.team == FL_TEAM_2)
                        --bluealive;
-               else if(self.team == COLOR_TEAM3)
+               else if(self.team == FL_TEAM_3)
                        --yellowalive;
-               else if(self.team == COLOR_TEAM4)
+               else if(self.team == FL_TEAM_4)
                        --pinkalive;
                --totalalive;
 
@@ -281,16 +270,16 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDies)
        if(frag_attacker == frag_target || frag_attacker == world)
        {
                if(frag_target.classname == STR_PLAYER)
-                       centerprint(frag_target, "^1You froze yourself.\n");
-               bprint("^7", frag_target.netname, "^1 froze himself.\n");
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_SELF, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+               Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_FREEZETAG_SELF, frag_target.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
        }
        else
        {
                if(frag_target.classname == STR_PLAYER)
-                       centerprint(frag_target, strcat("^1You were frozen by ^7", frag_attacker.netname, ".\n"));
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_FREEZETAG_FROZEN, frag_attacker.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                if(frag_attacker.classname == STR_PLAYER)
-                       centerprint(frag_attacker, strcat("^2You froze ^7", frag_target.netname, ".\n"));
-               bprint("^7", frag_target.netname, "^1 was frozen by ^7", frag_attacker.netname, ".\n");
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, frag_attacker, MSG_CENTER, CENTER_FREEZETAG_FREEZE, frag_target.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+               Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_FREEZETAG_FREEZE, frag_target.netname, frag_attacker.netname, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
        }
 
        frag_target.health = 1; // "respawn" the player :P
@@ -312,7 +301,7 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerSpawn)
        }
        if(warmup && time > warmup) // spawn too late, freeze player
        {
-               centerprint(self, "^1You spawned after the round started, you'll spawn as frozen.\n");
+               Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_CENTER, CENTER_FREEZETAG_SPAWN_LATE, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                freezetag_Freeze(world);
        }
 
@@ -376,15 +365,9 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerPreThink)
                                }
                        }
 
-                       if(n > 1)
-                               centerprint(self, strcat("^5You were revived by ^7", o.netname, "^5 et al.\n"));
-                       else
-                               centerprint(self, strcat("^5You were revived by ^7", o.netname, "^5.\n"));
-                       centerprint(o, strcat("^5You revived ^7", self.netname, "^5.\n"));
-                       if(n > 1)
-                               bprint("^7", o.netname, "^5 et al revived ^7", self.netname, "^5.\n");
-                       else
-                               bprint("^7", o.netname, "^5 revived ^7", self.netname, "^5.\n");
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, self, MSG_CENTER, CENTER_FREEZETAG_REVIVED, o.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+                       Send_Notification_Legacy_Wrapper(NOTIF_ONE, o, MSG_CENTER, CENTER_FREEZETAG_REVIVE, self.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+                       Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_FREEZETAG_REVIVE, self.netname, o.netname, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                }
 
                // now find EVERY teammate within reviving radius, set their revive_progress values correct
index 3be0b035272b013598402f91188aed6c003069b6..13acb68c7958084bc5544e15857d7ba6eeacbfd3 100644 (file)
@@ -101,9 +101,8 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth
        
        // messages and sounds
        ka_EventLog("pickup", other);
-       Send_KillNotification(other.netname, "", "", KA_PICKUPBALL, MSG_KA);
-       WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
-       WriteString(MSG_BROADCAST, strcat(other.netname, "^7 has picked up the ball!"));
+       Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_KEEPAWAY_PICKUP, other.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+       Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, other.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
        sound(self.owner, CH_TRIGGER, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere) 
        
        // scoring
@@ -144,9 +143,8 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
 
        // messages and sounds
        ka_EventLog("dropped", plyr);
-       Send_KillNotification(plyr.netname, "", "", KA_DROPBALL, MSG_KA);
-       WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
-       WriteString(MSG_BROADCAST, strcat(plyr.netname, "^7 has dropped the ball!"));
+       Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_KEEPAWAY_DROPPED, plyr.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+       Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_CENTER, CENTER_KEEPAWAY_DROPPED, plyr.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
        sound(other, CH_TRIGGER, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE);  // ATTN_NONE (it's a sound intended to be heard anywhere) 
        
        // scoring
@@ -254,7 +252,7 @@ MUTATOR_HOOKFUNCTION(ka_Scoring)
                }
                else if(!frag_attacker.ballcarried)
                        if(autocvar_g_keepaway_noncarrier_warn)
-                               centerprint(frag_attacker, "Killing people while you don't have the ball gives no points!");
+                               Send_Notification_Legacy_Wrapper(NOTIF_ONE_ONLY, frag_attacker, MSG_CENTER, CENTER_KEEPAWAY_WARN, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
 
                if(frag_attacker.ballcarried) // add to amount of kills while ballcarrier
                        PlayerScore_Add(frag_attacker, SP_SCORE, autocvar_g_keepaway_score_killac);
index 592fa327cfb7af6ae6b413369dcc6759573523a2..7755b0f45514e0b72c4eb3bfd1015bb1fe400b12 100644 (file)
@@ -40,10 +40,10 @@ float kh_keystatus[17];
 
 float kh_Team_ByID(float t)
 {
-       if(t == 0) return COLOR_TEAM1;
-       if(t == 1) return COLOR_TEAM2;
-       if(t == 2) return COLOR_TEAM3;
-       if(t == 3) return COLOR_TEAM4;
+       if(t == 0) return FL_TEAM_1;
+       if(t == 1) return FL_TEAM_2;
+       if(t == 2) return FL_TEAM_3;
+       if(t == 3) return FL_TEAM_4;
        return 0;
 }
 
@@ -361,13 +361,13 @@ void kh_Key_AssignTo(entity key, entity player)  // runs every time a key is pic
                        WaypointSprite_AttachCarrier("", player, RADARICON_FLAGCARRIER, colormapPaletteColor(player.team - 1, 0));
                        player.waypointsprite_attachedforcarrier.waypointsprite_visible_for_player = kh_KeyCarrier_waypointsprite_visible_for_player;
                        WaypointSprite_UpdateRule(player.waypointsprite_attachedforcarrier, player.team, SPRITERULE_TEAMPLAY);
-                       if(player.team == COLOR_TEAM1)
+                       if(player.team == FL_TEAM_1)
                                WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, "keycarrier-red", "keycarrier-friend", "keycarrier-red");
-                       else if(player.team == COLOR_TEAM2)
+                       else if(player.team == FL_TEAM_2)
                                WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, "keycarrier-blue", "keycarrier-friend", "keycarrier-blue");
-                       else if(player.team == COLOR_TEAM3)
+                       else if(player.team == FL_TEAM_3)
                                WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, "keycarrier-yellow", "keycarrier-friend", "keycarrier-yellow");
-                       else if(player.team == COLOR_TEAM4)
+                       else if(player.team == FL_TEAM_4)
                                WaypointSprite_UpdateSprites(player.waypointsprite_attachedforcarrier, "keycarrier-pink", "keycarrier-friend", "keycarrier-pink");
                        if(!kh_no_radar_circles)
                                WaypointSprite_Ping(player.waypointsprite_attachedforcarrier);
@@ -541,7 +541,7 @@ void kh_WinnerTeam(float teem)  // runs when a team wins
                        bprint(key.owner.netname);
                        first = FALSE;
                }
-       bprint("^7 captured the keys for the ", ColoredTeamName(teem), "\n");
+       bprint("^7 captured the keys for the ", Team_ColoredFullName(teem), "\n");
 
        first = TRUE;
        midpoint = '0 0 0';
@@ -567,7 +567,7 @@ void kh_WinnerTeam(float teem)  // runs when a team wins
                te_lightning2(world, lastorigin, firstorigin);
        }
        midpoint = midpoint * (1 / kh_teams);
-       te_customflash(midpoint, 1000, 1, TeamColor(teem) * 0.5 + '0.5 0.5 0.5');  // make the color >=0.5 in each component
+       te_customflash(midpoint, 1000, 1, Team_ColorRGB(teem) * 0.5 + '0.5 0.5 0.5');  // make the color >=0.5 in each component
 
        play2all(kh_sound_capture);
        kh_FinishRound();
@@ -596,7 +596,7 @@ void kh_LoserTeam(float teem, entity lostkey)  // runs when a player pushes a fl
                kh_Scores_Event(attacker, world, "push", autocvar_g_balance_keyhunt_score_push, 0);
                PlayerScore_Add(attacker, SP_KH_PUSHES, 1);
                centerprint(attacker, "Your push is the best!");
-               bprint("The ", ColoredTeamName(teem), "^7 could not take care of the ", lostkey.netname, "^7 when ", attacker.netname, "^7 came\n");
+               bprint("The ", Team_ColoredFullName(teem), "^7 could not take care of the ", lostkey.netname, "^7 when ", attacker.netname, "^7 came\n");
        }
        else
        {
@@ -656,7 +656,7 @@ void kh_LoserTeam(float teem, entity lostkey)  // runs when a player pushes a fl
                        --j;
                }
 
-               bprint("The ", ColoredTeamName(teem), "^7 could not take care of the ", lostkey.netname, "\n");
+               bprint("The ", Team_ColoredFullName(teem), "^7 could not take care of the ", lostkey.netname, "\n");
        }
        play2all(kh_sound_destroy);
        te_tarexplosion(lostkey.origin);
@@ -715,7 +715,7 @@ void kh_Key_Think()  // runs all the time
                                else
                                        Send_CSQC_Centerprint_Generic(head, CPID_KH_MSG, "All keys are in your team's hands!\n\nHelp the key carriers to meet!", 0, 0);
                        else
-                               Send_CSQC_Centerprint_Generic(head, CPID_KH_MSG, strcat("All keys are in the ", ColoredTeamName(kh_interferemsg_team), "^7's hands!\n\nInterfere ^1NOW^7!"), 0, 0);
+                               Send_CSQC_Centerprint_Generic(head, CPID_KH_MSG, strcat("All keys are in the ", Team_ColoredFullName(kh_interferemsg_team), "^7's hands!\n\nInterfere ^1NOW^7!"), 0, 0);
                }
        }
 
@@ -748,21 +748,21 @@ void kh_Key_Spawn(entity initial_owner, float angle, float i)  // runs every tim
        key.kh_dropperteam = 0;
        key.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
        setsize(key, KH_KEY_MIN, KH_KEY_MAX);
-       key.colormod = TeamColor(initial_owner.team) * KH_KEY_BRIGHTNESS;
+       key.colormod = Team_ColorRGB(initial_owner.team) * KH_KEY_BRIGHTNESS;
        key.reset = key_reset;
 
        switch(initial_owner.team)
        {
-               case COLOR_TEAM1:
+               case FL_TEAM_1:
                        key.netname = "^1red key";
                        break;
-               case COLOR_TEAM2:
+               case FL_TEAM_2:
                        key.netname = "^4blue key";
                        break;
-               case COLOR_TEAM3:
+               case FL_TEAM_3:
                        key.netname = "^3yellow key";
                        break;
-               case COLOR_TEAM4:
+               case FL_TEAM_4:
                        key.netname = "^6pink key";
                        break;
                default:
@@ -876,7 +876,7 @@ string kh_CheckEnoughPlayers()  // checks enough player are present, runs after
                {
                        if(result != "")
                                result = strcat(result, ", ");
-                       result = strcat(result, ColoredTeamName(teem));
+                       result = strcat(result, Team_ColoredFullName(teem));
                }
        }
        return result;
index 62cfd01ad867250673f406bfc68ab7ea99841671..74698d371d30c7b918e46d99d6944d0cf4931d4a 100644 (file)
@@ -49,7 +49,7 @@ void nexball_setstatus(void)
        {
                if(self.ballcarried.teamtime && (self.ballcarried.teamtime < time))
                {
-                       bprint("The ", ColoredTeamName(self.team), " held the ball for too long.\n");
+                       bprint("The ", Team_ColoredFullName(self.team), " held the ball for too long.\n");
                        oldself = self;
                        self = self.ballcarried;
                        DropBall(self, self.owner.origin, '0 0 0');
@@ -204,7 +204,8 @@ void ResetBall(void)
        if(self.cnt < 2)        // step 1
        {
                if(time == self.teamtime)
-                       bprint("The ", ColoredTeamName(self.team), " held the ball for too long.\n");
+                       bprint("The ", Team_ColoredFullName(self.team), " held the ball for too long.\n");
+
                self.touch = func_null;
                self.movetype = MOVETYPE_NOCLIP;
                self.velocity = '0 0 0'; // just in case?
@@ -341,9 +342,9 @@ void GoalTouch(void)
        {
                LogNB("fault", ball.pusher);
                if(nb_teams == 2)
-                       bprint(ColoredTeamName(otherteam), " gets a point due to ", pname, "^7's silliness.\n");
+                       bprint(Team_ColoredFullName(otherteam), " gets a point due to ", pname, "^7's silliness.\n");
                else
-                       bprint(ColoredTeamName(ball.team), " loses a point due to ", pname, "^7's silliness.\n");
+                       bprint(Team_ColoredFullName(ball.team), " loses a point due to ", pname, "^7's silliness.\n");
                pscore = -1;
        }
        else if(self.team == GOAL_OUT)
@@ -358,7 +359,7 @@ void GoalTouch(void)
        else                                                       //score
        {
                LogNB(strcat("goal:", ftos(self.team)), ball.pusher);
-               bprint("Goaaaaal! ", pname, "^7 scored a point for the ", ColoredTeamName(ball.team), ".\n");
+               bprint("Goaaaaal! ", pname, "^7 scored a point for the ", Team_ColoredFullName(ball.team), ".\n");
                pscore = 1;
        }
 
@@ -424,28 +425,28 @@ void nb_spawnteams(void)
        {
                switch(e.team)
                {
-               case COLOR_TEAM1:
+               case FL_TEAM_1:
                        if(!t_r)
                        {
                                nb_spawnteam("Red", e.team-1)   ;
                                t_r = 1;
                        }
                        break;
-               case COLOR_TEAM2:
+               case FL_TEAM_2:
                        if(!t_b)
                        {
                                nb_spawnteam("Blue", e.team-1)  ;
                                t_b = 1;
                        }
                        break;
-               case COLOR_TEAM3:
+               case FL_TEAM_3:
                        if(!t_y)
                        {
                                nb_spawnteam("Yellow", e.team-1);
                                t_y = 1;
                        }
                        break;
-               case COLOR_TEAM4:
+               case FL_TEAM_4:
                        if(!t_p)
                        {
                                nb_spawnteam("Pink", e.team-1)  ;
@@ -575,22 +576,22 @@ void SpawnGoal(void)
 
 void spawnfunc_nexball_redgoal(void)
 {
-       self.team = COLOR_TEAM1;
+       self.team = FL_TEAM_1;
        SpawnGoal();
 }
 void spawnfunc_nexball_bluegoal(void)
 {
-       self.team = COLOR_TEAM2;
+       self.team = FL_TEAM_2;
        SpawnGoal();
 }
 void spawnfunc_nexball_yellowgoal(void)
 {
-       self.team = COLOR_TEAM3;
+       self.team = FL_TEAM_3;
        SpawnGoal();
 }
 void spawnfunc_nexball_pinkgoal(void)
 {
-       self.team = COLOR_TEAM4;
+       self.team = FL_TEAM_4;
        SpawnGoal();
 }
 
index dd0152ed084311be37509b34e5471531386afdcc..ee07c8f40f6a867d5e2db2a9bdd0985699904f0f 100644 (file)
@@ -163,16 +163,16 @@ void onslaught_updatelinks()
                        }
                        if(l.goalentity.classname == "onslaught_generator")
                        {
-                               if(l.goalentity.team == COLOR_TEAM1)
+                               if(l.goalentity.team == FL_TEAM_1)
                                        l.enemy.isgenneighbor_red = TRUE;
-                               else if(l.goalentity.team == COLOR_TEAM2)
+                               else if(l.goalentity.team == FL_TEAM_2)
                                        l.enemy.isgenneighbor_blue = TRUE;
                        }
                        else
                        {
-                               if(l.goalentity.team == COLOR_TEAM1)
+                               if(l.goalentity.team == FL_TEAM_1)
                                        l.enemy.iscpneighbor_red = TRUE;
-                               else if(l.goalentity.team == COLOR_TEAM2)
+                               else if(l.goalentity.team == FL_TEAM_2)
                                        l.enemy.iscpneighbor_blue = TRUE;
                        }
                }
@@ -185,16 +185,16 @@ void onslaught_updatelinks()
                        }
                        if(l.enemy.classname == "onslaught_generator")
                        {
-                               if(l.enemy.team == COLOR_TEAM1)
+                               if(l.enemy.team == FL_TEAM_1)
                                        l.goalentity.isgenneighbor_red = TRUE;
-                               else if(l.enemy.team == COLOR_TEAM2)
+                               else if(l.enemy.team == FL_TEAM_2)
                                        l.goalentity.isgenneighbor_blue = TRUE;
                        }
                        else
                        {
-                               if(l.enemy.team == COLOR_TEAM1)
+                               if(l.enemy.team == FL_TEAM_1)
                                        l.goalentity.iscpneighbor_red = TRUE;
-                               else if(l.enemy.team == COLOR_TEAM2)
+                               else if(l.enemy.team == FL_TEAM_2)
                                        l.goalentity.iscpneighbor_blue = TRUE;
                        }
                }
@@ -254,10 +254,10 @@ void onslaught_updatelinks()
        {
                if (l.iscaptured)
                {
-                       if (l.team == COLOR_TEAM1) t1 = 1;
-                       if (l.team == COLOR_TEAM2) t2 = 1;
-                       if (l.team == COLOR_TEAM3) t3 = 1;
-                       if (l.team == COLOR_TEAM4) t4 = 1;
+                       if (l.team == FL_TEAM_1) t1 = 1;
+                       if (l.team == FL_TEAM_2) t2 = 1;
+                       if (l.team == FL_TEAM_3) t3 = 1;
+                       if (l.team == FL_TEAM_4) t4 = 1;
                }
                onslaught_generator_updatesprite(l);
                l = l.chain;
@@ -271,14 +271,14 @@ void onslaught_updatelinks()
 
 float onslaught_controlpoint_can_be_linked(entity cp, float t)
 {
-       if(t == COLOR_TEAM1)
+       if(t == FL_TEAM_1)
        {
                if(cp.isgenneighbor_red)
                        return 2;
                if(cp.iscpneighbor_red)
                        return 1;
        }
-       else if(t == COLOR_TEAM2)
+       else if(t == FL_TEAM_2)
        {
                if(cp.isgenneighbor_blue)
                        return 2;
@@ -354,7 +354,7 @@ float onslaught_controlpoint_attackable(entity cp, float t)
                // if there's already an icon built, nothing happens
                if(cp.team == t)
                {
-                       a = onslaught_controlpoint_can_be_linked(cp, COLOR_TEAM1 + COLOR_TEAM2 - t);
+                       a = onslaught_controlpoint_can_be_linked(cp, FL_TEAM_1 + FL_TEAM_2 - t);
                        if(a) // attackable by enemy?
                                return -2; // EMERGENCY!
                        return -1;
@@ -371,7 +371,7 @@ float onslaught_controlpoint_attackable(entity cp, float t)
                // free point
                if(onslaught_controlpoint_can_be_linked(cp, t))
                {
-                       a = onslaught_controlpoint_can_be_linked(cp, COLOR_TEAM1 + COLOR_TEAM2 - t);
+                       a = onslaught_controlpoint_can_be_linked(cp, FL_TEAM_1 + FL_TEAM_2 - t);
                        if(a == 2)
                                return 4; // GET THIS ONE NOW!
                        else
@@ -596,7 +596,7 @@ void onslaught_generator_damage(entity inflictor, entity attacker, float damage,
                if (time > self.pain_finished)
                {
                        self.pain_finished = time + 10;
-                       bprint(ColoredTeamName(self.team), " generator under attack!\n");
+                       bprint(Team_ColoredFullName(self.team), " generator under attack!\n");
                        play2team(self.team, "onslaught/generator_underattack.wav");
                }
        }
@@ -612,19 +612,19 @@ void onslaught_generator_damage(entity inflictor, entity attacker, float damage,
                lh = ceil(self.lasthealth / 100) * 100;
                h = ceil(self.health / 100) * 100;
                if(lh != h)
-                       bprint(ColoredTeamName(self.team), " generator has less than ", ftos(h), " health remaining\n");
+                       bprint(Team_ColoredFullName(self.team), " generator has less than ", ftos(h), " health remaining\n");
 #endif
                self.lasthealth = self.health;
        }
        else if not(inWarmupStage)
        {
                if (attacker == self)
-                       bprint(ColoredTeamName(self.team), " generator spontaneously exploded due to overtime!\n");
+                       bprint(Team_ColoredFullName(self.team), " generator spontaneously exploded due to overtime!\n");
                else
                {
                        string t;
-                       t = ColoredTeamName(attacker.team);
-                       bprint(ColoredTeamName(self.team), " generator destroyed by ", t, "!\n");
+                       t = Team_ColoredFullName(attacker.team);
+                       bprint(Team_ColoredFullName(self.team), " generator destroyed by ", t, "!\n");
                }
                self.iscaptured = FALSE;
                self.islinked = FALSE;
@@ -706,16 +706,16 @@ string onslaught_generator_waypointsprite_for_team(entity e, float t)
 {
        if(t == e.team)
        {
-               if(e.team == COLOR_TEAM1)
+               if(e.team == FL_TEAM_1)
                        return "ons-gen-red";
-               else if(e.team == COLOR_TEAM2)
+               else if(e.team == FL_TEAM_2)
                        return "ons-gen-blue";
        }
        if(e.isshielded)
                return "ons-gen-shielded";
-       if(e.team == COLOR_TEAM1)
+       if(e.team == FL_TEAM_1)
                return "ons-gen-red";
-       else if(e.team == COLOR_TEAM2)
+       else if(e.team == FL_TEAM_2)
                return "ons-gen-blue";
        return "";
 }
@@ -723,8 +723,8 @@ string onslaught_generator_waypointsprite_for_team(entity e, float t)
 void onslaught_generator_updatesprite(entity e)
 {
        string s1, s2, s3;
-       s1 = onslaught_generator_waypointsprite_for_team(e, COLOR_TEAM1);
-       s2 = onslaught_generator_waypointsprite_for_team(e, COLOR_TEAM2);
+       s1 = onslaught_generator_waypointsprite_for_team(e, FL_TEAM_1);
+       s2 = onslaught_generator_waypointsprite_for_team(e, FL_TEAM_2);
        s3 = onslaught_generator_waypointsprite_for_team(e, -1);
        WaypointSprite_UpdateSprites(e.sprite, s1, s2, s3);
 
@@ -734,14 +734,14 @@ void onslaught_generator_updatesprite(entity e)
                e.lastshielded = e.isshielded;
                if(e.lastshielded)
                {
-                       if(e.team == COLOR_TEAM1 || e.team == COLOR_TEAM2)
+                       if(e.team == FL_TEAM_1 || e.team == FL_TEAM_2)
                                WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, 0.5 * colormapPaletteColor(e.team - 1, FALSE));
                        else
                                WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, '0.5 0.5 0.5');
                }
                else
                {
-                       if(e.team == COLOR_TEAM1 || e.team == COLOR_TEAM2)
+                       if(e.team == FL_TEAM_1 || e.team == FL_TEAM_2)
                                WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, colormapPaletteColor(e.team - 1, FALSE));
                        else
                                WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_GENERATOR, '0.75 0.75 0.75');
@@ -758,25 +758,25 @@ string onslaught_controlpoint_waypointsprite_for_team(entity e, float t)
                a = onslaught_controlpoint_attackable(e, t);
                if(a == 3 || a == 4) // ATTACK/TOUCH THIS ONE NOW
                {
-                       if(e.team == COLOR_TEAM1)
+                       if(e.team == FL_TEAM_1)
                                return "ons-cp-atck-red";
-                       else if(e.team == COLOR_TEAM2)
+                       else if(e.team == FL_TEAM_2)
                                return "ons-cp-atck-blue";
                        else
                                return "ons-cp-atck-neut";
                }
                else if(a == -2) // DEFEND THIS ONE NOW
                {
-                       if(e.team == COLOR_TEAM1)
+                       if(e.team == FL_TEAM_1)
                                return "ons-cp-dfnd-red";
-                       else if(e.team == COLOR_TEAM2)
+                       else if(e.team == FL_TEAM_2)
                                return "ons-cp-dfnd-blue";
                }
                else if(e.team == t || a == -1 || a == 1) // own point, or fire at it
                {
-                       if(e.team == COLOR_TEAM1)
+                       if(e.team == FL_TEAM_1)
                                return "ons-cp-red";
-                       else if(e.team == COLOR_TEAM2)
+                       else if(e.team == FL_TEAM_2)
                                return "ons-cp-blue";
                }
                else if(a == 2) // touch it
@@ -784,9 +784,9 @@ string onslaught_controlpoint_waypointsprite_for_team(entity e, float t)
        }
        else
        {
-               if(e.team == COLOR_TEAM1)
+               if(e.team == FL_TEAM_1)
                        return "ons-cp-red";
-               else if(e.team == COLOR_TEAM2)
+               else if(e.team == FL_TEAM_2)
                        return "ons-cp-blue";
                else
                        return "ons-cp-neut";
@@ -797,13 +797,13 @@ string onslaught_controlpoint_waypointsprite_for_team(entity e, float t)
 void onslaught_controlpoint_updatesprite(entity e)
 {
        string s1, s2, s3;
-       s1 = onslaught_controlpoint_waypointsprite_for_team(e, COLOR_TEAM1);
-       s2 = onslaught_controlpoint_waypointsprite_for_team(e, COLOR_TEAM2);
+       s1 = onslaught_controlpoint_waypointsprite_for_team(e, FL_TEAM_1);
+       s2 = onslaught_controlpoint_waypointsprite_for_team(e, FL_TEAM_2);
        s3 = onslaught_controlpoint_waypointsprite_for_team(e, -1);
        WaypointSprite_UpdateSprites(e.sprite, s1, s2, s3);
 
        float sh;
-       sh = !(onslaught_controlpoint_can_be_linked(e, COLOR_TEAM1) || onslaught_controlpoint_can_be_linked(e, COLOR_TEAM2));
+       sh = !(onslaught_controlpoint_can_be_linked(e, FL_TEAM_1) || onslaught_controlpoint_can_be_linked(e, FL_TEAM_2));
 
        if(e.lastteam != e.team + 2 || e.lastshielded != sh || e.iscaptured != e.lastcaptured)
        {
@@ -821,14 +821,14 @@ void onslaught_controlpoint_updatesprite(entity e)
                }
                if(e.lastshielded)
                {
-                       if(e.team == COLOR_TEAM1 || e.team == COLOR_TEAM2)
+                       if(e.team == FL_TEAM_1 || e.team == FL_TEAM_2)
                                WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, 0.5 * colormapPaletteColor(e.team - 1, FALSE));
                        else
                                WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, '0.5 0.5 0.5');
                }
                else
                {
-                       if(e.team == COLOR_TEAM1 || e.team == COLOR_TEAM2)
+                       if(e.team == FL_TEAM_1 || e.team == FL_TEAM_2)
                                WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, colormapPaletteColor(e.team - 1, FALSE));
                        else
                                WaypointSprite_UpdateTeamRadar(e.sprite, RADARICON_CONTROLPOINT, '0.75 0.75 0.75');
@@ -910,10 +910,10 @@ void spawnfunc_onslaught_generator()
        if (!self.team)
                objerror("team must be set");
        
-       if(self.team == COLOR_TEAM1)
+       if(self.team == FL_TEAM_1)
         ons_red_generator = self;
 
-       if(self.team == COLOR_TEAM2)
+       if(self.team == FL_TEAM_2)
         ons_blue_generator = self;
         
        self.team_saved = self.team;
@@ -948,7 +948,7 @@ void spawnfunc_onslaught_generator()
        InitializeEntity(self, onslaught_generator_delayed, INITPRIO_LAST);
 
        WaypointSprite_SpawnFixed(string_null, self.origin + '0 0 128', self, sprite, RADARICON_NONE, '0 0 0');
-       WaypointSprite_UpdateRule(self.sprite, COLOR_TEAM2, SPRITERULE_TEAMPLAY);
+       WaypointSprite_UpdateRule(self.sprite, FL_TEAM_2, SPRITERULE_TEAMPLAY);
        WaypointSprite_UpdateMaxHealth(self.sprite, self.max_health);
        WaypointSprite_UpdateHealth(self.sprite, self.health);
 
@@ -988,7 +988,7 @@ void onslaught_controlpoint_icon_damage(entity inflictor, entity attacker, float
        if (attacker.classname == "player")
        {
                nag = FALSE;
-               if(self.team == COLOR_TEAM1)
+               if(self.team == FL_TEAM_1)
                {
                        if(time - ons_notification_time_team1 > 10)
                        {
@@ -996,7 +996,7 @@ void onslaught_controlpoint_icon_damage(entity inflictor, entity attacker, float
                                ons_notification_time_team1 = time;
                        }
                }
-               else if(self.team == COLOR_TEAM2)
+               else if(self.team == FL_TEAM_2)
                {
                        if(time - ons_notification_time_team2 > 10)
                        {
@@ -1035,8 +1035,8 @@ void onslaught_controlpoint_icon_damage(entity inflictor, entity attacker, float
                pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
                {
                        string t;
-                       t = ColoredTeamName(attacker.team);
-                       bprint(ColoredTeamName(self.team), " ", self.message, " control point destroyed by ", t, "\n");
+                       t = Team_ColoredFullName(attacker.team);
+                       bprint(Team_ColoredFullName(self.team), " ", self.message, " control point destroyed by ", t, "\n");
                        ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 25, "models/onslaught/controlpoint_icon_gib1.md3", 3, FALSE);
                        ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 45, "models/onslaught/controlpoint_icon_gib2.md3", 3, FALSE);
                        ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 45, "models/onslaught/controlpoint_icon_gib2.md3", 3, FALSE);
@@ -1234,7 +1234,7 @@ void onslaught_controlpoint_icon_buildthink()
                self.count = autocvar_g_onslaught_cp_regen * sys_frametime; // slow repair rate from now on
                self.think = onslaught_controlpoint_icon_think;
                sound(self, CH_TRIGGER, "onslaught/controlpoint_built.wav", VOL_BASE, ATTN_NORM);
-               bprint(ColoredTeamName(self.team), " captured ", self.owner.message, " control point\n");
+               bprint(Team_ColoredFullName(self.team), " captured ", self.owner.message, " control point\n");
                self.owner.iscaptured = TRUE;
 
                WaypointSprite_UpdateMaxHealth(self.owner.sprite, self.max_health);
@@ -1438,7 +1438,7 @@ void spawnfunc_onslaught_controlpoint()
        waypoint_spawnforitem(self);
 
        WaypointSprite_SpawnFixed(string_null, self.origin + '0 0 128', self, sprite, RADARICON_NONE, '0 0 0');
-       WaypointSprite_UpdateRule(self.sprite, COLOR_TEAM2, SPRITERULE_TEAMPLAY);
+       WaypointSprite_UpdateRule(self.sprite, FL_TEAM_2, SPRITERULE_TEAMPLAY);
 
        onslaught_updatelinks();
        
@@ -1476,28 +1476,28 @@ void onslaught_link_checkupdate()
        redpower = bluepower = 0;
        if(self.goalentity.islinked)
        {
-               if(self.goalentity.team == COLOR_TEAM1)
+               if(self.goalentity.team == FL_TEAM_1)
                        redpower = 1;
-               else if(self.goalentity.team == COLOR_TEAM2)
+               else if(self.goalentity.team == FL_TEAM_2)
                        bluepower = 1;
        }
        if(self.enemy.islinked)
        {
-               if(self.enemy.team == COLOR_TEAM1)
+               if(self.enemy.team == FL_TEAM_1)
                        redpower = 2;
-               else if(self.enemy.team == COLOR_TEAM2)
+               else if(self.enemy.team == FL_TEAM_2)
                        bluepower = 2;
        }
 
        float cc;
        if(redpower == 1 && bluepower == 2)
-               cc = (COLOR_TEAM1 - 1) * 0x01 + (COLOR_TEAM2 - 1) * 0x10;
+               cc = (FL_TEAM_1 - 1) * 0x01 + (FL_TEAM_2 - 1) * 0x10;
        else if(redpower == 2 && bluepower == 1)
-               cc = (COLOR_TEAM1 - 1) * 0x10 + (COLOR_TEAM2 - 1) * 0x01;
+               cc = (FL_TEAM_1 - 1) * 0x10 + (FL_TEAM_2 - 1) * 0x01;
        else if(redpower)
-               cc = (COLOR_TEAM1 - 1) * 0x11;
+               cc = (FL_TEAM_1 - 1) * 0x11;
        else if(bluepower)
-               cc = (COLOR_TEAM2 - 1) * 0x11;
+               cc = (FL_TEAM_2 - 1) * 0x11;
        else
                cc = 0;
 
@@ -1569,10 +1569,10 @@ MUTATOR_HOOKFUNCTION(ons_Spawn_Score)
     
        RandomSelection_Init();
        
-       if(self.team == COLOR_TEAM1)
+       if(self.team == FL_TEAM_1)
         RandomSelection_Add(ons_red_generator, 0, string_null, 1, 1);
        
-       if(self.team == COLOR_TEAM2)
+       if(self.team == FL_TEAM_2)
         RandomSelection_Add(ons_blue_generator, 0, string_null, 1, 1);
        
        entity _cp = findchain(classname, "onslaught_controlpoint"):
@@ -1611,7 +1611,7 @@ MUTATOR_HOOKFUNCTION(ons_PlayerSpawn)
     
        RandomSelection_Init();
     
-       if(self.team == COLOR_TEAM1)
+       if(self.team == FL_TEAM_1)
        {
            if(!_close_to_home)
             _trg_gen = ons_blue_generator;
@@ -1619,7 +1619,7 @@ MUTATOR_HOOKFUNCTION(ons_PlayerSpawn)
             _trg_gen  = ons_red_generator;        
        }
        
-       if(self.team == COLOR_TEAM2)
+       if(self.team == FL_TEAM_2)
        {
            if(_close_to_home)
             _trg_gen = ons_blue_generator;
@@ -1664,7 +1664,7 @@ MUTATOR_HOOKFUNCTION(ons_PlayerSpawn)
         if(!autocvar_g_onslaught_spawn_at_generator)
             return 0;
         
-        _trg_gen = ((self.team == COLOR_TEAM1) ? ons_red_generator : ons_blue_generator);
+        _trg_gen = ((self.team == FL_TEAM_1) ? ons_red_generator : ons_blue_generator);
         
         for(i = 0; i < 10; ++i)
         {
index 0645b4805446b17cd1baafe035225d4b4793fceb..a5fb0e8011aec4afc41397ecf28979cb9c24c9da 100644 (file)
@@ -392,9 +392,9 @@ MUTATOR_HOOKFUNCTION(superspec_SV_ParseClientCommand)
                if(cmd_argc == 2)
                {
                        if(argv(1) == "red")
-                               _team = COLOR_TEAM1;
+                               _team = FL_TEAM_1;
                        else
-                               _team = COLOR_TEAM2;
+                               _team = FL_TEAM_2;
                }
 
                FOR_EACH_PLAYER(_player)
index db93116109612dd97660f35306509908f43df41c..dcd144d31634b3474985f63f917c564dd02e41dd 100644 (file)
@@ -13,8 +13,11 @@ sys-post.qh
 ../warpzonelib/server.qh
 
 ../common/constants.qh
+../common/teams.qh
 ../common/util.qh
 ../common/items.qh
+../common/deathtypes.qh
+../common/notifications.qh
 ../common/explosion_equation.qh
 ../common/urllib.qh
 ../common/command/markup.qh
@@ -235,5 +238,6 @@ mutators/mutator_superspec.qc
 
 ../common/animdecide.qc
 ../common/util.qc
+../common/notifications.qc
 
 ../common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail
index 2742888b6179bab1e088d5d4a222b778f01af3e2..4b32c6af694d3615d3b905c6953277c14fb67dfc 100644 (file)
@@ -156,13 +156,13 @@ void race_setTime(string map, float t, string myuid, string mynetname, entity e)
                recorddifference = strcat(" ^1[+", TIME_ENCODED_TOSTRING(t - oldrec), "]");
                bprint(mynetname, "^7 couldn't break their ", race_placeName(player_prevpos), " place record of ", TIME_ENCODED_TOSTRING(oldrec), recorddifference, "\n");
                race_SendStatus(0, e); // "fail"
-               Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_FAIL, MSG_RACE);
+               Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_FAIL, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                return;
        } else if (!newpos) { // no ranking, time worse than the worst ranked
                recorddifference = strcat(" ^1[+", TIME_ENCODED_TOSTRING(t - race_readTime(GetMapname(), RANKINGS_CNT)), "]");
                bprint(mynetname, "^7 couldn't break the ", race_placeName(RANKINGS_CNT), " place record of ", TIME_ENCODED_TOSTRING(race_readTime(GetMapname(), RANKINGS_CNT)), recorddifference, "\n");
                race_SendStatus(0, e); // "fail"
-               Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_FAIL, MSG_RACE);
+               Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_FAIL, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                return;
        }
 
@@ -201,22 +201,22 @@ void race_setTime(string map, float t, string myuid, string mynetname, entity e)
                        bprint(mynetname, "^1 broke ", oldrec_holder, "^1's 1st place record with ", strcat(TIME_ENCODED_TOSTRING(t), recorddifference, "\n"));
                }
                race_SendStatus(3, e); // "new server record"
-               Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_SERVER_RECORD, MSG_RACE);
+               Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_NEW_RECORD, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
        } else {
                if(newpos == player_prevpos) {
                        recorddifference = strcat(" ^2[-", TIME_ENCODED_TOSTRING(oldrec - t), "]");
                        bprint(mynetname, "^5 improved their ", race_placeName(newpos), " ^5place record with ", TIME_ENCODED_TOSTRING(t), recorddifference, "\n");
                        race_SendStatus(1, e); // "new time"
-                       Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_NEW_TIME, MSG_RACE);
+                       Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_NEW_TIME, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                } else if (oldrec == 0) {
                        bprint(mynetname, "^2 set the ", race_placeName(newpos), " ^2place record with ", TIME_ENCODED_TOSTRING(t), "\n");
                        race_SendStatus(2, e); // "new rank"
-                       Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_NEW_RANK, MSG_RACE);
+                       Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_NEW_RANK, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                } else {
                        recorddifference = strcat(" ^2[-", TIME_ENCODED_TOSTRING(oldrec - t), "]");
                        bprint(mynetname, "^2 broke ", oldrec_holder, "^2's ", race_placeName(newpos), " ^2place record with ", strcat(TIME_ENCODED_TOSTRING(t), recorddifference, "\n"));
                        race_SendStatus(2, e); // "new rank"
-                       Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_NEW_TIME, MSG_RACE);
+                       Send_Notification_Legacy_Wrapper(NOTIF_ANY, world, MSG_INFO, INFO_RACE_NEW_RANK, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
                }
        }
 }
index 0df5b69af06fbc09c3809ddca9604a3d51a0f412..1d62a7084254e750e14c04136c37ca49e83245c3 100644 (file)
@@ -204,13 +204,13 @@ void ScoreInfo_Init(float teams)
                Net_LinkEntity(scores_initialized, FALSE, 0, ScoreInfo_SendEntity);
        }
        if(teams >= 1)
-               TeamScore_Spawn(COLOR_TEAM1, "Red");
+               TeamScore_Spawn(FL_TEAM_1, "Red");
        if(teams >= 2)
-               TeamScore_Spawn(COLOR_TEAM2, "Blue");
+               TeamScore_Spawn(FL_TEAM_2, "Blue");
        if(teams >= 3)
-               TeamScore_Spawn(COLOR_TEAM3, "Yellow");
+               TeamScore_Spawn(FL_TEAM_3, "Yellow");
        if(teams >= 4)
-               TeamScore_Spawn(COLOR_TEAM4, "Pink");
+               TeamScore_Spawn(FL_TEAM_4, "Pink");
 }
 
 /*
@@ -795,7 +795,7 @@ void Score_NicePrint_Team(entity to, float t, float w)
        sk = teamscorekeepers[t - 1];
        if(sk)
        {
-               s = strcat(s, ColoredTeamName(t));
+               s = strcat(s, Team_ColoredFullName(t));
                for(i = 0; i < MAX_TEAMSCORE; ++i)
                        if(teamscores_label[i] != "")
                        {
index 1ed2f533b3a923c93981ef14ad5403eb847a0f25..dddd5f1d4258f7409f2a4a0a8d91f5a3538ca681 100644 (file)
@@ -13,45 +13,6 @@ void TeamchangeFrags(entity e)
        PlayerScore_Clear(e);
 }
 
-vector TeamColor(float teem)
-{
-       switch(teem)
-       {
-               case COLOR_TEAM1:
-                       return '1 0.0625 0.0625';
-               case COLOR_TEAM2:
-                       return '0.0625 0.0625 1';
-               case COLOR_TEAM3:
-                       return '1 1 0.0625';
-               case COLOR_TEAM4:
-                       return '1 0.0625 1';
-               default:
-                       return '1 1 1';
-       }
-}
-
-string TeamName(float t)
-{
-       return strcat(Team_ColorName(t), " Team");
-}
-string ColoredTeamName(float t)
-{
-       return strcat(Team_ColorCode(t), Team_ColorName(t), " Team^7");
-}
-string TeamNoName(float t)
-{
-       // fixme: Search for team entities and get their .netname's!
-       if(t == 1)
-               return "Red Team";
-       if(t == 2)
-               return "Blue Team";
-       if(t == 3)
-               return "Yellow Team";
-       if(t == 4)
-               return "Pink Team";
-       return "Neutral Team";
-}
-
 void runematch_init();
 void tdm_init();
 void entcs_init();
@@ -416,13 +377,13 @@ void SetPlayerTeam(entity pl, float t, float s, float noprint)
        float _color;
 
        if(t == 4)
-               _color = COLOR_TEAM4 - 1;
+               _color = FL_TEAM_4 - 1;
        else if(t == 3)
-               _color = COLOR_TEAM3 - 1;
+               _color = FL_TEAM_3 - 1;
        else if(t == 2)
-               _color = COLOR_TEAM2 - 1;
+               _color = FL_TEAM_2 - 1;
        else
-               _color = COLOR_TEAM1 - 1;
+               _color = FL_TEAM_1 - 1;
 
        SetPlayerColors(pl,_color);
 
@@ -430,7 +391,7 @@ void SetPlayerTeam(entity pl, float t, float s, float noprint)
                LogTeamchange(pl.playerid, pl.team, 3);  // log manual team join
 
                if(!noprint)
-               bprint(pl.netname, "^7 has changed from ", TeamNoName(s), " to ", TeamNoName(t), "\n");
+               bprint(pl.netname, "^7 has changed from ", Team_NumberToColoredFullName(s), "^7 to ", Team_NumberToColoredFullName(t), "\n");
        }
 
 }
@@ -452,10 +413,10 @@ void CheckAllowedTeams (entity for_whom)
                head = findchain(classname, "onslaught_generator");
                while (head)
                {
-                       if (head.team == COLOR_TEAM1) c1 = 0;
-                       if (head.team == COLOR_TEAM2) c2 = 0;
-                       if (head.team == COLOR_TEAM3) c3 = 0;
-                       if (head.team == COLOR_TEAM4) c4 = 0;
+                       if (head.team == FL_TEAM_1) c1 = 0;
+                       if (head.team == FL_TEAM_2) c2 = 0;
+                       if (head.team == FL_TEAM_3) c3 = 0;
+                       if (head.team == FL_TEAM_4) c4 = 0;
                        head = head.chain;
                }
        }
@@ -497,13 +458,13 @@ void CheckAllowedTeams (entity for_whom)
                {
                        if(!(g_domination && head.netname == ""))
                        {
-                               if(head.team == COLOR_TEAM1)
+                               if(head.team == FL_TEAM_1)
                                        c1 = 0;
-                               else if(head.team == COLOR_TEAM2)
+                               else if(head.team == FL_TEAM_2)
                                        c2 = 0;
-                               else if(head.team == COLOR_TEAM3)
+                               else if(head.team == FL_TEAM_3)
                                        c3 = 0;
-                               else if(head.team == COLOR_TEAM4)
+                               else if(head.team == FL_TEAM_4)
                                        c4 = 0;
                        }
                        head = find(head, classname, teament_name);
@@ -533,13 +494,13 @@ void CheckAllowedTeams (entity for_whom)
        }
 
        // if player has a forced team, ONLY allow that one
-       if(self.team_forced == COLOR_TEAM1 && c1 >= 0)
+       if(self.team_forced == FL_TEAM_1 && c1 >= 0)
                c2 = c3 = c4 = -1;
-       else if(self.team_forced == COLOR_TEAM2 && c2 >= 0)
+       else if(self.team_forced == FL_TEAM_2 && c2 >= 0)
                c1 = c3 = c4 = -1;
-       else if(self.team_forced == COLOR_TEAM3 && c3 >= 0)
+       else if(self.team_forced == FL_TEAM_3 && c3 >= 0)
                c1 = c2 = c4 = -1;
-       else if(self.team_forced == COLOR_TEAM4 && c4 >= 0)
+       else if(self.team_forced == FL_TEAM_4 && c4 >= 0)
                c1 = c2 = c3 = -1;
 }
 
@@ -576,7 +537,7 @@ void GetTeamCounts(entity ignore)
                                bvalue = value;
                        else
                                bvalue = 0;
-                       if(t == COLOR_TEAM1)
+                       if(t == FL_TEAM_1)
                        {
                                if(c1 >= 0)
                                {
@@ -584,7 +545,7 @@ void GetTeamCounts(entity ignore)
                                        cb1 = cb1 + bvalue;
                                }
                        }
-                       if(t == COLOR_TEAM2)
+                       if(t == FL_TEAM_2)
                        {
                                if(c2 >= 0)
                                {
@@ -592,7 +553,7 @@ void GetTeamCounts(entity ignore)
                                        cb2 = cb2 + bvalue;
                                }
                        }
-                       if(t == COLOR_TEAM3)
+                       if(t == FL_TEAM_3)
                        {
                                if(c3 >= 0)
                                {
@@ -600,7 +561,7 @@ void GetTeamCounts(entity ignore)
                                        cb3 = cb3 + bvalue;
                                }
                        }
-                       if(t == COLOR_TEAM4)
+                       if(t == FL_TEAM_4)
                        {
                                if(c4 >= 0)
                                {
@@ -769,13 +730,13 @@ float JoinBestTeam(entity pl, float only_return_best, float forcebestteam)
        // if he's not on a valid team, then let other code put him on the smallest team
        if(!forcebestteam)
        {
-               if(     c1 >= 0 && pl.team == COLOR_TEAM1)
+               if(     c1 >= 0 && pl.team == FL_TEAM_1)
                        selectedteam = pl.team;
-               else if(c2 >= 0 && pl.team == COLOR_TEAM2)
+               else if(c2 >= 0 && pl.team == FL_TEAM_2)
                        selectedteam = pl.team;
-               else if(c3 >= 0 && pl.team == COLOR_TEAM3)
+               else if(c3 >= 0 && pl.team == FL_TEAM_3)
                        selectedteam = pl.team;
-               else if(c4 >= 0 && pl.team == COLOR_TEAM4)
+               else if(c4 >= 0 && pl.team == FL_TEAM_4)
                        selectedteam = pl.team;
                else
                        selectedteam = -1;
@@ -802,19 +763,19 @@ float JoinBestTeam(entity pl, float only_return_best, float forcebestteam)
                TeamchangeFrags(self);
                if(smallest == 1)
                {
-                       SetPlayerColors(pl, COLOR_TEAM1 - 1);
+                       SetPlayerColors(pl, FL_TEAM_1 - 1);
                }
                else if(smallest == 2)
                {
-                       SetPlayerColors(pl, COLOR_TEAM2 - 1);
+                       SetPlayerColors(pl, FL_TEAM_2 - 1);
                }
                else if(smallest == 3)
                {
-                       SetPlayerColors(pl, COLOR_TEAM3 - 1);
+                       SetPlayerColors(pl, FL_TEAM_3 - 1);
                }
                else if(smallest == 4)
                {
-                       SetPlayerColors(pl, COLOR_TEAM4 - 1);
+                       SetPlayerColors(pl, FL_TEAM_4 - 1);
                }
                else
                {
@@ -844,21 +805,21 @@ void SV_ChangeTeam(float _color)
        scolor = self.clientcolors & 0x0F;
        dcolor = _color & 0x0F;
 
-       if(scolor == COLOR_TEAM1 - 1)
+       if(scolor == FL_TEAM_1 - 1)
                steam = 1;
-       else if(scolor == COLOR_TEAM2 - 1)
+       else if(scolor == FL_TEAM_2 - 1)
                steam = 2;
-       else if(scolor == COLOR_TEAM3 - 1)
+       else if(scolor == FL_TEAM_3 - 1)
                steam = 3;
-       else // if(scolor == COLOR_TEAM4 - 1)
+       else // if(scolor == FL_TEAM_4 - 1)
                steam = 4;
-       if(dcolor == COLOR_TEAM1 - 1)
+       if(dcolor == FL_TEAM_1 - 1)
                dteam = 1;
-       else if(dcolor == COLOR_TEAM2 - 1)
+       else if(dcolor == FL_TEAM_2 - 1)
                dteam = 2;
-       else if(dcolor == COLOR_TEAM3 - 1)
+       else if(dcolor == FL_TEAM_3 - 1)
                dteam = 3;
-       else // if(dcolor == COLOR_TEAM4 - 1)
+       else // if(dcolor == FL_TEAM_4 - 1)
                dteam = 4;
 
        CheckAllowedTeams(self);
@@ -947,13 +908,13 @@ void ShufflePlayerOutOfTeam (float source_team)
        }
 
        if(source_team == 1)
-               steam = COLOR_TEAM1;
+               steam = FL_TEAM_1;
        else if(source_team == 2)
-               steam = COLOR_TEAM2;
+               steam = FL_TEAM_2;
        else if(source_team == 3)
-               steam = COLOR_TEAM3;
+               steam = FL_TEAM_3;
        else // if(source_team == 4)
-               steam = COLOR_TEAM4;
+               steam = FL_TEAM_4;
 
        lowest_bot = world;
        lowest_bot_score = 999999999;
@@ -1048,7 +1009,7 @@ void ShufflePlayerOutOfTeam (float source_team)
 
        if(selected.deadflag == DEAD_NO)
                Damage(selected, selected, selected, 100000, DEATH_AUTOTEAMCHANGE, selected.origin, '0 0 0');
-       centerprint(selected, strcat("You have been moved into a different team to improve team balance\nYou are now on: ", ColoredTeamName(selected.team)));
+       centerprint(selected, strcat("You have been moved into a different team to improve team balance\nYou are now on: ", Team_ColoredFullName(selected.team)));
 }
 
 // code from here on is just to support maps that don't have team entities
@@ -1072,12 +1033,12 @@ void tdm_spawnteams()
                numteams = autocvar_g_tdm_teams;
        numteams = bound(2, numteams, 4);
 
-       tdm_spawnteam("Red", COLOR_TEAM1-1);
-       tdm_spawnteam("Blue", COLOR_TEAM2-1);
+       tdm_spawnteam("Red", FL_TEAM_1-1);
+       tdm_spawnteam("Blue", FL_TEAM_2-1);
        if(numteams >= 3)
-               tdm_spawnteam("Yellow", COLOR_TEAM3-1);
+               tdm_spawnteam("Yellow", FL_TEAM_3-1);
        if(numteams >= 4)
-               tdm_spawnteam("Pink", COLOR_TEAM4-1);
+               tdm_spawnteam("Pink", FL_TEAM_4-1);
 }
 
 void tdm_delayedinit()
index b9c7dbfb8339e406603dbbea763f63c28ea81c24..429b8e5f9f8c55cdf709e2e405c5481dffb74527 100644 (file)
@@ -86,7 +86,7 @@ void bumb_fire_cannon(entity _gun, string _tagname, entity _owner)
        vehicles_projectile("bigplasma_muzzleflash", "weapons/flacexp3.wav",
                                                v, normalize(v_forward + randomvec() * autocvar_g_vehicle_bumblebee_cannon_spread) * autocvar_g_vehicle_bumblebee_cannon_speed,
                                                autocvar_g_vehicle_bumblebee_cannon_damage, autocvar_g_vehicle_bumblebee_cannon_radius, autocvar_g_vehicle_bumblebee_cannon_force,  0,
-                                               DEATH_BUMB_GUN, PROJECTILE_BUMBLE_GUN, 0, TRUE, TRUE, _owner);
+                                               DEATH_VH_BUMB_GUN, PROJECTILE_BUMBLE_GUN, 0, TRUE, TRUE, _owner);
 }
 
 float bumb_gunner_frame()
@@ -735,7 +735,7 @@ void bumb_blowup()
                                 autocvar_g_vehicle_bumblebee_blowup_edgedamage,
                                 autocvar_g_vehicle_bumblebee_blowup_radius, self,
                                 autocvar_g_vehicle_bumblebee_blowup_forceintensity,
-                                DEATH_WAKIBLOWUP, world);
+                                DEATH_VH_BUMB_DEATH, world);
 
        sound(self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM);
        pointparticles(particleeffectnum("explosion_large"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
index 93b27df9756a0deb3ef6452ebfc77e6df2878252..f5788c60b4b993a4631b2b4dbebe18456a136b85 100644 (file)
@@ -129,7 +129,7 @@ void racer_fire_cannon(string tagname)
     bolt = vehicles_projectile("wakizashi_gun_muzzleflash", "weapons/lasergun_fire.wav",
                            v, normalize(v_forward + randomvec() * autocvar_g_vehicle_racer_cannon_spread) * autocvar_g_vehicle_racer_cannon_speed,
                            autocvar_g_vehicle_racer_cannon_damage, autocvar_g_vehicle_racer_cannon_radius, autocvar_g_vehicle_racer_cannon_force,  0,
-                           DEATH_WAKIGUN, PROJECTILE_WAKICANNON, 0, TRUE, TRUE, self.owner);
+                           DEATH_VH_WAKI_GUN, PROJECTILE_WAKICANNON, 0, TRUE, TRUE, self.owner);
 
        // Fix z-aim (for chase mode)
     v = normalize(trace_endpos - bolt.origin);
@@ -243,7 +243,7 @@ void racer_fire_rocket(string tagname, entity trg)
     entity rocket = rocket = vehicles_projectile("wakizashi_rocket_launch", "weapons/rocket_fire.wav",
                            v, v_forward * autocvar_g_vehicle_racer_rocket_speed,
                            autocvar_g_vehicle_racer_rocket_damage, autocvar_g_vehicle_racer_rocket_radius, autocvar_g_vehicle_racer_rocket_force, 3,
-                           DEATH_WAKIROCKET, PROJECTILE_WAKIROCKET, 20, FALSE, FALSE, self.owner);
+                           DEATH_VH_WAKI_ROCKET, PROJECTILE_WAKIROCKET, 20, FALSE, FALSE, self.owner);
 
     rocket.lip              = autocvar_g_vehicle_racer_rocket_accel * sys_frametime;
     rocket.wait             = autocvar_g_vehicle_racer_rocket_turnrate;
@@ -542,7 +542,7 @@ void racer_blowup()
                                        autocvar_g_vehicle_racer_blowup_edgedamage,
                                        autocvar_g_vehicle_racer_blowup_radius, world,
                                        autocvar_g_vehicle_racer_blowup_forceintensity,
-                                       DEATH_WAKIBLOWUP, world);
+                                       DEATH_VH_WAKI_DEATH, world);
 
     self.nextthink  = time + autocvar_g_vehicle_racer_respawntime;
     self.think      = racer_spawn_default;
index 11b9081a6022dc72d9cbbaf45596fbba0fc59308..e899d4a31468b6a83d585babfee4d7f17287ffb3 100644 (file)
@@ -93,7 +93,7 @@ void raptor_bomblet_boom()
     RadiusDamage (self, self.realowner, autocvar_g_vehicle_raptor_bomblet_damage,
                                     autocvar_g_vehicle_raptor_bomblet_edgedamage,
                                     autocvar_g_vehicle_raptor_bomblet_radius, world,
-                                    autocvar_g_vehicle_raptor_bomblet_force, DEATH_RAPTOR_BOMB, world);
+                                    autocvar_g_vehicle_raptor_bomblet_force, DEATH_VH_RAPT_BOMB, world);
     remove(self);
 }
 
@@ -124,7 +124,7 @@ void raptor_bomb_burst()
     entity bomblet;
     float i;
 
-    Damage_DamageInfo(self.origin, 0, 0, 0, '0 0 0', DEATH_RAPTOR_BOMB_SPLIT, 0, self);
+    Damage_DamageInfo(self.origin, 0, 0, 0, '0 0 0', DEATH_VH_RAPT_FRAGMENT, 0, self);
 
     for(i = 0; i < autocvar_g_vehicle_raptor_bomblets; ++i)
     {
@@ -185,7 +185,7 @@ void raptor_fire_cannon(entity gun, string tagname)
     vehicles_projectile("raptor_cannon_muzzleflash", "weapons/lasergun_fire.wav",
                            gettaginfo(gun, gettagindex(gun, tagname)), normalize(v_forward + randomvec() * autocvar_g_vehicle_raptor_cannon_spread) * autocvar_g_vehicle_raptor_cannon_speed,
                            autocvar_g_vehicle_raptor_cannon_damage, autocvar_g_vehicle_raptor_cannon_radius, autocvar_g_vehicle_raptor_cannon_force,  0,
-                           DEATH_RAPTOR_CANNON, PROJECTILE_RAPTORCANNON, 0, TRUE, TRUE, self.owner);
+                           DEATH_VH_RAPT_CANNON, PROJECTILE_RAPTORCANNON, 0, TRUE, TRUE, self.owner);
 }
 
 void raptor_think()
@@ -690,7 +690,7 @@ void raptor_blowup()
 {
     self.deadflag    = DEAD_DEAD;
     self.vehicle_exit(VHEF_NORMAL);
-    RadiusDamage (self, self.enemy, 250, 15, 250, world, 250, DEATH_WAKIBLOWUP, world);
+    RadiusDamage (self, self.enemy, 250, 15, 250, world, 250, DEATH_VH_RAPT_DEATH, world);
 
     self.alpha          = -1;
     self.movetype       = MOVETYPE_NONE;
index 9bbdd096a259e609b5aa3bfdb46cc485f7393569..ff6a2ab27e87deaa35515d5e429bbe6a83000a25 100644 (file)
@@ -257,7 +257,7 @@ void spiderbot_rocket_do()
             rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav",
                                    v, normalize(randomvec() * autocvar_g_vehicle_spiderbot_rocket_spread + v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
                                    autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
-                                   DEATH_SBROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, TRUE, self.owner);
+                                   DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, TRUE, self.owner);
             crosshair_trace(self.owner);
             float _dist = (random() * autocvar_g_vehicle_spiderbot_rocket_radius) + vlen(v - trace_endpos);
             _dist -= (random() * autocvar_g_vehicle_spiderbot_rocket_radius) ;
@@ -271,7 +271,7 @@ void spiderbot_rocket_do()
             rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav",
                                    v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
                                    autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
-                                   DEATH_SBROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, FALSE, self.owner);
+                                   DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, FALSE, self.owner);
             crosshair_trace(self.owner);
             rocket.pos1       = trace_endpos;
             rocket.nextthink  = time;
@@ -283,7 +283,7 @@ void spiderbot_rocket_do()
             rocket = vehicles_projectile("spiderbot_rocket_launch", "weapons/rocket_fire.wav",
                                    v, normalize(v_forward) * autocvar_g_vehicle_spiderbot_rocket_speed,
                                    autocvar_g_vehicle_spiderbot_rocket_damage, autocvar_g_vehicle_spiderbot_rocket_radius, autocvar_g_vehicle_spiderbot_rocket_force, 1,
-                                   DEATH_SBROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, TRUE, self.owner);
+                                   DEATH_VH_SPID_ROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, TRUE, self.owner);
             
             crosshair_trace(self.owner);
             
@@ -498,11 +498,11 @@ float spiderbot_frame()
 //void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float headshotbonus, float force, float dtype, float tracereffects, float gravityfactor, float bulletconstant)
 
             fireBallisticBullet(v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_speed,
-                                5, autocvar_g_vehicle_spiderbot_minigun_damage, 0, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_SBMINIGUN, 0, 1, autocvar_g_vehicle_spiderbot_minigun_bulletconstant);
+                                5, autocvar_g_vehicle_spiderbot_minigun_damage, 0, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN, 0, 1, autocvar_g_vehicle_spiderbot_minigun_bulletconstant);
             endFireBallisticBullet();
 
 //            fireBullet (v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_damage,
-//                autocvar_g_vehicle_spiderbot_minigun_spread, DEATH_SBMINIGUN, 0);
+//                autocvar_g_vehicle_spiderbot_minigun_spread, DEATH_VH_SPID_MINIGUN, 0);
 
             sound (gun, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
             //trailparticles(self, particleeffectnum("spiderbot_minigun_trail"), v, trace_endpos);
@@ -722,7 +722,7 @@ void spiderbot_blowup()
     SUB_SetFade(g1, time, min(autocvar_g_vehicle_spiderbot_respawntime, 10));
     SUB_SetFade(g2, time, min(autocvar_g_vehicle_spiderbot_respawntime, 10));
 
-    RadiusDamage (self, self.enemy, 250, 15, 250, world, 250, DEATH_SBBLOWUP, world);
+    RadiusDamage (self, self.enemy, 250, 15, 250, world, 250, DEATH_VH_SPID_DEATH, world);
 
     self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = -1;
     self.movetype   = MOVETYPE_NONE;
index 5e377079e01dd2fc0b1377fde2a884a17e50656a..e23cc702cc706cdb912cf0e6602d0c5ce351aa82 100644 (file)
@@ -544,7 +544,7 @@ void vehicles_touch()
         if(vehicles_crushable(other))
         {
             if(vlen(self.velocity) != 0)
-                Damage(other, self, self.owner, autocvar_g_vehicles_crush_dmg, DEATH_VHCRUSH, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicles_crush_force);
+                Damage(other, self, self.owner, autocvar_g_vehicles_crush_dmg, DEATH_VH_CRUSH, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicles_crush_force);
 
             return; // Dont do selfdamage when hitting "soft targets".
         }
@@ -1033,7 +1033,7 @@ void vehicles_showwp()
     }
 
     if(teamplay && self.team)
-           rgb = TeamColor(self.team);
+           rgb = Team_ColorRGB(self.team);
     else
            rgb = '1 1 1';
     WaypointSprite_Spawn("vehicle", 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE, RADARICON_POWERUP, rgb);
index 1bb9ad6004e7853f71acd590f9837049df3bfe7e..b2472df2ae0fa5798f7cc3e80de744210cf88827 100644 (file)
@@ -684,6 +684,14 @@ float w_crylink(float req)
        {
                W_Reload(min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo), autocvar_g_balance_crylink_reload_ammo, autocvar_g_balance_crylink_reload_time, "weapons/reload.wav");
        }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               return WEAPON_CRYLINK_SUICIDE;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               return WEAPON_CRYLINK_MURDER;
+       }
        return TRUE;
 }
 #endif
@@ -712,19 +720,6 @@ float w_crylink(float req)
                precache_sound("weapons/crylink_impact2.wav");
                precache_sound("weapons/crylink_impact.wav");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-       {
-               w_deathtypestring = _("%s succeeded at self-destructing themself with the Crylink");
-       }
-       else if (req == WR_KILLMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_BOUNCE)
-                       w_deathtypestring = _("%s could not hide from %s's Crylink"); // unchecked: SPLASH (SECONDARY can't be)
-               else if(w_deathtype & HITTYPE_SPLASH)
-                       w_deathtypestring = _("%s was too close to %s's Crylink"); // unchecked: SECONDARY
-               else
-                       w_deathtypestring = _("%s took a close look at %s's Crylink"); // unchecked: SECONDARY
-       }
        return TRUE;
 }
 #endif
index 082e454ace2de00516090a35270868346ba7a8c8..20aac867e91ae0f3b856be81fecc325b96f14180 100644 (file)
@@ -543,6 +543,27 @@ float w_electro(float req)
        {
                W_Reload(min(autocvar_g_balance_electro_primary_ammo, autocvar_g_balance_electro_secondary_ammo), autocvar_g_balance_electro_reload_ammo, autocvar_g_balance_electro_reload_time, "weapons/reload.wav");
        }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               if(w_deathtype & HITTYPE_SECONDARY)
+                       return WEAPON_ELECTRO_SUICIDE_ORBS;
+               else
+                       return WEAPON_ELECTRO_SUICIDE_BOLT;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               if(w_deathtype & HITTYPE_SECONDARY)
+               {
+                       return WEAPON_ELECTRO_MURDER_ORBS;
+               }
+               else
+               {
+                       if(w_deathtype & HITTYPE_BOUNCE)
+                               return WEAPON_ELECTRO_MURDER_COMBO;
+                       else
+                               return WEAPON_ELECTRO_MURDER_BOLT;
+               }
+       }
        return TRUE;
 }
 #endif
@@ -581,32 +602,6 @@ float w_electro(float req)
                precache_sound("weapons/electro_impact.wav");
                precache_sound("weapons/electro_impact_combo.wav");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s could not remember where they put their electro plasma");
-               else
-                       w_deathtypestring = _("%s played with electro plasma");
-       }
-       else if (req == WR_KILLMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_SECONDARY)
-               {
-                       if(w_deathtype & HITTYPE_SPLASH) // unchecked: BOUNCE
-                               w_deathtypestring = _("%s just noticed %s's electro plasma");
-                       else // unchecked: BOUNCE
-                               w_deathtypestring = _("%s got in touch with %s's electro plasma");
-               }
-               else
-               {
-                       if(w_deathtype & HITTYPE_BOUNCE) // combo
-                               w_deathtypestring = _("%s felt the electrifying air of %s's electro combo");
-                       else if(w_deathtype & HITTYPE_SPLASH)
-                               w_deathtypestring = _("%s got too close to %s's blue electro bolt");
-                       else
-                               w_deathtypestring = _("%s was blasted by %s's blue electro bolt");
-               }
-       }
        return TRUE;
 }
 #endif
index 02557ad94e0da5db1a889ed76bb4abc2afe2fd7a..d7cd57e8225000bf1ddadf35529e5900925f51a4 100644 (file)
@@ -374,6 +374,24 @@ float w_fireball(float req)
        {
                self.fireball_primarytime = time;
        }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               if(w_deathtype & HITTYPE_SECONDARY)
+                       return WEAPON_FIREBALL_SUICIDE_FIREMINE;
+               else
+                       return WEAPON_FIREBALL_SUICIDE_BLAST;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               if(w_deathtype & HITTYPE_SECONDARY)
+               {
+                       return WEAPON_FIREBALL_MURDER_FIREMINE;
+               }
+               else
+               {
+                       return WEAPON_FIREBALL_MURDER_BLAST;
+               }
+       }
        return TRUE;
 }
 #endif
@@ -399,37 +417,6 @@ float w_fireball(float req)
        {
                precache_sound("weapons/fireball_impact2.wav");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s forgot about some firemine");
-               else
-                       w_deathtypestring = _("%s should have used a smaller gun");
-       }
-       else if (req == WR_KILLMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_SECONDARY)
-               {
-                       if(w_deathtype & HITTYPE_HEADSHOT)
-                               w_deathtypestring = _("%s tried to catch %s's firemine");
-                       else
-                               w_deathtypestring = _("%s fatefully ignored %s's firemine");
-               }
-               else
-               {
-                       if(w_deathtype & HITTYPE_BOUNCE)
-                       {
-                               if(w_deathtype & HITTYPE_SPLASH) // BFG effect
-                                       w_deathtypestring = _("%s could not hide from %s's fireball");
-                               else // laser
-                                       w_deathtypestring = _("%s saw the pretty lights of %s's fireball");
-                       }
-                       else if(w_deathtype & HITTYPE_SPLASH)
-                               w_deathtypestring = _("%s got too close to %s's fireball");
-                       else
-                               w_deathtypestring = _("%s tasted %s's fireball");
-               }
-       }
        return TRUE;
 }
 #endif
index 91b50fe7f76642cf336763a11243baa401a482d5..b463a4e71ab0c18823678c8bd9d992060698dbe0 100644 (file)
@@ -366,6 +366,20 @@ float w_glauncher(float req)
        {
                W_Reload(min(autocvar_g_balance_grenadelauncher_primary_ammo, autocvar_g_balance_grenadelauncher_secondary_ammo), autocvar_g_balance_grenadelauncher_reload_ammo, autocvar_g_balance_grenadelauncher_reload_time, "weapons/reload.wav");
        }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               if(w_deathtype & HITTYPE_SECONDARY)
+                       return WEAPON_MORTAR_SUICIDE_BOUNCE;
+               else
+                       return WEAPON_MORTAR_SUICIDE_EXPLODE;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               if(w_deathtype & HITTYPE_SECONDARY)
+                       return WEAPON_MORTAR_MURDER_BOUNCE;
+               else
+                       return WEAPON_MORTAR_MURDER_EXPLODE;
+       }
        return TRUE;
 }
 #endif
@@ -384,23 +398,6 @@ float w_glauncher(float req)
        {
                precache_sound("weapons/grenade_impact.wav");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s didn't see their own grenade");
-               else
-                       w_deathtypestring = _("%s blew themself up with their grenadelauncher");
-       }
-       else if (req == WR_KILLMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_SPLASH)
-                       if(w_deathtype & HITTYPE_BOUNCE) // (must be secondary then)
-                               w_deathtypestring = _("%s didn't see %s's grenade");
-                       else // unchecked: SECONDARY
-                               w_deathtypestring = _("%s almost dodged %s's grenade");
-               else // unchecked: SECONDARY, BOUNCE
-                       w_deathtypestring = _("%s ate %s's grenade");
-       }
        return TRUE;
 }
 #endif
index 55e361ebbcdb9ca395f145407edc9b0d957f07ef..b4b79abb832363bfea7fcd11d775bb0c8eb84554 100644 (file)
@@ -432,6 +432,17 @@ float w_hagar(float req)
                if not(self.hagar_load) // require releasing loaded rockets first
                        W_Reload(min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo), autocvar_g_balance_hagar_reload_ammo, autocvar_g_balance_hagar_reload_time, "weapons/reload.wav");
        }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               return WEAPON_HAGAR_SUICIDE;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               if(w_deathtype & HITTYPE_SECONDARY)
+                       return WEAPON_HAGAR_MURDER_BURST;
+               else
+                       return WEAPON_HAGAR_MURDER_SPRAY;
+       }
        return TRUE;
 }
 #endif
@@ -459,15 +470,6 @@ float w_hagar(float req)
                precache_sound("weapons/hagexp2.wav");
                precache_sound("weapons/hagexp3.wav");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s played with tiny hagar rockets");
-       else if (req == WR_KILLMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_BOUNCE) // must be secondary; unchecked: SPLASH
-                       w_deathtypestring = _("%s was pummeled with a burst of hagar rockets by %s");
-               else // unchecked: SPLASH, SECONDARY
-                       w_deathtypestring = _("%s was pummeled with hagar rockets by %s");
-       }
        return TRUE;
 }
 #endif
index 716d0a177cd811bc5c4f91acd7c5238384b1c719..142a231923214be2cfd8a91b921fa00e88d56d15 100644 (file)
@@ -219,6 +219,14 @@ float w_hlac(float req)
        {
                W_Reload(min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo), autocvar_g_balance_hlac_reload_ammo, autocvar_g_balance_hlac_reload_time, "weapons/reload.wav");
        }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               return WEAPON_HLAC_SUICIDE;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               return WEAPON_HLAC_MURDER;
+       }
        return TRUE;
 }
 #endif
@@ -237,10 +245,6 @@ float w_hlac(float req)
        {
                precache_sound("weapons/laserimpact.wav");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s should have used a smaller gun");
-       else if (req == WR_KILLMESSAGE)
-               w_deathtypestring = _("%s was cut down with a HLAC by %s");
        return TRUE;
 }
 #endif
index c6644f1003be9867516d17c0db4f15d828af9da3..1f9dda17b6adcad942d336bd3ea224b2e0416092 100644 (file)
@@ -265,6 +265,14 @@ float w_hook(float req)
        {
                self.hook_refire = time;
        }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               return FALSE;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               return WEAPON_HOOK_MURDER;
+       }
        return TRUE;
 }
 #endif
@@ -283,10 +291,6 @@ float w_hook(float req)
        {
                precache_sound("weapons/hookbomb_impact.wav");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s did the impossible");
-       else if (req == WR_KILLMESSAGE)
-               w_deathtypestring = _("%s was caught in %s's hook gravity bomb");
        return TRUE;
 }
 #endif
index ecedc89fc1bb5748ccba92a8f7b7e750c49f3ae4..69dcb17aa5c292d4328b539668c8dac674f76935 100644 (file)
@@ -291,6 +291,14 @@ float w_laser(float req)
        {
                W_Reload(0, autocvar_g_balance_laser_reload_ammo, autocvar_g_balance_laser_reload_time, "weapons/reload.wav");
        }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               return WEAPON_LASER_SUICIDE;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               return WEAPON_LASER_MURDER;
+       }
        return TRUE;
 }
 #endif
@@ -309,15 +317,6 @@ float w_laser(float req)
        {
                precache_sound("weapons/laserimpact.wav");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s lasered themself to hell");
-       else if (req == WR_KILLMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s was cut in half by %s's gauntlet"); // unchecked: SPLASH
-               else
-                       w_deathtypestring = _("%s was lasered to death by %s"); // unchecked: SPLASH
-       }
        return TRUE;
 }
 #endif
index 1b4f7c6cd06aa232811c06b67617006ba6f031d2..989dfe962329ed576f63a1837aae1b04bcab83c4 100644 (file)
@@ -509,6 +509,14 @@ float w_minelayer(float req)
        {
                W_Reload(autocvar_g_balance_minelayer_ammo, autocvar_g_balance_minelayer_reload_ammo, autocvar_g_balance_minelayer_reload_time, "weapons/reload.wav");
        }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               return WEAPON_MINELAYER_SUICIDE;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               return WEAPON_MINELAYER_MURDER;
+       }
        return TRUE;
 }
 #endif
@@ -527,20 +535,6 @@ float w_minelayer(float req)
        {
                precache_sound("weapons/mine_exp.wav");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-               if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation)
-                       w_deathtypestring = _("%s blew themself up with their minelayer");
-               else
-                       w_deathtypestring = _("%s forgot about their mine");
-       else if (req == WR_KILLMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation)
-                       w_deathtypestring = _("%s got too close to %s's mine");
-               else if(w_deathtype & HITTYPE_SPLASH)
-                       w_deathtypestring = _("%s almost dodged %s's mine");
-               else
-                       w_deathtypestring = _("%s stepped on %s's mine");
-       }
        return TRUE;
 }
 #endif
index a2d3b988734a6d75e9ff2c3fd3db737573821e30..36f4d28ec647cc988f1c1229fb0112ca7c1ebebf 100644 (file)
@@ -50,25 +50,25 @@ void W_MinstaNex_Attack (void)
        {
            switch(self.team)
            {
-            case COLOR_TEAM1:   // Red
+            case FL_TEAM_1:   // Red
                 if(damage_goodhits)
                     WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED_HIT"), w_shotorg, v);
                 else
                     WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3RED"), w_shotorg, v);
                 break;
-            case COLOR_TEAM2:   // Blue
+            case FL_TEAM_2:   // Blue
                 if(damage_goodhits)
                     WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE_HIT"), w_shotorg, v);
                 else
                     WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3BLUE"), w_shotorg, v);
                 break;
-            case COLOR_TEAM3:   // Yellow
+            case FL_TEAM_3:   // Yellow
                 if(damage_goodhits)
                     WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW_HIT"), w_shotorg, v);
                 else
                     WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3YELLOW"), w_shotorg, v);
                 break;
-            case COLOR_TEAM4:   // Pink
+            case FL_TEAM_4:   // Pink
                 if(damage_goodhits)
                     WarpZone_TrailParticles(world, particleeffectnum("TE_TEI_G3PINK_HIT"), w_shotorg, v);
                 else
@@ -278,6 +278,14 @@ float w_minstanex(float req)
 
                W_Reload(used_ammo, autocvar_g_balance_minstanex_reload_ammo, autocvar_g_balance_minstanex_reload_time, "weapons/reload.wav");
        }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               return WEAPON_THINKING_WITH_PORTALS;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               return WEAPON_MINSTANEX_MURDER;
+       }
        return TRUE;
 }
 #endif
index 51afdd00f100bcb7a3847960c43ec561619c08dd..9d66f407ef8bbb401c2fd4c77f0c1fd2ae52cf42 100644 (file)
@@ -233,7 +233,14 @@ float w_nex(float req)
        {
                W_Reload(min(autocvar_g_balance_nex_primary_ammo, autocvar_g_balance_nex_secondary_ammo), autocvar_g_balance_nex_reload_ammo, autocvar_g_balance_nex_reload_time, "weapons/reload.wav");
        }
-
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               return WEAPON_THINKING_WITH_PORTALS;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               return WEAPON_NEX_MURDER;
+       }
        return TRUE;
 }
 #endif
@@ -252,10 +259,6 @@ float w_nex(float req)
        {
                precache_sound("weapons/neximpact.wav");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s is now thinking with portals");
-       else if (req == WR_KILLMESSAGE)
-               w_deathtypestring = _("%s has been vaporized by %s's nex");
        return TRUE;
 }
 #endif
index f95e554b0e9799d78a52108ca39e72f2c7dde053..790bcd124c588deff469d8d258bed5b919009d3e 100644 (file)
@@ -375,10 +375,6 @@ float w_porto(float req)
        {
                // nothing to do
        }
-       else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s did the impossible");
-       else if (req == WR_KILLMESSAGE)
-               w_deathtypestring = _("%s felt %s doing the impossible to him");
        return TRUE;
 }
 #endif
index 1c5f766d7dbf2240ce03ee0bce3e149db4c48489..33b2bda5ff2b99361f0e688f55360c6a9ceea9be 100644 (file)
@@ -200,6 +200,34 @@ float w_rifle(float req)
        {
                W_Reload(min(autocvar_g_balance_rifle_primary_ammo, autocvar_g_balance_rifle_secondary_ammo), autocvar_g_balance_rifle_reload_ammo, autocvar_g_balance_rifle_reload_time, "weapons/reload.wav");
        }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               return WEAPON_THINKING_WITH_PORTALS;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               if(w_deathtype & HITTYPE_SECONDARY)
+               {
+                       if(w_deathtype & HITTYPE_BOUNCE)
+                               return WEAPON_RIFLE_MURDER_HAIL_PIERCING;
+                       else
+                               return WEAPON_RIFLE_MURDER_HAIL;
+               }
+               else
+               {
+                       if(w_deathtype & HITTYPE_BOUNCE)
+                       {
+                               return WEAPON_RIFLE_MURDER_PIERCING;
+                       }
+                       else
+                       {
+                               if(w_deathtype & HITTYPE_HEADSHOT)
+                                       return WEAPON_RIFLE_MURDER_HEADSHOT;
+                               else
+                                       return WEAPON_RIFLE_MURDER;
+                       }
+               }
+       }
        return TRUE;
 }
 #endif
@@ -227,35 +255,6 @@ float w_rifle(float req)
                precache_sound("weapons/ric2.wav");
                precache_sound("weapons/ric3.wav");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-       {
-               w_deathtypestring = _("%s is now thinking with portals");
-       }
-       else if (req == WR_KILLMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_SECONDARY)
-               {
-                       if(w_deathtype & HITTYPE_BOUNCE)
-                               w_deathtypestring = _("%s failed to hide from %s's rifle bullet hail");
-                       else
-                               w_deathtypestring = _("%s died in %s's rifle bullet hail");
-               }
-               else
-               {
-                       if(w_deathtype & HITTYPE_BOUNCE)
-                       {
-                               // TODO special headshot message here too?
-                               w_deathtypestring = _("%s failed to hide from %s's rifle");
-                       }
-                       else
-                       {
-                               if(w_deathtype & HITTYPE_HEADSHOT)
-                                       w_deathtypestring = _("%s got shot in the head with a rifle by %s");
-                               else
-                                       w_deathtypestring = _("%s was sniped with a rifle by %s");
-                       }
-               }
-       }
        return TRUE;
 }
 #endif
index add0207d12b57c8fd1ec90abd776143407bef84a..202dd68bdfaac166918253cf0863c88b3287c338 100644 (file)
@@ -446,6 +446,17 @@ float w_rlauncher(float req)
        {
                W_Reload(autocvar_g_balance_rocketlauncher_ammo, autocvar_g_balance_rocketlauncher_reload_ammo, autocvar_g_balance_rocketlauncher_reload_time, "weapons/reload.wav");
        }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               return WEAPON_ROCKETLAUNCHER_SUICIDE;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               if((w_deathtype & HITTYPE_BOUNCE) || (w_deathtype & HITTYPE_SPLASH))
+                       return WEAPON_ROCKETLAUNCHER_MURDER_SPLASH;
+               else
+                       return WEAPON_ROCKETLAUNCHER_MURDER_DIRECT;
+       }
        return TRUE;
 }
 #endif
@@ -464,17 +475,6 @@ float w_rlauncher(float req)
        {
                precache_sound("weapons/rocket_impact.wav");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s blew themself up with their rocketlauncher");
-       else if (req == WR_KILLMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation)
-                       w_deathtypestring = _("%s got too close to %s's rocket");
-               else if(w_deathtype & HITTYPE_SPLASH)
-                       w_deathtypestring = _("%s almost dodged %s's rocket");
-               else
-                       w_deathtypestring = _("%s ate %s's rocket");
-       }
        return TRUE;
 }
 #endif
index 975449f5d10c723c5fb765204c66641ae277e0c8..13c010f2a13010937f6d7a2a37fa8e2f426ba107 100644 (file)
@@ -612,6 +612,17 @@ float w_seeker(float req)
        {
                W_Reload(min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo), autocvar_g_balance_seeker_reload_ammo, autocvar_g_balance_seeker_reload_time, "weapons/reload.wav");
        }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               return WEAPON_SEEKER_SUICIDE;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               if(w_deathtype & HITTYPE_SECONDARY)
+                       return WEAPON_SEEKER_MURDER_TAG;
+               else
+                       return WEAPON_SEEKER_MURDER_SPRAY;
+       }
        return TRUE;
 }
 #endif
@@ -664,15 +675,6 @@ float w_seeker(float req)
                precache_sound("weapons/tagexp3.wav");
                precache_sound("weapons/tag_impact.wav");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s played with tiny seeker rockets");
-       else if (req == WR_KILLMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s was tagged with a seeker by %s");
-               else
-                       w_deathtypestring = _("%s was pummeled with seeker rockets by %s");
-       }
        return TRUE;
 }
 #endif
index fdfa6af382c27a48347689016cc92a161cb9c36d..350d6e01578fb1f46cf8f43c121e22318ba61a84 100644 (file)
@@ -238,6 +238,17 @@ float w_shotgun(float req)
        {
                W_Reload(autocvar_g_balance_shotgun_primary_ammo, autocvar_g_balance_shotgun_reload_ammo, autocvar_g_balance_shotgun_reload_time, "weapons/reload.wav");
        }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               return WEAPON_THINKING_WITH_PORTALS;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               if(w_deathtype & HITTYPE_SECONDARY)
+                       return WEAPON_SHOTGUN_MURDER_SLAP;
+               else
+                       return WEAPON_SHOTGUN_MURDER;
+       }
        return TRUE;
 }
 #endif
@@ -267,15 +278,6 @@ float w_shotgun(float req)
                precache_sound("weapons/ric2.wav");
                precache_sound("weapons/ric3.wav");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s is now thinking with portals");
-       else if (req == WR_KILLMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%2$s slapped %1$s around a bit with a large shotgun");
-               else
-                       w_deathtypestring = _("%s was gunned down with a shotgun by %s");
-       }
        return TRUE;
 }
 #endif
index 5f2dc5adbbf1a4ab01eb7ff64e06f2f8c0533e63..15d4ef9d7deb44e9d6690fff01c77cbde572735d 100644 (file)
@@ -186,7 +186,7 @@ float Tuba_GetNote(entity pl, float hittype)
        // that way, holes in the range of notes are "plugged"
        if(teamplay)
        {
-               if(pl.team == COLOR_TEAM2 || pl.team == COLOR_TEAM4)
+               if(pl.team == FL_TEAM_2 || pl.team == FL_TEAM_4)
                        note += 3;
        }
        else
@@ -425,6 +425,24 @@ float w_tuba(float req)
                return TRUE; // TODO use fuel?
        else if (req == WR_CHECKAMMO2)
                return TRUE; // TODO use fuel?
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               if(w_deathtype & HITTYPE_BOUNCE)
+                       return WEAPON_ACCORDEON_SUICIDE;
+               else if(w_deathtype & HITTYPE_HEADSHOT)
+                       return WEAPON_KLEINBOTTLE_SUICIDE;
+               else
+                       return WEAPON_TUBA_SUICIDE;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               if(w_deathtype & HITTYPE_BOUNCE)
+                       return WEAPON_ACCORDEON_MURDER;
+               else if(w_deathtype & HITTYPE_HEADSHOT)
+                       return WEAPON_KLEINBOTTLE_MURDER;
+               else
+                       return WEAPON_TUBA_MURDER;
+       }
        return TRUE;
 }
 #endif
@@ -439,54 +457,6 @@ float w_tuba(float req)
        {
                // nothing to do
        }
-       else if (req == WR_SUICIDEMESSAGE)
-       {
-               float instr;
-               instr = 0;
-               if(w_deathtype & HITTYPE_SECONDARY)
-                       instr |= 1;
-               if(w_deathtype & HITTYPE_BOUNCE)
-                       instr |= 2;
-               if(w_deathtype & HITTYPE_HEADSHOT)
-                       instr |= 4;
-               switch(instr)
-               {
-                       default:
-                       case 0: // Tuba
-                               w_deathtypestring = _("%s hurt his own ears with the @!#%%'n Tuba");
-                               break;
-                       case 1: // Accordeon
-                               w_deathtypestring = _("%s hurt his own ears with the @!#%%'n Accordeon");
-                               break;
-                       case 2: // Klein Bottle
-                               w_deathtypestring = _("%s hurt his own ears with the @!#%%'n Klein Bottle");
-                               break;
-               }
-       }
-       else if (req == WR_KILLMESSAGE)
-       {
-               float instr;
-               instr = 0;
-               if(w_deathtype & HITTYPE_SECONDARY)
-                       instr |= 1;
-               if(w_deathtype & HITTYPE_BOUNCE)
-                       instr |= 2;
-               if(w_deathtype & HITTYPE_HEADSHOT)
-                       instr |= 4;
-               switch(instr)
-               {
-                       default:
-                       case 0: // Tuba
-                               w_deathtypestring = _("%s died of %s's great playing on the @!#%%'n Tuba");
-                               break;
-                       case 1: // Accordeon
-                               w_deathtypestring = _("%s died of %s's great playing on the @!#%%'n Accordeon");
-                               break;
-                       case 2: // Klein Bottle
-                               w_deathtypestring = _("%s died of %s's great playing on the @!#%%'n Klein Bottle");
-                               break;
-               }
-       }
        return TRUE;
 }
 #endif
index 77d8b4aee562215cec57fa4a1021857d41be4ca0..7204437bb6f02fb7b8899f9ec8a74da4f9216e9f 100644 (file)
@@ -289,6 +289,17 @@ float w_uzi(float req)
        {
                W_Reload(min(max(autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_first_ammo), autocvar_g_balance_uzi_burst_ammo), autocvar_g_balance_uzi_reload_ammo, autocvar_g_balance_uzi_reload_time, "weapons/reload.wav");
        }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               return WEAPON_THINKING_WITH_PORTALS;
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               if(w_deathtype & HITTYPE_SECONDARY)
+                       return WEAPON_UZI_MURDER_SNIPE;
+               else
+                       return WEAPON_UZI_MURDER_SPRAY;
+       }
        return TRUE;
 }
 #endif
@@ -314,15 +325,6 @@ float w_uzi(float req)
                precache_sound("weapons/ric2.wav");
                precache_sound("weapons/ric3.wav");
        }
-       else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s is now thinking with portals");
-       else if (req == WR_KILLMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s was sniped by %s's machine gun");
-               else
-                       w_deathtypestring = _("%s was riddled full of holes by %s's machine gun");
-       }
        return TRUE;
 }
 #endif