]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Create separate file for common team functions/declarations
authorSamual Lenks <samual@xonotic.org>
Tue, 2 Oct 2012 03:22:25 +0000 (23:22 -0400)
committerSamual Lenks <samual@xonotic.org>
Tue, 2 Oct 2012 03:22:25 +0000 (23:22 -0400)
41 files changed:
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/csqcmodel_hooks.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
qcsrc/client/tturrets.qc
qcsrc/client/waypointsprites.qc
qcsrc/common/notifications.qc
qcsrc/server/arena.qc
qcsrc/server/assault.qc
qcsrc/server/attic/ctf.qc
qcsrc/server/attic/nexball.qc
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/domination.qc
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_freezetag.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/scores.qc
qcsrc/server/teamplay.qc
qcsrc/server/w_minstanex.qc
qcsrc/server/w_tuba.qc

index 368ff4785225c7b8567a4b7a1a7a9e0ecd736bb7..87d278a718213c483b56c5edebb0721bfdaacd68 100644 (file)
@@ -149,7 +149,7 @@ 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);
@@ -261,16 +261,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 +286,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;
                }
index 46d116cbd74dd0d8e572973621a75e35164766e6..2380e941f66356f3c8526cd3a9c5fc530ed10b8c 100644 (file)
@@ -240,7 +240,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 9c87d13addf9949c671a4319da1e5c91f2f69b45..e7988cb5ad1d165920dd654f336bab94b9b430ee 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 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 4ceae02028732471fe428f8eaba80c9ce7bf87be..60bfec04b43eda0df975725be66f178216092212 100644 (file)
@@ -2451,7 +2451,7 @@ void HUD_Radar(void)
        for(tm = world; (tm = find(tm, classname, "entcs_receiver")); )
        {
                color2 = GetPlayerColor(tm.sv_entnum);
-               //if(color == COLOR_SPECTATOR || color == color2)
+               //if(color == FL_SPECTATOR || color == color2)
                        draw_teamradar_player(tm.origin, tm.angles, GetTeamRGB(color2));
        }
        draw_teamradar_player(view_origin, view_angles, '1 1 1');
@@ -2534,7 +2534,7 @@ 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);
@@ -2550,14 +2550,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)
@@ -2582,7 +2582,7 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me, float team_count)
                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)
@@ -2703,7 +2703,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)
                        {
@@ -2741,7 +2741,7 @@ void HUD_Score(void)
                max_fragcount = -99;
                draw_beginBoldFont();
                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)
@@ -3184,7 +3184,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;
@@ -3197,7 +3197,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;
@@ -3212,7 +3212,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;
@@ -3225,7 +3225,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;
@@ -3233,7 +3233,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 {
@@ -3242,7 +3242,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 {
@@ -3356,16 +3356,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:
@@ -3703,7 +3703,7 @@ void HUD_Mod_Dom(vector myPos, vector mySize)
        entity tm;
        float teams_count;
        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;
@@ -4162,7 +4162,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);
@@ -4174,7 +4174,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 43e7b64995e3b991f05b72f0623f684fa2892acd..474e919f42ee1b5f170d89551fb4585f34c6b806 100644 (file)
@@ -40,16 +40,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 72bb9c5c40a66ec0932bc1dbed0d3b2d00e8a292..ff43b29d20b51a3e0e1cd7540d9f87bcb69e262e 100644 (file)
@@ -110,7 +110,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)
@@ -166,20 +166,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 4e7aca7f63f8ca417d88dd931fc0f75e8eb0ecd9..7ea864d5d09885094a0fecf6bf711e16b43a19a3 100644 (file)
@@ -14,6 +14,7 @@ Defs.qc
 ../warpzonelib/common.qh
 ../warpzonelib/client.qh
 
+../common/teams.qh
 ../common/util.qh
 ../common/items.qh
 ../common/deathtypes.qh
