img_curr_group = -1; \
MACRO_END
+string get_team_list(int team_mask)
+{
+ return strcat(
+ ((team_mask & BIT(0)) ? strcat(Team_ColoredFullName(NUM_TEAM_1), (team_mask >> 1) ? ", " : "") : ""),
+ ((team_mask & BIT(1)) ? strcat(Team_ColoredFullName(NUM_TEAM_2), (team_mask >> 2) ? ", " : "") : ""),
+ ((team_mask & BIT(2)) ? strcat(Team_ColoredFullName(NUM_TEAM_3), (team_mask >> 3) ? ", " : "") : ""),
+ ((team_mask & BIT(3)) ? Team_ColoredFullName(NUM_TEAM_4) : "")
+ );
+}
+
void HUD_InfoMessages()
{
if(!autocvar__hud_configure)
InfoMessage(s);
}
+ int missing_teams_mask = STAT(MISSING_TEAMS_MASK);
+ if (missing_teams_mask)
+ {
+ string missing_teams_list = get_team_list(missing_teams_mask);
+ s = sprintf(_("%sNeed active players for: %s"), blinkcolor, missing_teams_list);
+ InfoMessage(s);
+ }
+
if(teamplay && !spectatee_status && teamnagger)
{
float ts_min = 0, ts_max = 0;
static int prev_missing_teams_mask;
allowed_to_spawn = true;
CA_count_alive_players();
+ missing_teams_mask = 0;
if (Team_GetNumberOfAliveTeams() == NumTeams(ca_teams))
- {
- if(prev_missing_teams_mask > 0)
- Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
- prev_missing_teams_mask = -1;
return true;
- }
if(total_players == 0)
- {
- if(prev_missing_teams_mask > 0)
- Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
- prev_missing_teams_mask = -1;
return false;
- }
- int missing_teams_mask = 0;
for (int i = 1; i <= NUM_TEAMS; ++i)
{
if ((ca_teams & Team_IndexToBit(i)) &&
}
}
if(prev_missing_teams_mask != missing_teams_mask)
- {
- Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask);
prev_missing_teams_mask = missing_teams_mask;
- }
return false;
}
bool freezetag_CheckTeams()
{
static float prev_missing_teams_mask;
+ missing_teams_mask = 0;
if (Team_GetNumberOfAliveTeams() == NumTeams(freezetag_teams))
- {
- if(prev_missing_teams_mask > 0)
- Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
- prev_missing_teams_mask = -1;
return true;
- }
if(total_players == 0)
- {
- if(prev_missing_teams_mask > 0)
- Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
- prev_missing_teams_mask = -1;
return false;
- }
- int missing_teams_mask = 0;
for (int i = 1; i <= NUM_TEAMS; ++i)
{
if ((freezetag_teams & Team_IndexToBit(i)) &&
}
}
if(prev_missing_teams_mask != missing_teams_mask)
- {
- Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask);
prev_missing_teams_mask = missing_teams_mask;
- }
return false;
}
void kh_WaitForPlayers() // delay start of the round until enough players are present
{
static int prev_missing_teams_mask;
+ missing_teams_mask = kh_GetMissingTeams();
if(time < game_starttime)
{
- if (prev_missing_teams_mask > 0)
- Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
- prev_missing_teams_mask = -1;
kh_Controller_SetThink(game_starttime - time + 0.1, kh_WaitForPlayers);
return;
}
- int missing_teams_mask = kh_GetMissingTeams();
if(!missing_teams_mask)
{
- if(prev_missing_teams_mask > 0)
- Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
- prev_missing_teams_mask = -1;
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_KEYHUNT_ROUNDSTART, autocvar_g_balance_keyhunt_delay_round);
kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round, kh_StartRound);
}
else
{
- if(player_count == 0)
- {
- if(prev_missing_teams_mask > 0)
- Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS);
- prev_missing_teams_mask = -1;
- }
- else
+ if(player_count != 0)
{
if(prev_missing_teams_mask != missing_teams_mask)
- {
- Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask);
prev_missing_teams_mask = missing_teams_mask;
- }
}
kh_Controller_SetThink(1, kh_WaitForPlayers);
}
MSG_CENTER_NOTIF(LMS_SPECWARN, N_ENABLE, 0, 0, "", CPID_LMS, "0 0", _("^F4WARNING:^BG you can't rejoin this match after spectating.\nUse the same command again to spectate anyway."), "")
MSG_CENTER_NOTIF(LMS_VISIBLE_LEADER, N_ENABLE, 0, 0, "", CPID_LMS, "0 0", _("^BGEnemies can now see you on radar!"), "")
MSG_CENTER_NOTIF(LMS_VISIBLE_OTHER, N_ENABLE, 0, 0, "", CPID_LMS, "0 0", _("^BGLeaders can now be seen by enemies on radar!"), "")
-
- MSG_CENTER_NOTIF(MISSING_TEAMS, N_ENABLE, 0, 1, "missing_teams", CPID_MISSING_TEAMS, "-1 0", _("^BGWaiting for players to join...\nNeed active players for: %s"), "")
- MSG_CENTER_NOTIF(MISSING_PLAYERS, N_ENABLE, 0, 1, "f1", CPID_MISSING_PLAYERS, "-1 0", _("^BGWaiting for %s player(s) to join..."), "")
-
+// TODO update notifications.cfg
MSG_CENTER_NOTIF(INSTAGIB_DOWNGRADE, N_ENABLE, 0, 0, "", CPID_INSTAGIB_FINDAMMO, "5 0", _("^BGYour weapon has been downgraded until you find some ammo!"), "")
MSG_CENTER_NOTIF(INSTAGIB_FINDAMMO, N_ENABLE, 0, 0, "", CPID_INSTAGIB_FINDAMMO, "1 9", _("^F4^COUNT^BG left to find some ammo!"), "")
MSG_CENTER_NOTIF(INSTAGIB_FINDAMMO_FIRST, N_ENABLE, 0, 0, "", CPID_INSTAGIB_FINDAMMO, "1 10", _("^BGGet some ammo or you'll be dead in ^F4^COUNT^BG!"), _("^BGGet some ammo! ^F4^COUNT^BG left!"))
CASE(CPID, KEYHUNT)
CASE(CPID, KEYHUNT_OTHER)
CASE(CPID, LMS)
- CASE(CPID, MISSING_TEAMS)
- CASE(CPID, MISSING_PLAYERS)
CASE(CPID, INSTAGIB_FINDAMMO)
CASE(CPID, MOTD)
CASE(CPID, NIX)
f2race_time: TIME_ENCODED_TOSTRING of f2
race_col: color of race time/position (i.e. good or bad)
race_diff: show time difference between f2 and f3
- missing_teams: show which teams still need players
pass_key: find the keybind for "passing" or "dropping" in CTF game mode
nade_key: find the keybind for nade throwing
frag_ping: show the ping of a player
ARG_CASE(ARG_CS_SV_HA, "f3race_time", TIME_ENCODED_TOSTRING(f3, true)) \
ARG_CASE(ARG_CS_SV, "race_col", CCR(((f1 == 1) ? "^F1" : "^F2"))) \
ARG_CASE(ARG_CS_SV, "race_diff", ((f2 > f3) ? sprintf(CCR("^1[+%s]"), TIME_ENCODED_TOSTRING(f2 - f3, true)) : sprintf(CCR("^2[-%s]"), TIME_ENCODED_TOSTRING(f3 - f2, true)))) \
- ARG_CASE(ARG_CS, "missing_teams", notif_arg_missing_teams(f1)) \
ARG_CASE(ARG_CS, "pass_key", getcommandkey(_("drop flag"), "+use")) \
ARG_CASE(ARG_CS, "nade_key", getcommandkey(_("throw nade"), "dropweapon")) \
ARG_CASE(ARG_CS, "join_key", getcommandkey(_("jump"), "+jump")) \
return sprintf(CCR(_("\n(^F4Dead^BG)%s")), s);
}
-string notif_arg_missing_teams(float f1)
-{
- return strcat(
- ((f1 & BIT(0)) ? strcat(Team_ColoredFullName(NUM_TEAM_1), (f1 >> 1) ? ", " : "") : ""),
- ((f1 & BIT(1)) ? strcat(Team_ColoredFullName(NUM_TEAM_2), (f1 >> 2) ? ", " : "") : ""),
- ((f1 & BIT(2)) ? strcat(Team_ColoredFullName(NUM_TEAM_3), (f1 >> 3) ? ", " : "") : ""),
- ((f1 & BIT(3)) ? Team_ColoredFullName(NUM_TEAM_4) : "")
- );
-}
-
string notif_arg_spree_cen(float spree)
{
// 0 = off, 1 = target (but only for first victim) and attacker
float game_stopped;
float game_starttime; //point in time when the countdown to game start is over
float round_starttime; //point in time when the countdown to round start is over
+int missing_teams_mask;
int autocvar_leadlimit;
int overtimes; // overtimes added (-1 = sudden death)
int timeout_status; // (values: 0, 1, 2) contains whether a timeout is not active (0), was called but still at leadtime (1) or is active (2)
REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor(this))
REGISTER_STAT(GAME_STOPPED, int, game_stopped)
REGISTER_STAT(GAMESTARTTIME, float, game_starttime)
+REGISTER_STAT(MISSING_TEAMS_MASK, float, missing_teams_mask)
/** arc heat in [0,1] */
REGISTER_STAT(PRESSED_KEYS, int)
REGISTER_STAT(FUEL, int)