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);
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;
}
if(GetTeam(Team, false) == world)
{
print(sprintf(_("trying to switch to unsupported team %d\n"), Team));
- Team = COLOR_SPECTATOR;
+ Team = FL_SPECTATOR;
}
break;
}
if(teamplay)
if(t == myteam)
return SHOTTYPE_HITTEAM;
- if(t == COLOR_SPECTATOR)
+ if(t == FL_SPECTATOR)
return SHOTTYPE_HITWORLD;
return SHOTTYPE_HITENEMY;
}
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)
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';
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');
// 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);
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)
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)
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)
{
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)
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;
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;
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;
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;
}
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 {
}
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 {
{
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:
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;
{
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);
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)
//.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
{
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)
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)
{
../warpzonelib/common.qh
../warpzonelib/client.qh
+../common/teams.qh
../common/util.qh
../common/items.qh
../common/deathtypes.qh
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
{
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];
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;
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;
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;
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();
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);
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);
{
float t;
t = GetPlayerColor(i);
- if(t == COLOR_SPECTATOR)
+ if(t == FL_SPECTATOR)
continue;
entity e;
{
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;
}
}
{
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;
}
}
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);
}
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
}
}
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");
}
}
{
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;
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;
#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
// 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("", ""), "", "", "") \
#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), "", "") \
// 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;
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;
{
// 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;
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");
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();
}
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();
}
}
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();
}
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;
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;
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;
}
{
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;
}
}
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)
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)
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);
}
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)
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);
}
// 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"));
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();}
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();}
remove(self);
return;
}
- self.team = COLOR_TEAM3; // yellow
+ self.team = FL_TEAM_3; // yellow
spawnfunc_info_player_deathmatch();
}
remove(self);
return;
}
- self.team = COLOR_TEAM4; // purple
+ self.team = FL_TEAM_4; // purple
spawnfunc_info_player_deathmatch();
}
// 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;
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###";
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###";
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()
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) {
{
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;
}
}
}
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();
}
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);
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;
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;
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));
{
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")
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"));
}
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;
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
}
else if(team_color == 0) // auto team
{
- team_color = NumberToTeamNumber(FindSmallestTeam(client, FALSE));
+ team_color = Team_NumberToTeam(FindSmallestTeam(client, FALSE));
}
else
{
// 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;
}
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)
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;
//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;
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", "", "");
}
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;
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, "", "", "");
}
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);
{
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);
{
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");
}
{
// 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;
}
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;
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();
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;
}
{
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);
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)
{
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;
}
}
}
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
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?
{
if(g_assault) { remove(self); return; }
- self.team = COLOR_TEAM1; // red
+ self.team = FL_TEAM_1; // red
spawnfunc_info_player_deathmatch();
}
{
if(g_assault) { remove(self); return; }
- self.team = COLOR_TEAM2; // blue
+ self.team = FL_TEAM_2; // blue
spawnfunc_info_player_deathmatch();
}
{
if(g_assault) { remove(self); return; }
- self.team = COLOR_TEAM3; // yellow
+ self.team = FL_TEAM_3; // yellow
spawnfunc_info_player_deathmatch();
}
{
if(g_assault) { remove(self); return; }
- self.team = COLOR_TEAM4; // purple
+ self.team = FL_TEAM_4; // purple
spawnfunc_info_player_deathmatch();
}
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();
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;
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";
{
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;
}
{
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;
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;
}
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);
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:
{
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) ;
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();
}
}
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;
}
}
}
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;
}
}
{
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;
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;
// 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;
// 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
{
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 "";
}
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);
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');
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
}
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";
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)
{
}
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');
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;
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);
if (attacker.classname == "player")
{
nag = FALSE;
- if(self.team == COLOR_TEAM1)
+ if(self.team == FL_TEAM_1)
{
if(time - ons_notification_time_team1 > 10)
{
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)
{
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();
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;
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"):
RandomSelection_Init();
- if(self.team == COLOR_TEAM1)
+ if(self.team == FL_TEAM_1)
{
if(!_close_to_home)
_trg_gen = ons_blue_generator;
_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;
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)
{
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)
../warpzonelib/server.qh
../common/constants.qh
+../common/teams.qh
../common/util.qh
../common/items.qh
../common/deathtypes.qh
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");
}
/*
{
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';
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);
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;
}
}
{
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);
}
// 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;
}
bvalue = value;
else
bvalue = 0;
- if(t == COLOR_TEAM1)
+ if(t == FL_TEAM_1)
{
if(c1 >= 0)
{
cb1 = cb1 + bvalue;
}
}
- if(t == COLOR_TEAM2)
+ if(t == FL_TEAM_2)
{
if(c2 >= 0)
{
cb2 = cb2 + bvalue;
}
}
- if(t == COLOR_TEAM3)
+ if(t == FL_TEAM_3)
{
if(c3 >= 0)
{
cb3 = cb3 + bvalue;
}
}
- if(t == COLOR_TEAM4)
+ if(t == FL_TEAM_4)
{
if(c4 >= 0)
{
// 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;
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
{
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);
}
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;
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()
{
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
// 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