index 48a7217fc703a08b3b7f7fdfab3bc58efea36c2e..417f97e0dfb45cc48d68a4365b2b978ba318a8fd 100644 (file)
@@ -136,16 +136,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
@@ -201,9 +201,9 @@ float HUD_CompareTeamScores(entity left, entity right)
 {
        float vl, vr;
 
-       if(left.team == COLOR_SPECTATOR)
+       if(left.team == FL_SPECTATOR)
                return 1;
-       if(right.team == COLOR_SPECTATOR)
+       if(right.team == FL_SPECTATOR)
                return 0;
 
        vl = left.teamscores[ts_primary];
@@ -663,7 +663,7 @@ void HUD_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_numb
        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;
@@ -907,7 +907,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;
@@ -1124,7 +1124,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;
@@ -1241,7 +1241,7 @@ 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();
@@ -1267,7 +1267,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);
@@ -1304,7 +1304,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 5309c555e6085050b6a37b36509cf010964c2deb..3d404b5e41b43a6178ed8345b6d2c45be53d1842 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;
index 80d89318f4c88d09cf5170aaa47e89c51ad0c156..058b699ba12e18911da8f52eebcd2521df363506 100644 (file)
@@ -2,10 +2,10 @@ 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;
+       case FL_TEAM_1: return 0;
+       case FL_TEAM_2: return 1;
+       case FL_TEAM_3: return 2;
+       case FL_TEAM_4: return 3;
        default: return 0;
        }
 }
@@ -13,11 +13,11 @@ 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;
+       case 0: return FL_TEAM_1;
+       case 1: return FL_TEAM_2;
+       case 2: return FL_TEAM_3;
+       case 3: return FL_TEAM_4;
+       default: return FL_TEAM_1;
        }
 }
 
@@ -32,9 +32,9 @@ float GetPlayerColorForce(float i)
 float GetPlayerColor(float i)
 {
        if not(playerslots[i].gotscores) // unconnected
-               return COLOR_SPECTATOR;
+               return FL_SPECTATOR;
        else if(stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR)
-               return COLOR_SPECTATOR;
+               return FL_SPECTATOR;
        else
                return GetPlayerColorForce(i);
 }
@@ -49,10 +49,10 @@ 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
+       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
        }
 }
 
@@ -61,9 +61,9 @@ 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");
+       case FL_TEAM_1: return _("Red Team");
+       case FL_TEAM_2: return _("Blue Team");
+       case FL_TEAM_3: return _("Yellow Team");
+       case FL_TEAM_4: return _("Pink Team");
        }
 }
index 272a24610204128247559cf76ecd6fca41bef53b..01553891f15e92b363cdf5d25fe559504118dea9 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 d3d57aba9e8cbcd52ad7606466f912dc394032a9..9cac6bf6eb0250b246771ed1e0e524dde324bb8c 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 e8491da8452063832bb2e580464e2c9a7633c976..caca75999cf0e484c6c203a284199850fee0bd6e 100644 (file)
@@ -36,15 +36,6 @@ var float autocvar_notification_ctf_pickup_enemy_verbose = TRUE;
 #define ADD_CSQC_AUTOCVAR(name)
 #endif
 
-string team_name_red = _("Red");
-string team_name_blue = _("Blue");
-string team_name_yellow = _("Yellow");
-string team_name_pink = _("Pink");
-string team_color_red = "^1";
-string team_color_blue = "^4";
-string team_color_yellow = "";
-string team_color_pink = "";
-
 
 // ====================================
 //  Notifications List and Information
@@ -89,13 +80,13 @@ string team_color_pink = "";
 // weaponorder[f1].netname
 
 #define MULTITEAM_INFO(prefix,teams,strnum,flnum,args,hudargs,icon,normal,gentle) \
-       MSG_INFO_NOTIF(prefix##RED, strnum, flnum, args, hudargs, sprintf(icon, strtolower(team_name_red)), TCR(normal, team_color_red, strtoupper(team_name_red)), TCR(gentle, team_color_red, strtoupper(team_name_red))) \
-       MSG_INFO_NOTIF(prefix##BLUE, strnum, flnum, args, hudargs, sprintf(icon, strtolower(team_name_blue)), TCR(normal, team_color_blue, strtoupper(team_name_blue)), TCR(gentle, team_color_blue, strtoupper(team_name_blue))) \
+       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(team_name_yellow)), TCR(normal, team_color_yellow, strtoupper(team_name_yellow)), TCR(gentle, team_color_yellow, strtoupper(team_name_yellow))) \
+               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(team_name_pink)), TCR(normal, team_color_pink, strtoupper(team_name_pink)), TCR(gentle, team_color_pink, strtoupper(team_name_pink))) \
+               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, XPND2("", ""),                                        "", "", "") \
@@ -116,13 +107,13 @@ string team_color_pink = "";
        #undef MSG_INFO_NOTIF
 
 #define MULTITEAM_CENTER(prefix,teams,strnum,flnum,args,cpid,durcnt,normal,gentle) \
