1 #ifdef TEAMNUMBERS_THAT_ARENT_STUPID
2 const float NUM_TEAM_1 = 1; // red
3 const float NUM_TEAM_2 = 2; // blue
4 const float NUM_TEAM_3 = 3; // yellow
5 const float NUM_TEAM_4 = 4; // pink
6 const float NUM_SPECTATOR = 5;
9 const float NUM_TEAM_1 = 4; // red
10 const float NUM_TEAM_2 = 13; // blue
11 const float NUM_TEAM_3 = 12; // yellow
12 const float NUM_TEAM_4 = 9; // pink
14 const float NUM_TEAM_1 = 5; // red
15 const float NUM_TEAM_2 = 14; // blue
16 const float NUM_TEAM_3 = 13; // yellow
17 const float NUM_TEAM_4 = 10; // pink
19 const float NUM_SPECTATOR = 1337;
22 const string COL_TEAM_1 = "^1";
23 const string COL_TEAM_2 = "^4";
24 const string COL_TEAM_3 = "^3";
25 const string COL_TEAM_4 = "^6";
26 const string NAME_TEAM_1 = _("Red");
27 const string NAME_TEAM_2 = _("Blue");
28 const string NAME_TEAM_3 = _("Yellow");
29 const string NAME_TEAM_4 = _("Pink");
30 const string NAME_TEAM = _("Team");
31 const string NAME_NEUTRAL = _("Neutral");
33 // used for replacement in filenames or such where the name CANNOT be allowed to be translated
34 const string STATIC_NAME_TEAM_1 = "Red";
35 const string STATIC_NAME_TEAM_2 = "Blue";
36 const string STATIC_NAME_TEAM_3 = "Yellow";
37 const string STATIC_NAME_TEAM_4 = "Pink";
39 #define APP_TEAM_NUM_2(num,prefix) ((num == NUM_TEAM_1) ? prefix##RED : prefix##BLUE)
40 #define APP_TEAM_NUM_4(num,prefix) ((num == NUM_TEAM_1) ? prefix##RED : ((num == NUM_TEAM_2) ? prefix##BLUE : ((num == NUM_TEAM_3) ? prefix##YELLOW : prefix##PINK)))
41 #define APP_TEAM_ENT_2(ent,prefix) ((ent.team == NUM_TEAM_1) ? prefix##RED : prefix##BLUE)
42 #define APP_TEAM_ENT_4(ent,prefix) ((ent.team == NUM_TEAM_1) ? prefix##RED : ((ent.team == NUM_TEAM_2) ? prefix##BLUE : ((ent.team == NUM_TEAM_3) ? prefix##YELLOW : prefix##PINK)))
49 string Team_ColorCode(float teamid)
53 case NUM_TEAM_1: return COL_TEAM_1;
54 case NUM_TEAM_2: return COL_TEAM_2;
55 case NUM_TEAM_3: return COL_TEAM_3;
56 case NUM_TEAM_4: return COL_TEAM_4;
62 vector Team_ColorRGB(float teamid)
66 case NUM_TEAM_1: return '1 0.0625 0.0625';
67 case NUM_TEAM_2: return '0.0625 0.0625 1';
68 case NUM_TEAM_3: return '1 1 0.0625';
69 case NUM_TEAM_4: return '1 0.0625 1';
75 string Team_ColorName(float teamid)
79 case NUM_TEAM_1: return NAME_TEAM_1;
80 case NUM_TEAM_2: return NAME_TEAM_2;
81 case NUM_TEAM_3: return NAME_TEAM_3;
82 case NUM_TEAM_4: return NAME_TEAM_4;
88 // used for replacement in filenames or such where the name CANNOT be allowed to be translated
89 string Static_Team_ColorName(float teamid)
93 case NUM_TEAM_1: return STATIC_NAME_TEAM_1;
94 case NUM_TEAM_2: return STATIC_NAME_TEAM_2;
95 case NUM_TEAM_3: return STATIC_NAME_TEAM_3;
96 case NUM_TEAM_4: return STATIC_NAME_TEAM_4;
102 float Team_ColorToTeam(string team_color)
104 switch(strtolower(team_color))
106 case "red": return NUM_TEAM_1;
107 case "blue": return NUM_TEAM_2;
108 case "yellow": return NUM_TEAM_3;
109 case "pink": return NUM_TEAM_4;
110 case "auto": return 0;
116 float Team_NumberToTeam(float number)
120 case 1: return NUM_TEAM_1;
121 case 2: return NUM_TEAM_2;
122 case 3: return NUM_TEAM_3;
123 case 4: return NUM_TEAM_4;
129 float Team_TeamToNumber(float teamid)
133 case NUM_TEAM_1: return 1;
134 case NUM_TEAM_2: return 2;
135 case NUM_TEAM_3: return 3;
136 case NUM_TEAM_4: return 4;
143 // legacy aliases for shitty code
144 #define TeamByColor(teamid) (Team_TeamToNumber(teamid) - 1)
145 #define ColorByTeam(number) Team_NumberToTeam(number + 1)
148 #define Team_ColorName_Lower(teamid) strtolower(Team_ColorName(teamid))
149 #define Team_ColorName_Upper(teamid) strtoupper(Team_ColorName(teamid))
151 // used for replacement in filenames or such where the name CANNOT be allowed to be translated
152 #define Static_Team_ColorName_Lower(teamid) strtolower(Static_Team_ColorName(teamid))
153 #define Static_Team_ColorName_Upper(teamid) strtoupper(Static_Team_ColorName(teamid))
155 #define Team_FullName(teamid) strcat(Team_ColorName(teamid), " ", NAME_TEAM, "^7")
156 #define Team_ColoredFullName(teamid) strcat(Team_ColorCode(teamid), Team_ColorName(teamid), " ", NAME_TEAM, "^7")
158 #define Team_NumberToFullName(number) Team_FullName(Team_NumberToTeam(number))
159 #define Team_NumberToColoredFullName(number) Team_ColoredFullName(Team_NumberToTeam(number))
161 // replace these flags in a string with the strings provided
162 #define TCR(input,teamcolor,teamtext) strreplace("^TC", teamcolor, strreplace("^TT", teamtext, input))