23 vector redflag_pos, blueflag_pos, yellowflag_pos, pinkflag_pos, neutralflag_pos;
27 int redflag, blueflag, yellowflag, pinkflag, neutralflag;
28 float redflag_statuschange_elapsedtime = 0, blueflag_statuschange_elapsedtime = 0, yellowflag_statuschange_elapsedtime = 0, pinkflag_statuschange_elapsedtime = 0, neutralflag_statuschange_elapsedtime = 0;
31 int stat_items = STAT(OBJECTIVE_STATUS);
32 float fs, fs2, fs3, size1, size2;
37 redflag = (stat_items/CTF_RED_FLAG_TAKEN) & 3;
38 blueflag = (stat_items/CTF_BLUE_FLAG_TAKEN) & 3;
39 yellowflag = (stat_items/CTF_YELLOW_FLAG_TAKEN) & 3;
40 pinkflag = (stat_items/CTF_PINK_FLAG_TAKEN) & 3;
41 neutralflag = (stat_items/CTF_NEUTRAL_FLAG_TAKEN) & 3;
43 ctf_oneflag = (stat_items & CTF_FLAG_NEUTRAL);
45 ctf_stalemate = (stat_items & CTF_STALEMATE);
47 mod_active = (redflag || blueflag || yellowflag || pinkflag || neutralflag || (stat_items & CTF_SHIELDED));
56 ctf_oneflag = neutralflag = 0;
60 #define X(team) MACRO_BEGIN \ 61 if (team##flag != team##flag_prevframe) { \ 62 team##flag_statuschange_time = time; \ 63 team##flag_prevstatus = team##flag_prevframe; \ 64 team##flag_prevframe = team##flag; \ 66 team##flag_statuschange_elapsedtime = time - team##flag_statuschange_time; \ 75 #define X(team, cond) \ 76 string team##_icon = string_null, team##_icon_prevstatus = string_null; \ 77 int team##_alpha, team##_alpha_prevstatus; \ 78 team##_alpha = team##_alpha_prevstatus = 1; \ 80 switch (team##flag) { \ 81 case 1: team##_icon = "flag_" #team "_taken"; break; \ 82 case 2: team##_icon = "flag_" #team "_lost"; break; \ 83 case 3: team##_icon = "flag_" #team "_carrying"; team##_alpha = blink(0.85, 0.15, 5); break; \ 85 if ((stat_items & CTF_SHIELDED) && (cond)) { \ 86 team##_icon = "flag_" #team "_shielded"; \ 88 team##_icon = string_null; \ 92 switch (team##flag_prevstatus) { \ 93 case 1: team##_icon_prevstatus = "flag_" #team "_taken"; break; \ 94 case 2: team##_icon_prevstatus = "flag_" #team "_lost"; break; \ 95 case 3: team##_icon_prevstatus = "flag_" #team "_carrying"; team##_alpha_prevstatus = blink(0.85, 0.15, 5); break; \ 97 if (team##flag == 3) { \ 98 team##_icon_prevstatus = "flag_" #team "_carrying"; \ 99 } else if((stat_items & CTF_SHIELDED) && (cond)) { \ 100 team##_icon_prevstatus = "flag_" #team "_shielded"; \ 102 team##_icon_prevstatus = string_null; \ 111 X(neutral, ctf_oneflag);
122 red_icon = red_icon_prevstatus = blue_icon = blue_icon_prevstatus = yellow_icon = yellow_icon_prevstatus = pink_icon = pink_icon_prevstatus =
string_null;
124 }
else switch (tcount) {
126 case 2: fs = 0.5; fs2 = 0.5; fs3 = 0.5;
break;
127 case 3: fs = 1; fs2 = 0.35; fs3 = 0.35;
break;
128 case 4: fs = 0.75; fs2 = 0.25; fs3 = 0.5;
break;
131 if (mySize_x > mySize_y) {
147 blueflag_pos = pos +
eX * fs2 * size1;
148 yellowflag_pos = pos -
eX * fs2 * size1;
149 pinkflag_pos = pos +
eX * fs3 * size1;
153 redflag_pos = pos +
eX * fs2 * size1;
155 yellowflag_pos = pos -
eX * fs2 * size1;
156 pinkflag_pos = pos +
eX * fs3 * size1;
160 redflag_pos = pos +
eX * fs3 * size1;
161 blueflag_pos = pos -
eX * fs2 * size1;
162 yellowflag_pos = pos;
163 pinkflag_pos = pos +
eX * fs2 * size1;
167 redflag_pos = pos -
eX * fs2 * size1;
168 blueflag_pos = pos +
eX * fs3 * size1;
169 yellowflag_pos = pos +
eX * fs2 * size1;
174 neutralflag_pos = pos;
175 flag_size = e1 * fs * size1 + e2 * size2;
177 #define X(team) MACRO_BEGIN \ 178 f = bound(0, team##flag_statuschange_elapsedtime * 2, 1); \ 179 if (team##_icon && ctf_stalemate) \ 180 drawpic_aspect_skin(team##flag_pos, "flag_stalemate", flag_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); \ 181 if (team##_icon_prevstatus && f < 1) \ 182 drawpic_aspect_skin_expanding(team##flag_pos, team##_icon_prevstatus, flag_size, '1 1 1', panel_fg_alpha * team##_alpha_prevstatus, DRAWFLAG_NORMAL, f); \ 184 drawpic_aspect_skin(team##flag_pos, team##_icon, flag_size, '1 1 1', panel_fg_alpha * team##_alpha * f, DRAWFLAG_NORMAL); \ 202 M_ARGV(0,
string) = _(
"Capture time rankings");
bool autocvar__hud_configure
bool autocvar_hud_panel_scoreboard_ctf_leaderboard
float neutralflag_statuschange_time
void HUD_Mod_CTF(vector pos, vector mySize)
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
float yellowflag_statuschange_time
int neutralflag_prevstatus
int neutralflag_prevframe
int autocvar__teams_available
float redflag_statuschange_time
int yellowflag_prevstatus
MUTATOR_HOOKFUNCTION(cl_ctf, ShowRankings)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
REGISTER_MUTATOR(cl_ctf, true)
float blueflag_statuschange_time
float pinkflag_statuschange_time