-       MSG_CENTER_NOTIF(prefix##RED, strnum, flnum, args, cpid, durcnt, TCR(normal, team_color_red, strtoupper(team_name_red)), TCR(gentle, team_color_red, strtoupper(team_name_red))) \
-       MSG_CENTER_NOTIF(prefix##BLUE, strnum, flnum, args, cpid, durcnt, TCR(normal, team_color_blue, strtoupper(team_name_blue)), TCR(gentle, team_color_blue, strtoupper(team_name_blue))) \
+       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, team_color_yellow, strtoupper(team_name_yellow)), TCR(gentle, team_color_yellow, strtoupper(team_name_yellow))) \
+               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, team_color_pink, strtoupper(team_name_pink)), TCR(gentle, team_color_pink, strtoupper(team_name_pink))) \
+               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,                                XPND2(0, 0), "", "") \
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 d3f4b55f4a49acf42693df6e04df24942a1b99f3..ee0c13b87d20cd3f5740505057572be23bb4cc50 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 3e1cae313ff6ecbc06c3629d699c911bb16abb42..bdcfe864e4e43666a60901933d549893f513a543 100644 (file)
@@ -399,13 +399,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);
 
@@ -426,13 +426,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 b17697d2f8524d6ae21bc3c9dee8205161a07cf3..f63ddbdc22c575286a6c1717e95a1ceb6e69d951 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 72302d26eb109d25bfaf150d232e5ff3c8f19d11..8512f57dfbfe2a6752aff8cb4780dd962ccdce6b 100644 (file)
@@ -554,7 +554,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));
@@ -1401,30 +1401,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")
index 4b5bca748c54dd5e39597525325f961b9838eef3..f7c206091f63096298571f285ecea6a96d88d4ea 100644 (file)
@@ -1423,7 +1423,7 @@ void MoveToTeam(entity client, float team_colour, float type, float show_message
        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
+               sprint(client, strcat("\{1}\{13}^3", admin_name(), "^7: You have been moved to the ", Team_ColorName_Lower(team_colour), " team\n"));  // send a chat message
 
        bprint(strcat(client.netname, " joined the ", ColoredTeamName(client.team), "\n"));
 }
index 530646afd2ec8fbb105dc8a080b41dadaaa25d0f..eba74cd3860b76424f5600dd302e237e9142e9db 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;
index b2bf9d9b97aa6bb2a9b92433299234c351f01b28..c289334f25ea56b834875f8e9626ca72145e1c81 100644 (file)
@@ -966,7 +966,7 @@ void GameCommand_moveplayer(float request, float argc)
                                                                client.team_forced = 0;
 
                                                                // find the team to move the player to
-                                                               team_color = ColourToNumber(destination);
+                                                               team_color = Team_ColorToNumber(destination);
                                                                if(team_color == client.team) // already on the destination team
                                                                {
                                                                        // keep the forcing undone
@@ -975,7 +975,7 @@ void GameCommand_moveplayer(float request, float argc)
                                                                } 
                                                                else if(team_color == 0)  // auto team
                                                                {
-                                                                       team_color = NumberToTeamNumber(FindSmallestTeam(client, FALSE));
+                                                                       team_color = Team_NumberToTeam(FindSmallestTeam(client, FALSE));
                                                                }
                                                                else
                                                                {
@@ -986,10 +986,10 @@ void GameCommand_moveplayer(float request, float argc)
                                                                // Check to see if the destination team is even available
                                                                switch(team_color) 
                                                                {
-                                                                       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;
                                                                }
@@ -1298,7 +1298,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)
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 0a2fe02b66fcf13c88c02240c0fb5b653f31ed88..2599b13518f1863637851440df9bbaacbfdf2aad 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 b2a0e99e3bff92990614ca2d77c22699961317c9..b32424d37dc0840e51ad330bcc6fead80cbe2730 100644 (file)
@@ -349,7 +349,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                        s2 = ((targ.killcount > 2) ? ftos(targ.killcount) : "");
                                
                        //if(teamplay && deathtype == DEATH_MIRRORDAMAGE)
