return 0;
}
+float GetPlayerColorForce(float i)
+{
+ if(!teamplay)
+ return 0;
+ else
+ return stof(getplayerkeyvalue(i, "colors")) & 15;
+}
+
+float GetPlayerColor(float i)
+{
+ if not(playerslots[i].gotscores) // unconnected
+ return FL_SPECTATOR;
+ else if(stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR)
+ return FL_SPECTATOR;
+ else
+ return GetPlayerColorForce(i);
+}
+
+string GetPlayerName(float i)
+{
+ return ColorTranslateRGB(getplayerkeyvalue(i, "name"));
+}
+
+
/*
==================
HUD panels
{
color2 = GetPlayerColor(tm.sv_entnum);
//if(color == FL_SPECTATOR || color == color2)
- draw_teamradar_player(tm.origin, tm.angles, GetTeamRGB(color2));
+ draw_teamradar_player(tm.origin, tm.angles, Team_ColorRGB(color2));
}
draw_teamradar_player(view_origin, view_angles, '1 1 1');
for(i=0; i<team_count; ++i) {
if (i == floor((entries - 2) / players_per_team) || (entries == 1 && i == 0))
HUD_Panel_DrawHighlight(pos + eX * score_size * i, eX * score_size + eY * fontsize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect(pos + eX * score_size * i, ftos(175 - 23*i), eX * score_size + eY * fontsize_y, GetTeamRGB(ColorByTeam(i)) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(pos + eX * score_size * i, ftos(175 - 23*i), eX * score_size + eY * fontsize_y, Team_ColorRGB(ColorByTeam(i)) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
}
first_pl = 1;
pos_y += fontsize_y;
}
if (team_count)
- score_color = GetTeamRGB(ColorByTeam(floor((i - first_pl) / players_per_team))) * 0.8;
+ score_color = Team_ColorRGB(ColorByTeam(floor((i - first_pl) / players_per_team))) * 0.8;
s = textShortenToWidth(s, name_size, fontsize, stringwidth_colors);
drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, TRUE, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
drawstring(pos + eX * (name_size + spacing_size), ftos(score), fontsize, score_color, panel_fg_alpha, DRAWFLAG_NORMAL);
continue;
if (tm.team == myteam)
drawfill(pos + eX * score_size * i, eX * score_size + eY * fontsize_y, '1 1 1', highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect(pos + eX * score_size * i, ftos(tm.(teamscores[ts_primary])), eX * score_size + eY * fontsize_y, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(pos + eX * score_size * i, ftos(tm.(teamscores[ts_primary])), eX * score_size + eY * fontsize_y, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
++i;
}
first_pl = 1;
drawfill(pos, eX * mySize_x + eY * fontsize_y, rgb, highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
if (team_count)
- score_color = GetTeamRGB(pl.team) * 0.8;
+ score_color = Team_ColorRGB(pl.team) * 0.8;
s = textShortenToWidth(GetPlayerName(pl.sv_entnum), name_size, fontsize, stringwidth_colors);
drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, TRUE, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
drawstring(pos + eX * (name_size + spacing_size), ftos(pl.(scores[ps_primary])), fontsize, score_color, panel_fg_alpha, DRAWFLAG_NORMAL);
score_pos = pos + eX * column * (score_size_x + offset_x) + eY * row * (score_size_y + offset_y);
if (max_fragcount == score)
HUD_Panel_DrawHighlight(score_pos, score_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect(score_pos, ftos(score), score_size, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(score_pos, ftos(score), score_size, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
++row;
if(row >= rows)
{
else if(tm.team == myteam) {
if (max_fragcount == score)
HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize_x + eY * mySize_y, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize_x + eY * mySize_y, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
} else {
if (max_fragcount == score)
HUD_Panel_DrawHighlight(pos + eX * 0.75 * mySize_x + eY * (1/3) * rows * mySize_y, score_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
- drawstring_aspect(pos + eX * 0.75 * mySize_x + eY * (1/3) * rows * mySize_y, ftos(score), score_size, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring_aspect(pos + eX * 0.75 * mySize_x + eY * (1/3) * rows * mySize_y, ftos(score), score_size, Team_ColorRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
++rows;
}
}
prandom.qh
bgmscript.qh
noise.qh
-teamplay.qh
tturrets.qh
../server/tturrets/include/turrets_early.qh
../server/movelib.qc
sortlist.qc
miscfunctions.qc
-teamplay.qc
../server/t_items.qc
teamradar.qc
void HUD_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_number)
{
vector tmp, rgb;
- rgb = GetTeamRGB(pl.team);
+ rgb = Team_ColorRGB(pl.team);
string str;
float i, field;
float is_spec;
continue;
draw_beginBoldFont();
- rgb = GetTeamRGB(tm.team);
+ rgb = Team_ColorRGB(tm.team);
str = ftos(tm.(teamscores[ts_primary]));
drawstring(pos + team_score_baseoffset - eX * stringwidth(str, FALSE, hud_fontsize * 1.5), str, hud_fontsize * 1.5, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
}
else if(autocvar_scoreboard_accuracy && spectatee_status != -1 && !warmup_stage) {
if(teamplay)
- pos = HUD_DrawScoreboardAccuracyStats(pos, GetTeamRGB(myteam), bg_size);
+ pos = HUD_DrawScoreboardAccuracyStats(pos, Team_ColorRGB(myteam), bg_size);
else
pos = HUD_DrawScoreboardAccuracyStats(pos, rgb, bg_size);
}
if(teamplay)
- pos = HUD_DrawMapStats(pos, GetTeamRGB(myteam), bg_size);
+ pos = HUD_DrawMapStats(pos, Team_ColorRGB(myteam), bg_size);
else
pos = HUD_DrawMapStats(pos, rgb, bg_size);
+++ /dev/null
-float TeamByColor(float color)
-{
- switch(color)
- {
- 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;
- }
-}
-float ColorByTeam(float i)
-{
- switch(i)
- {
- 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 GetPlayerColorForce(float i)
-{
- if(!teamplay)
- return 0;
- else
- return stof(getplayerkeyvalue(i, "colors")) & 15;
-}
-
-float GetPlayerColor(float i)
-{
- if not(playerslots[i].gotscores) // unconnected
- return FL_SPECTATOR;
- else if(stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR)
- return FL_SPECTATOR;
- else
- return GetPlayerColorForce(i);
-}
-
-string GetPlayerName(float i)
-{
- return ColorTranslateRGB(getplayerkeyvalue(i, "name"));
-}
-
-vector GetTeamRGB(float color)
-{
- switch(color)
- {
- default: return '1 1 1';
- 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
- }
-}
-
-string GetTeamName(float color)
-{
- switch(color)
- {
- default: return _("Spectators");
- 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");
- }
-}
+++ /dev/null
-float teamplay;
-float myteam;
#endif
#define MSG_INFO_NOTIFICATIONS \
MSG_INFO_NOTIF(INFO_EMPTY, 0, 0, NO_STR_ARG, XPND2("", ""), "", "", "") \
- MULTITEAM_INFO(INFO_SCORES_, 2, 0, 0, NO_STR_ARG, XPND2("", ""), "", _("^TC^TT ^BGteam scores!\n"), "") \
+ MULTITEAM_INFO(INFO_SCORES_, 4, 0, 0, NO_STR_ARG, XPND2("", ""), "", _("^TC^TT ^BGteam scores!\n"), "") \
MULTITEAM_INFO(INFO_CTF_FLAGRETURN_DROPPED_, 2, 0, 0, NO_STR_ARG, XPND2("", ""), "", _("^BGThe ^TC^TT^BG flag was dropped in the base and returned itself\n"), "") \
MULTITEAM_INFO(INFO_CTF_FLAGRETURN_DAMAGED_, 2, 0, 0, NO_STR_ARG, XPND2("", ""), "", _("^BGThe ^TC^TT^BG flag was destroyed and returned to base\n"), "") \
MULTITEAM_INFO(INFO_CTF_FLAGRETURN_SPEEDRUN_, 2, 0, 1, f1/100, XPND2("", ""), "", _("^BGThe ^TC^TT^BG flag became impatient after ^F1%.2f^BG seconds and returned itself\n"), "") \
case MSG_INFO:
{
#define MSG_INFO_NOTIF(name,strnum,flnum,args,hudargs,icon,normal,gentle) \
- { NOTIF_MATCH(name, net_name) CHECK_AUTOCVAR(name) { print(sprintf(CCR(normal_or_gentle(normal, gentle)), args)); if(strtolower(icon) != "") { HUD_Notify_Push(icon, hudargs); } } }
+ { NOTIF_MATCH(name, net_name) CHECK_AUTOCVAR(name) \
+ { \
+ print(sprintf(CCR(normal_or_gentle(normal, gentle)), args)); \
+ if(strtolower(icon) != "") { HUD_Notify_Push(icon, hudargs); } \
+ } }
MSG_INFO_NOTIFICATIONS
break;
}
case MSG_CENTER:
{
#define MSG_CENTER_NOTIF(name,strnum,flnum,args,cpid,durcnt,normal,gentle) \
- { NOTIF_MATCH(name, net_name) CHECK_AUTOCVAR(name) { centerprint_generic(HANDLE_CPID(cpid), sprintf(CCR(normal_or_gentle(normal, gentle)), args), durcnt); } }
+ { NOTIF_MATCH(name, net_name) CHECK_AUTOCVAR(name) \
+ { \
+ centerprint_generic(HANDLE_CPID(cpid), sprintf(CCR(normal_or_gentle(normal, gentle)), args), durcnt); \
+ } }
MSG_CENTER_NOTIFICATIONS
break;
}
case MSG_WEAPON:
{
#define MSG_WEAPON_NOTIF(name,strnum,flnum,args,normal,gentle) \
- { NOTIF_MATCH(name, net_name) CHECK_AUTOCVAR(name) { print("unhandled\n"); } }
+ { NOTIF_MATCH(name, net_name) CHECK_AUTOCVAR(name) \
+ { \
+ print("unhandled\n"); \
+ } }
MSG_WEAPON_NOTIFICATIONS
break;
}
--- /dev/null
+#ifdef TEAMNUMBERS_THAT_ARENT_STUPID
+const float FL_TEAM_1 = 1; // red
+const float FL_TEAM_2 = 2; // blue
+const float FL_TEAM_3 = 3; // yellow
+const float FL_TEAM_4 = 4; // pink
+const float FL_SPECTATOR = 5;
+#else
+#ifdef CSQC
+const float FL_TEAM_1 = 4; // red
+const float FL_TEAM_2 = 13; // blue
+const float FL_TEAM_3 = 12; // yellow
+const float FL_TEAM_4 = 9; // pink
+#else
+const float FL_TEAM_1 = 5; // red
+const float FL_TEAM_2 = 14; // blue
+const float FL_TEAM_3 = 13; // yellow
+const float FL_TEAM_4 = 10; // pink
+#endif
+const float FL_SPECTATOR = 1337;
+#endif
+
+const string COL_TEAM_1 = "^1";
+const string COL_TEAM_2 = "^4";
+const string COL_TEAM_3 = "^3";
+const string COL_TEAM_4 = "^6";
+const string STR_TEAM_1 = _("Red");
+const string STR_TEAM_2 = _("Blue");
+const string STR_TEAM_3 = _("Yellow");
+const string STR_TEAM_4 = _("Pink");
+const string STR_TEAM = _("Team");
+const string STR_NEUTRAL = _("Neutral");
+
+#ifdef CSQC
+float teamplay;
+float myteam;
+#endif
+
+string Team_ColorCode(float teamid)
+{
+ switch(teamid)
+ {
+ case FL_TEAM_1: return COL_TEAM_1;
+ case FL_TEAM_2: return COL_TEAM_2;
+ case FL_TEAM_3: return COL_TEAM_3;
+ case FL_TEAM_4: return COL_TEAM_4;
+ }
+
+ return "^7";
+}
+
+vector Team_ColorRGB(float teamid)
+{
+ switch(teamid)
+ {
+ #ifdef TEAMNUMBERS_THAT_ARENT_STUPID
+ case FL_TEAM_1: return '1 0 0'; // red
+ case FL_TEAM_2: return '0 0 1'; // blue
+ case FL_TEAM_3: return '1 1 0'; // yellow
+ case FL_TEAM_4: return '1 0 1'; // pink
+ #else
+ case FL_TEAM_1: return '1 0.0625 0.0625';
+ case FL_TEAM_2: return '0.0625 0.0625 1';
+ case FL_TEAM_3: return '1 1 0.0625';
+ case FL_TEAM_4: return '1 0.0625 1';
+ #endif
+ }
+
+ return '0 0 0';
+}
+
+string Team_ColorName(float teamid)
+{
+ switch(teamid)
+ {
+ case FL_TEAM_1: return STR_TEAM_1;
+ case FL_TEAM_2: return STR_TEAM_2;
+ case FL_TEAM_3: return STR_TEAM_3;
+ case FL_TEAM_4: return STR_TEAM_4;
+ }
+
+ return STR_NEUTRAL;
+}
+
+float Team_ColorToTeam(string team_color)
+{
+ switch(strtolower(team_color))
+ {
+ case "red": return FL_TEAM_1;
+ case "blue": return FL_TEAM_2;
+ case "yellow": return FL_TEAM_3;
+ case "pink": return FL_TEAM_4;
+ case "auto": return 0;
+ }
+
+ return -1;
+}
+
+float Team_NumberToTeam(float number)
+{
+ switch(number)
+ {
+ case 1: return FL_TEAM_1;
+ case 2: return FL_TEAM_2;
+ case 3: return FL_TEAM_3;
+ case 4: return FL_TEAM_4;
+ }
+
+ return -1;
+}
+
+float Team_TeamToNumber(float teamid)
+{
+ switch(teamid)
+ {
+ case FL_TEAM_1: return 1;
+ case FL_TEAM_2: return 2;
+ case FL_TEAM_3: return 3;
+ case FL_TEAM_4: return 4;
+ }
+
+ return -1;
+}
+
+
+// legacy aliases for shitty code
+float TeamByColor(float teamid) { return (Team_TeamToNumber(teamid) - 1); }
+float ColorByTeam(float number) { return Team_NumberToTeam(number + 1); }
+
+// useful aliases
+string Team_ColorName_Lower(float teamid) { return strtolower(Team_ColorName(teamid)); }
+string Team_ColorName_Upper(float teamid) { return strtoupper(Team_ColorName(teamid)); }
+
+string Team_FullName(float teamid) { return strcat(Team_ColorName(teamid), " ", STR_TEAM, "^7"); }
+string Team_ColoredFullName(float teamid) { return strcat(Team_ColorCode(teamid), Team_ColorName(teamid), " ", STR_TEAM, "^7"); }
+
+string Team_NumberToFullName(float number) { return Team_FullName(Team_NumberToTeam(number)); }
+string Team_NumberToColoredFullName(float number) { return Team_ColoredFullName(Team_NumberToTeam(number)); }
}
else
{
- self.killindicator.colormod = TeamColor(targetteam);
+ self.killindicator.colormod = Team_ColorRGB(targetteam);
if(clienttype(self) == CLIENTTYPE_REAL)
if(self.killindicator.cnt > 0)
- Send_CSQC_Centerprint_Generic(self, CPID_TEAMCHANGE, strcat("Changing to ", ColoredTeamName(targetteam), " in %d seconds"), 1, self.killindicator.cnt);
+ Send_CSQC_Centerprint_Generic(self, CPID_TEAMCHANGE, strcat("^7Changing to ", Team_ColoredFullName(targetteam), "^7 in %d seconds"), 1, self.killindicator.cnt);
}
}
Called when a client connects to the server
=============
*/
-string ColoredTeamName(float t);
void DecodeLevelParms (void);
//void dom_player_join_team(entity pl);
void set_dom_state(entity e);
bprint("^4", self.netname, "^4 connected");
if(self.classname != "observer" && (g_domination || g_ctf))
- bprint(" and joined the ", ColoredTeamName(self.team));
+ bprint(" and joined the ", Team_ColoredFullName(self.team));
bprint("\n");
if not(show_message & 1) // admin 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"));
+ bprint(strcat(client.netname, " joined the ", Team_ColoredFullName(client.team), "\n"));
}
if(teamplay)
{
// set up
- float team_color;
+ float team_id;
float save = client.team_forced;
client.team_forced = 0;
// find the team to move the player to
- team_color = Team_ColorToNumber(destination);
- if(team_color == client.team) // already on the destination team
+ team_id = Team_ColorToTeam(destination);
+ if(team_id == client.team) // already on the destination team
{
// keep the forcing undone
- print("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") is already on the ", ColoredTeamName(client.team), (targets ? ", skipping to next player.\n" : ".\n"));
+ print("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") is already on the ", Team_ColoredFullName(client.team), (targets ? "^7, skipping to next player.\n" : "^7.\n"));
continue;
}
- else if(team_color == 0) // auto team
+ else if(team_id == 0) // auto team
{
- team_color = Team_NumberToTeam(FindSmallestTeam(client, FALSE));
+ team_id = Team_NumberToTeam(FindSmallestTeam(client, FALSE));
}
else
{
client.team_forced = save;
// Check to see if the destination team is even available
- switch(team_color)
+ switch(team_id)
{
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;
// If so, lets continue and finally move the player
client.team_forced = 0;
- MoveToTeam(client, team_color, 6, stof(notify));
+ MoveToTeam(client, team_id, 6, stof(notify));
successful = strcat(successful, (successful ? ", " : ""), client.netname);
- print("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") has been moved to the ", ColoredTeamName(team_color), ".\n");
+ print("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") has been moved to the ", Team_ColoredFullName(team_id), "^7.\n");
continue;
}
else
if (targ == attacker) // suicides
{
- s1 = ((deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE) ? ColoredTeamName(targ.team) : "");
+ s1 = ((deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE) ? Team_ColoredFullName(targ.team) : "");
// no "killed your own dumb self" message in CTS
if(!g_cts) { Obituary_Notification(targ, s1, "", "", deathtype); }
void() spawnfunc_info_player_deathmatch; // needed for the other spawnpoints
void() spawnpoint_use;
string GetMapname();
-string ColoredTeamName(float t);
string admin_name(void)
{
bprint(key.owner.netname);
first = FALSE;
}
- bprint("^7 captured the keys for the ", ColoredTeamName(teem), "\n");
+ bprint("^7 captured the keys for the ", Team_ColoredFullName(teem), "\n");
first = TRUE;
midpoint = '0 0 0';
te_lightning2(world, lastorigin, firstorigin);
}
midpoint = midpoint * (1 / kh_teams);
- te_customflash(midpoint, 1000, 1, TeamColor(teem) * 0.5 + '0.5 0.5 0.5'); // make the color >=0.5 in each component
+ te_customflash(midpoint, 1000, 1, Team_ColorRGB(teem) * 0.5 + '0.5 0.5 0.5'); // make the color >=0.5 in each component
play2all(kh_sound_capture);
kh_FinishRound();
kh_Scores_Event(attacker, world, "push", autocvar_g_balance_keyhunt_score_push, 0);
PlayerScore_Add(attacker, SP_KH_PUSHES, 1);
centerprint(attacker, "Your push is the best!");
- bprint("The ", ColoredTeamName(teem), "^7 could not take care of the ", lostkey.netname, "^7 when ", attacker.netname, "^7 came\n");
+ bprint("The ", Team_ColoredFullName(teem), "^7 could not take care of the ", lostkey.netname, "^7 when ", attacker.netname, "^7 came\n");
}
else
{
--j;
}
- bprint("The ", ColoredTeamName(teem), "^7 could not take care of the ", lostkey.netname, "\n");
+ bprint("The ", Team_ColoredFullName(teem), "^7 could not take care of the ", lostkey.netname, "\n");
}
play2all(kh_sound_destroy);
te_tarexplosion(lostkey.origin);
else
Send_CSQC_Centerprint_Generic(head, CPID_KH_MSG, "All keys are in your team's hands!\n\nHelp the key carriers to meet!", 0, 0);
else
- Send_CSQC_Centerprint_Generic(head, CPID_KH_MSG, strcat("All keys are in the ", ColoredTeamName(kh_interferemsg_team), "^7's hands!\n\nInterfere ^1NOW^7!"), 0, 0);
+ Send_CSQC_Centerprint_Generic(head, CPID_KH_MSG, strcat("All keys are in the ", Team_ColoredFullName(kh_interferemsg_team), "^7's hands!\n\nInterfere ^1NOW^7!"), 0, 0);
}
}
key.kh_dropperteam = 0;
key.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
setsize(key, KH_KEY_MIN, KH_KEY_MAX);
- key.colormod = TeamColor(initial_owner.team) * KH_KEY_BRIGHTNESS;
+ key.colormod = Team_ColorRGB(initial_owner.team) * KH_KEY_BRIGHTNESS;
key.reset = key_reset;
switch(initial_owner.team)
{
if(result != "")
result = strcat(result, ", ");
- result = strcat(result, ColoredTeamName(teem));
+ result = strcat(result, Team_ColoredFullName(teem));
}
}
return result;
{
if(self.ballcarried.teamtime && (self.ballcarried.teamtime < time))
{
- bprint("The ", ColoredTeamName(self.team), " held the ball for too long.\n");
+ bprint("The ", Team_ColoredFullName(self.team), " held the ball for too long.\n");
oldself = self;
self = self.ballcarried;
DropBall(self, self.owner.origin, '0 0 0');
if(self.cnt < 2) // step 1
{
if(time == self.teamtime)
- bprint("The ", ColoredTeamName(self.team), " held the ball for too long.\n");
+ bprint("The ", Team_ColoredFullName(self.team), " held the ball for too long.\n");
self.touch = SUB_Null;
self.movetype = MOVETYPE_NOCLIP;
self.velocity = '0 0 0'; // just in case?
{
LogNB("fault", ball.pusher);
if(nb_teams == 2)
- bprint(ColoredTeamName(otherteam), " gets a point due to ", pname, "^7's silliness.\n");
+ bprint(Team_ColoredFullName(otherteam), " gets a point due to ", pname, "^7's silliness.\n");
else
- bprint(ColoredTeamName(ball.team), " loses a point due to ", pname, "^7's silliness.\n");
+ bprint(Team_ColoredFullName(ball.team), " loses a point due to ", pname, "^7's silliness.\n");
pscore = -1;
}
else if(self.team == GOAL_OUT)
else //score
{
LogNB(strcat("goal:", ftos(self.team)), ball.pusher);
- bprint("Goaaaaal! ", pname, "^7 scored a point for the ", ColoredTeamName(ball.team), ".\n");
+ bprint("Goaaaaal! ", pname, "^7 scored a point for the ", Team_ColoredFullName(ball.team), ".\n");
pscore = 1;
}
if (time > self.pain_finished)
{
self.pain_finished = time + 10;
- bprint(ColoredTeamName(self.team), " generator under attack!\n");
+ bprint(Team_ColoredFullName(self.team), " generator under attack!\n");
play2team(self.team, "onslaught/generator_underattack.wav");
}
}
lh = ceil(self.lasthealth / 100) * 100;
h = ceil(self.health / 100) * 100;
if(lh != h)
- bprint(ColoredTeamName(self.team), " generator has less than ", ftos(h), " health remaining\n");
+ bprint(Team_ColoredFullName(self.team), " generator has less than ", ftos(h), " health remaining\n");
#endif
self.lasthealth = self.health;
}
else if not(inWarmupStage)
{
if (attacker == self)
- bprint(ColoredTeamName(self.team), " generator spontaneously exploded due to overtime!\n");
+ bprint(Team_ColoredFullName(self.team), " generator spontaneously exploded due to overtime!\n");
else
{
string t;
- t = ColoredTeamName(attacker.team);
- bprint(ColoredTeamName(self.team), " generator destroyed by ", t, "!\n");
+ t = Team_ColoredFullName(attacker.team);
+ bprint(Team_ColoredFullName(self.team), " generator destroyed by ", t, "!\n");
}
self.iscaptured = FALSE;
self.islinked = FALSE;
pointparticles(particleeffectnum("rocket_explode"), self.origin, '0 0 0', 1);
{
string t;
- t = ColoredTeamName(attacker.team);
- bprint(ColoredTeamName(self.team), " ", self.message, " control point destroyed by ", t, "\n");
+ t = Team_ColoredFullName(attacker.team);
+ bprint(Team_ColoredFullName(self.team), " ", self.message, " control point destroyed by ", t, "\n");
ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 25, "models/onslaught/controlpoint_icon_gib1.md3", 3, FALSE);
ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 45, "models/onslaught/controlpoint_icon_gib2.md3", 3, FALSE);
ons_throwgib(self.origin, (2 * randomvec() - '1 1 1') * 45, "models/onslaught/controlpoint_icon_gib2.md3", 3, FALSE);
self.count = autocvar_g_onslaught_cp_regen * sys_frametime; // slow repair rate from now on
self.think = onslaught_controlpoint_icon_think;
sound(self, CH_TRIGGER, "onslaught/controlpoint_built.wav", VOL_BASE, ATTN_NORM);
- bprint(ColoredTeamName(self.team), " captured ", self.owner.message, " control point\n");
+ bprint(Team_ColoredFullName(self.team), " captured ", self.owner.message, " control point\n");
self.owner.iscaptured = TRUE;
WaypointSprite_UpdateMaxHealth(self.owner.sprite, self.max_health);
sk = teamscorekeepers[t - 1];
if(sk)
{
- s = strcat(s, ColoredTeamName(t));
+ s = strcat(s, Team_ColoredFullName(t));
for(i = 0; i < MAX_TEAMSCORE; ++i)
if(teamscores_label[i] != "")
{
PlayerScore_Clear(e);
}
-vector TeamColor(float teem)
-{
- switch(teem)
- {
- case FL_TEAM_1:
- return '1 0.0625 0.0625';
- case FL_TEAM_2:
- return '0.0625 0.0625 1';
- case FL_TEAM_3:
- return '1 1 0.0625';
- case FL_TEAM_4:
- return '1 0.0625 1';
- default:
- return '1 1 1';
- }
-}
-
-string TeamName(float t)
-{
- return strcat(Team_ColorName(t), " Team");
-}
-string ColoredTeamName(float t)
-{
- return strcat(Team_ColorCode(t), Team_ColorName(t), " Team^7");
-}
-string TeamNoName(float t)
-{
- // fixme: Search for team entities and get their .netname's!
- if(t == 1)
- return "Red Team";
- if(t == 2)
- return "Blue Team";
- if(t == 3)
- return "Yellow Team";
- if(t == 4)
- return "Pink Team";
- return "Neutral Team";
-}
-
void dom_init();
void runematch_init();
void tdm_init();
LogTeamchange(pl.playerid, pl.team, 3); // log manual team join
if(!noprint)
- bprint(pl.netname, "^7 has changed from ", TeamNoName(s), " to ", TeamNoName(t), "\n");
+ bprint(pl.netname, "^7 has changed from ", Team_NumberToColoredFullName(s), "^7 to ", Team_NumberToColoredFullName(t), "\n");
}
}
if(selected.deadflag == DEAD_NO)
Damage(selected, selected, selected, 100000, DEATH_AUTOTEAMCHANGE, selected.origin, '0 0 0');
- centerprint(selected, strcat("You have been moved into a different team to improve team balance\nYou are now on: ", ColoredTeamName(selected.team)));
+ centerprint(selected, strcat("You have been moved into a different team to improve team balance\nYou are now on: ", Team_ColoredFullName(selected.team)));
}
// code from here on is just to support maps that don't have team entities
}
if(teamplay && self.team)
- rgb = TeamColor(self.team);
+ rgb = Team_ColorRGB(self.team);
else
rgb = '1 1 1';
WaypointSprite_Spawn("vehicle", 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE, RADARICON_POWERUP, rgb);