-                       //      { deathtype = ((attacker.team == COLOR_TEAM1) ? KILL_TEAM_SUICIDE_RED : KILL_TEAM_SUICIDE_BLUE); }
+                       //      { deathtype = ((attacker.team == FL_TEAM_1) ? KILL_TEAM_SUICIDE_RED : KILL_TEAM_SUICIDE_BLUE); }
 
                        Obituary_Notification(world, s1, s2, "", deathtype);
                        //Send_KillNotification(s, s2, ftos(w), deathtype, MSG_SUICIDE);
@@ -358,7 +358,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                {
                        if(!IsDifferentTeam(attacker, targ))
                        {
-                               //type = ((attacker.team == COLOR_TEAM1) ? KILL_TEAM_FRAG_RED : KILL_TEAM_FRAG_BLUE);
+                               //type = ((attacker.team == FL_TEAM_1) ? KILL_TEAM_FRAG_RED : KILL_TEAM_FRAG_BLUE);
 
                                GiveFrags(attacker, targ, -1, deathtype);
 
index f7982cf881ae5bd3a6ca8109a0cfa9d6236db0d4..b5ae693cb867c9affaf896ecd7e6f95cd71f5eec 100644 (file)
@@ -1758,10 +1758,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");
        }
@@ -1769,10 +1769,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;
        }
@@ -1810,13 +1810,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;
@@ -1942,10 +1942,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();
@@ -2062,25 +2062,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;
        }
 
@@ -2094,20 +2094,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 08b06f513804b35f018c41a4e6dcad638091d241..593d57d403790f4f5e1acd3deda46686ee02d1e5 100644 (file)
@@ -611,85 +611,6 @@ void backtrace(string msg)
     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)
 {
index 911c3dee23a0187c3b309b20054cdd4d2726b5c5..6c713e7aad05d63cf264e11616536fb05406251a 100644 (file)
@@ -605,8 +605,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;
                        }
                }
        }
@@ -932,7 +932,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
@@ -952,7 +952,7 @@ void ctf_FlagSetup(float teamnumber, entity flag) // called when spawning a flag
        setattachment(flag, world, ""); 
 
        flag.netname = ((teamnumber) ? "^1REPLACETHIS^7" : "^4REPLACETHIS^7"); // ((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.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?
@@ -2029,7 +2029,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();
 }
 
@@ -2041,7 +2041,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();
 }
 
@@ -2052,7 +2052,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();
 }
 
@@ -2064,7 +2064,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();
 }
 
@@ -2166,8 +2166,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();
index bb64ee9eaec42423fba9caef5ff3c01f8ade7c1f..8e067caf012136c0d7d3657de4e17df953f2d80c 100644 (file)
@@ -132,7 +132,7 @@ float havocbot_ctf_middlepoint_radius;
 void havocbot_role_ctf_setrole(entity bot, float role);
 
 // client notification stuff
-#define RED_OR_BLUE(ent,prefix) ((ent.team == COLOR_TEAM1) ? prefix##RED : prefix##BLUE)
+#define RED_OR_BLUE(ent,prefix) ((ent.team == FL_TEAM_1) ? prefix##RED : prefix##BLUE)
 .float CAPTURE_VERBOSE;
 .float PICKUP_TEAM_VERBOSE;
 .float PICKUP_ENEMY_VERBOSE;
index aedfd6364c942ef5f1d967b38d0dac04fa8d202f..505ba51cb0f9ebbd4171f3a55b2150cdd1ef2fc4 100644 (file)
@@ -36,11 +36,11 @@ void freezetag_CheckWinner()
 
        if(winner != world) // just in case a winner wasn't found
        {
-               if(winner.team == COLOR_TEAM1)
+               if(winner.team == FL_TEAM_1)
                        teamname = "^1Red Team";
-               else if(winner.team == COLOR_TEAM2)
+               else if(winner.team == FL_TEAM_2)
                        teamname = "^4Blue Team";
-               else if(winner.team == COLOR_TEAM3)
+               else if(winner.team == FL_TEAM_3)
                        teamname = "^3Yellow Team";
                else
                        teamname = "^6Pink Team";
@@ -242,13 +242,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 +265,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;
 
index 58d732d7f70b926c6cb13c6f93aa0f9a5807f48e..bcf42bbed4c5f3acf45419e4c8c91f313b9a9df7 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);
@@ -753,16 +753,16 @@ void kh_Key_Spawn(entity initial_owner, float angle, float i)  // runs every tim
 
        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:
index 808d1a29b35229d56931b9645642a524d95e833b..433d781fb9eb1df2dc08c2327320f9e2090aa0ce 100644 (file)
@@ -424,28 +424,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 +575,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 060447c39eb7d04ec06d80564a12ec4aca752971..70479625aa27d3ba5979bcccfda3be9847435190 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
@@ -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)
                        {
@@ -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 8b6bf05a204a9f0ebe3f8ee682ffea5c9af1a782..1a7263c909f6c5f02d2975d9f95c988a991b319c 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 e78c3d979704d3c9e8258c5b0cac9044c6f0f3ea..cce684926645b2da9b6c792ff18eddb31db174cb 100644 (file)
@@ -13,6 +13,7 @@ sys-post.qh
 ../warpzonelib/server.qh
 
 ../common/constants.qh
+../common/teams.qh
 ../common/util.qh
 ../common/items.qh
 ../common/deathtypes.qh
index 102dd6a33ef326af860bdd8d66c0ba537f5f8a89..19d613b0791b635b4564ca85983d721d65b5be0e 100644 (file)
@@ -200,13 +200,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");
 }
 
 /*
index b8f2f3ac8746ea4e02daae0936833d2086954699..be6f34a6e0a6dd2437144c2b02c0b3264fd0f8f1 100644 (file)
@@ -17,13 +17,13 @@ vector TeamColor(float teem)
 {
        switch(teem)
        {
-               case COLOR_TEAM1:
+               case FL_TEAM_1:
                        return '1 0.0625 0.0625';
-               case COLOR_TEAM2:
+               case FL_TEAM_2:
                        return '0.0625 0.0625 1';
-               case COLOR_TEAM3:
+               case FL_TEAM_3:
                        return '1 1 0.0625';
-               case COLOR_TEAM4:
+               case FL_TEAM_4:
                        return '1 0.0625 1';
                default:
                        return '1 1 1';
@@ -417,13 +417,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);
 
@@ -453,10 +453,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;
                }
        }
@@ -498,13 +498,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);
@@ -534,13 +534,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;
 }
 
@@ -577,7 +577,7 @@ void GetTeamCounts(entity ignore)
                                bvalue = value;
                        else
                                bvalue = 0;
-                       if(t == COLOR_TEAM1)
+                       if(t == FL_TEAM_1)
                        {
                                if(c1 >= 0)
                                {
@@ -585,7 +585,7 @@ void GetTeamCounts(entity ignore)
                                        cb1 = cb1 + bvalue;
                                }
                        }
-                       if(t == COLOR_TEAM2)
+                       if(t == FL_TEAM_2)
                        {
                                if(c2 >= 0)
                                {
@@ -593,7 +593,7 @@ void GetTeamCounts(entity ignore)
                                        cb2 = cb2 + bvalue;
                                }
                        }
-                       if(t == COLOR_TEAM3)
+                       if(t == FL_TEAM_3)
                        {
                                if(c3 >= 0)
                                {
@@ -601,7 +601,7 @@ void GetTeamCounts(entity ignore)
                                        cb3 = cb3 + bvalue;
                                }
                        }
-                       if(t == COLOR_TEAM4)
+                       if(t == FL_TEAM_4)
                        {
                                if(c4 >= 0)
                                {
@@ -770,13 +770,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;
@@ -803,19 +803,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
                {
@@ -845,21 +845,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);
@@ -948,13 +948,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;
@@ -1073,12 +1073,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 1f1137e4b845b151321d1501c5dbdca9e325b2fd..7a94299eb28ee110e3d01e8aa686bf51d3918828 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
index f19a50208293073f1507fc4bf2beec258456fa13..bf6a98eaece2a85c75857fcbdd8dc7371bc021b7 100644 (file)
@@ -180,7 +180,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