// generic commands (across all programs)
alias addtolist "qc_cmd_svmenu addtolist ${* ?}" // Add a string to a cvar
-alias qc_curl "qc_cmd_svmenu curl ${* ?}" // curl requests
alias dumpcommands "qc_cmd_svmenu dumpcommands ${* ?}" // Dump all commands on the program to *_cmd_dump.txt
+alias dumpnotifs "qc_cmd_svmenu dumpnotifs ${* ?}" // Dump all notifications into notifications_dump.txt
alias maplist "qc_cmd_svmenu maplist ${* ?}" // Automatic control of maplist
-alias nextframe "qc_cmd_svmenu nextframe ${* ?}" // do something next frame
+alias nextframe "qc_cmd_svmenu nextframe ${* ?}" // Execute the given command next frame of this VM
+alias qc_curl "qc_cmd_svmenu qc_curl ${* ?}" // Queries a URL
alias removefromlist "qc_cmd_svmenu removefromlist ${* ?}" // Remove a string from a cvar
alias rpn "qc_cmd_svmenu rpn ${* ?}" // RPN calculator
//alias settemp "qc_cmd_svmenu settemp ${* ?}" // Temporarily set a value to a cvar which is restored later
set g_chat_flood_burst_tell 2 "private chat: allow bursts of so many chat lines"
set g_chat_flood_notify_flooder 1 "when 0, the flooder still can see his own message"
set g_chat_teamcolors 0 "colorize nicknames in team color for chat"
+set g_chat_tellprivacy 1 "when disabled, tell messages are also sent to the server console log... otherwise they're kept private between players."
set g_nick_flood_timeout 120 "time after which nick flood protection resets (set to 0 to disable nick flood checking)"
set g_nick_flood_penalty 0.5 "duration of the nick flood penalty"
set g_nick_flood_penalty_yellow 3 "number of changes to allow before warning and movement blocking"
set g_ctf_flag_health 0
set g_ctf_flag_dropped_waypoint 2 "show dropped flag waypointsprite when a flag is lost. 1 = team only, 2 = for all players"
set g_ctf_flag_dropped_floatinwater 200 "move upwards while in water at this velocity"
-set g_ctf_flag_pickup_verbosename 0 "show the name of the person who picked up the flag too"
set g_ctf_throw 1 "throwing allows circumventing carrierkill score, so enable this with care!"
set g_ctf_throw_angle_max 90 "maximum upwards angle you can throw the flag"
set g_ctf_throw_angle_min -90 "minimum downwards angle you can throw the flag"
-floop-labels \
-funtyped-nil \
-fno-permissive \
+ -fvariadic-args \
$(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
else
# this. is. fteqccccccccccccccccccc!
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);
CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
-
+ CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
+ CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
+
WaypointSprite_Load();
// precaches
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;
}
cl_notice_read();
bHandled = true;
break;
+ case TE_CSQC_NOTIFICATION:
+ Read_Notification();
+ bHandled = true;
+ break;
default:
// No special logic for this temporary entity; return 0 so the engine can handle it
bHandled = false;
if(teamplay)
if(t == myteam)
return SHOTTYPE_HITTEAM;
- if(t == COLOR_SPECTATOR)
+ if(t == FL_SPECTATOR)
return SHOTTYPE_HITWORLD;
return SHOTTYPE_HITENEMY;
}
float autocvar_hud_panel_notify_fadetime;
float autocvar_hud_panel_notify_flip;
float autocvar_hud_panel_notify_fontsize;
-float autocvar_hud_panel_notify_print;
float autocvar_hud_panel_notify_time;
float autocvar_hud_panel_physics;
float autocvar_hud_panel_physics_acceleration_progressbar_mode;
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';
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
return w_deathtypestring;
}
-#define KN_MAX_ENTRIES 10
-float kn_index;
-float killnotify_times[KN_MAX_ENTRIES];
-float killnotify_deathtype[KN_MAX_ENTRIES];
-float killnotify_actiontype[KN_MAX_ENTRIES]; // 0 = "Y [used by] X", 1 = "X [did action to] Y"
-string killnotify_attackers[KN_MAX_ENTRIES];
-string killnotify_victims[KN_MAX_ENTRIES];
-void HUD_KillNotify_Push(string attacker, string victim, float actiontype, float wpn)
-{
- --kn_index;
- if (kn_index == -1)
- kn_index = KN_MAX_ENTRIES-1;
- killnotify_times[kn_index] = time;
- killnotify_deathtype[kn_index] = wpn;
- killnotify_actiontype[kn_index] = actiontype;
- if(killnotify_attackers[kn_index])
- strunzone(killnotify_attackers[kn_index]);
- killnotify_attackers[kn_index] = strzone(attacker);
- if(killnotify_victims[kn_index])
- strunzone(killnotify_victims[kn_index]);
- killnotify_victims[kn_index] = strzone(victim);
-}
void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s1 = attacker, s2 = victim
{
+ /*
float w;
float alsoprint, gentle;
alsoprint = (autocvar_hud_panel_notify_print || !panel_enabled); // print message to console if: notify panel disabled, or cvar to do so enabled
if(alsoprint)
print(sprintf(_("%s^7 has dropped the ball!\n"), s1));
}
- }
+ }*/
}
void HUD_KillCenterprint(string s1, string s2, float type, float msg)
centerprint_hud(_("^1Don't go against team mates!"));
else
centerprint_hud(_("^1Don't shoot your team mates!"));
- } else if (type == DEATH_QUIET) {
- // do nothing
} else { // generic message
if(gentle)
centerprint_hud(_("^1You need to be more careful!"));
}
}
-void HUD_Notify (void)
+void HUD_Notify(void)
{
if(!autocvar__hud_configure)
{
float fadetime;
fadetime = autocvar_hud_panel_notify_fadetime;
- string s;
-
- vector pos_attacker, pos_victim;
- vector weap_pos;
+ vector pos_attacker, pos_victim, pos_icon;
float width_attacker;
- string attacker, victim;
+ string attacker, victim, icon;
- float i, j, w, type, step, limit;
+ float i, j, step, limit;
if(autocvar_hud_panel_notify_flip) //order items from the top down
{
i = 0;
a = entries - 1 - i;
attacker = textShortenToWidth(sprintf(_("Player %d"), a+1), 0.48 * mySize_x - height, fontsize, stringwidth_colors);
victim = textShortenToWidth(sprintf(_("Player %d"), a+2), 0.48 * mySize_x - height, fontsize, stringwidth_colors);
- s = strcat("weapon", get_weaponinfo(WEP_FIRST + mod(floor(a*2.4), WEP_LAST)).netname);
+ icon = strcat("weapon", get_weaponinfo(WEP_FIRST + mod(floor(a*2.4), WEP_LAST)).netname);
a = bound(0, (when - a) / 4, 1);
goto hud_config_notifyprint;
}
-
- if (j == KN_MAX_ENTRIES)
- j = 0;
-
- if(killnotify_times[j] + when > time)
- a = 1;
- else if(fadetime)
- {
- a = bound(0, (killnotify_times[j] + when + fadetime - time) / fadetime, 1);
- if(!a)
- {
- break;
- }
- }
else
{
- break;
- }
-
- s = "";
-
- type = killnotify_deathtype[j];
- w = DEATH_WEAPONOF(type);
+ if (j == KN_MAX_ENTRIES)
+ j = 0;
- // TODO: maybe print in team colors?
- //
- // Y [used by] X
- if(killnotify_actiontype[j] == 0)
- {
- if(type == DEATH_GENERIC)
- {
- s = "notify_death";
- }
- else if(type == DEATH_NOAMMO)
- {
- s = "notify_outofammo";
- }
- else if(type == DEATH_KILL)
- {
- s = "notify_selfkill";
- }
- else if(type == DEATH_CAMP)
- {
- s = "notify_camping";
- }
- else if(type == KILL_TEAM_RED)
- {
- s = "notify_teamkill_red";
- }
- else if(type == KILL_TEAM_BLUE)
- {
- s = "notify_teamkill_blue";
- }
- else if(type == DEATH_DROWN)
- {
- s = "notify_water";
- }
- else if(type == DEATH_SLIME)
- {
- s = "notify_slime";
- }
- else if(type == DEATH_LAVA)
- {
- s = "notify_lava";
- }
- else if(type == DEATH_FALL)
- {
- s = "notify_fall";
- }
- else if(type == DEATH_SHOOTING_STAR)
- {
- s = "notify_shootingstar";
- }
- else if(type == DEATH_HURTTRIGGER || type == DEATH_CUSTOM)
- {
- s = "notify_death";
- }
- else if(type == INFO_GOTFLAG)
- {
- if(killnotify_victims[j] == "^1RED^7 flag")
- {
- s = "notify_red_taken";
- }
- else
- {
- s = "notify_blue_taken";
- }
- }
- else if(type == INFO_RETURNFLAG)
- {
- if(killnotify_victims[j] == "^1RED^7 flag")
- {
- s = "notify_red_returned";
- }
- else
- {
- s = "notify_blue_returned";
- }
- }
- else if(type == INFO_LOSTFLAG)
- {
- if(killnotify_victims[j] == "^1RED^7 flag")
- {
- s = "notify_red_lost";
- }
- else
- {
- s = "notify_blue_lost";
- }
- }
- else if(type == INFO_CAPTUREFLAG)
+ if(killnotify_times[j] + when > time)
+ a = 1;
+ else if(fadetime)
{
- if(killnotify_victims[j] == "^1RED^7 flag")
- {
- s = "notify_red_captured";
- }
- else
+ a = bound(0, (killnotify_times[j] + when + fadetime - time) / fadetime, 1);
+ if(!a)
{
- s = "notify_blue_captured";
+ break;
}
}
- else if(type == KA_DROPBALL)
- {
- s = "notify_balldropped";
- }
- else if(type == KA_PICKUPBALL)
+ else
{
- s = "notify_ballpickedup";
+ break;
}
- attacker = textShortenToWidth(killnotify_attackers[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors);
- pos_attacker = pos + eX * (0.52 * mySize_x + height) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight)));
- weap_pos = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height;
-
- if(s != "")
- {
- drawpic_aspect_skin(weap_pos, s, '2 1 0' * height, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
- drawcolorcodedstring(pos_attacker, attacker, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
- }
+ attacker = killnotify_attackers[j];
+ victim = killnotify_victims[j];
+ icon = killnotify_icon[j];
}
- // X [did action to] Y
- else
+
+ //type = killnotify_deathtype[j];
+ //w = DEATH_WEAPONOF(type);
+
+ if(icon != "")
{
- if(type & HITTYPE_SECONDARY && w == WEP_LASER)
- {
- s = "notify_melee_laser";
- }
- else if(type & HITTYPE_SECONDARY && w == WEP_SHOTGUN)
- {
- s = "notify_melee_shotgun";
- }
- else if(type & HITTYPE_HEADSHOT && (w == WEP_RIFLE || w == WEP_MINSTANEX)) // all headshot weapons go here
- {
- s = "notify_headshot";
- }
- else if(WEP_VALID(w))
- {
- self = get_weaponinfo(w);
- s = strcat("weapon", self.netname);
- }
- else if(type == KILL_TEAM_RED)
- {
- s = "notify_teamkill_red";
- }
- else if(type == KILL_TEAM_BLUE)
- {
- s = "notify_teamkill_red";
- }
- else if(type == DEATH_TELEFRAG)
- {
- s = "notify_telefrag";
- }
- else if(type == DEATH_DROWN)
- {
- s = "notify_water";
- }
- else if(type == DEATH_SLIME)
- {
- s = "notify_slime";
- }
- else if(type == DEATH_LAVA)
- {
- s = "notify_lava";
- }
- else if(type == DEATH_FALL)
- {
- s = "notify_fall";
- }
- else if(type == DEATH_SHOOTING_STAR)
- {
- s = "notify_shootingstar";
- }
- else if(type == DEATH_HURTTRIGGER || type == DEATH_CUSTOM) // DEATH_CUSTOM is also void, right?
- {
- s = "notify_void";
- }
- else if(type == RACE_SERVER_RECORD)
- {
- s = "race_newrecordserver";
- }
- else if(type == RACE_NEW_RANK)
- {
- s = "race_newrankyellow";
- }
- else if(type == RACE_NEW_TIME)
+ if((attacker != "") && (victim == ""))
{
- s = "race_newtime";
+ // Y [used by] X
+ attacker = textShortenToWidth(attacker, 0.73 * mySize_x - height, fontsize, stringwidth_colors);
+ pos_attacker = pos + eX * (0.27 * mySize_x + height) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight)));
+ pos_icon = pos + eX * 0.25 * mySize_x - eX * height + eY * i * height;
+
+ drawpic_aspect_skin(pos_icon, icon, '2 1 0' * height, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos_attacker, attacker, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
}
- else if(type == RACE_FAIL)
+ else if((attacker != "") && (victim != ""))
{
- s = "race_newfail";
- }
-
- attacker = textShortenToWidth(killnotify_attackers[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors);
- victim = textShortenToWidth(killnotify_victims[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors);
+ // X [did action to] Y
+ attacker = textShortenToWidth(attacker, 0.48 * mySize_x - height, fontsize, stringwidth_colors);
+ victim = textShortenToWidth(victim, 0.48 * mySize_x - height, fontsize, stringwidth_colors);
:hud_config_notifyprint
- width_attacker = stringwidth(attacker, TRUE, fontsize);
- pos_attacker = pos + eX * (0.48 * mySize_x - height - width_attacker) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight)));
- pos_victim = pos + eX * (0.52 * mySize_x + height) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight)));
- weap_pos = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height;
+ width_attacker = stringwidth(attacker, TRUE, fontsize);
+ pos_attacker = pos + eX * (0.48 * mySize_x - height - width_attacker) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight)));
+ pos_victim = pos + eX * (0.52 * mySize_x + height) + eY * ((0.5 * fontsize_y + i * height) + (0.5 * (height - fontheight)));
+ pos_icon = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height;
- if(s != "")
- {
- drawpic_aspect_skin(weap_pos, s, '2 1 0' * height, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(pos_icon, icon, '2 1 0' * height, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
drawcolorcodedstring(pos_attacker, attacker, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
drawcolorcodedstring(pos_victim, victim, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
}
for(tm = world; (tm = find(tm, classname, "entcs_receiver")); )
{
color2 = GetPlayerColor(tm.sv_entnum);
- //if(color == COLOR_SPECTATOR || color == color2)
- draw_teamradar_player(tm.origin, tm.angles, GetTeamRGB(color2));
+ //if(color == FL_SPECTATOR || color == 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);
// 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);
- 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;
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)
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);
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)
{
draw_beginBoldFont();
row = column = 0;
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)
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;
}
}
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 = 0;
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
+../common/notifications.qh
../common/explosion_equation.qh
../common/mapinfo.qh
../common/command/markup.qh
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
noise.qc
../common/util.qc
+../common/notifications.qc
../common/command/markup.qc
../common/command/rpn.qc
../common/command/generic.qc
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 i, r;
- if(left.team == COLOR_SPECTATOR)
+ if(left.team == FL_SPECTATOR)
return 1;
- if(right.team == COLOR_SPECTATOR)
+ if(right.team == FL_SPECTATOR)
return 0;
r = HUD_CompareScore(left.teamscores[ts_primary], right.teamscores[ts_primary], teamscores_flags[ts_primary]);
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;
- 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();
- 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);
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);
}
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);
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;
+++ /dev/null
-float TeamByColor(float color)
-{
- switch(color)
- {
- case COLOR_TEAM1: return 0;
- case COLOR_TEAM2: return 1;
- case COLOR_TEAM3: return 2;
- case COLOR_TEAM4: return 3;
- default: return 0;
- }
-}
-float ColorByTeam(float i)
-{
- 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;
- }
-}
-
-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 COLOR_SPECTATOR;
- else if(stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR)
- return COLOR_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 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
- }
-}
-
-string GetTeamName(float color)
-{
- 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");
- }
-}
+++ /dev/null
-float teamplay;
-float myteam;
{
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;
}
}
-void GenericCommand_curl(float request, float argc)
+void GenericCommand_qc_curl(float request, float argc)
{
switch(request)
{
default:
case CMD_REQUEST_USAGE:
{
- print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " curl [--key N] [--cvar] [--exec] URL [postargs...]"));
+ print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " qc_curl [--key N] [--cvar] [--exec] URL [postargs...]"));
return;
}
}
}
}
+void GenericCommand_dumpnotifs(float request)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ float fh, alsoprint = FALSE;
+
+ string filename = argv(1);
+
+ if(filename == "")
+ {
+ filename = "notifications_dump.txt";
+ alsoprint = FALSE;
+ }
+ else if(filename == "-")
+ {
+ filename = "notifications_dump.txt";
+ alsoprint = TRUE;
+ }
+ fh = fopen(filename, FILE_WRITE);
+
+ if(fh >= 0)
+ {
+ fputs(fh, "dump of notifications list:\n");
+ if(alsoprint) { print("dump of notifications list:\n"); }
+ Dump_Notifications(fh, alsoprint);
+ print(sprintf("File located in ^2data/data/%s^7.\n", filename));
+ fclose(fh);
+ }
+ else
+ {
+ print(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
+ }
+ return;
+ }
+
+ default:
+ case CMD_REQUEST_USAGE:
+ {
+ print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]"));
+ print(" Where 'filename' is the file to write (default is notifications_dump.txt),\n");
+ print(" if supplied with '-' output to console as well as default,\n");
+ print(" if left blank, it will only write to default.\n");
+ return;
+ }
+ }
+}
+
void GenericCommand_maplist(float request, float argc)
{
switch(request)
// Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
#define GENERIC_COMMANDS(request,arguments,command) \
GENERIC_COMMAND("addtolist", GenericCommand_addtolist(request, arguments), "Add a string to a cvar") \
- GENERIC_COMMAND("curl", GenericCommand_curl(request, arguments), "Queries an URL") \
GENERIC_COMMAND("dumpcommands", GenericCommand_dumpcommands(request), "Dump all commands on the program to *_cmd_dump.txt") \
+ GENERIC_COMMAND("dumpnotifs", GenericCommand_dumpnotifs(request), "Dump all notifications into notifications_dump.txt") \
GENERIC_COMMAND("maplist", GenericCommand_maplist(request, arguments), "Automatic control of maplist") \
GENERIC_COMMAND("nextframe", GenericCommand_nextframe(request, arguments, command), "Execute the given command next frame of this VM") \
+ GENERIC_COMMAND("qc_curl", GenericCommand_qc_curl(request, arguments), "Queries a URL") \
GENERIC_COMMAND("removefromlist", GenericCommand_removefromlist(request, arguments), "Remove a string from a cvar") \
GENERIC_COMMAND("rpn", GenericCommand_rpn(request, arguments, command), "RPN calculator") \
GENERIC_COMMAND("settemp", GenericCommand_settemp(request, arguments), "Temporarily set a value to a cvar which is restored later") \
const float TE_CSQC_HAGAR_MAXROCKETS = 118;
const float TE_CSQC_VEHICLESETUP = 119;
const float TE_CSQC_SVNOTICE = 120;
+const float TE_CSQC_NOTIFICATION = 121;
const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
const float RACE_NET_CHECKPOINT_CLEAR = 1;
float SPECIES_ROBOT_SHINY = 5;
float SPECIES_RESERVED = 15;
-// Deathtypes (weapon deathtypes are the IT_* constants below)
-// NOTE: when adding death types, please add an explanation to Docs/spamlog.txt too.
-float DEATH_SPECIAL_START = 10000;
-float DEATH_FALL = 10000;
-float DEATH_TELEFRAG = 10001;
-float DEATH_DROWN = 10002;
-float DEATH_HURTTRIGGER = 10003;
-float DEATH_LAVA = 10004;
-float DEATH_SLIME = 10005;
-float DEATH_KILL = 10006;
-float DEATH_NOAMMO = 10007;
-float DEATH_SWAMP = 10008;
-float DEATH_TEAMCHANGE = 10009;
-float DEATH_AUTOTEAMCHANGE = 10010;
-float DEATH_CAMP = 10011;
-float DEATH_SHOOTING_STAR = 10012;
-float DEATH_ROT = 10013;
-float DEATH_MIRRORDAMAGE = 10014;
-float DEATH_TOUCHEXPLODE = 10015;
-float DEATH_CHEAT = 10016;
-float DEATH_FIRE = 10017;
-float DEATH_QUIET = 10021;
-
-float DEATH_VHFIRST = 10030;
-float DEATH_VHCRUSH = 10030;
-float DEATH_SBMINIGUN = 10031;
-float DEATH_SBROCKET = 10032;
-float DEATH_SBBLOWUP = 10033;
-float DEATH_WAKIGUN = 10034;
-float DEATH_WAKIROCKET = 10035;
-float DEATH_WAKIBLOWUP = 10036;
-float DEATH_RAPTOR_CANNON = 10037;
-float DEATH_RAPTOR_BOMB = 10038;
-float DEATH_RAPTOR_BOMB_SPLIT = 10039;
-float DEATH_RAPTOR_DEATH = 10040;
-float DEATH_BUMB_GUN = 10041;
-float DEATH_BUMB_RAY = 10042;
-float DEATH_BUMB_RAY_HEAL = 10043;
-float DEATH_BUMB_DEATH = 10044;
-float DEATH_VHLAST = 10044;
-#define DEATH_ISVEHICLE(t) ((t) >= DEATH_VHFIRST && (t) <= DEATH_VHLAST)
-
-float DEATH_GENERIC = 10050;
-
-float DEATH_WEAPON = 10100;
-
-float DEATH_CUSTOM = 10300;
-
-float DEATH_TURRET = 10500;
-float DEATH_TURRET_EWHEEL = 10501;
-float DEATH_TURRET_FLAC = 10502;
-float DEATH_TURRET_MACHINEGUN = 10503;
-float DEATH_TURRET_WALKER_GUN = 10504;
-float DEATH_TURRET_WALKER_MEELE = 10505;
-float DEATH_TURRET_WALKER_ROCKET = 10506;
-float DEATH_TURRET_HELLION = 10507;
-float DEATH_TURRET_HK = 10508;
-float DEATH_TURRET_MLRS = 10509;
-float DEATH_TURRET_PLASMA = 10510;
-float DEATH_TURRET_PHASER = 10511;
-float DEATH_TURRET_TESLA = 10512;
-float DEATH_TURRET_LAST = 10512;
-
-float DEATH_WEAPONMASK = 0xFF;
-float DEATH_HITTYPEMASK = 0x1F00; // which is WAY below 10000 used for normal deaths
-float HITTYPE_SECONDARY = 0x100;
-float HITTYPE_SPLASH = 0x200; // automatically set by RadiusDamage
-float HITTYPE_BOUNCE = 0x400;
-float HITTYPE_HEADSHOT = 0x800; // automatically set by Damage (if headshotbonus is set)
-float HITTYPE_RESERVED = 0x1000; // unused yet
-
-// macros to access these
-#define DEATH_ISTURRET(t) ((t) >= DEATH_TURRET && (t) <= DEATH_TURRET_LAST)
-#define DEATH_ISSPECIAL(t) ((t) >= DEATH_SPECIAL_START)
-#define DEATH_WEAPONOFWEAPONDEATH(t) ((t) & DEATH_WEAPONMASK)
-#define DEATH_ISWEAPON(t,w) (!DEATH_ISSPECIAL(t) && DEATH_WEAPONOFWEAPONDEATH(t) == (w))
-#define DEATH_WEAPONOF(t) (DEATH_ISSPECIAL(t) ? 0 : DEATH_WEAPONOFWEAPONDEATH(t))
-#define WEP_VALID(w) ((w) >= WEP_FIRST && (w) <= WEP_LAST)
-
#define FRAGS_PLAYER 0
#define FRAGS_SPECTATOR -666
#define FRAGS_LMS_LOSER -616
float CPID_KH_MSG = 10;
float CPID_PREVENT_JOIN = 11;
-// CSQC centerprint/notify message types
-float MSG_SUICIDE = 0;
-float MSG_KILL = 1;
-float MSG_SPREE = 2;
-float MSG_KILL_ACTION = 3;
-float MSG_KILL_ACTION_SPREE = 4;
-float MSG_INFO = 5;
-float MSG_KA = 6;
-float MSG_RACE = 10;
-
-float KILL_TEAM_RED = 12001;
-float KILL_TEAM_BLUE = 12002;
-float KILL_TEAM_SPREE = 12003;
-float KILL_FIRST_BLOOD = 12004;
-float KILL_FIRST_VICTIM = 12005;
-float KILL_TYPEFRAG = 12006;
-float KILL_TYPEFRAGGED = 12007;
-float KILL_FRAG = 12008;
-float KILL_FRAGGED = 12009;
-float KILL_SPREE = 12010;
-float KILL_END_SPREE = 12011;
-float KILL_SPREE_3 = 12012;
-float KILL_SPREE_5 = 12013;
-float KILL_SPREE_10 = 12014;
-float KILL_SPREE_15 = 12015;
-float KILL_SPREE_20 = 12016;
-float KILL_SPREE_25 = 12017;
-float KILL_SPREE_30 = 12018;
-
-float INFO_GOTFLAG = 13001;
-float INFO_PICKUPFLAG = 13002;
-float INFO_LOSTFLAG = 13003;
-float INFO_RETURNFLAG = 13004;
-float INFO_CAPTUREFLAG = 13005;
-
-float KA_PICKUPBALL = 14001;
-float KA_DROPBALL = 14002;
-
-float RACE_SERVER_RECORD = 15001;
-float RACE_NEW_TIME = 15002;
-float RACE_NEW_RANK = 15003;
-float RACE_FAIL = 15004;
-
// weapon requests
float WR_SETUP = 1; // (SVQC) setup weapon data
float WR_THINK = 2; // (SVQC) logic to run every frame
--- /dev/null
+// Deathtypes (weapon deathtypes are the IT_* constants below)
+// NOTE: when adding death types, please add an explanation to Docs/spamlog.txt too.
+#define DT_FIRST 10000
+#define DT_MAX 1024 // limit of recursive functions with ACCUMULATE_FUNCTION
+float DT_COUNT;
+
+#define DT_MATCH(a,b) if(min(DT_MAX, a) == b)
+
+#define DEATHTYPE(name,msg_death,msg_death_by,position) \
+ float name; \
+ float position; \
+ void RegisterDeathtype_##name() \
+ { \
+ SET_FIRST_OR_LAST(position, DT_FIRST, DT_COUNT) \
+ SET_FIELD_COUNT(name, DT_FIRST, DT_COUNT) \
+ CHECK_MAX_COUNT(name, DT_MAX, DT_COUNT, "deathtypes") \
+ } \
+ ACCUMULATE_FUNCTION(RegisterDeathtypes, RegisterDeathtype_##name)
+
+#define DEATHTYPES \
+ DEATHTYPE(DEATH_FALL, DEATH_SELF_FALL, DEATH_MURDER_FALL, DEATH_SPECIAL_START) \
+ DEATHTYPE(DEATH_TELEFRAG, NO_MSG, DEATH_MURDER_TELEFRAG, NORMAL_POS) \
+ DEATHTYPE(DEATH_DROWN, DEATH_SELF_DROWN, DEATH_MURDER_DROWN, NORMAL_POS) \
+ DEATHTYPE(DEATH_HURTTRIGGER, DEATH_SELF_VOID, DEATH_MURDER_VOID, NORMAL_POS) \
+ DEATHTYPE(DEATH_LAVA, DEATH_SELF_LAVA, DEATH_MURDER_LAVA, NORMAL_POS) \
+ DEATHTYPE(DEATH_SLIME, DEATH_SELF_SLIME, DEATH_MURDER_SLIME, NORMAL_POS) \
+ DEATHTYPE(DEATH_KILL, DEATH_SELF_SUICIDE, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_NOAMMO, DEATH_SELF_NOAMMO, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_SWAMP, DEATH_SELF_SWAMP, DEATH_MURDER_SWAMP, NORMAL_POS) \
+ DEATHTYPE(DEATH_TEAMCHANGE, DEATH_SELF_TEAMCHANGE, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_AUTOTEAMCHANGE, DEATH_SELF_AUTOTEAMCHANGE, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_CAMP, DEATH_SELF_CAMP, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_SHOOTING_STAR, DEATH_SELF_SHOOTING_STAR, DEATH_MURDER_SHOOTING_STAR, NORMAL_POS) \
+ DEATHTYPE(DEATH_ROT, DEATH_SELF_ROT, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_MIRRORDAMAGE, DEATH_SELF_BETRAYAL, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_TOUCHEXPLODE, DEATH_SELF_TOUCHEXPLODE, DEATH_MURDER_TOUCHEXPLODE, NORMAL_POS) \
+ DEATHTYPE(DEATH_CHEAT, DEATH_SELF_CHEAT, DEATH_MURDER_CHEAT, NORMAL_POS) \
+ DEATHTYPE(DEATH_FIRE, DEATH_SELF_FIRE, DEATH_MURDER_FIRE, NORMAL_POS) \
+ DEATHTYPE(DEATH_VHCRUSH, NO_MSG, NO_MSG, DEATH_VHFIRST) \
+ DEATHTYPE(DEATH_SBMINIGUN, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_SBROCKET, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_SBBLOWUP, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_WAKIGUN, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_WAKIROCKET, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_WAKIBLOWUP, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_RAPTOR_CANNON, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_RAPTOR_BOMB, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_RAPTOR_BOMB_SPLIT, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_RAPTOR_DEATH, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_BUMB_GUN, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_BUMB_RAY, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_BUMB_RAY_HEAL, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_BUMB_DEATH, NO_MSG, NO_MSG, DEATH_VHLAST) \
+ DEATHTYPE(DEATH_TURRET, NO_MSG, NO_MSG, DEATH_TURRET_FIRST) \
+ DEATHTYPE(DEATH_TURRET_EWHEEL, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_TURRET_FLAC, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_TURRET_MACHINEGUN, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_TURRET_WALKER_GUN, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_TURRET_WALKER_MEELE, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_TURRET_WALKER_ROCKET, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_TURRET_HELLION, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_TURRET_HK, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_TURRET_MLRS, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_TURRET_PLASMA, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_TURRET_PHASER, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_TURRET_TESLA, NO_MSG, NO_MSG, DEATH_TURRET_LAST) \
+ DEATHTYPE(DEATH_GENERIC, DEATH_SELF_GENERIC, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_WEAPON, NO_MSG, NO_MSG, NORMAL_POS) \
+ DEATHTYPE(DEATH_CUSTOM, DEATH_SELF_CUSTOM, NO_MSG, NORMAL_POS)
+
+DEATHTYPES
+#undef DEATHTYPE
+
+#define DEATH_ISSPECIAL(t) ((t) >= DEATH_SPECIAL_START)
+#define DEATH_ISVEHICLE(t) ((t) >= DEATH_VHFIRST && (t) <= DEATH_VHLAST)
+#define DEATH_ISTURRET(t) ((t) >= DEATH_TURRET_FIRST && (t) <= DEATH_TURRET_LAST)
+#define DEATH_WEAPONOFWEAPONDEATH(t) ((t) & DEATH_WEAPONMASK)
+#define DEATH_ISWEAPON(t,w) (!DEATH_ISSPECIAL(t) && DEATH_WEAPONOFWEAPONDEATH(t) == (w))
+#define DEATH_WEAPONOF(t) (DEATH_ISSPECIAL(t) ? 0 : DEATH_WEAPONOFWEAPONDEATH(t))
+#define WEP_VALID(w) ((w) >= WEP_FIRST && (w) <= WEP_LAST)
+
+string Deathtype_Name(float deathtype)
+{
+ if(DEATH_ISSPECIAL(deathtype))
+ {
+ #define DEATHTYPE(name,msg_death,msg_death_by,position) \
+ { if(deathtype == max(0, name)) return VAR_TO_TEXT(name); }
+
+ DEATHTYPES
+ #undef DEATHTYPE
+ }
+ return "foobar";
+}
+
+float DEATH_WEAPONMASK = 0xFF;
+float DEATH_HITTYPEMASK = 0x1F00; // which is WAY below 10000 used for normal deaths
+float HITTYPE_SECONDARY = 0x100;
+float HITTYPE_SPLASH = 0x200; // automatically set by RadiusDamage
+float HITTYPE_BOUNCE = 0x400;
+float HITTYPE_HEADSHOT = 0x800; // automatically set by Damage (if headshotbonus is set)
+float HITTYPE_RESERVED = 0x1000; // unused yet
+
+// CSQC centerprint/notify message types
+float MSG_SUICIDE = 0;
+float MSG_KILL = 1;
+float MSG_SPREE = 2;
+float MSG_KILL_ACTION = 3;
+float MSG_KILL_ACTION_SPREE = 4;
+float MSG_INFO = 5;
+float MSG_KA = 6;
+float MSG_RACE = 10;
+
+float KILL_TEAM_RED = 12001;
+float KILL_TEAM_BLUE = 12002;
+float KILL_TEAM_SPREE = 12003;
+float KILL_FIRST_BLOOD = 12004;
+float KILL_FIRST_VICTIM = 12005;
+float KILL_TYPEFRAG = 12006;
+float KILL_TYPEFRAGGED = 12007;
+float KILL_FRAG = 12008;
+float KILL_FRAGGED = 12009;
+float KILL_SPREE = 12010;
+float KILL_END_SPREE = 12011;
+float KILL_SPREE_3 = 12012;
+float KILL_SPREE_5 = 12013;
+float KILL_SPREE_10 = 12014;
+float KILL_SPREE_15 = 12015;
+float KILL_SPREE_20 = 12016;
+float KILL_SPREE_25 = 12017;
+float KILL_SPREE_30 = 12018;
+
+
+
+// this shit has got to go
+float INFO_GOTFLAG = 13001;
+float INFO_PICKUPFLAG = 13002;
+float INFO_LOSTFLAG = 13003;
+float INFO_RETURNFLAG = 13004;
+float INFO_CAPTUREFLAG = 13005;
+
+float KA_PICKUPBALL = 14001;
+float KA_DROPBALL = 14002;
+
+float RACE_SERVER_RECORD = 15001;
+float RACE_NEW_TIME = 15002;
+float RACE_NEW_RANK = 15003;
+float RACE_FAIL = 15004;
--- /dev/null
+// ================================================
+// Unified notification system, written by Samual
+// Last updated: December, 2012
+// ================================================
+
+// ======================
+// Supporting Functions
+// ======================
+
+// team code replace
+string TCR(string input, string teamcolor, string teamtext) // TODO: MOVE TO UTIL.QC
+{
+ input = strreplace("^TC", teamcolor, input);
+ input = strreplace("^TT", teamtext, input);
+ return input;
+}
+
+// color code replace, place inside of sprintf and parse the string
+string CCR(string input) // TODO: MOVE TO UTIL.QC
+{
+ // foreground/normal colors
+ input = strreplace("^F1", "^2", input); // primary priority (important names, etc)
+ input = strreplace("^F2", "^3", input); // secondary priority (items, locations, numbers, etc)
+
+ // "kill" colors
+ input = strreplace("^K1", "^1", input); // "bad" or "dangerous" text (death messages against you, kill notifications, etc)
+ input = strreplace("^K2", "^3", input); // similar to above, but less important... OR, a highlight out of above message type
+ input = strreplace("^K3", "^4", input); // "good" or "beneficial" text (you fragging someone, etc)
+
+ // background colors
+ input = strreplace("^BG", "^7", input); // neutral/unimportant text
+ input = strreplace("^N", "^7", input); // "none"-- reset to white...
+ return input;
+}
+
+#ifndef MENUQC
+// select between the normal or the gentle message string based on client (or server) settings
+string normal_or_gentle(string normal, string gentle)
+{
+ #ifdef CSQC
+ if(autocvar_cl_gentle || autocvar_cl_gentle_messages)
+ #else
+ if(autocvar_sv_gentle)
+ #endif
+ return ((gentle != "") ? gentle : normal);
+ else
+ return normal;
+}
+
+float notif_checkstring(string input)
+{
+ if not(input == "") { return TRUE; }
+ else { return FALSE; }
+}
+
+// get the actual name of a notification and return it as a string
+string Get_Field_Value(float field, float net_type, float net_name)
+{
+ string output = "";
+
+ #define GET_FIELD_VALUE_OUTPUT(field,name,strnum,flnum) \
+ switch(field) { \
+ case F_NAME: { output = VAR_TO_TEXT(name); break; } \
+ case F_STRNUM: { output = ftos(strnum); break; } \
+ case F_FLNUM: { output = ftos(flnum); break; } }
+
+ switch(net_type)
+ {
+ case MSG_INFO:
+ {
+ #define MSG_INFO_NOTIF(name,strnum,flnum,args,hudargs,icon,normal,gentle) \
+ { NOTIF_MATCH(name, net_name) { GET_FIELD_VALUE_OUTPUT(field,name,strnum,flnum) } }
+ MSG_INFO_NOTIFICATIONS
+ #undef MSG_INFO_NOTIF
+ break;
+ }
+ case MSG_CENTER:
+ {
+ #define MSG_CENTER_NOTIF(name,strnum,flnum,args,cpid,durcnt,normal,gentle) \
+ { NOTIF_MATCH(name, net_name) { GET_FIELD_VALUE_OUTPUT(field,name,strnum,flnum) } }
+ MSG_CENTER_NOTIFICATIONS
+ #undef MSG_CENTER_NOTIF
+ break;
+ }
+ case MSG_WEAPON:
+ {
+ #define MSG_WEAPON_NOTIF(name,infoname,centername) \
+ { NOTIF_MATCH(name, net_name) { GET_FIELD_VALUE_OUTPUT(field,name, \
+ max(stof(Get_Field_Value(F_STRNUM, MSG_INFO, infoname)), stof(Get_Field_Value(F_STRNUM, MSG_CENTER, centername))), \
+ max(stof(Get_Field_Value(F_FLNUM, MSG_INFO, infoname)), stof(Get_Field_Value(F_FLNUM, MSG_CENTER, centername)))) } }
+ MSG_WEAPON_NOTIFICATIONS
+ #undef MSG_WEAPON_NOTIF
+ break;
+ }
+ case MSG_DEATH:
+ {
+ #define MSG_DEATH_NOTIF(name,infoname,centername) \
+ { NOTIF_MATCH(name, net_name) { GET_FIELD_VALUE_OUTPUT(field,name, \
+ max(stof(Get_Field_Value(F_STRNUM, MSG_INFO, infoname)), stof(Get_Field_Value(F_STRNUM, MSG_CENTER, centername))), \
+ max(stof(Get_Field_Value(F_FLNUM, MSG_INFO, infoname)), stof(Get_Field_Value(F_FLNUM, MSG_CENTER, centername)))) } }
+ MSG_DEATH_NOTIFICATIONS
+ #undef MSG_DEATH_NOTIF
+ break;
+ }
+ }
+
+ #undef GET_FIELD_VALUE_OUTPUT
+ return output;
+}
+#endif // ifndef MENUQC
+
+
+// ===============================
+// Frontend Notification Pushing
+// ===============================
+
+void Dump_Notifications(float fh, float alsoprint)
+{
+ float MSG_INFO_NOTIFS = 0, MSG_CENTER_NOTIFS = 0, MSG_WEAPON_NOTIFS = 0, MSG_DEATH_NOTIFS = 0;
+ string notif_msg;
+
+ #define NOTIF_WRITE(type,name,text) notif_msg = sprintf("seta %s 1 // %s - %s\n", name, type, strreplace("\n", "\\n", text)); fputs(fh, notif_msg); if(alsoprint) { print(strreplace("^", "^^", notif_msg)); }
+ #define MSG_INFO_NOTIF(name,strnum,flnum,args,hudargs,icon,normal,gentle) { ++MSG_INFO_NOTIFS; NOTIF_WRITE("MSG_INFO", VAR_TO_TEXT(name), normal) }
+ #define MSG_CENTER_NOTIF(name,strnum,flnum,args,cpid,durcnt,normal,gentle) { ++MSG_CENTER_NOTIFS; NOTIF_WRITE("MSG_CENTER", VAR_TO_TEXT(name), normal) }
+ #define MSG_WEAPON_NOTIF(name,infoname,centername) { ++MSG_WEAPON_NOTIFS; NOTIF_WRITE("MSG_WEAPON", VAR_TO_TEXT(name),sprintf("infoname: %s, centername: %s", VAR_TO_TEXT(infoname), VAR_TO_TEXT(centername))) }
+ #define MSG_DEATH_NOTIF(name,infoname,centername) { ++MSG_DEATH_NOTIFS; NOTIF_WRITE("MSG_DEATH", VAR_TO_TEXT(name), sprintf("infoname: %s, centername: %s", VAR_TO_TEXT(infoname), VAR_TO_TEXT(centername))) }
+ MSG_INFO_NOTIFICATIONS
+ MSG_CENTER_NOTIFICATIONS
+ MSG_WEAPON_NOTIFICATIONS
+ MSG_DEATH_NOTIFICATIONS
+ #undef NOTIF_WRITE
+ #undef MSG_INFO_NOTIF
+ #undef MSG_CENTER_NOTIF
+ #undef MSG_WEAPON_NOTIF
+ #undef MSG_DEATH_NOTIF
+
+ print(sprintf("Notification counts: MSG_INFO = %d, MSG_CENTER = %d, MSG_WEAPON = %d, MSG_DEATH = %d\n", MSG_INFO_NOTIFS, MSG_CENTER_NOTIFS, MSG_WEAPON_NOTIFS, MSG_DEATH_NOTIFS));
+ return;
+}
+
+#ifndef MENUQC
+#ifdef CSQC
+void HUD_Notify_Push(string icon, string attacker, string victim)
+{
+ if(icon != "")
+ {
+ --kn_index;
+ if (kn_index == -1) { kn_index = KN_MAX_ENTRIES-1; }
+ killnotify_times[kn_index] = time;
+
+ // icon
+ if(killnotify_icon[kn_index]) { strunzone(killnotify_icon[kn_index]); }
+ killnotify_icon[kn_index] = strzone(icon);
+
+ // attacker
+ if(killnotify_attackers[kn_index]) { strunzone(killnotify_attackers[kn_index]); }
+ killnotify_attackers[kn_index] = strzone(attacker);
+
+ // victim
+ if(killnotify_victims[kn_index]) { strunzone(killnotify_victims[kn_index]); }
+ killnotify_victims[kn_index] = strzone(victim);
+ }
+}
+
+void backtrace(string msg) // TODO: MOVE TO UTIL.QC
+{
+ float dev, war;
+ dev = cvar("developer");
+ war = cvar("prvm_backtraceforwarnings");
+ cvar_set("developer", "1");
+ cvar_set("prvm_backtraceforwarnings", "1");
+ print("\n");
+ print("--- CUT HERE ---\nWARNING: ");
+ print(msg);
+ print("\n");
+ remove(world); // isn't there any better way to cause a backtrace?
+ print("\n--- CUT UNTIL HERE ---\n");
+ cvar_set("developer", ftos(dev));
+ cvar_set("prvm_backtraceforwarnings", ftos(war));
+}
+#endif // ifdef CSQC
+
+void Local_Notification(float net_type, float net_name, ...count)
+{
+ float stringcount = stof(Get_Field_Value(F_STRNUM, net_type, net_name));
+ float floatcount = stof(Get_Field_Value(F_FLNUM, net_type, net_name));
+
+ string s1 = ((0 < stringcount) ? ...(0, string) : NO_STR_ARG);
+ string s2 = ((1 < stringcount) ? ...(1, string) : NO_STR_ARG);
+ string s3 = ((2 < stringcount) ? ...(2, string) : NO_STR_ARG);
+ string s4 = ((3 < stringcount) ? ...(3, string) : NO_STR_ARG);
+ float f1 = ((stringcount < count) ? ...(stringcount, float) : NO_FL_ARG);
+ float f2 = (((stringcount + 1) < count) ? ...((stringcount + 1), float) : NO_FL_ARG);
+ float f3 = (((stringcount + 2) < count) ? ...((stringcount + 2), float) : NO_FL_ARG);
+ float f4 = (((stringcount + 3) < count) ? ...((stringcount + 3), float) : NO_FL_ARG);
+
+ dprint("Local_Notification(", ftos(net_type), ", ", Get_Field_Value(F_NAME, net_type, net_name), strcat(", ", s1, ", ", s2, ", ", s3, ", ", s4, ", "), strcat(ftos(f1), strcat(", ", ftos(f2), ", ", ftos(f3), ", ", ftos(f4), ");\n")));
+ dprint(" ^--: stringcount: ", ftos(stringcount), ", floatcount: ", ftos(floatcount), ".\n");
+
+ if((stringcount + floatcount) > count) { backtrace(strcat("Not enough arguments for Local_Notification! ", strcat("stringcount(", ftos(stringcount), ") + floatcount(", ftos(floatcount), ")"), " > count(", ftos(count), ").\nCheck the notification definition and the function call for accuracy...?\n")); return; }
+ else if((stringcount + floatcount) < count) { backtrace(strcat("Too many arguments for Local_Notification! ", strcat("stringcount(", ftos(stringcount), ") + floatcount(", ftos(floatcount), ")"), " < count(", ftos(count), ").\nCheck the notification definition and the function call for accuracy...?\n")); return; }
+
+ switch(net_type)
+ {
+ case MSG_INFO:
+ {
+ #define MSG_INFO_NOTIF(name,strnum,flnum,args,hudargs,icon,normal,gentle) \
+ { NOTIF_MATCH(name, net_name) CHECK_AUTOCVAR(name) \
+ { \
+ if(notif_checkstring(normal)) { print(sprintf(CCR(normal_or_gentle(normal, gentle)), args)); } \
+ #ifdef CSQC \
+ if(notif_checkstring(icon)) { HUD_Notify_Push(icon, hudargs); } \
+ #endif \
+ } }
+ MSG_INFO_NOTIFICATIONS
+ #undef MSG_INFO_NOTIF
+ break;
+ }
+ #ifdef CSQC
+ case MSG_CENTER:
+ {
+ #define MSG_CENTER_NOTIF(name,strnum,flnum,args,cpid,durcnt,normal,gentle) \
+ { NOTIF_MATCH(name, net_name) CHECK_AUTOCVAR(name) \
+ { \
+ if(notif_checkstring(normal)) { centerprint_generic(HANDLE_CPID(cpid), sprintf(CCR(normal_or_gentle(normal, gentle)), args), durcnt); } \
+ } }
+ MSG_CENTER_NOTIFICATIONS
+ #undef MSG_CENTER_NOTIF
+ break;
+ }
+ #endif
+ case MSG_WEAPON:
+ {
+ #define MSG_WEAPON_NOTIF(name,infoname,centername) \
+ { NOTIF_MATCH(name, net_name) CHECK_AUTOCVAR(name) \
+ { \
+ #if infoname != NO_MSG \
+ Local_Notification_Without_VarArgs(MSG_INFO, infoname, \
+ stof(Get_Field_Value(F_STRNUM, MSG_INFO, infoname)), \
+ stof(Get_Field_Value(F_FLNUM, MSG_INFO, infoname)), \
+ s1, s2, s3, s4, f1, f2, f3, f4); \
+ #endif \
+ #ifdef CSQC \
+ #if centername != NO_MSG \
+ Local_Notification_Without_VarArgs(MSG_CENTER, centername, \
+ stof(Get_Field_Value(F_STRNUM, MSG_CENTER, centername)), \
+ stof(Get_Field_Value(F_FLNUM, MSG_CENTER, centername)), \
+ s1, s2, s3, s4, f1, f2, f3, f4); \
+ #endif \
+ #endif \
+ } }
+ MSG_WEAPON_NOTIFICATIONS
+ #undef MSG_WEAPON_NOTIF
+ break;
+ }
+ case MSG_DEATH:
+ {
+ #define MSG_DEATH_NOTIF(name,infoname,centername) \
+ { NOTIF_MATCH(name, net_name) CHECK_AUTOCVAR(name) \
+ { \
+ #if infoname != NO_MSG \
+ Local_Notification_Without_VarArgs(MSG_INFO, infoname, \
+ stof(Get_Field_Value(F_STRNUM, MSG_INFO, infoname)), \
+ stof(Get_Field_Value(F_FLNUM, MSG_INFO, infoname)), \
+ s1, s2, s3, s4, f1, f2, f3, f4); \
+ #endif \
+ #ifdef CSQC \
+ #if centername != NO_MSG \
+ Local_Notification_Without_VarArgs(MSG_CENTER, centername, \
+ stof(Get_Field_Value(F_STRNUM, MSG_CENTER, centername)), \
+ stof(Get_Field_Value(F_FLNUM, MSG_CENTER, centername)), \
+ s1, s2, s3, s4, f1, f2, f3, f4); \
+ #endif \
+ #endif \
+ } }
+ MSG_DEATH_NOTIFICATIONS
+ #undef MSG_DEATH_NOTIF
+ break;
+ }
+ }
+}
+
+void Local_Notification_Without_VarArgs(float net_type, float net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4)
+{
+ #define VARITEM(stringc,floatc,args) if((stringcount == stringc) && (floatcount == floatc)) { Local_Notification(net_type, net_name, args); return; }
+ EIGHT_VARS_TO_VARARGS_VARLIST
+ #undef VARITEM
+
+ Local_Notification(net_type, net_name); // some notifications don't have any arguments at all
+}
+
+
+// =========================
+// Notification Networking
+// =========================
+
+#ifdef CSQC
+void Read_Notification(void)
+{
+ float net_type = ReadByte();
+ float net_name = ReadShort();
+
+ float stringcount = stof(Get_Field_Value(F_STRNUM, net_type, net_name));
+ float floatcount = stof(Get_Field_Value(F_FLNUM, net_type, net_name));
+
+ Local_Notification_Without_VarArgs(net_type, net_name,
+ stringcount, floatcount,
+ ((stringcount >= 1) ? ReadString() : NO_STR_ARG),
+ ((stringcount >= 2) ? ReadString() : NO_STR_ARG),
+ ((stringcount >= 3) ? ReadString() : NO_STR_ARG),
+ ((stringcount == 4) ? ReadString() : NO_STR_ARG),
+ ((floatcount >= 1) ? ReadLong() : NO_FL_ARG),
+ ((floatcount >= 2) ? ReadLong() : NO_FL_ARG),
+ ((floatcount >= 3) ? ReadLong() : NO_FL_ARG),
+ ((floatcount == 4) ? ReadLong() : NO_FL_ARG));
+}
+#endif
+
+#ifdef SVQC
+void Send_Notification(entity client, float broadcast, float net_type, float net_name, ...count)
+{
+ if((broadcast == MSG_BROADCAST || broadcast == MSG_ONE) && net_type && net_name)
+ {
+ float stringcount = stof(Get_Field_Value(F_STRNUM, net_type, net_name));
+ float floatcount = stof(Get_Field_Value(F_FLNUM, net_type, net_name));
+ float i, tmp_f;
+ string tmp_s;
+
+ dprint("Send_Notification(", ftos(broadcast), ", ", ftos(net_type), ", ", Get_Field_Value(F_NAME, net_type, net_name), strcat(", ", ftos(count), ");\n"));
+ dprint(" ^--: stringcount: ", ftos(stringcount), ", floatcount: ", ftos(floatcount), ".\n");
+
+ if((stringcount + floatcount) > count) { backtrace(strcat("Not enough arguments for Send_Notification! ", strcat("stringcount(", ftos(stringcount), ") + floatcount(", ftos(floatcount), "),"), " > count(", ftos(count), ").\nCheck the notification definition and the function call for accuracy...?\n")); return; }
+ else if((stringcount + floatcount) < count) { backtrace(strcat("Too many arguments for Send_Notification! ", strcat("stringcount(", ftos(stringcount), ") + floatcount(", ftos(floatcount), "),"), " < count(", ftos(count), ").\nCheck the notification definition and the function call for accuracy...?\n")); return; }
+
+ //if(Count_Proper_Strings(NO_STR_ARG, s1, s2) > stringcount) { backtrace("Too many string arguments for notification!\n"); return; }
+ //if(Count_Proper_Floats(NO_FL_ARG, f1, f2, f3) > floatcount) { backtrace("Too many float arguments for notification!\n"); return; }
+
+ #define WRITE_NOTIFICATION(msg) \
+ WriteByte(msg, SVC_TEMPENTITY); \
+ WriteByte(msg, TE_CSQC_NOTIFICATION); \
+ WriteByte(msg, net_type); \
+ WriteShort(msg, net_name); \
+ for(i = 0; i < stringcount; ++i) \
+ { tmp_s = ...(i, string); WriteString(msg, tmp_s); dprint("WriteString(...(", ftos(i), ", string)); - ", tmp_s, "\n"); } \
+ for(i = 0; i < floatcount; ++i) \
+ { tmp_f = ...((stringcount + i), float); WriteLong(msg, tmp_f); dprint("WriteLong(...(", ftos((stringcount + i)), ", float)); - ", ftos(tmp_f), "\n"); }
+
+
+ switch(broadcast)
+ {
+ case MSG_ONE: // personal/direct notification sent to ONE person and their spectators
+ {
+ if(client && (clienttype(client) == CLIENTTYPE_REAL) && (client.flags & FL_CLIENT))
+ {
+ msg_entity = client;
+ WRITESPECTATABLE_MSG_ONE({WRITE_NOTIFICATION(MSG_ONE)});
+ }
+ break;
+ }
+
+ case MSG_BROADCAST: // global notification sent to EVERYONE
+ {
+ WRITE_NOTIFICATION(MSG_BROADCAST)
+ break;
+ }
+
+ case MSG_ALL: { backtrace("DO NOT USE MSG_ALL FOR NOTIFICATIONS, IT IS BAD!\n"); break; }
+ default: { backtrace("Unknown MSG_ type to write with!\n"); break; }
+ }
+
+ #undef WRITE_NOTIFICATION
+
+ if(!server_is_local)
+ {
+ Local_Notification_Without_VarArgs(net_type, net_name, stringcount, floatcount, IFSTR(0), IFSTR(1), IFSTR(2), IFSTR(3), IFFL(0), IFFL(1), IFFL(2), IFFL(3));
+ }
+ }
+ else { backtrace("Incorrect usage of Send_Notification!\n"); }
+}
+
+void Send_Notification_Without_VarArgs(entity client, float broadcast, float net_type, float net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4)
+{
+ #define VARITEM(stringc,floatc,args) if((stringcount == stringc) && (floatcount == floatc)) { Send_Notification(client, broadcast, net_type, net_name, args); return; }
+ EIGHT_VARS_TO_VARARGS_VARLIST
+ #undef VARITEM
+
+ Send_Notification(client, broadcast, net_type, net_name); // some notifications don't have any arguments at all
+}
+
+void Send_Notification_Legacy_Wrapper(entity client, float broadcast, float net_type, float net_name, string s1, string s2, float f1, float f2, float f3)
+{
+ float stringcount = stof(Get_Field_Value(F_STRNUM, net_type, net_name));
+ float floatcount = stof(Get_Field_Value(F_FLNUM, net_type, net_name));
+ Send_Notification_Without_VarArgs(client, broadcast, net_type, net_name, stringcount, floatcount, s1, s2, NO_STR_ARG, NO_STR_ARG, f1, f2, f3, NO_FL_ARG);
+}
+
+void Send_Notification_ToTeam(float targetteam, entity except, float net_type, float net_name, ...count)
+{
+ float stringcount = stof(Get_Field_Value(F_STRNUM, net_type, net_name));
+ float floatcount = stof(Get_Field_Value(F_FLNUM, net_type, net_name));
+
+ entity tmp_entity;
+ FOR_EACH_REALCLIENT(tmp_entity)
+ {
+ if(tmp_entity.classname == STR_PLAYER)
+ if(tmp_entity.team == targetteam)
+ if(tmp_entity != except)
+ {
+ Send_Notification_Without_VarArgs(tmp_entity, MSG_ONE, net_type, net_name, stringcount, floatcount, IFSTR(0), IFSTR(1), IFSTR(2), IFSTR(3), IFFL(0), IFFL(1), IFFL(2), IFFL(3));
+ }
+ }
+}
+
+// WARNING: use this ONLY if you need exceptions or want to exclude spectators, otherwise use Send_Notification(world, MSG_BROADCAST, ...)
+void Send_Notification_ToAll(entity except, float spectators, float net_type, float net_name, ...count)
+{
+ float stringcount = stof(Get_Field_Value(F_STRNUM, net_type, net_name));
+ float floatcount = stof(Get_Field_Value(F_FLNUM, net_type, net_name));
+
+ entity tmp_entity;
+ FOR_EACH_REALCLIENT(tmp_entity)
+ {
+ if((tmp_entity.classname == STR_PLAYER) || spectators)
+ if(tmp_entity != except)
+ {
+ Send_Notification_Without_VarArgs(tmp_entity, MSG_ONE, net_type, net_name, stringcount, floatcount, IFSTR(0), IFSTR(1), IFSTR(2), IFSTR(3), IFFL(0), IFFL(1), IFFL(2), IFFL(3));
+ }
+ }
+}
+
+
+// =============================
+// LEGACY NOTIFICATION SYSTEMS
+// =============================
+
+void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, float countdown_num)
+{
+ if ((clienttype(e) == CLIENTTYPE_REAL) && (e.flags & FL_CLIENT))
+ {
+ msg_entity = e;
+ WRITESPECTATABLE_MSG_ONE({
+ WriteByte(MSG_ONE, SVC_TEMPENTITY);
+ WriteByte(MSG_ONE, TE_CSQC_CENTERPRINT_GENERIC);
+ WriteByte(MSG_ONE, id);
+ WriteString(MSG_ONE, s);
+ if (id != 0 && s != "")
+ {
+ WriteByte(MSG_ONE, duration);
+ WriteByte(MSG_ONE, countdown_num);
+ }
+ });
+ }
+}
+void Send_CSQC_Centerprint_Generic_Expire(entity e, float id)
+{
+ Send_CSQC_Centerprint_Generic(e, id, "", 1, 0);
+}
+#endif // ifdef SVQC
+#endif // ifndef MENUQC
--- /dev/null
+// ================================================
+// Unified notification system, written by Samual
+// Last updated: December, 2012
+// ================================================
+
+// main types/groups of notifications
+#define MSG_INFO 1 // "Global" information messages (sent to console, and notify panel if it has an icon)
+#define MSG_CENTER 2 // "Personal" centerprint messages
+#define MSG_WEAPON 3 // "Personal" weapon messages (like "You got the Nex", sent to weapon notify panel)
+#define MSG_DEATH 4 // "Personal" AND "Global" death messages
+
+string TCR(string input, string teamcolor, string teamtext); // team code replace
+string CCR(string input); // color code replace, place inside of sprintf and parse the string
+
+void Dump_Notifications(float fh, float alsoprint);
+
+#ifndef MENUQC // SERVER AND CLIENT ONLY
+// Since this code uses macro processors to list notifications,
+// the normal compiler sees these checks as "constant" and throws
+// a warning. We have to get around this by using another function.
+#define NOTIF_MATCH(a,b) if(min(NOTIF_MAX, a) == b)
+
+// notification system nullified arguments
+#define NO_STR_ARG ""
+#define NO_FL_ARG -12345
+#define NO_MSG -12345
+
+// field identifiers for Get_Field_Value()
+#define F_NAME 1
+#define F_STRNUM 2
+#define F_FLNUM 3
+
+// ping of bots defined for extra frag message notification information
+#define BOT_PING -1
+
+#define EIGHT_VARS_TO_VARARGS_VARLIST \
+ VARITEM(1, 0, s1) \
+ VARITEM(2, 0, XPD(s1, s2)) \
+ VARITEM(3, 0, XPD(s1, s2, s3)) \
+ VARITEM(4, 0, XPD(s1, s2, s3, s4)) \
+ VARITEM(0, 1, f1) \
+ VARITEM(1, 1, XPD(s1, f1)) \
+ VARITEM(2, 1, XPD(s1, s2, f1)) \
+ VARITEM(3, 1, XPD(s1, s2, s3, f1)) \
+ VARITEM(4, 1, XPD(s1, s2, s3, s4, f1)) \
+ VARITEM(0, 2, XPD(f1, f2)) \
+ VARITEM(1, 2, XPD(s1, f1, f2)) \
+ VARITEM(2, 2, XPD(s1, s2, f1, f2)) \
+ VARITEM(3, 2, XPD(s1, s2, s3, f1, f2)) \
+ VARITEM(4, 2, XPD(s1, s2, s3, s4, f1, f2)) \
+ VARITEM(0, 3, XPD(f1, f2, f3)) \
+ VARITEM(1, 3, XPD(s1, f1, f2, f3)) \
+ VARITEM(2, 3, XPD(s1, s2, f1, f2, f3)) \
+ VARITEM(3, 3, XPD(s1, s2, s3, f1, f2, f3)) \
+ VARITEM(4, 3, XPD(s1, s2, s3, s4, f1, f2, f3)) \
+ VARITEM(0, 4, XPD(f1, f2, f3, f4)) \
+ VARITEM(1, 4, XPD(s1, f1, f2, f3, f4)) \
+ VARITEM(2, 4, XPD(s1, s2, f1, f2, f3, f4)) \
+ VARITEM(3, 4, XPD(s1, s2, s3, f1, f2, f3, f4)) \
+ VARITEM(4, 4, XPD(s1, s2, s3, s4, f1, f2, f3, f4))
+
+/*
+ Acquire special information to generate for display in the
+ notification from variables networked to the client.
+ Macro descriptions:
+ PASS_KEY: find the keybind for "passing" or "dropping" in CTF game mode
+ FRAG_PING: show the ping of a player
+ FRAG_STATS: show health/armor/ping of a player
+ FRAG_POS: show score status and position in the match of a player
+ SPREE_CEN: centerprint notif for kill spree/how many kills they have
+ SPREE_INF: info notif for kill spree/how many kills they have
+ SPREE_END: placed at the end of murder messages to show ending of sprees
+ SPREE_LOST: placed at the end of suicide messages to show losing of sprees
+ DEATH_TEAM: show the full name of the team a player is switching from
+ WEAPON_NAME: return the full name of a weapon from a weaponid
+*/
+
+#ifdef CSQC // CSQC replacements
+string got_commandkey;
+#define PASS_KEY ((((got_commandkey = getcommandkey("pass", "+use")) != "pass") && !(strstrofs(got_commandkey, "not bound", 0) >= 0)) ? sprintf(CCR(_(" ^F1(Press %s)")), got_commandkey) : "")
+#define FRAG_PING ((f2 != BOT_PING) ? sprintf(CCR(_("\n(Ping ^2%d^BG)")), f2) : "")
+#define FRAG_STATS sprintf(CCR(_("\n(Health ^1%d^BG / Armor ^2%d^BG)%s")), f1, f2, ((f3 != BOT_PING) ? sprintf(CCR(_(" (Ping ^2%d^BG)")), f3) : ""))
+#define FRAG_POS ((Should_Print_Score_Pos(f1)) ? sprintf("\n^BG%s", Read_Score_Pos(f1)) : "")
+#define SPREE_CEN (((f1 == 3) || (f1 == 5) || (f1 == 10) || (f1 == 15) || (f1 == 20) || (f1 == 25) || (f1 == 30)) ? sprintf(normal_or_gentle(_("%d frag spree! "), _("%d score spree! ")), f1) : "")
+#define SPREE_INF (((f1 == 3) || (f1 == 5) || (f1 == 10) || (f1 == 15) || (f1 == 20) || (f1 == 25) || (f1 == 30)) ? sprintf(normal_or_gentle(_("%d frag spree! "), _("%d score spree! ")), f1) : "")
+#define SPREE_END ((f1 >= 3) ? sprintf(normal_or_gentle(_(", ending their %d frag spree"), _(", ending their %d score spree")), f1) : "")
+#define SPREE_LOST ((f1 >= 3) ? sprintf(normal_or_gentle(_(", losing their %d frag spree"), _(", losing their %d score spree")), f1) : "")
+#define DEATH_TEAM Team_ColoredFullName(TEAM_SV_TO_CL(f1))
+#define WEAPON_NAME f1 // weaponorder[f1].netname
+
+#else // SVQC replacements
+#define SPREE_INF (((f1 == 3) || (f1 == 5) || (f1 == 10) || (f1 == 15) || (f1 == 20) || (f1 == 25) || (f1 == 30)) ? sprintf(normal_or_gentle(_("%d frag spree! "), _("%d score spree! ")), f1) : "")
+#define SPREE_END ((f1 >= 3) ? sprintf(normal_or_gentle(_(", ending their %d frag spree"), _(", ending their %d score spree")), f1) : "")
+#define SPREE_LOST ((f1 >= 3) ? sprintf(normal_or_gentle(_(", losing their %d frag spree"), _(", losing their %d score spree")), f1) : "")
+#define DEATH_TEAM Team_ColoredFullName(f1)
+#define WEAPON_NAME f1 // weaponorder[f1].netname
+#endif
+
+#define ADD_AUTOCVAR(name) var float autocvar_notification_##name = TRUE;
+#define CHECK_AUTOCVAR(name) if(autocvar_notification_##name)
+
+string normal_or_gentle(string normal, string gentle); // select between the normal or the gentle message string based on client (or server) settings
+float notif_checkstring(string input);
+string Get_Field_Value(float field, float net_type, float net_name); // get the actual name of a notification and return it as a string
+void Local_Notification(float net_type, float net_name, ...count);
+void Local_Notification_Without_VarArgs(float net_type, float net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4);
+
+#ifdef CSQC // CLIENT ONLY
+// NO_CPID normally has a variable value, so we need to check and see
+// whether a notification uses it. If so, cancel out the centerprint ID.
+#define HANDLE_CPID(cpid) ((min(NOTIF_MAX, cpid) == NO_CPID) ? FALSE : cpid)
+#define KN_MAX_ENTRIES 10
+
+float kn_index;
+float killnotify_times[KN_MAX_ENTRIES];
+string killnotify_icon[KN_MAX_ENTRIES];
+string killnotify_attackers[KN_MAX_ENTRIES];
+string killnotify_victims[KN_MAX_ENTRIES];
+void HUD_Notify_Push(string icon, string attacker, string victim);
+void backtrace(string msg);
+void Read_Notification(void);
+#endif // ifdef CSQC
+
+#ifdef SVQC // SERVER ONLY
+// allow sending of notifications to also pass through to spectators (specifically for centerprints)
+#define WRITESPECTATABLE_MSG_ONE_VARNAME(varname,statement) entity varname; varname = msg_entity; FOR_EACH_REALCLIENT(msg_entity) if(msg_entity == varname || (msg_entity.classname == STR_SPECTATOR && msg_entity.enemy == varname)) statement msg_entity = varname
+#define WRITESPECTATABLE_MSG_ONE(statement) WRITESPECTATABLE_MSG_ONE_VARNAME(oldmsg_entity, statement)
+#define WRITESPECTATABLE(msg,statement) if(msg == MSG_ONE) { WRITESPECTATABLE_MSG_ONE(statement); } else statement float WRITESPECTATABLE_workaround = 0
+
+#define IFSTR(num) ((num <= (stringcount-1)) ? ...(num, string) : NO_STR_ARG)
+#define IFFL(num) ((((stringcount-1) + num) < count) ? ...(((stringcount-1) + num), float) : NO_FL_ARG)
+
+void Send_Notification(entity client, float broadcast, float net_type, float net_name, ...count);
+void Send_Notification_Without_VarArgs(entity client, float broadcast, float net_type, float net_name, float stringcount, float floatcount, string s1, string s2, string s3, string s4, float f1, float f2, float f3, float f4);
+void Send_Notification_Legacy_Wrapper(entity client, float broadcast, float net_type, float net_name, string s1, string s2, float f1, float f2, float f3);
+void Send_Notification_ToTeam(float targetteam, entity except, float net_type, float net_name, ...count);
+void Send_Notification_ToAll(entity except, float spectators, float net_type, float net_name, ...count); // WARNING: use this ONLY if you need exceptions or want to exclude spectators, otherwise use Send_Notification(world, MSG_BROADCAST, ...)
+
+void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, float countdown_num);
+void Send_CSQC_Centerprint_Generic_Expire(entity e, float id);
+#endif // ifdef SVQC
+#endif // ifndef MENUQC
+
+
+// ====================================
+// Notifications List and Information
+// ====================================
+/*
+ List of all notifications (including identifiers and display information)
+ Possible Tokens: name, infoname, centername, strnum, flnum, args, hudargs, icon, cpid, durcnt, normal, gentle
+ Format Specifications:
+ MSG_INFO:
+ name: VAR: Name of notification
+ strnum: FLOAT: Number of STRING arguments (so that networking knows how many to send/receive)
+ flnum: FLOAT: Number of FLOAT arguments (so that networking knows how many to send/receive)
+ args: MISC: Arguments for sprintf(string, args), if no args needed then use ""
+ hudargs: XPD(STRING, STRING): arguments for names in notify messages
+ icon: STRING: icon string name for the hud notify panel, "" if no icon is used
+ normal: STRING: Normal message (string for sprintf when gentle messages are NOT enabled)
+ gentle: STRING: Gentle message (string for sprintf when gentle messages ARE enabled)
+ MSG_CENTER:
+ name: VAR: Name of notification
+ strnum: FLOAT: Number of STRING arguments (so that networking knows how many to send/receive)
+ flnum: FLOAT: Number of FLOAT arguments (so that networking knows how many to send/receive)
+ args: MISC: Arguments for sprintf(string, args), if no args needed then use ""
+ cpid: FLOAT: centerprint ID number (CPID_*), NO_CPID if no CPID is needed
+ durcnt: XPD(FLOAT, FLOAT): Duration/Countdown: extra arguments for centerprint messages
+ normal: STRING: Normal message (string for sprintf when gentle messages are NOT enabled)
+ gentle: STRING: Gentle message (string for sprintf when gentle messages ARE enabled)
+ MSG_WEAPON:
+ MSG_DEATH:
+ name: VAR: Name of chaining notification
+ infoname: VAR: Name of info notification for reference
+ centername: VAR: Name of centerprint notification for reference
+
+ Messages with ^F1, ^BG, ^TC, etc etc in them will replace those strings
+ with colors according to the cvars the user has chosen. This allows for
+ users to create unique color profiles for their HUD, giving more customization
+ options to HUD designers and end users who want such a feature.
+
+ Check out the function calls for string CCR(...) and
+ string TCR(...) to better understand how these codes work.
+
+ Guidlines for notification declaration (please try and follow these):
+ -ALWAYS start the string with a color, preferably background.
+ -ALWAYS reset a color after a name (this way they don't set it for the whole string).
+ -NEVER re-declare an event twice.
+ -NEVER add or remove tokens from the format, it SHOULD already work.
+ -MSG_INFO messages must ALWAYS end with a new line: \n
+ -MSG_CENTER should NOT end with a new line
+ -Be clean and simple with your notification naming,
+ nothing too long for the name field... Abbreviations are your friend. :D
+ -Keep the spacing as clean as possible... if the arguments are abnormally long,
+ it's okay to go out of line a bit... but try and keep it clean still.
+ -Sort the notifications in the most appropriate order for their tasks.
+ TODO: ? centerprint IDs are given priority based on their order (first being highest priority going downwards)
+ -ARIRE unir frk jvgu lbhe bja zbgure. (gvc sbe zvxrrhfn) -- Don't pay attention to this ^_^
+
+ Final note: DO NOT PROVIDE MORE ARGUMENTS THAN NECESSARY FOR THE NOTIFICATION YOU'RE CALLING!
+ The system is designed to save as much networking bandwidth as possible,
+ so please dynamically control your argument sending to fit *exactly* what is required.
+*/
+
+#define MULTITEAM_INFO(prefix,teams,strnum,flnum,args,hudargs,icon,normal,gentle) \
+ 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(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(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, XPD("", ""), "", "", "") \
+ MULTITEAM_INFO(INFO_CTF_FLAGRETURN_DROPPED_, 2, 0, 0, NO_STR_ARG, XPD("", ""), "", _("^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, XPD("", ""), "", _("^BGThe ^TC^TT^BG flag was destroyed and returned to base\n"), "") \
+ MULTITEAM_INFO(INFO_CTF_FLAGRETURN_SPEEDRUN_, 2, 0, 1, f1/100, XPD("", ""), "", _("^BGThe ^TC^TT^BG flag became impatient after ^F1%.2f^BG seconds and returned itself\n"), "") \
+ MULTITEAM_INFO(INFO_CTF_FLAGRETURN_NEEDKILL_, 2, 0, 0, NO_STR_ARG, XPD("", ""), "", _("^BGThe ^TC^TT^BG flag fell somewhere it couldn't be reached and returned to base\n"), "") \
+ MULTITEAM_INFO(INFO_CTF_FLAGRETURN_ABORTRUN_, 2, 0, 0, NO_STR_ARG, XPD("", ""), "", _("^BGThe ^TC^TT^BG flag was returned to base by its owner\n"), "") \
+ MULTITEAM_INFO(INFO_CTF_FLAGRETURN_TIMEOUT_, 2, 0, 0, NO_STR_ARG, XPD("", ""), "", _("^BGThe ^TC^TT^BG flag has returned to the base\n"), "") \
+ MULTITEAM_INFO(INFO_CTF_PICKUP_, 2, 1, 0, s1, XPD(s1, ""), "notify_%s_taken", _("^BG%s^BG got the ^TC^TT^BG flag\n"), "") \
+ MULTITEAM_INFO(INFO_CTF_RETURN_, 2, 1, 0, s1, XPD(s1, ""), "notify_%s_returned", _("^BG%s^BG returned the ^TC^TT^BG flag\n"), "") \
+ MULTITEAM_INFO(INFO_CTF_LOST_, 2, 1, 0, s1, XPD(s1, ""), "notify_%s_lost", _("^BG%s^BG lost the ^TC^TT^BG flag\n"), "") \
+ MULTITEAM_INFO(INFO_CTF_CAPTURE_, 2, 1, 0, s1, XPD(s1, ""), "notify_%s_captured", _("^BG%s^BG captured the ^TC^TT^BG flag\n"), "") \
+ MULTITEAM_INFO(INFO_CTF_CAPTURE_TIME_, 2, 1, 1, XPD(s1, f1/100), XPD(s1, ""), "notify_%s_captured", _("^BG%s^BG captured the ^TC^TT^BG flag in ^F1%.2f^BG seconds\n"), "") \
+ MULTITEAM_INFO(INFO_CTF_CAPTURE_BROKEN_, 2, 2, 2, XPD(s1, f1/100, s2, f2/100), XPD(s1, ""), "notify_%s_captured", _("^BG%s^BG captured the ^TC^TT^BG flag in ^F1%.2f^BG seconds, breaking ^BG%s^BG's previous record of ^F2%.2f^BG seconds\n"), "") \
+ MULTITEAM_INFO(INFO_CTF_CAPTURE_UNBROKEN_, 2, 2, 2, XPD(s1, f1/100, s2, f2/100), XPD(s1, ""), "notify_%s_captured", _("^BG%s^BG captured the ^TC^TT^BG flag in ^F2%.2f^BG seconds, failing to break ^BG%s^BG's previous record of ^F1%.2f^BG seconds\n"), "") \
+ MULTITEAM_INFO(INFO_DEATH_TEAMKILL_, 4, 2, 1, XPD(s1, s2, SPREE_END), XPD(s1, s2), "notify_teamkill_%s", _("^BG%s^K1 was betrayed by ^BG%s^K1%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_FIRSTBLOOD, 2, 0, s2, XPD("", ""), "", _("^BG%s^K1 drew first blood\n"), _("^F1%s^K1 got the first score\n")) \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_CUSTOM, 2, 1, XPD(s1, s2, SPREE_LOST), XPD(s1, ""), "notify_void", _("^BG%s^K1 %s^K1%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_GENERIC, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_selfkill", _("^BG%s^K1 died%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_VOID, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_void", _("^BG%s^K1 was in the wrong place%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_SUICIDE, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_selfkill", _("^BG%s^K1 couldn't take it anymore%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_NOAMMO, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_outofammo", _("^BG%s^K1 died%s. What's the point of living without ammo?\n"), _("^F1%s^K1 ran out of ammo%s\n")) \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_ROT, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_death", _("^BG%s^K1 rotted away%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_CAMP, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_camping", _("^BG%s^K1 thought they found a nice camping ground%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_BETRAYAL, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_teamkill_red", _("^BG%s^K1 became enemies with the Lord of Teamplay%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_TEAMCHANGE, 1, 1, XPD(s1, DEATH_TEAM), XPD("", ""), "", _("^BG%s^K1 switched to the %s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_AUTOTEAMCHANGE, 1, 1, XPD(s1, DEATH_TEAM), XPD("", ""), "", _("^BG%s^K1 was moved into the %s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_FALL, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_fall", _("^BG%s^K1 hit the ground with a crunch%s\n"), _("^F1%s^K1 hit the ground with a bit too much force%s\n")) \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_DROWN, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_water", _("^BG%s^K1 couldn't catch their breath%s\n"), _("^F1%s^K1 was in the water for too long%s\n")) \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_FIRE, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_death", _("^BG%s^K1 became a bit too crispy%s\n"), _("^F1%s^K1 felt a little hot%s\n")) \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_LAVA, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_lava", _("^BG%s^K1 turned into hot slag%s\n"), _("^F1%s^K1 found a hot place%s\n")) \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_SLIME, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_slime", _("^BG%s^K1 was slimed%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_SHOOTING_STAR, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_shootingstar", _("^BG%s^K1 became a shooting star%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_SWAMP, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_slime", _("^BG%s^K1 is now preserved for centuries to come%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_CHEAT, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_selfkill", _("^BG%s^K1 unfairly eliminated themself%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_SELF_TOUCHEXPLODE, 1, 1, XPD(s1, SPREE_LOST), XPD(s1, ""), "notify_death", _("^BG%s^K1 died in an accident%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_MURDER_TELEFRAG, 2, 1, XPD(s1, s2, SPREE_END), XPD(s1, s2), "notify_telefrag", _("^BG%s^K1 was telefragged by ^BG%s^K1%s\n"), _("^F1%s^K1 tried to occupy ^BG%s^K1's teleport destination space\n")) \
+ MSG_INFO_NOTIF(INFO_DEATH_MURDER_FALL, 2, 1, XPD(s1, s2, SPREE_END), XPD(s1, s2), "notify_fall", _("^BG%s^K1 was grounded by ^BG%s^K1%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_MURDER_DROWN, 2, 1, XPD(s1, s2, SPREE_END), XPD(s1, s2), "notify_water", _("^BG%s^K1 was drowned by ^BG%s^K1%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_MURDER_LAVA, 2, 1, XPD(s1, s2, SPREE_END), XPD(s1, s2), "notify_lava", _("^BG%s^K1 was cooked by ^BG%s^K1%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_MURDER_SLIME, 2, 1, XPD(s1, s2, SPREE_END), XPD(s1, s2), "notify_slime", _("^BG%s^K1 was slimed by ^BG%s^K1%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_MURDER_SHOOTING_STAR, 2, 1, XPD(s1, s2, SPREE_END), XPD(s1, s2), "notify_shootingstar", _("^BG%s^K1 was shot into space by ^BG%s^K1%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_MURDER_SWAMP, 2, 1, XPD(s1, s2, SPREE_END), XPD(s1, s2), "notify_slime", _("^BG%s^K1 was preserved by ^BG%s^K1%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_MURDER_VOID, 2, 1, XPD(s1, s2, SPREE_END), XPD(s1, s2), "notify_void", _("^BG%s^K1 was thrown into a world of hurt by ^BG%s^K1%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_MURDER_TOUCHEXPLODE, 2, 1, XPD(s1, s2, SPREE_END), XPD(s1, s2), "notify_death", _("^BG%s^K1 died in an accident with ^BG%s^K1%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_MURDER_CHEAT, 2, 1, XPD(s1, s2, SPREE_END), XPD(s1, s2), "notify_death", _("^BG%s^K1 was unfairly eliminated by ^BG%s^K1%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_DEATH_MURDER_FIRE, 2, 1, XPD(s1, s2, SPREE_END), XPD(s1, s2), "notify_death", _("^BG%s^K1 was burnt up into a crisp by ^BG%s^K1%s\n"), _("^F1%s^K1 felt a little hot from ^BG%s^K1's fire^K1%s\n")) \
+ MULTITEAM_INFO(INFO_FREEZETAG_ROUND_WIN_, 4, 0, 0, NO_STR_ARG, XPD("", ""), "", _("^TC^TT^BG team wins the round, all other teams were frozen\n"), "") \
+ MSG_INFO_NOTIF(INFO_FREEZETAG_REVIVE, 2, 0, XPD(s1, s2), XPD("", ""), "", _("^BG%s^K3 was revived by ^BG%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_FREEZETAG_FREEZE, 2, 0, XPD(s1, s2), XPD("", ""), "", _("^BG%s^K1 was frozen by ^BG%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_FREEZETAG_SELF, 1, 0, s1, XPD("", ""), "", _("^BG%s^K1 froze themself\n"), "") \
+ MSG_INFO_NOTIF(INFO_KEEPAWAY_DROPPED, 1, 0, s1, XPD(s1, ""), "notify_balldropped", _("^BG%s^BG has dropped the ball!\n"), "") \
+ MSG_INFO_NOTIF(INFO_KEEPAWAY_PICKUP, 1, 0, s1, XPD(s1, ""), "notify_ballpickedup", _("^BG%s^BG has picked up the ball!\n"), "") \
+ MSG_INFO_NOTIF(INFO_RACE_FAIL, 2, 0, XPD(s1, s2), XPD(s1, ""), "race_newfail", "", "") \
+ MSG_INFO_NOTIF(INFO_RACE_NEW_RECORD, 2, 0, XPD(s1, s2), XPD(s1, ""), "race_newrecordserver", "", "") \
+ MSG_INFO_NOTIF(INFO_RACE_NEW_TIME, 2, 0, XPD(s1, s2), XPD(s1, ""), "race_newtime", "", "") \
+ MSG_INFO_NOTIF(INFO_RACE_NEW_RANK, 2, 0, XPD(s1, s2), XPD(s1, ""), "race_newrankyellow", "", "") \
+ MULTITEAM_INFO(INFO_SCORES_, 4, 0, 0, NO_STR_ARG, XPD("", ""), "", _("^TC^TT ^BGteam scores!\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_THINKING_WITH_PORTALS, 1, 0, s1, XPD(s1, ""), "notify_selfkill", _("^BG%s^K1 is now thinking with portals...\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_CRYLINK_SUICIDE, 1, 0, s1, XPD(s1, ""), "weaponcrylink", _("^BG%s^K1 felt the strong pull of their Crylink\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_CRYLINK_MURDER, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponcrylink", _("^BG%s^K1 felt the strong pull of ^BG%s^K1's Crylink\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_ELECTRO_SUICIDE_ORBS, 1, 0, s1, XPD(s1, ""), "weaponelectro", _("^BG%s^K1 could not remember where they put their Electro plasma\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_ELECTRO_SUICIDE_BOLT, 1, 0, s1, XPD(s1, ""), "weaponelectro", _("^BG%s^K1 played with Electro plasma\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_ELECTRO_MURDER_BOLT, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponelectro", _("^BG%s^K1 was blasted by ^BG%s^K1's Electro bolt\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_ELECTRO_MURDER_ORBS, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponelectro", _("^BG%s^K1 got too close to ^BG%s^K1's Electro plasma\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_ELECTRO_MURDER_COMBO, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponelectro", _("^BG%s^K1 felt the electrifying air of ^BG%s^K1's Electro combo\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_FIREBALL_SUICIDE_FIREMINE, 1, 0, s1, XPD(s1, ""), "weaponfireball", _("^BG%s^K1 forgot about their firemine\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_FIREBALL_SUICIDE_BLAST, 1, 0, s1, XPD(s1, ""), "weaponfireball", _("^BG%s^K1 should have used a smaller gun\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_FIREBALL_MURDER_FIREMINE, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponfireball", _("^BG%s^K1 got burnt by ^BG%s^K1's firemine\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_FIREBALL_MURDER_BLAST, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponfireball", _("^BG%s^K1 got too close to ^BG%s^K1's fireball\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_MORTAR_SUICIDE_EXPLODE, 1, 0, s1, XPD(s1, ""), "weapongrenadelauncher", _("^BG%s^K1 blew themself up with their own Mortar\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_MORTAR_SUICIDE_BOUNCE, 1, 0, s1, XPD(s1, ""), "weapongrenadelauncher", _("^BG%s^K1 didn't see their own Mortar grenade\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_MORTAR_MURDER_EXPLODE, 2, 0, XPD(s1, s2), XPD(s1, s2), "weapongrenadelauncher", _("^BG%s^K1 ate ^BG%s^K1's Mortar grenade\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_MORTAR_MURDER_BOUNCE, 2, 0, XPD(s1, s2), XPD(s1, s2), "weapongrenadelauncher", _("^BG%s^K1 got too close to ^BG%s^K1's Mortar grenade\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_HAGAR_SUICIDE, 1, 0, s1, XPD(s1, ""), "weaponhagar", _("^BG%s^K1 played with tiny Hagar rockets\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_HAGAR_MURDER_BURST, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponhagar", _("^BG%s^K1 was pummeled by a burst of ^BG%s^K1's Hagar rockets\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_HAGAR_MURDER_SPRAY, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponhagar", _("^BG%s^K1 was pummeled by ^BG%s^K1's Hagar rockets\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_HLAC_SUICIDE, 1, 0, s1, XPD(s1, ""), "weaponhlac", _("^BG%s^K1 got a little jumpy with their HLAC\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_HLAC_MURDER, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponhlac", _("^BG%s^K1 was cut down with ^BG%s^K1's HLAC\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_HOOK_MURDER, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponhook", _("^BG%s^K1 was caught in ^BG%s^K1's Hook gravity bomb\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_LASER_SUICIDE, 1, 0, s1, XPD(s1, ""), "weaponlaser", _("^BG%s^K1 shot themself to hell with their Laser\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_LASER_MURDER, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponlaser", _("^BG%s^K1 was shot to death by ^BG%s^K1's Laser\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_MINELAYER_SUICIDE, 1, 0, s1, XPD(s1, ""), "weaponminelayer", _("^BG%s^K1 forgot about their mine\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_MINELAYER_MURDER, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponminelayer", _("^BG%s^K1 got too close to ^BG%s^K1's mine\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_MINSTANEX_MURDER, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponminstanex", _("^BG%s^K1 has been vaporized by ^BG%s^K1's Minstanex\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_NEX_MURDER, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponnex", _("^BG%s^K1 has been vaporized by ^BG%s^K1's Nex\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_RIFLE_MURDER_HAIL_PIERCING, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponrifle", _("^BG%s^K1 failed to hide from ^BG%s^K1's Rifle bullet hail\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_RIFLE_MURDER_HAIL, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponrifle", _("^BG%s^K1 died in ^BG%s^K1's Rifle bullet hail\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_RIFLE_MURDER_PIERCING, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponrifle", _("^BG%s^K1 failed to hide from ^BG%s^K1's Rifle\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_RIFLE_MURDER, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponrifle", _("^BG%s^K1 was sniped with a Rifle by ^BG%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_RIFLE_MURDER_HEADSHOT, 2, 0, XPD(s1, s2), XPD(s1, s2), "notify_headshot", _("^BG%s^K1 was shot in the head with a Rifle by ^BG%s\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_ROCKETLAUNCHER_SUICIDE, 1, 0, s1, XPD(s1, ""), "weaponrocketlauncher", _("^BG%s^K1 blew themself up with their Rocketlauncher\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_ROCKETLAUNCHER_MURDER_DIRECT, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponrocketlauncher", _("^BG%s^K1 ate ^BG%s^K1's rocket\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_ROCKETLAUNCHER_MURDER_SPLASH, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponrocketlauncher", _("^BG%s^K1 got too close ^BG%s^K1's rocket\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_SEEKER_SUICIDE, 1, 0, s1, XPD(s1, ""), "weaponseeker", _("^BG%s^K1 played with tiny Seeker rockets\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_SEEKER_MURDER_TAG, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponseeker", _("^BG%s^K1 was tagged by ^BG%s^K1's Seeker\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_SEEKER_MURDER_SPRAY, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponseeker", _("^BG%s^K1 was pummeled by ^BG%s^K1's Seeker rockets\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_SHOTGUN_MURDER_SLAP, 2, 0, XPD(s2, s1), XPD(s1, s2), "notify_melee_shotgun", _("^BG%s^K1 slapped ^BG%s^K1 around a bit with a large Shotgun\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_SHOTGUN_MURDER, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponshotgun", _("^BG%s^K1 was gunned down by ^BG%s^K1's Shotgun\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_TUBA_SUICIDE, 1, 0, s1, XPD(s1, ""), "weapontuba", _("^BG%s^K1 hurt their own ears with the @!#%%'n Tuba\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_TUBA_MURDER, 2, 0, XPD(s1, s2), XPD(s1, s2), "weapontuba", _("^BG%s^K1 died of ^BG%s^K1's great playing on the @!#%%'n Tuba\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_ACCORDEON_SUICIDE, 1, 0, s1, XPD(s1, ""), "weapontuba", _("^BG%s^K1 hurt their own ears with the @!#%%'n Accordeon\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_ACCORDEON_MURDER, 2, 0, XPD(s1, s2), XPD(s1, s2), "weapontuba", _("^BG%s^K1 died of ^BG%s^K1's great playing on the @!#%%'n Accordeon\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_KLEINBOTTLE_SUICIDE, 1, 0, s1, XPD(s1, ""), "weapontuba", _("^BG%s^K1 hurt their own ears with the @!#%%'n Klein Bottle\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_KLEINBOTTLE_MURDER, 2, 0, XPD(s1, s2), XPD(s1, s2), "weapontuba", _("^BG%s^K1 died of ^BG%s^K1's great playing on the @!#%%'n Klein Bottle\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_UZI_MURDER_SNIPE, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponuzi", _("^BG%s^K1 was sniped by ^BG%s^K1's Machine Gun\n"), "") \
+ MSG_INFO_NOTIF(INFO_WEAPON_UZI_MURDER_SPRAY, 2, 0, XPD(s1, s2), XPD(s1, s2), "weaponuzi", _("^BG%s^K1 was riddled full of holes by ^BG%s^K1's Machine Gun\n"), "")
+
+#define MULTITEAM_CENTER(prefix,teams,strnum,flnum,args,cpid,durcnt,normal,gentle) \
+ 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, 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, 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, XPD(0, 0), "", "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_CAPTURESHIELD_SHIELDED, 0, 0, NO_STR_ARG, CPID_CTF_CAPSHIELD, XPD(0, 0), _("^BGYou are now ^F1shielded^BG from the flag\n^BGfor ^F2too many unsuccessful attempts^BG to capture.\n^BGMake some defensive scores before trying again."), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_CAPTURESHIELD_FREE, 0, 0, NO_STR_ARG, CPID_CTF_CAPSHIELD, XPD(0, 0), _("^BGYou are now free.\n^BGFeel free to ^F2try to capture^BG the flag again\n^BGif you think you will succeed."), "") \
+ MULTITEAM_CENTER(CENTER_CTF_PASS_OTHER_, 2, 2, 0, XPD(s1, s2), CPID_CTF_PASS, XPD(0, 0), _("^BG%s^BG passed the ^TC^TT^BG flag to %s"), "") \
+ MULTITEAM_CENTER(CENTER_CTF_PASS_SENT_, 2, 1, 0, s1, CPID_CTF_PASS, XPD(0, 0), _("^BGYou passed the ^TC^TT^BG flag to %s"), "") \
+ MULTITEAM_CENTER(CENTER_CTF_PASS_RECEIVED_, 2, 1, 0, s1, CPID_CTF_PASS, XPD(0, 0), _("^BGYou received the ^TC^TT^BG flag from %s"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_PASS_REQUESTING, 1, 0, s1, CPID_CTF_PASS, XPD(0, 0), _("^BGRequesting %s^BG to pass you the flag"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_PASS_REQUESTED, 1, 0, XPD(s1, PASS_KEY), CPID_CTF_PASS, XPD(0, 0), _("^BG%s^BG requests you to pass the flag%s"), "") \
+ MULTITEAM_CENTER(CENTER_CTF_RETURN_, 2, 0, 0, NO_STR_ARG, CPID_CTF_LOWPRIO, XPD(0, 0), _("^BGYou returned the ^TC^TT^BG flag!"), "") \
+ MULTITEAM_CENTER(CENTER_CTF_CAPTURE_, 2, 0, 0, NO_STR_ARG, CPID_CTF_LOWPRIO, XPD(0, 0), _("^BGYou captured the ^TC^TT^BG flag!"), "") \
+ MULTITEAM_CENTER(CENTER_CTF_PICKUP_, 2, 0, 0, NO_STR_ARG, CPID_CTF_LOWPRIO, XPD(0, 0), _("^BGYou got the ^TC^TT^BG flag!"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_PICKUP_TEAM, 1, 0, s1, CPID_CTF_LOWPRIO, XPD(0, 0), _("^BGYour %steam mate^BG got the flag! Protect them!"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_PICKUP_TEAM_VERBOSE, 2, 0, XPD(s1, s2, s1), CPID_CTF_LOWPRIO, XPD(0, 0), _("^BGYour %steam mate (^BG%s%s)^BG got the flag! Protect them!"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_PICKUP_ENEMY, 1, 0, s1, CPID_CTF_LOWPRIO, XPD(0, 0), _("^BGThe %senemy^BG got your flag! Retrieve it!"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_PICKUP_ENEMY_VERBOSE, 2, 0, XPD(s1, s2, s1), CPID_CTF_LOWPRIO, XPD(0, 0), _("^BGThe %senemy (^BG%s%s)^BG got your flag! Retrieve it!"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_STALEMATE_CARRIER, 0, 0, NO_STR_ARG, CPID_STALEMATE, XPD(0, 0), _("^BGStalemate! Enemies can now see you on radar!"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_STALEMATE_OTHER, 0, 0, NO_STR_ARG, CPID_STALEMATE, XPD(0, 0), _("^BGStalemate! Flag carriers can now be seen by enemies on radar!"), "") \
+ MSG_CENTER_NOTIF(CENTER_CTF_FLAG_THROW_PUNISH, 0, 1, f1, CPID_CTF_LOWPRIO, XPD(0, 0), _("^BGToo many flag throws! Throwing disabled for %d seconds."), "") \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_CUSTOM, 2, 0, s2, NO_CPID, XPD(0, 0), _("^K1You were %s"), "") \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_GENERIC, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1You killed your own dumb self!"), _("^K1You need to be more careful!")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_VOID, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1Watch your step!"), "") \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_SUICIDE, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1You committed suicide!"), _("^K1You ended it all!")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_NOAMMO, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1You were killed for running out of ammo..."), _("^K1You are respawning for running out of ammo...")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_ROT, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1You grew too old without taking your medicine"), _("^K1You need to preserve your health")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_CAMP, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1Die camper!"), _("^K1Reconsider your tactics, camper!")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_BETRAYAL, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1Don't shoot your team mates!"), _("^K1Don't go against your team mates!")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_TEAMCHANGE, 0, 1, DEATH_TEAM, NO_CPID, XPD(0, 0), _("^BGYou are now on: %s"), "") \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_AUTOTEAMCHANGE, 0, 1, DEATH_TEAM, NO_CPID, XPD(0, 0), _("^BGYou have been moved into a different team\nYou are now on: %s"), "") \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_FALL, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1You hit the ground with a crunch!"), "") \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_DROWN, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1You couldn't catch your breath in time!"), "") \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_FIRE, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1You got a little bit too crispy!"), _("^K1You felt a little too hot!")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_LAVA, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1You couldn't stand the heat!"), "") \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_SLIME, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1You melted away in slime!"), "") \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_SHOOTING_STAR, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1You became a shooting star!"), "") \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_SWAMP, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1You got stuck in a swamp!"), "") \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_CHEAT, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1You unfairly eliminated yourself!"), "") \
+ MSG_CENTER_NOTIF(CENTER_DEATH_SELF_TOUCHEXPLODE, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1You died in an accident!"), "") \
+ MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_FRAG, 1, 1, XPD(SPREE_CEN, s1), NO_CPID, XPD(0, 0), _("^K3%sYou fragged ^BG%s"), _("^K3%sYou scored against ^BG%s")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_FRAGGED, 1, 0, s1, NO_CPID, XPD(0, 0), _("^K1You were fragged by ^BG%s"), _("^K1You were scored against by ^BG%s")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_TYPEFRAG, 1, 1, XPD(SPREE_CEN, s1), NO_CPID, XPD(0, 0), _("^K1%sYou typefragged ^BG%s"), _("^K1%sYou scored against ^BG%s^K1 while they were typing")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_TYPEFRAGGED, 1, 0, s1, NO_CPID, XPD(0, 0), _("^K1You were typefragged by ^BG%s"), _("^K1You were scored against by ^BG%s^K1 while typing!")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_FRAG_FIRST, 1, 0, s1, NO_CPID, XPD(0, 0), _("^K3First blood! You fragged ^BG%s"), _("^K3First score! You scored against ^BG%s")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_FRAGGED_FIRST, 1, 0, s1, NO_CPID, XPD(0, 0), _("^K1First victim! You were fragged by ^BG%s"), _("^K1First casualty! You were scored against by ^BG%s")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_TYPEFRAG_FIRST, 1, 0, s1, NO_CPID, XPD(0, 0), _("^K1First blood! You typefragged ^BG%s"), _("^K1First score! You scored against ^BG%s^K1 while they were typing")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_TYPEFRAGGED_FIRST, 1, 0, s1, NO_CPID, XPD(0, 0), _("^K1First victim! You were typefragged by ^BG%s"), _("^K1First casualty! You were scored against by ^BG%s^K1 while typing!")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_FRAG_VERBOSE, 1, 2, XPD(SPREE_CEN, s1, FRAG_PING), NO_CPID, XPD(0, 0), _("^K3You fragged ^BG%s^BG%s"), _("^K3You scored against ^BG%s^BG%s")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_FRAGGED_VERBOSE, 1, 3, XPD(s1, FRAG_STATS), NO_CPID, XPD(0, 0), _("^K1You were fragged by ^BG%s^BG%s"), _("^K1You were scored against by ^BG%s^BG%s")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_TYPEFRAG_VERBOSE, 1, 2, XPD(SPREE_CEN, s1, FRAG_PING), NO_CPID, XPD(0, 0), _("^K1You typefragged ^BG%s^BG%s"), _("^K1You scored against ^BG%s^K1 while they were typing^BG%s")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_TYPEFRAGGED_VERBOSE, 1, 3, XPD(s1, FRAG_STATS), NO_CPID, XPD(0, 0), _("^K1You were typefragged by ^BG%s^BG%s"), _("^K1You were scored against by ^BG%s^K1 while typing^BG%s")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_FRAG_FIRST_VERBOSE, 1, 1, s1, NO_CPID, XPD(0, 0), _("^K3First blood! You fragged ^BG%s"), _("^K3First score! You scored against ^BG%s")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_FRAGGED_FIRST_VERBOSE, 1, 3, s1, NO_CPID, XPD(0, 0), _("^K1First victim! You were fragged by ^BG%s"), _("^K1First casualty! You were scored against by ^BG%s")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_TYPEFRAG_FIRST_VERBOSE, 1, 1, s1, NO_CPID, XPD(0, 0), _("^K1First blood! You typefragged ^BG%s"), _("^K1First score! You scored against ^BG%s^K1 while they were typing")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_MURDER_TYPEFRAGGED_FIRST_VERBOSE, 1, 3, s1, NO_CPID, XPD(0, 0), _("^K1First victim! You were typefragged by ^BG%s"), _("^K1First casualty! You were scored against by ^BG%s^K1 while typing!")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_TEAMKILL_FRAG, 1, 0, s1, NO_CPID, XPD(0, 0), _("^K1Moron! You fragged ^BG%s^K1, a team mate!"), _("^K1Moron! You went against ^BG%sK1, a team mate!")) \
+ MSG_CENTER_NOTIF(CENTER_DEATH_TEAMKILL_FRAGGED, 1, 0, s1, NO_CPID, XPD(0, 0), _("^K1You were fragged by ^BG%s^K1, a team mate"), _("^K1You were scored against by ^BG%s^K1, a team mate")) \
+ MULTITEAM_CENTER(CENTER_FREEZETAG_ROUND_WIN_, 4, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^TC^TT^BG team wins the round, all other teams were frozen"), "") \
+ MSG_CENTER_NOTIF(CENTER_FREEZETAG_SPAWN_LATE, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1You spawned after the round started, you'll spawn as frozen"), "") \
+ MSG_CENTER_NOTIF(CENTER_FREEZETAG_REVIVE, 1, 0, s1, NO_CPID, XPD(0, 0), _("^K3You revived ^BG%s"), "") \
+ MSG_CENTER_NOTIF(CENTER_FREEZETAG_REVIVED, 1, 0, s1, NO_CPID, XPD(0, 0), _("^K3You were revived by ^BG%s"), "") \
+ MSG_CENTER_NOTIF(CENTER_FREEZETAG_SELF, 0, 0, NO_STR_ARG, NO_CPID, XPD(0, 0), _("^K1You froze yourself"), "") \
+ MSG_CENTER_NOTIF(CENTER_FREEZETAG_FREEZE, 1, 0, s1, NO_CPID, XPD(0, 0), _("^K3You froze ^BG%s"), "") \
+ MSG_CENTER_NOTIF(CENTER_FREEZETAG_FROZEN, 1, 0, s1, NO_CPID, XPD(0, 0), _("^K1You were frozen by ^BG%s"), "") \
+ MSG_CENTER_NOTIF(CENTER_KEEPAWAY_DROPPED, 1, 0, s1, CPID_KEEPAWAY, XPD(0, 0), _("^BG%s^BG has dropped the ball!"), "") \
+ MSG_CENTER_NOTIF(CENTER_KEEPAWAY_PICKUP, 1, 0, s1, CPID_KEEPAWAY, XPD(0, 0), _("^BG%s^BG has picked up the ball!"), "") \
+ MSG_CENTER_NOTIF(CENTER_KEEPAWAY_WARN, 0, 0, NO_STR_ARG, CPID_KA_WARN, XPD(0, 0), _("^BGKilling people while you don't have the ball gives no points!"), "") \
+ MSG_CENTER_NOTIF(CENTER_WEAPON_MARBLES_LOST, 1, 1, XPD(s1, WEAPON_NAME), NO_CPID, XPD(0, 0), _("^K1You lost your marbles against ^BG%s^K1 using the ^BG%s!"), "")
+
+#define MSG_WEAPON_NOTIFICATIONS \
+ MSG_WEAPON_NOTIF(WEAPON_EMPTY, NO_MSG, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_THINKING_WITH_PORTALS, INFO_WEAPON_THINKING_WITH_PORTALS, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_CRYLINK_SUICIDE, INFO_WEAPON_CRYLINK_SUICIDE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_CRYLINK_MURDER, INFO_WEAPON_CRYLINK_MURDER, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_ELECTRO_SUICIDE_ORBS, INFO_WEAPON_ELECTRO_SUICIDE_ORBS, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_ELECTRO_SUICIDE_BOLT, INFO_WEAPON_ELECTRO_SUICIDE_BOLT, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_ELECTRO_MURDER_BOLT, INFO_WEAPON_ELECTRO_MURDER_BOLT, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_ELECTRO_MURDER_ORBS, INFO_WEAPON_ELECTRO_MURDER_ORBS, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_ELECTRO_MURDER_COMBO, INFO_WEAPON_ELECTRO_MURDER_COMBO, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_FIREBALL_SUICIDE_FIREMINE, INFO_WEAPON_FIREBALL_SUICIDE_FIREMINE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_FIREBALL_SUICIDE_BLAST, INFO_WEAPON_FIREBALL_SUICIDE_BLAST, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_FIREBALL_MURDER_FIREMINE, INFO_WEAPON_FIREBALL_MURDER_FIREMINE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_FIREBALL_MURDER_BLAST, INFO_WEAPON_FIREBALL_MURDER_BLAST, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_MORTAR_SUICIDE_EXPLODE, INFO_WEAPON_MORTAR_SUICIDE_EXPLODE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_MORTAR_SUICIDE_BOUNCE, INFO_WEAPON_MORTAR_SUICIDE_BOUNCE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_MORTAR_MURDER_EXPLODE, INFO_WEAPON_MORTAR_MURDER_EXPLODE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_MORTAR_MURDER_BOUNCE, INFO_WEAPON_MORTAR_MURDER_BOUNCE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_HAGAR_SUICIDE, INFO_WEAPON_HAGAR_SUICIDE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_HAGAR_MURDER_BURST, INFO_WEAPON_HAGAR_MURDER_BURST, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_HAGAR_MURDER_SPRAY, INFO_WEAPON_HAGAR_MURDER_SPRAY, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_HLAC_SUICIDE, INFO_WEAPON_HLAC_SUICIDE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_HLAC_MURDER, INFO_WEAPON_HLAC_MURDER, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_HOOK_MURDER, INFO_WEAPON_HOOK_MURDER, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_LASER_SUICIDE, INFO_WEAPON_LASER_SUICIDE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_LASER_MURDER, INFO_WEAPON_LASER_MURDER, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_MINELAYER_SUICIDE, INFO_WEAPON_MINELAYER_SUICIDE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_MINELAYER_MURDER, INFO_WEAPON_MINELAYER_MURDER, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_MINSTANEX_MURDER, INFO_WEAPON_MINSTANEX_MURDER, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_NEX_MURDER, INFO_WEAPON_NEX_MURDER, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_RIFLE_MURDER_HAIL_PIERCING, INFO_WEAPON_RIFLE_MURDER_HAIL_PIERCING, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_RIFLE_MURDER_HAIL, INFO_WEAPON_RIFLE_MURDER_HAIL, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_RIFLE_MURDER_PIERCING, INFO_WEAPON_RIFLE_MURDER_PIERCING, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_RIFLE_MURDER, INFO_WEAPON_RIFLE_MURDER, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_RIFLE_MURDER_HEADSHOT, INFO_WEAPON_RIFLE_MURDER_HEADSHOT, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_ROCKETLAUNCHER_SUICIDE, INFO_WEAPON_ROCKETLAUNCHER_SUICIDE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_ROCKETLAUNCHER_MURDER_DIRECT, INFO_WEAPON_ROCKETLAUNCHER_MURDER_DIRECT, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_ROCKETLAUNCHER_MURDER_SPLASH, INFO_WEAPON_ROCKETLAUNCHER_MURDER_SPLASH, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_SEEKER_SUICIDE, INFO_WEAPON_SEEKER_SUICIDE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_SEEKER_MURDER_TAG, INFO_WEAPON_SEEKER_MURDER_TAG, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_SEEKER_MURDER_SPRAY, INFO_WEAPON_SEEKER_MURDER_SPRAY, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_SHOTGUN_MURDER_SLAP, INFO_WEAPON_SHOTGUN_MURDER_SLAP, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_SHOTGUN_MURDER, INFO_WEAPON_SHOTGUN_MURDER, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_TUBA_SUICIDE, INFO_WEAPON_TUBA_SUICIDE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_TUBA_MURDER, INFO_WEAPON_TUBA_MURDER, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_ACCORDEON_SUICIDE, INFO_WEAPON_ACCORDEON_SUICIDE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_ACCORDEON_MURDER, INFO_WEAPON_ACCORDEON_MURDER, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_KLEINBOTTLE_SUICIDE, INFO_WEAPON_KLEINBOTTLE_SUICIDE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_KLEINBOTTLE_MURDER, INFO_WEAPON_KLEINBOTTLE_MURDER, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_UZI_MURDER_SNIPE, INFO_WEAPON_UZI_MURDER_SNIPE, NO_MSG) \
+ MSG_WEAPON_NOTIF(WEAPON_UZI_MURDER_SPRAY, INFO_WEAPON_UZI_MURDER_SPRAY, NO_MSG)
+
+#define MSG_DEATH_NOTIFICATIONS \
+ MSG_DEATH_NOTIF(DEATH_EMPTY, NO_MSG, NO_MSG) \
+ MSG_DEATH_NOTIF(DEATH_SELF_CUSTOM, INFO_DEATH_SELF_GENERIC, CENTER_DEATH_SELF_CUSTOM) \
+ MSG_DEATH_NOTIF(DEATH_SELF_GENERIC, INFO_DEATH_SELF_GENERIC, CENTER_DEATH_SELF_GENERIC) \
+ MSG_DEATH_NOTIF(DEATH_SELF_VOID, INFO_DEATH_SELF_VOID, CENTER_DEATH_SELF_VOID) \
+ MSG_DEATH_NOTIF(DEATH_SELF_SUICIDE, INFO_DEATH_SELF_SUICIDE, CENTER_DEATH_SELF_SUICIDE) \
+ MSG_DEATH_NOTIF(DEATH_SELF_NOAMMO, INFO_DEATH_SELF_NOAMMO, CENTER_DEATH_SELF_NOAMMO) \
+ MSG_DEATH_NOTIF(DEATH_SELF_ROT, INFO_DEATH_SELF_ROT, CENTER_DEATH_SELF_ROT) \
+ MSG_DEATH_NOTIF(DEATH_SELF_CAMP, INFO_DEATH_SELF_CAMP, CENTER_DEATH_SELF_CAMP) \
+ MSG_DEATH_NOTIF(DEATH_SELF_BETRAYAL, INFO_DEATH_SELF_BETRAYAL, CENTER_DEATH_SELF_BETRAYAL) \
+ MSG_DEATH_NOTIF(DEATH_SELF_TEAMCHANGE, INFO_DEATH_SELF_TEAMCHANGE, CENTER_DEATH_SELF_TEAMCHANGE) \
+ MSG_DEATH_NOTIF(DEATH_SELF_AUTOTEAMCHANGE, INFO_DEATH_SELF_AUTOTEAMCHANGE, CENTER_DEATH_SELF_AUTOTEAMCHANGE) \
+ MSG_DEATH_NOTIF(DEATH_SELF_FALL, INFO_DEATH_SELF_FALL, CENTER_DEATH_SELF_FALL) \
+ MSG_DEATH_NOTIF(DEATH_SELF_DROWN, INFO_DEATH_SELF_DROWN, CENTER_DEATH_SELF_DROWN) \
+ MSG_DEATH_NOTIF(DEATH_SELF_FIRE, INFO_DEATH_SELF_FIRE, CENTER_DEATH_SELF_FIRE) \
+ MSG_DEATH_NOTIF(DEATH_SELF_LAVA, INFO_DEATH_SELF_LAVA, CENTER_DEATH_SELF_LAVA) \
+ MSG_DEATH_NOTIF(DEATH_SELF_SLIME, INFO_DEATH_SELF_SLIME, CENTER_DEATH_SELF_SLIME) \
+ MSG_DEATH_NOTIF(DEATH_SELF_SHOOTING_STAR, INFO_DEATH_SELF_SHOOTING_STAR, CENTER_DEATH_SELF_SHOOTING_STAR) \
+ MSG_DEATH_NOTIF(DEATH_SELF_SWAMP, INFO_DEATH_SELF_SWAMP, CENTER_DEATH_SELF_SWAMP) \
+ MSG_DEATH_NOTIF(DEATH_SELF_CHEAT, INFO_DEATH_SELF_CHEAT, CENTER_DEATH_SELF_CHEAT) \
+ MSG_DEATH_NOTIF(DEATH_SELF_TOUCHEXPLODE, INFO_DEATH_SELF_TOUCHEXPLODE, CENTER_DEATH_SELF_TOUCHEXPLODE) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_TELEFRAG, INFO_DEATH_MURDER_TELEFRAG, NO_MSG) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_FALL, INFO_DEATH_MURDER_FALL, NO_MSG) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_DROWN, INFO_DEATH_MURDER_DROWN, NO_MSG) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_LAVA, INFO_DEATH_MURDER_LAVA, NO_MSG) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_SLIME, INFO_DEATH_MURDER_SLIME, NO_MSG) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_SHOOTING_STAR, INFO_DEATH_MURDER_SHOOTING_STAR, NO_MSG) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_SWAMP, INFO_DEATH_MURDER_SWAMP, NO_MSG) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_VOID, INFO_DEATH_MURDER_VOID, NO_MSG) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_TOUCHEXPLODE, INFO_DEATH_MURDER_TOUCHEXPLODE, NO_MSG) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_CHEAT, INFO_DEATH_MURDER_CHEAT, NO_MSG) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_FIRE, INFO_DEATH_MURDER_FIRE, NO_MSG) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_FRAG, NO_MSG, CENTER_DEATH_MURDER_FRAG) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_FRAGGED, NO_MSG, CENTER_DEATH_MURDER_FRAGGED) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_TYPEFRAG, NO_MSG, CENTER_DEATH_MURDER_TYPEFRAG) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_TYPEFRAGGED, NO_MSG, CENTER_DEATH_MURDER_TYPEFRAGGED) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_FRAG_FIRST, INFO_DEATH_FIRSTBLOOD, CENTER_DEATH_MURDER_FRAG_FIRST) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_FRAGGED_FIRST, NO_MSG, CENTER_DEATH_MURDER_FRAGGED_FIRST) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_TYPEFRAG_FIRST, INFO_DEATH_FIRSTBLOOD, CENTER_DEATH_MURDER_TYPEFRAG_FIRST) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_TYPEFRAGGED_FIRST, NO_MSG, CENTER_DEATH_MURDER_TYPEFRAGGED_FIRST) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_FRAG_VERBOSE, NO_MSG, CENTER_DEATH_MURDER_FRAG_VERBOSE) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_FRAGGED_VERBOSE, NO_MSG, CENTER_DEATH_MURDER_FRAGGED_VERBOSE) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_TYPEFRAG_VERBOSE, NO_MSG, CENTER_DEATH_MURDER_TYPEFRAG_VERBOSE) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_TYPEFRAGGED_VERBOSE, NO_MSG, CENTER_DEATH_MURDER_TYPEFRAGGED_VERBOSE) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_FRAG_FIRST_VERBOSE, INFO_DEATH_FIRSTBLOOD, CENTER_DEATH_MURDER_FRAG_FIRST_VERBOSE) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_FRAGGED_FIRST_VERBOSE, NO_MSG, CENTER_DEATH_MURDER_FRAGGED_FIRST_VERBOSE) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_TYPEFRAG_FIRST_VERBOSE, INFO_DEATH_FIRSTBLOOD, CENTER_DEATH_MURDER_TYPEFRAG_FIRST_VERBOSE) \
+ MSG_DEATH_NOTIF(DEATH_MURDER_TYPEFRAGGED_FIRST_VERBOSE, NO_MSG, CENTER_DEATH_MURDER_TYPEFRAGGED_FIRST_VERBOSE) \
+ MSG_DEATH_NOTIF(DEATH_TEAMKILL_FRAG, NO_MSG, CENTER_DEATH_TEAMKILL_FRAG) \
+ MSG_DEATH_NOTIF(DEATH_TEAMKILL_FRAGGED, NO_MSG, CENTER_DEATH_TEAMKILL_FRAGGED)
+
+
+// ====================================
+// Initialization/Create Declarations
+// ====================================
+
+#define NOTIF_FIRST 1
+#define NOTIF_MAX 1024 // limit of recursive functions with ACCUMULATE_FUNCTION
+float NOTIF_INFO_COUNT;
+float NOTIF_CENTER_COUNT;
+float NOTIF_WEAPON_COUNT;
+float NOTIF_DEATH_COUNT;
+float NOTIF_CPID_COUNT;
+
+#define MSG_INFO_NOTIF(name,strnum,flnum,args,hudargs,icon,normal,gentle) \
+ #ifndef MENUQC \
+ ADD_AUTOCVAR(name) \
+ #endif \
+ float name; \
+ void RegisterNotification_##name() \
+ { \
+ SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_INFO_COUNT) \
+ CHECK_MAX_COUNT(name, NOTIF_MAX, NOTIF_INFO_COUNT, "notifications") \
+ } \
+ ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
+
+#define MSG_CENTER_NOTIF(name,strnum,flnum,args,cpid,durcnt,normal,gentle) \
+ #ifndef MENUQC \
+ ADD_AUTOCVAR(name) \
+ #endif \
+ float name; \
+ float cpid; \
+ void RegisterNotification_##name() \
+ { \
+ SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_CENTER_COUNT) \
+ SET_FIELD_COUNT(cpid, NOTIF_FIRST, NOTIF_CPID_COUNT) \
+ CHECK_MAX_COUNT(name, NOTIF_MAX, NOTIF_CENTER_COUNT, "notifications") \
+ } \
+ ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
+
+#define MSG_WEAPON_NOTIF(name,infoname,centername) \
+ #ifndef MENUQC \
+ ADD_AUTOCVAR(name) \
+ #endif \
+ float name; \
+ void RegisterNotification_##name() \
+ { \
+ SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_WEAPON_COUNT) \
+ CHECK_MAX_COUNT(name, NOTIF_MAX, NOTIF_WEAPON_COUNT, "notifications") \
+ } \
+ ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
+
+#define MSG_DEATH_NOTIF(name,infoname,centername) \
+ #ifndef MENUQC \
+ ADD_AUTOCVAR(name) \
+ #endif \
+ float name; \
+ void RegisterNotification_##name() \
+ { \
+ SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_DEATH_COUNT) \
+ CHECK_MAX_COUNT(name, NOTIF_MAX, NOTIF_DEATH_COUNT, "notifications") \
+ } \
+ ACCUMULATE_FUNCTION(RegisterNotifications, RegisterNotification_##name)
+
+// NOW we actually activate the declarations
+MSG_INFO_NOTIFICATIONS
+MSG_CENTER_NOTIFICATIONS
+MSG_WEAPON_NOTIFICATIONS
+MSG_DEATH_NOTIFICATIONS
+#undef MSG_INFO_NOTIF
+#undef MSG_CENTER_NOTIF
+#undef MSG_WEAPON_NOTIF
+#undef MSG_DEATH_NOTIF
--- /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;
+
+// TO BE PHASED OUT IF WE SWITCH TO USE "TEAMNUMBERS_THAT_ARENT_STUPID"
+#define TEAM_SV_TO_CL(num) num
+#define TEAM_CL_TO_SV(num) num
+#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;
+
+// TO BE PHASED OUT IF WE SWITCH TO USE "TEAMNUMBERS_THAT_ARENT_STUPID"
+#define TEAM_SV_TO_CL(num) (num - 1)
+#define TEAM_CL_TO_SV(num) (num + 1)
+#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");
+
+#define APP_TEAM_NUM_2(num,prefix) ((num == FL_TEAM_1) ? prefix##RED : prefix##BLUE)
+#define APP_TEAM_NUM_4(num,prefix) ((num == FL_TEAM_1) ? prefix##RED : ((num == FL_TEAM_2) ? prefix##BLUE : ((num == FL_TEAM_3) ? prefix##YELLOW : prefix##PINK)))
+#define APP_TEAM_ENT_2(ent,prefix) ((ent.team == FL_TEAM_1) ? prefix##RED : prefix##BLUE)
+#define APP_TEAM_ENT_4(ent,prefix) ((ent.team == FL_TEAM_1) ? prefix##RED : ((ent.team == FL_TEAM_2) ? prefix##BLUE : ((ent.team == FL_TEAM_3) ? prefix##YELLOW : prefix##PINK)))
+
+#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
+#define TeamByColor(teamid) (Team_TeamToNumber(teamid) - 1)
+#define ColorByTeam(number) Team_NumberToTeam(number + 1)
+
+// useful aliases
+#define Team_ColorName_Lower(teamid) strtolower(Team_ColorName(teamid))
+#define Team_ColorName_Upper(teamid) strtoupper(Team_ColorName(teamid))
+
+#define Team_FullName(teamid) strcat(Team_ColorName(teamid), " ", STR_TEAM, "^7")
+#define Team_ColoredFullName(teamid) strcat(Team_ColorCode(teamid), Team_ColorName(teamid), " ", STR_TEAM, "^7")
+
+#define Team_NumberToFullName(number) Team_FullName(Team_NumberToTeam(number))
+#define Team_NumberToColoredFullName(number) Team_ColoredFullName(Team_NumberToTeam(number))
for(queue_start = e; queue_start; queue_start = queue_start.fld)
queue_start.FindConnectedComponent_processing = 0;
}
+
+float Count_Proper_Strings(string improper, string...count)
+{
+ float i, total = 0;
+ string tmp;
+
+ for(i = 0; i < count; ++i)
+ {
+ tmp = ...(i, string);
+ if((tmp) && (tmp != improper)) { ++total; }
+ }
+
+ return total;
+}
+
+float Count_Proper_Floats(float improper, float...count)
+{
+ float i, total = 0;
+
+ for(i = 0; i < count; ++i)
+ {
+ if(...(i, float) != improper) { ++total; }
+ }
+
+ return total;
+}
// a dummy macro that prevents the "hanging ;" warning
#define ENDS_WITH_CURLY_BRACE
+// return the actual code name of a var as a string
+#define VAR_TO_TEXT(var) #var
+
#ifdef HAVE_YO_DAWG_CPP
// TODO make ascii art pic of xzibit
// YO DAWG!
ACCUMULATE_call(#func)
#endif
+// used for simplifying ACCUMULATE_FUNCTIONs
+#define SET_FIRST_OR_LAST(input,first,count) if(!input) { input = (first + count); }
+#define SET_FIELD_COUNT(field,first,count) if(!field) { field = (first + count); ++count; }
+#define CHECK_MAX_COUNT(name,max,count,type) if(count == max) { error(strcat("Maximum ", type, " hit: ", VAR_TO_TEXT(name), ": ", ftos(count), ".\n")); }
+
// this returns a tempstring containing a copy of s with additional \n newlines added, it also replaces \n in the text with a real newline
// NOTE: s IS allowed to be a tempstring
string wordwrap(string s, float l);
typedef entity(entity cur, entity near, entity pass) findNextEntityNearFunction_t;
typedef float(entity a, entity b, entity pass) isConnectedFunction_t;
void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t nxt, isConnectedFunction_t iscon, entity pass);
+
+// expand multiple arguments into one argument by stripping parenthesis
+#define XPD(...) __VA_ARGS__
+
+float Count_Proper_Strings(string improper, string...count);
+float Count_Proper_Floats(float improper, float...count);
oo/base.h
+../common/teams.qh
+../common/notifications.qh
../common/constants.qh
../common/mapinfo.qh
../common/campaign_common.qh
classes.c
../common/util.qc
+../common/notifications.qc
../common/command/markup.qc
../common/command/rpn.qc
../common/command/generic.qc
// 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();
}
float autocvar_g_chat_flood_spl_tell;
float autocvar_g_chat_nospectators;
float autocvar_g_chat_teamcolors;
+float autocvar_g_chat_tellprivacy;
float autocvar_g_ctf_allow_vehicle_carry;
float autocvar_g_ctf_allow_vehicle_touch;
float autocvar_g_ctf_throw;
float autocvar_g_ctf_pass_turnrate;
float autocvar_g_ctf_pass_timelimit;
float autocvar_g_ctf_pass_velocity;
-float autocvar_g_ctf_captimerecord_always;
float autocvar_g_ctf_dynamiclights;
string autocvar_g_ctf_flag_blue_model;
float autocvar_g_ctf_flag_blue_skin;
float autocvar_g_ctf_flag_dropped_floatinwater;
float autocvar_g_ctf_flag_glowtrails;
float autocvar_g_ctf_flag_health;
-float autocvar_g_ctf_flag_pickup_verbosename;
string autocvar_g_ctf_flag_red_model;
float autocvar_g_ctf_flag_red_skin;
float autocvar_g_ctf_flag_return_time;
string autocvar_sv_eventlog_files_nameprefix;
string autocvar_sv_eventlog_files_namesuffix;
float autocvar_sv_eventlog_files_timestamps;
-float autocvar_sv_fraginfo;
-float autocvar_sv_fraginfo_handicap;
-float autocvar_sv_fraginfo_ping;
-float autocvar_sv_fraginfo_stats;
float autocvar_sv_friction;
float autocvar_sv_friction_on_land;
float autocvar_sv_gameplayfix_q2airaccelerate;
+float autocvar_sv_gentle;
#define autocvar_sv_gravity cvar("sv_gravity")
string autocvar_sv_intermission_cdtrack;
string autocvar_sv_jumpspeedcap_max;
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));
}
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);
}
}
stuffcmd(e, "cl_cmd settemp cl_movecliptokeyboard 2\n");
if(autocvar_g_antilag == 3) // client side hitscan
stuffcmd(e, "cl_cmd settemp cl_prydoncursor_notrace 0\n");
- if(sv_gentle)
+ if(autocvar_sv_gentle)
stuffcmd(e, "cl_cmd settemp cl_gentle 1\n");
/*
* we no longer need to stuff this. Remove this comment block if you feel
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);
self.flags = FL_CLIENT;
self.version_nagtime = time + 10 + random() * 10;
+ if(self.netaddress == "local")
+ {
+ print("^3server is local!\n");
+
+ if(server_is_local)
+ print("Multiple local clients???");
+ else
+ server_is_local = TRUE;
+ }
+
if(player_count<0)
{
dprint("BUG player count is lower than zero, this cannot happen!\n");
{
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")
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");
{
self.pain_finished = time + 0.5; //Supajoe
- if(sv_gentle < 1) {
+ if(autocvar_sv_gentle < 1) {
if(self.classname != "body") // pain anim is BORKED on our ZYMs, FIXME remove this once we have good models
{
if (!self.animstate_override)
if(valid_damage_for_weaponstats)
WeaponStats_LogKill(awep, abot, self.weapon, vbot);
- if(sv_gentle < 1) // TODO make a "gentle" version?
+ if(autocvar_sv_gentle < 1) // TODO make a "gentle" version?
if(sound_allowed(MSG_BROADCAST, attacker))
{
if(deathtype == DEATH_DROWN)
// set up to fade out later
SUB_SetFade (self, time + 6 + random (), 1);
- if(sv_gentle > 0 || autocvar_ekg) {
+ if(autocvar_sv_gentle > 0 || autocvar_ekg) {
// remove corpse
PlayerCorpseDamage (inflictor, attacker, autocvar_sv_gibhealth+1.0, deathtype, hitloc, force);
}
if(sourcecmsgstr != "" && !privatesay)
centerprint(source, sourcecmsgstr);
}
- else if(privatesay) // private message, between 2 people only, not sent to server console
+ else if(privatesay) // private message, between 2 people only
{
sprint(source, sourcemsgstr);
sprint(privatesay, msgstr);
+ if not(autocvar_g_chat_tellprivacy) { dedicated_print(msgstr); } // send to server console too if "tellprivacy" is disabled
if(cmsgstr != "")
centerprint(privatesay, cmsgstr);
}
else if(teamsay > 0) // team message, only sent to team mates
{
sprint(source, sourcemsgstr);
- //print(msgstr); // send to server console too
+ dedicated_print(msgstr); // send to server console too
if(sourcecmsgstr != "")
centerprint(source, sourcecmsgstr);
FOR_EACH_REALPLAYER(head) if(head.team == source.team)
else if(teamsay < 0) // spectator message, only sent to spectators
{
sprint(source, sourcemsgstr);
- //print(msgstr); // send to server console too
+ dedicated_print(msgstr); // send to server console too
FOR_EACH_REALCLIENT(head) if(head.classname != "player")
if(head != source)
sprint(head, msgstr);
else if(sourcemsgstr != msgstr) // trimmed/server fixed message, sent to all players
{
sprint(source, sourcemsgstr);
- //print(msgstr); // send to server console too
+ dedicated_print(msgstr); // send to server console too
FOR_EACH_REALCLIENT(head)
if(head != source)
sprint(head, msgstr);
break;
if(!sv_taunt)
break;
- if(sv_gentle)
+ if(autocvar_sv_gentle)
break;
tauntrand = random();
msg_entity = self;
setanim(self, self.anim_taunt, FALSE, TRUE, TRUE);
if(!sv_taunt)
break;
- if(sv_gentle)
+ if(autocvar_sv_gentle)
break;
msg_entity = self;
if (msg_entity.cvar_cl_voice_directional >= 1)
break;
if(!sv_taunt)
break;
- if(sv_gentle)
+ if(autocvar_sv_gentle)
break;
tauntrand = random();
FOR_EACH_REALCLIENT(msg_entity)
setanim(self, self.anim_taunt, FALSE, TRUE, TRUE);
if(!sv_taunt)
break;
- if(sv_gentle)
+ if(autocvar_sv_gentle)
break;
FOR_EACH_REALCLIENT(msg_entity)
{
FakeGlobalSound(self.sample, CH_VOICE, voicetype);
}
-void MoveToTeam(entity client, float team_colour, float type, float show_message)
+void MoveToTeam(entity client, float team_colour, float type)
{
-// show_message
-// 0 (00) automove centerprint, admin message
-// 1 (01) automove centerprint, no admin message
-// 2 (10) no centerprint, admin message
-// 3 (11) no centerprint, no admin message
-
float lockteams_backup;
lockteams_backup = lockteams; // backup any team lock
TeamchangeFrags(client); // move the players frags
SetPlayerColors(client, team_colour - 1); // set the players colour
- Damage(client, client, client, 100000, ((show_message & 2) ? DEATH_QUIET : DEATH_AUTOTEAMCHANGE), client.origin, '0 0 0'); // kill the player
+ Damage(client, client, client, 100000, DEATH_AUTOTEAMCHANGE, client.origin, '0 0 0'); // kill the player
lockteams = lockteams_backup; // restore the team lock
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
-
- 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;
string targets = strreplace(",", " ", argv(1));
string original_targets = strreplace(" ", ", ", targets);
string destination = argv(2);
- string notify = argv(3);
string successful, t;
successful = string_null;
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 = ColourToNumber(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 = NumberToTeamNumber(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 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;
}
// 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);
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
print("Incorrect parameters for ^2moveplayer^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd moveplayer clients destination [notify]\n");
+ print("\nUsage:^3 sv_cmd moveplayer clients destination\n");
print(" 'clients' is a list (separated by commas) of player entity ID's or nicknames\n");
print(" 'destination' is what to send the player to, be it team or spectating\n");
print(" Full list of destinations here: \"spec, spectator, red, blue, yellow, pink, auto.\"\n");
- print(" 'notify' is whether or not to send messages notifying of the move. Detail below.\n");
- print(" 0 (00) automove centerprint, admin message; 1 (01) automove centerprint, no admin message\n");
- print(" 2 (10) no centerprint, admin message; 3 (11) no centerprint, no admin message\n");
print("Examples: sv_cmd moveplayer 1,3,5 red 3\n");
print(" sv_cmd moveplayer 2 spec \n");
print("See also: ^2allspec, shuffleteams^7\n");
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)
self = edict_num(shuffleteams_players[z]);
if(self.team != team_color)
- MoveToTeam(self, team_color, 6, 0);
+ MoveToTeam(self, team_color, 6);
shuffleteams_players[z] = 0;
shuffleteams_teams[i] = shuffleteams_teams[i] + 1;
// This... is a fairly dangerous and powerful command... - It allows any arguments to be sent to a client via rcon.
// Because of this, it is disabled by default and must be enabled by the server owner when doing compilation. That way,
// we can be certain they understand the risks of it... So to enable, compile server with -DSTUFFTO_ENABLED argument.
-
+
#ifdef STUFFTO_ENABLED
+ //#message stuffto command enabled
switch(request)
{
case CMD_REQUEST_COMMAND:
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;
float g_jetpack;
float sv_clones;
-float sv_gentle;
float sv_foginterval;
entity activator;
float maxclients;
+float server_is_local; // innocent until proven guilty by ClientConnect() in cl_client.qc
+
// Fields
.void(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) event_damage;
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, "", "", "");
}
UpdateFrags(attacker, f);
}
-string Obituary_ExtraFragInfo(entity player) // Extra fragmessage information
+/*string Obituary_ExtraFragInfo(entity player) // Extra fragmessage information
{
string health_output = string_null;
string ping_output = string_null;
}
return output;
-}
+}*/
string AppendItemcodes(string s, entity player)
{
s = strcat(":kill:", mode);
s = strcat(s, ":", ftos(killer.playerid));
s = strcat(s, ":", ftos(killed.playerid));
- s = strcat(s, ":type=", ftos(deathtype));
+ s = strcat(s, ":type=", Deathtype_Name(deathtype));
s = strcat(s, ":items=");
s = AppendItemcodes(s, killer);
if(killed != killer)
GameLogEcho(s);
}
-void Send_KillNotification (string s1, string s2, string s3, float msg, float type)
-{
- WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte(MSG_BROADCAST, TE_CSQC_KILLNOTIFY);
- WriteString(MSG_BROADCAST, s1);
- WriteString(MSG_BROADCAST, s2);
- WriteString(MSG_BROADCAST, s3);
- WriteShort(MSG_BROADCAST, msg);
- WriteByte(MSG_BROADCAST, type);
-}
+#define INFO_NO_MSG 0
-// Function is used to send a generic centerprint whose content CSQC gets to decide (gentle version or not in the below cases)
-void Send_CSQC_KillCenterprint(entity e, string s1, string s2, float msg, float type)
+void Obituary_SpecialDeath(entity notif_target, float murder, float deathtype, string s1, string s2, float f1, float f2, float f3)
{
- if (clienttype(e) == CLIENTTYPE_REAL)
+ float handled = 0, hits = 0;
+ if(DEATH_ISSPECIAL(deathtype))
{
- msg_entity = e;
- WRITESPECTATABLE_MSG_ONE({
- WriteByte(MSG_ONE, SVC_TEMPENTITY);
- WriteByte(MSG_ONE, TE_CSQC_KILLCENTERPRINT);
- WriteString(MSG_ONE, s1);
- WriteString(MSG_ONE, s2);
- WriteShort(MSG_ONE, msg);
- WriteByte(MSG_ONE, type);
- });
+ #define DEATHTYPE(name,msg_death,msg_death_by,position) \
+ { if(deathtype == max(0, name)) \
+ { \
+ #if msg_death != NO_MSG \
+ if not(murder) \
+ { \
+ Send_Notification_Legacy_Wrapper(notif_target, MSG_ONE, MSG_DEATH, msg_death, s1, s2, f1, f2, f3); \
+ Send_Notification_ToAll(notif_target, TRUE, MSG_INFO, INFO_##msg_death, s1, s2, f1, f2, f3); \
+ ++handled; \
+ } \
+ #endif \
+ #if msg_death_by != NO_MSG \
+ if(murder) \
+ { \
+ Send_Notification_Legacy_Wrapper(notif_target, MSG_ONE, MSG_DEATH, msg_death_by, s1, s2, f1, f2, f3); \
+ Send_Notification_ToAll(notif_target, TRUE, MSG_INFO, INFO_##msg_death_by, s1, s2, f1, f2, f3); \
+ ++handled; \
+ } \
+ #endif \
+ ++hits; \
+ } }
+
+ DEATHTYPES
+ #undef DEATHTYPE
+
+ if not(hits)
+ {
+ backtrace("Obituary_SpecialDeath(): Unhandled deathtype- Please notify Samual!\n");
+ }
+ if not(handled)
+ {
+ dprint(sprintf("Obituary_SpecialDeath(): ^1Deathtype ^7(%s-%d)^1 has no notification!\n", Deathtype_Name(deathtype), deathtype));
+ return;
+ }
}
}
-void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
+float w_deathtype;
+float Obituary_WeaponDeath(float murder, float deathtype, string s1, string s2)
{
- string s, a, msg;
- float type;
+ float death_weapon = DEATH_WEAPONOF(deathtype);
- if (targ.classname == "player")
+ if(death_weapon)
{
- s = targ.netname;
- a = attacker.netname;
-
- if (targ == attacker) // suicides
- {
- if (deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
- msg = ColoredTeamName(targ.team); // TODO: check if needed?
- else
- msg = "";
- if(!g_cts) // no "killed your own dumb self" message in CTS
- Send_CSQC_KillCenterprint(targ, msg, "", deathtype, MSG_SUICIDE);
+ w_deathtype = deathtype;
+ float death_message = weapon_action(death_weapon, ((murder) ? WR_KILLMESSAGE : WR_SUICIDEMESSAGE));
+ w_deathtype = FALSE;
- if(deathtype != DEATH_TEAMCHANGE && deathtype != DEATH_QUIET)
- {
- LogDeath("suicide", deathtype, targ, targ);
- GiveFrags(attacker, targ, -1, deathtype);
- }
-
- if (targ.killcount > 2)
- msg = ftos(targ.killcount);
- else
- msg = "";
- if(teamplay && deathtype == DEATH_MIRRORDAMAGE)
- {
- if(attacker.team == COLOR_TEAM1)
- deathtype = KILL_TEAM_RED;
- else
- deathtype = KILL_TEAM_BLUE;
- }
+ if(death_message) { Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_WEAPON, death_message, s1, s2, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); }
+ else { dprint(sprintf("Obituary_WeaponDeath(): ^1Deathtype ^7(%s-%d)^1 has no notification for weapon %d!\n", Deathtype_Name(deathtype), deathtype, death_weapon)); }
- Send_KillNotification(s, msg, "", deathtype, MSG_SUICIDE);
- }
- else if (attacker.classname == "player")
- {
- if(!IsDifferentTeam(attacker, targ))
- {
- if(attacker.team == COLOR_TEAM1)
- type = KILL_TEAM_RED;
- else
- type = KILL_TEAM_BLUE;
-
- GiveFrags(attacker, targ, -1, deathtype);
-
- Send_CSQC_KillCenterprint(attacker, s, "", type, MSG_KILL);
+ return TRUE;
+ }
+ return FALSE;
+}
- if (targ.killcount > 2)
- msg = ftos(targ.killcount);
- else
- msg = "";
+.float FRAG_VERBOSE;
+void Obituary(entity attacker, entity inflictor, entity targ, float deathtype)
+{
+ // Sanity check
+ if not(targ.classname == STR_PLAYER) { backtrace("Obituary called on non-player?!\n"); return; }
- if (attacker.killcount > 2) {
- msg = ftos(attacker.killcount);
- type = KILL_TEAM_SPREE;
- }
- Send_KillNotification(a, s, msg, type, MSG_KILL);
+ // Declarations
+ string s1 = NO_STR_ARG, s2 = NO_STR_ARG;
+ float f1 = NO_FL_ARG, f2 = NO_FL_ARG, f3 = NO_FL_ARG;
+ float notif_firstblood = FALSE;
- attacker.killcount = 0;
+ //dprint(sprintf("Obituary(): Deathtype = %s (%d), Attacker = %s, Inflictor = %s, Target = %s...\n", Deathtype_Name(deathtype), deathtype, attacker.netname, inflictor.netname, targ.netname));
- LogDeath("tk", deathtype, attacker, targ);
+ // =======
+ // SUICIDE
+ // =======
+ if(targ == attacker)
+ {
+ if(DEATH_ISSPECIAL(deathtype))
+ {
+ if(deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
+ {
+ s1 = targ.netname;
+ f1 = targ.team;
}
else
{
- if (!checkrules_firstblood)
+ switch(deathtype)
{
- checkrules_firstblood = TRUE;
- Send_KillNotification(a, "", "", KILL_FIRST_BLOOD, MSG_KILL);
- // TODO: make these print a newline if they dont
- Send_CSQC_KillCenterprint(attacker, "", "", KILL_FIRST_BLOOD, MSG_KILL);
- Send_CSQC_KillCenterprint(targ, "", "", KILL_FIRST_VICTIM, MSG_KILL);
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD, 1);
- PlayerStats_Event(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
- }
-
- if(targ.istypefrag) {
- Send_CSQC_KillCenterprint(attacker, s, Obituary_ExtraFragInfo(targ), KILL_TYPEFRAG, MSG_KILL);
- Send_CSQC_KillCenterprint(targ, a, Obituary_ExtraFragInfo(attacker), KILL_TYPEFRAGGED, MSG_KILL);
- } else {
- Send_CSQC_KillCenterprint(attacker, s, Obituary_ExtraFragInfo(targ), KILL_FRAG, MSG_KILL);
- Send_CSQC_KillCenterprint(targ, a, Obituary_ExtraFragInfo(attacker), KILL_FRAGGED, MSG_KILL);
+ case DEATH_MIRRORDAMAGE:
+ {
+ s1 = targ.netname;
+ f1 = targ.killcount;
+ break;
+ }
+
+ default:
+ {
+ s1 = targ.netname;
+ f1 = targ.killcount;
+ s2 = NO_STR_ARG;
+ f2 = f3 = NO_FL_ARG;
+ break;
+ }
}
+ LogDeath("suicide", deathtype, targ, targ);
+ GiveFrags(attacker, targ, -1, deathtype);
+ }
+
+ Obituary_SpecialDeath(targ, FALSE, deathtype, s1, s2, f1, f2, NO_FL_ARG);
+ }
+ else if not(Obituary_WeaponDeath(FALSE, deathtype, targ.netname, NO_STR_ARG))
+ {
+ backtrace("SUICIDE: what the hell happened here?\n");
+ }
+ }
- attacker.taunt_soundtime = time + 1;
-
- if (deathtype == DEATH_HURTTRIGGER && inflictor.message2 != "")
- msg = inflictor.message2;
- else if (deathtype == DEATH_CUSTOM)
- msg = deathmessage;
- else
- msg = "";
+ // ======
+ // MURDER
+ // ======
+ else if(attacker.classname == "player")
+ {
+ s1 = attacker.netname;
+ s2 = targ.netname;
- if(strstrofs(msg, "%", 0) < 0)
- msg = strcat("%s ", msg, " by %s");
+ // TODO: ADD REAL CHECK HERE!
+ attacker.FRAG_VERBOSE = TRUE;
+ targ.FRAG_VERBOSE = TRUE;
+
+ if(!IsDifferentTeam(attacker, targ))
+ {
+ LogDeath("tk", deathtype, attacker, targ);
+ GiveFrags(attacker, targ, -1, deathtype);
- Send_KillNotification(a, s, msg, deathtype, MSG_KILL);
+ attacker.killcount = 0;
+
+ Send_Notification_Legacy_Wrapper(attacker, MSG_ONE, MSG_DEATH, DEATH_TEAMKILL_FRAG, s2, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ Send_Notification_Legacy_Wrapper(targ, MSG_ONE, MSG_DEATH, DEATH_TEAMKILL_FRAGGED, s1, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, APP_TEAM_NUM_4(targ.team, INFO_DEATH_TEAMKILL_), s2, s1, targ.killcount, NO_FL_ARG, NO_FL_ARG);
- GiveFrags(attacker, targ, 1, deathtype);
+ // In this case, the death message will ALWAYS be "foo was betrayed by bar"
+ // No need for specific death/weapon messages...
+ }
+ else
+ {
+ LogDeath("frag", deathtype, attacker, targ);
+ GiveFrags(attacker, targ, 1, deathtype);
- if (targ.killcount > 2) {
- Send_KillNotification(s, ftos(targ.killcount), a, KILL_END_SPREE, MSG_SPREE);
+ attacker.taunt_soundtime = time + 1;
+ attacker.killcount = attacker.killcount + 1;
+
+ #define ADD_ACHIEVEMENT_CASE(numa,numb) \
+ case numa: \
+ { \
+ AnnounceTo(attacker, strcat(#numb, "kills")); \
+ PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_##numa, 1); \
+ break; \
}
+ switch(attacker.killcount)
+ {
+ ADD_ACHIEVEMENT_CASE(3, 03)
+ ADD_ACHIEVEMENT_CASE(5, 05)
+ ADD_ACHIEVEMENT_CASE(10, 10)
+ ADD_ACHIEVEMENT_CASE(15, 15)
+ ADD_ACHIEVEMENT_CASE(20, 20)
+ ADD_ACHIEVEMENT_CASE(25, 25)
+ ADD_ACHIEVEMENT_CASE(30, 30)
+ default: break;
+ }
+ #undef ADD_ACHIEVEMENT_CASE
- attacker.killcount = attacker.killcount + 1;
+ if(!checkrules_firstblood)
+ {
+ checkrules_firstblood = TRUE;
+ notif_firstblood = TRUE; // modify the current messages so that they too show firstblood information
+ PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD, 1);
+ PlayerStats_Event(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
+ }
- if (attacker.killcount == 3)
- {
- Send_KillNotification(a, "", "", KILL_SPREE_3, MSG_SPREE);
- AnnounceTo(attacker, "03kills");
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3, 1);
- }
- else if (attacker.killcount == 5)
- {
- Send_KillNotification(a, "", "", KILL_SPREE_5, MSG_SPREE);
- AnnounceTo(attacker, "05kills");
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5, 1);
- }
- else if (attacker.killcount == 10)
- {
- Send_KillNotification(a, "", "", KILL_SPREE_10, MSG_SPREE);
- AnnounceTo(attacker, "10kills");
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10, 1);
- }
- else if (attacker.killcount == 15)
+ if(notif_firstblood) // first blood, no kill sprees yet
+ {
+ if(targ.istypefrag)
{
- Send_KillNotification(a, "", "", KILL_SPREE_15, MSG_SPREE);
- AnnounceTo(attacker, "15kills");
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15, 1);
+ Send_Notification_Legacy_Wrapper(attacker, MSG_ONE, MSG_DEATH, (attacker.FRAG_VERBOSE ? DEATH_MURDER_TYPEFRAG_FIRST_VERBOSE : DEATH_MURDER_TYPEFRAG_FIRST),
+ s2, s1, (attacker.FRAG_VERBOSE ? ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping) : NO_FL_ARG), NO_FL_ARG, NO_FL_ARG);
+
+ Send_Notification_Legacy_Wrapper(targ, MSG_ONE, MSG_DEATH, (targ.FRAG_VERBOSE ? DEATH_MURDER_TYPEFRAGGED_FIRST_VERBOSE : DEATH_MURDER_TYPEFRAGGED_FIRST),
+ s1, NO_STR_ARG, (targ.FRAG_VERBOSE ? attacker.health : NO_FL_ARG), (targ.FRAG_VERBOSE ? attacker.armorvalue : NO_FL_ARG), (targ.FRAG_VERBOSE ? ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping) : NO_FL_ARG));
}
- else if (attacker.killcount == 20)
+ else
{
- Send_KillNotification(a, "", "", KILL_SPREE_20, MSG_SPREE);
- AnnounceTo(attacker, "20kills");
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20, 1);
+ Send_Notification_Legacy_Wrapper(attacker, MSG_ONE, MSG_DEATH, (attacker.FRAG_VERBOSE ? DEATH_MURDER_FRAG_FIRST_VERBOSE : DEATH_MURDER_FRAG_FIRST),
+ s2, s1, (attacker.FRAG_VERBOSE ? ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping) : NO_FL_ARG), NO_FL_ARG, NO_FL_ARG);
+
+ Send_Notification_Legacy_Wrapper(targ, MSG_ONE, MSG_DEATH, (targ.FRAG_VERBOSE ? DEATH_MURDER_FRAGGED_FIRST_VERBOSE : DEATH_MURDER_FRAGGED_FIRST),
+ s1, NO_STR_ARG, (targ.FRAG_VERBOSE ? attacker.health : NO_FL_ARG), (targ.FRAG_VERBOSE ? attacker.armorvalue : NO_FL_ARG), (targ.FRAG_VERBOSE ? ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping) : NO_FL_ARG));
}
- else if (attacker.killcount == 25)
+ }
+ else // normal frags, kill sprees listed
+ {
+ if(targ.istypefrag)
{
- Send_KillNotification(a, "", "", KILL_SPREE_25, MSG_SPREE);
- AnnounceTo(attacker, "25kills");
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25, 1);
+ Send_Notification_Legacy_Wrapper(attacker, MSG_ONE, MSG_DEATH, (attacker.FRAG_VERBOSE ? DEATH_MURDER_TYPEFRAG_VERBOSE : DEATH_MURDER_TYPEFRAG),
+ s2, NO_STR_ARG, attacker.killcount, (attacker.FRAG_VERBOSE ? ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping) : NO_FL_ARG), NO_FL_ARG);
+
+ Send_Notification_Legacy_Wrapper(targ, MSG_ONE, MSG_DEATH, (targ.FRAG_VERBOSE ? DEATH_MURDER_TYPEFRAGGED_VERBOSE : DEATH_MURDER_TYPEFRAGGED),
+ s1, NO_STR_ARG, (targ.FRAG_VERBOSE ? attacker.health : NO_FL_ARG), (targ.FRAG_VERBOSE ? attacker.armorvalue : NO_FL_ARG), (targ.FRAG_VERBOSE ? ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping) : NO_FL_ARG));
}
- else if (attacker.killcount == 30)
+ else
{
- Send_KillNotification(a, "", "", KILL_SPREE_30, MSG_SPREE);
- AnnounceTo(attacker, "30kills");
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30, 1);
- }
- else if (attacker.killcount > 2) {
- Send_KillNotification(a, ftos(attacker.killcount), "", KILL_SPREE, MSG_SPREE);
+ Send_Notification_Legacy_Wrapper(attacker, MSG_ONE, MSG_DEATH, (attacker.FRAG_VERBOSE ? DEATH_MURDER_FRAG_VERBOSE : DEATH_MURDER_FRAG),
+ s2, NO_STR_ARG, attacker.killcount, (attacker.FRAG_VERBOSE ? ((clienttype(targ) == CLIENTTYPE_BOT) ? BOT_PING : targ.ping) : NO_FL_ARG), NO_FL_ARG);
+
+ Send_Notification_Legacy_Wrapper(targ, MSG_ONE, MSG_DEATH, (targ.FRAG_VERBOSE ? DEATH_MURDER_FRAGGED_VERBOSE : DEATH_MURDER_FRAGGED),
+ s1, NO_STR_ARG, (targ.FRAG_VERBOSE ? attacker.health : NO_FL_ARG), (targ.FRAG_VERBOSE ? attacker.armorvalue : NO_FL_ARG), (targ.FRAG_VERBOSE ? ((clienttype(attacker) == CLIENTTYPE_BOT) ? BOT_PING : attacker.ping) : NO_FL_ARG));
}
- LogDeath("frag", deathtype, attacker, targ);
}
+
+ if not(Obituary_WeaponDeath(TRUE, deathtype, targ.netname, attacker.netname))
+ Obituary_SpecialDeath(targ, TRUE, deathtype, s2, s1, targ.killcount, NO_FL_ARG, NO_FL_ARG);
}
- else
+ }
+
+ // =============
+ // ACCIDENT/TRAP
+ // =============
+ else
+ {
+ switch(deathtype)
{
- Send_CSQC_KillCenterprint(targ, "", "", deathtype, MSG_KILL_ACTION);
- if (deathtype == DEATH_HURTTRIGGER && inflictor.message != "")
- msg = inflictor.message;
- else if (deathtype == DEATH_CUSTOM)
- msg = deathmessage;
- else
- msg = "";
- if(strstrofs(msg, "%", 0) < 0)
- msg = strcat("%s ", msg);
-
- GiveFrags(targ, targ, -1, deathtype);
- if(PlayerScore_Add(targ, SP_SCORE, 0) == -5) {
- AnnounceTo(targ, "botlike");
- PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_BOTLIKE, 1);
+ // For now, we're just forcing HURTTRIGGER to behave as "DEATH_VOID" and giving it no special options...
+ // Later on you will only be able to make custom messages using DEATH_CUSTOM,
+ // and there will be a REAL DEATH_VOID implementation which mappers will use.
+ /*case DEATH_HURTTRIGGER:
+ {
+ s1 = targ.netname;
+ s2 = inflictor.message;
+ if(strstrofs(s2, "%", 0) < 0) { s2 = strcat("%s ", s2); }
+ break;
+ }*/
+
+ case DEATH_CUSTOM:
+ {
+ s1 = targ.netname;
+ s2 = deathmessage;
+ f1 = targ.killcount;
+ if(strstrofs(s2, "%", 0) < 0) { s2 = strcat("%s ", s2); }
+ f2 = f3 = NO_FL_ARG;
+ break;
+ }
+
+ default:
+ {
+ s1 = targ.netname;
+ f1 = targ.killcount;
+ s2 = NO_STR_ARG;
+ f2 = f3 = NO_FL_ARG;
+ break;
}
- Send_KillNotification(s, msg, "", deathtype, MSG_KILL_ACTION);
+ }
- if (targ.killcount > 2)
- Send_KillNotification(s, ftos(targ.killcount), "", 0, MSG_KILL_ACTION_SPREE);
+ LogDeath("accident", deathtype, targ, targ);
+ GiveFrags(targ, targ, -1, deathtype);
- LogDeath("accident", deathtype, targ, targ);
+ if(PlayerScore_Add(targ, SP_SCORE, 0) == -5)
+ {
+ AnnounceTo(targ, "botlike");
+ PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_BOTLIKE, 1);
}
- targ.death_origin = targ.origin;
- if(targ != attacker)
- targ.killer_origin = attacker.origin;
-
- // FIXME: this should go in PutClientInServer
- if (targ.killcount)
- targ.killcount = 0;
+ Obituary_SpecialDeath(targ, FALSE, deathtype, s1, s2, f1, f2, f3);
}
+
+ // Set final information for the death
+ targ.death_origin = targ.origin;
+ if(targ != attacker) { targ.killer_origin = attacker.origin; }
+ if(targ.killcount) { targ.killcount = 0; }
}
// these are updated by each Damage call for use in button triggering and such
}
}
- if(deathtype == DEATH_KILL || deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE || deathtype == DEATH_QUIET)
+ if(deathtype == DEATH_KILL || deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
{
// These are ALWAYS lethal
// No damage modification here
// needs to be done so early because of the constants they create
CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
+ CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
+ CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
MapInfo_Enumerate();
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
// needs to be done so early because of the constants they create
CALL_ACCUMULATED_FUNCTION(RegisterWeapons);
CALL_ACCUMULATED_FUNCTION(RegisterGametypes);
+ CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
+ CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
ServerProgsDB = db_load(strcat("server.db", autocvar_sessionid));
{
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);
void() spawnfunc_info_player_deathmatch; // needed for the other spawnpoints
void() spawnpoint_use;
string GetMapname();
-string ColoredTeamName(float t);
string admin_name(void)
{
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)
{
#endif
sv_clones = cvar("sv_clones");
- sv_gentle = cvar("sv_gentle");
sv_foginterval = cvar("sv_foginterval");
g_cloaked = cvar("g_cloaked");
if(g_cts)
#endif
}
-// sorry, but using \ in macros breaks line numbers
-#define WRITESPECTATABLE_MSG_ONE_VARNAME(varname,statement) entity varname; varname = msg_entity; FOR_EACH_REALCLIENT(msg_entity) if(msg_entity == varname || (msg_entity.classname == STR_SPECTATOR && msg_entity.enemy == varname)) statement msg_entity = varname
-#define WRITESPECTATABLE_MSG_ONE(statement) WRITESPECTATABLE_MSG_ONE_VARNAME(oldmsg_entity, statement)
-#define WRITESPECTATABLE(msg,statement) if(msg == MSG_ONE) { WRITESPECTATABLE_MSG_ONE(statement); } else statement float WRITESPECTATABLE_workaround = 0
-
-
-void Send_CSQC_Centerprint_Generic(entity e, float id, string s, float duration, float countdown_num)
-{
- if ((clienttype(e) == CLIENTTYPE_REAL) && (e.flags & FL_CLIENT))
- {
- msg_entity = e;
- WRITESPECTATABLE_MSG_ONE({
- WriteByte(MSG_ONE, SVC_TEMPENTITY);
- WriteByte(MSG_ONE, TE_CSQC_CENTERPRINT_GENERIC);
- WriteByte(MSG_ONE, id);
- WriteString(MSG_ONE, s);
- if (id != 0 && s != "")
- {
- WriteByte(MSG_ONE, duration);
- WriteByte(MSG_ONE, countdown_num);
- }
- });
- }
-}
-void Send_CSQC_Centerprint_Generic_Expire(entity e, float id)
-{
- Send_CSQC_Centerprint_Generic(e, id, "", 1, 0);
-}
// WARNING: this kills the trace globals
#define EXACTTRIGGER_TOUCH if(WarpZoneLib_ExactTrigger_Touch()) return
#define EXACTTRIGGER_INIT WarpZoneLib_ExactTrigger_Init()
return TRUE;
return FALSE;
}
+
+void dedicated_print(string input) // print(), but only print if the server is not local
+{
+ if not(server_is_local) { print(input); }
+}
GameLogEcho(strcat(":ctf:", mode, ":", ftos(flagteam), ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
}
-string ctf_CaptureRecord(entity flag, entity player)
+void ctf_CaptureRecord(entity flag, entity player)
{
- float cap_time, cap_record, success;
- string cap_message = string_null, refername;
-
- if((autocvar_g_ctf_captimerecord_always) || (player_count - currentbots))
- {
- cap_record = ctf_captimerecord;
- cap_time = (time - flag.ctf_pickuptime);
-
- refername = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"));
- refername = ((refername == player.netname) ? "their" : strcat(refername, "^7's"));
-
- if(!ctf_captimerecord)
- { cap_message = strcat(" in ", ftos_decimals(cap_time, 2), " seconds"); success = TRUE; }
- else if(cap_time < cap_record)
- { cap_message = strcat(" in ", ftos_decimals(cap_time, 2), " seconds, breaking ", refername, " previous record of ", ftos_decimals(cap_record, 2), " seconds"); success = TRUE; }
- else
- { cap_message = strcat(" in ", ftos_decimals(cap_time, 2), " seconds, failing to break ", refername, " record of ", ftos_decimals(cap_record, 2), " seconds"); success = FALSE; }
+ entity tmp_entity;
+ float notification, success;
+ float cap_record = ctf_captimerecord;
+ float cap_time = (time - flag.ctf_pickuptime);
+ float f1, f2 = NO_FL_ARG;
+ string s1, s2 = NO_STR_ARG;
+ string refername = db_get(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"));
+
+ // figure shit out
+ if(!ctf_captimerecord)
+ { notification = APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_TIME_); s1 = player.netname; f1 = (cap_time * 100); success = TRUE; }
+ else if(cap_time < cap_record)
+ { notification = APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_BROKEN_); s1 = player.netname; s2 = refername; f1 = (cap_time * 100); f2 = (cap_record * 100); success = TRUE; }
+ else
+ { notification = APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_UNBROKEN_); s1 = player.netname; s2 = refername; f1 = (cap_time * 100); f2 = (cap_record * 100); success = FALSE; }
- if(success)
- {
- ctf_captimerecord = cap_time;
- db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"), ftos(cap_time));
- db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"), player.netname);
- write_recordmarker(player, (time - cap_time), cap_time);
- }
+ // notify about shit
+ FOR_EACH_REALCLIENT(tmp_entity)
+ {
+ if not(tmp_entity.CAPTURE_VERBOSE) { notification = APP_TEAM_ENT_2(flag, INFO_CTF_CAPTURE_); s2 = NO_STR_ARG; f1 = f2 = NO_FL_ARG; }
+ Send_Notification_Legacy_Wrapper(tmp_entity, MSG_ONE, MSG_INFO, notification, s1, s2, f1, f2, NO_FL_ARG);
}
-
- return cap_message;
+
+ // write that shit in the database
+ if(success)
+ {
+ ctf_captimerecord = cap_time;
+ db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/time"), ftos(cap_time));
+ db_put(ServerProgsDB, strcat(GetMapname(), "/captimerecord/netname"), player.netname);
+ write_recordmarker(player, (time - cap_time), cap_time);
+ }
}
void ctf_FlagcarrierWaypoints(entity player)
if((wanted_status == player.ctf_captureshielded) && (updated_status != wanted_status)) // 0: shield only, 1: unshield only
{
if(updated_status) // TODO csqc notifier for this // Samual: How?
- Send_CSQC_Centerprint_Generic(player, CPID_CTF_CAPTURESHIELD, "^3You are now ^4shielded^3 from the flag\n^3for ^1too many unsuccessful attempts^3 to capture.\n\n^3Make some defensive scores before trying again.", 5, 0);
+ Send_Notification_Legacy_Wrapper(player, MSG_ONE, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_SHIELDED, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
else
- Send_CSQC_Centerprint_Generic(player, CPID_CTF_CAPTURESHIELD, "^3You are now free.\n\n^3Feel free to ^1try to capture^3 the flag again\n^3if you think you will succeed.", 5, 0);
+ Send_Notification_Legacy_Wrapper(player, MSG_ONE, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_FREE, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
player.ctf_captureshielded = updated_status;
}
vector othermid = (other.absmin + other.absmax) * 0.5;
Damage(other, self, self, 0, DEATH_HURTTRIGGER, mymid, normalize(othermid - mymid) * ctf_captureshield_force);
- Send_CSQC_Centerprint_Generic(other, CPID_CTF_CAPTURESHIELD, "^3You are ^4shielded^3 from the flag\n^3for ^1too many unsuccessful attempts^3 to capture.\n\n^3Get some defensive scores before trying again.", 5, 0);
+ Send_Notification_Legacy_Wrapper(other, MSG_ONE, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_SHIELDED, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
}
void ctf_CaptureShield_Spawn(entity flag)
flag.ctf_status = FLAG_DROPPED;
// messages and sounds
- Send_KillNotification(player.netname, flag.netname, "", INFO_LOSTFLAG, MSG_INFO);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_LOST_), player.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
sound(flag, CH_TRIGGER, flag.snd_flag_dropped, VOL_BASE, ATTN_NONE);
ctf_EventLog("dropped", player.team, player);
FOR_EACH_REALPLAYER(tmp_player)
{
if(tmp_player == sender)
- centerprint(tmp_player, strcat("You passed the ", flag.netname, " to ", player.netname));
+ Send_Notification_Legacy_Wrapper(tmp_player, MSG_ONE, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PASS_SENT_), player.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
else if(tmp_player == player)
- centerprint(tmp_player, strcat("You received the ", flag.netname, " from ", sender.netname));
+ Send_Notification_Legacy_Wrapper(tmp_player, MSG_ONE, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PASS_RECEIVED_), sender.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
else if(!IsDifferentTeam(tmp_player, sender))
- centerprint(tmp_player, strcat(sender.netname, " passed the ", flag.netname, " to ", player.netname));
+ Send_Notification_Legacy_Wrapper(tmp_player, MSG_ONE, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PASS_OTHER_), sender.netname, player.netname, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
}
// create new waypoint
if not(player) { return; } // without someone to give the reward to, we can't possibly cap
// messages and sounds
- Send_KillNotification(player.netname, enemy_flag.netname, ctf_CaptureRecord(enemy_flag, player), INFO_CAPTUREFLAG, MSG_INFO);
+ ctf_CaptureRecord(enemy_flag, player);
sound(player, CH_TRIGGER, flag.snd_flag_capture, VOL_BASE, ATTN_NONE);
switch(capturetype)
void ctf_Handle_Return(entity flag, entity player)
{
// messages and sounds
- //centerprint(player, strcat("You returned the ", flag.netname));
- Send_KillNotification(player.netname, flag.netname, "", INFO_RETURNFLAG, MSG_INFO);
+ Send_Notification_Legacy_Wrapper(player, MSG_ONE, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_RETURN_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_RETURN_), player.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
sound(player, CH_TRIGGER, flag.snd_flag_returned, VOL_BASE, ATTN_NONE);
ctf_EventLog("return", flag.team, player);
{
// declarations
entity tmp_player; // temporary entity which the FOR_EACH_PLAYER loop uses to scan players
- string verbosename; // holds the name of the player OR no name at all for printing in the centerprints
float pickup_dropped_score; // used to calculate dropped pickup score
// attach the flag to the player
}
// messages and sounds
- Send_KillNotification (player.netname, flag.netname, "", INFO_GOTFLAG, MSG_INFO);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_PICKUP_), player.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
sound(player, CH_TRIGGER, flag.snd_flag_taken, VOL_BASE, ATTN_NONE);
- verbosename = ((autocvar_g_ctf_flag_pickup_verbosename) ? strcat(Team_ColorCode(player.team), "(^7", player.netname, Team_ColorCode(player.team), ") ") : "");
-
+
FOR_EACH_REALPLAYER(tmp_player)
{
if(tmp_player == player)
{
- centerprint(tmp_player, strcat("You got the ", flag.netname, "!"));
- //if(ctf_stalemate) { centerprint(tmp_player, "Stalemate! Enemies can see you on radar!"); }
+ Send_Notification_Legacy_Wrapper(tmp_player, MSG_ONE, MSG_CENTER, APP_TEAM_ENT_2(flag, CENTER_CTF_PICKUP_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ if(ctf_stalemate) { Send_Notification_Legacy_Wrapper(player, MSG_ONE, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); }
}
- //else if(!IsDifferentTeam(tmp_player, player))
- // centerprint(tmp_player, strcat("Your ", Team_ColorCode(player.team), "team mate ", verbosename, "^7got the flag! Protect them!"));
- else if(!IsDifferentTeam(tmp_player, flag))
- centerprint(tmp_player, strcat("The ", Team_ColorCode(player.team), "enemy ", verbosename, "^7got your flag! Retrieve it!"));
+ else if(!IsDifferentTeam(tmp_player, player) && tmp_player != player)
+ Send_Notification_Legacy_Wrapper(tmp_player, MSG_ONE, MSG_CENTER, (tmp_player.PICKUP_TEAM_VERBOSE ? CENTER_CTF_PICKUP_TEAM_VERBOSE : CENTER_CTF_PICKUP_TEAM), Team_ColorCode(player.team), (tmp_player.PICKUP_TEAM_VERBOSE ? player.netname : NO_STR_ARG), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ else if(IsDifferentTeam(tmp_player, player))
+ Send_Notification_Legacy_Wrapper(tmp_player, MSG_ONE, MSG_CENTER, (tmp_player.PICKUP_ENEMY_VERBOSE ? CENTER_CTF_PICKUP_ENEMY_VERBOSE : CENTER_CTF_PICKUP_ENEMY), Team_ColorCode(player.team), (tmp_player.PICKUP_ENEMY_VERBOSE ? player.netname : NO_STR_ARG), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
}
// scoring
{
switch(returntype)
{
- case RETURN_DROPPED: bprint("The ", flag.netname, " was dropped in the base and returned itself\n"); break;
- case RETURN_DAMAGE: bprint("The ", flag.netname, " was destroyed and returned to base\n"); break;
- case RETURN_SPEEDRUN: bprint("The ", flag.netname, " became impatient after ", ftos_decimals(ctf_captimerecord, 2), " seconds and returned itself\n"); break;
- case RETURN_NEEDKILL: bprint("The ", flag.netname, " fell somewhere it couldn't be reached and returned to base\n"); break;
+ case RETURN_DROPPED: Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_DROPPED_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); break;
+ case RETURN_DAMAGE: Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_DAMAGED_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); break;
+ case RETURN_SPEEDRUN: Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_SPEEDRUN_), NO_STR_ARG, NO_STR_ARG, ctf_captimerecord, NO_FL_ARG, NO_FL_ARG); break;
+ case RETURN_NEEDKILL: Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_NEEDKILL_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); break;
default:
case RETURN_TIMEOUT:
- { bprint("The ", flag.netname, " has returned to base\n"); break; }
+ { Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, APP_TEAM_ENT_2(flag, INFO_CTF_FLAGRETURN_TIMEOUT_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG); break; }
}
sound(flag, CH_TRIGGER, flag.snd_flag_respawn, VOL_BASE, ATTN_NONE);
ctf_EventLog("returned", flag.team, world);
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;
}
}
}
{
FOR_EACH_REALPLAYER(tmp_entity)
if(tmp_entity.flagcarried)
- centerprint(tmp_entity, "Stalemate! Enemies can now see you on radar!");
+ Send_Notification_Legacy_Wrapper(tmp_entity, MSG_ONE, MSG_CENTER, CENTER_CTF_STALEMATE_CARRIER, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
else
- centerprint(tmp_entity, "Stalemate! Flag carriers can now be seen by enemies on radar!");
+ Send_Notification_Legacy_Wrapper(tmp_entity, MSG_ONE, MSG_CENTER, CENTER_CTF_STALEMATE_OTHER, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
wpforenemy_announced = TRUE;
}
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
flag.ctf_worldflagnext = ctf_worldflaglist; // link flag into ctf_worldflaglist
ctf_worldflaglist = flag;
- setattachment(flag, world, "");
+ setattachment(flag, world, "");
- flag.netname = ((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.netname = ((teamnumber) ? "^1REPLACETHIS^7" : "^4REPLACETHIS^7"); // ((teamnumber) ? "^1RED^7 flag" : "^4BLUE^7 flag");
+ 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(clienttype(head) == CLIENTTYPE_BOT)
{
- centerprint(player, strcat("Requesting ", head.netname, " to pass you the ", head.flagcarried.netname));
+ Send_Notification_Legacy_Wrapper(player, MSG_ONE, MSG_CENTER, CENTER_CTF_PASS_REQUESTING, head.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
ctf_Handle_Throw(head, player, DROP_PASS);
}
else
{
- centerprint(head, strcat(player.netname, " requests you to pass the ", head.flagcarried.netname));
- centerprint(player, strcat("Requesting ", head.netname, " to pass you the ", head.flagcarried.netname));
+ Send_Notification_Legacy_Wrapper(head, MSG_ONE, MSG_CENTER, CENTER_CTF_PASS_REQUESTED, player.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ Send_Notification_Legacy_Wrapper(player, MSG_ONE, MSG_CENTER, CENTER_CTF_PASS_REQUESTING, head.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
}
player.throw_antispam = time + autocvar_g_ctf_pass_wait;
return TRUE;
}
else
{
- centerprint(player, strcat("Too many flag throws, throwing disabled for ", ftos(rint((player.throw_prevtime + autocvar_g_ctf_throw_punish_delay) - time)), " seconds."));
+ Send_Notification_Legacy_Wrapper(player, MSG_ONE, MSG_CENTER, CENTER_CTF_FLAG_THROW_PUNISH, NO_STR_ARG, NO_STR_ARG, rint((player.throw_prevtime + autocvar_g_ctf_throw_punish_delay) - time), NO_FL_ARG, NO_FL_ARG);
return FALSE;
}
}
{
if(self.flagcarried)
{
- bprint("The ", self.flagcarried.netname, " was returned to base by its carrier\n");
- ctf_RespawnFlag(self);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, APP_TEAM_ENT_2(self.flagcarried, INFO_CTF_FLAGRETURN_ABORTRUN_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ ctf_RespawnFlag(self.flagcarried);
return TRUE;
}
return TRUE;
}
+MUTATOR_HOOKFUNCTION(ctf_GetCvars)
+{
+ GetCvars_handleFloat(get_cvars_s, get_cvars_f, CAPTURE_VERBOSE, "notification_ctf_capture_verbose");
+ GetCvars_handleFloat(get_cvars_s, get_cvars_f, PICKUP_TEAM_VERBOSE, "notification_ctf_pickup_team_verbose");
+ GetCvars_handleFloat(get_cvars_s, get_cvars_f, PICKUP_ENEMY_VERBOSE, "notification_ctf_pickup_enemy_verbose");
+ return TRUE;
+}
+
// ==========
// Spawnfuncs
{
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();
MUTATOR_HOOK(VehicleExit, ctf_VehicleExit, CBC_ORDER_ANY);
MUTATOR_HOOK(AbortSpeedrun, ctf_AbortSpeedrun, CBC_ORDER_ANY);
MUTATOR_HOOK(HavocBot_ChooseRule, ctf_BotRoles, CBC_ORDER_ANY);
+ MUTATOR_HOOK(GetCvars, ctf_GetCvars, CBC_ORDER_ANY);
MUTATOR_ONADD
{
// these are needed since mutators are compiled last
+#ifdef SVQC
// used in cheats.qc
void ctf_RespawnFlag(entity flag);
float havocbot_ctf_middlepoint_radius;
void havocbot_role_ctf_setrole(entity bot, float role);
+
+// client notification stuff
+.float CAPTURE_VERBOSE;
+.float PICKUP_TEAM_VERBOSE;
+.float PICKUP_ENEMY_VERBOSE;
+#else
+var float autocvar_notification_ctf_capture_verbose = TRUE;
+var float autocvar_notification_ctf_pickup_team_verbose = TRUE;
+var float autocvar_notification_ctf_pickup_enemy_verbose = TRUE;
+#endif
return; // we still have active players on two or more teams, nobody won yet
entity e, winner;
- string teamname;
winner = world;
FOR_EACH_PLAYER(e)
if(winner != world) // just in case a winner wasn't found
{
- if(winner.team == COLOR_TEAM1)
- teamname = "^1Red Team";
- else if(winner.team == COLOR_TEAM2)
- teamname = "^4Blue Team";
- else if(winner.team == COLOR_TEAM3)
- teamname = "^3Yellow Team";
- else
- teamname = "^6Pink Team";
- FOR_EACH_PLAYER(e) {
- centerprint(e, strcat(teamname, "^5 wins the round, all other teams were frozen.\n"));
- }
- bprint(teamname, "^5 wins the round since all the other teams were frozen.\n");
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_CENTER, APP_TEAM_NUM_4(winner.team, CENTER_FREEZETAG_ROUND_WIN_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, APP_TEAM_NUM_4(winner.team, INFO_FREEZETAG_ROUND_WIN_), NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
TeamScore_AddToTeam(winner.team, ST_SCORE, +1);
}
{
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;
if(frag_attacker == frag_target || frag_attacker == world)
{
if(frag_target.classname == STR_PLAYER)
- centerprint(frag_target, "^1You froze yourself.\n");
- bprint("^7", frag_target.netname, "^1 froze himself.\n");
+ Send_Notification_Legacy_Wrapper(frag_target, MSG_ONE, MSG_CENTER, CENTER_FREEZETAG_SELF, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, INFO_FREEZETAG_SELF, frag_target.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
}
else
{
if(frag_target.classname == STR_PLAYER)
- centerprint(frag_target, strcat("^1You were frozen by ^7", frag_attacker.netname, ".\n"));
+ Send_Notification_Legacy_Wrapper(frag_target, MSG_ONE, MSG_CENTER, CENTER_FREEZETAG_FROZEN, frag_attacker.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
if(frag_attacker.classname == STR_PLAYER)
- centerprint(frag_attacker, strcat("^2You froze ^7", frag_target.netname, ".\n"));
- bprint("^7", frag_target.netname, "^1 was frozen by ^7", frag_attacker.netname, ".\n");
+ Send_Notification_Legacy_Wrapper(frag_attacker, MSG_ONE, MSG_CENTER, CENTER_FREEZETAG_FREEZE, frag_target.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, INFO_FREEZETAG_FREEZE, frag_target.netname, frag_attacker.netname, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
}
frag_target.health = 1; // "respawn" the player :P
}
if(warmup && time > warmup) // spawn too late, freeze player
{
- centerprint(self, "^1You spawned after the round started, you'll spawn as frozen.\n");
+ Send_Notification_Legacy_Wrapper(self, MSG_ONE, MSG_CENTER, CENTER_FREEZETAG_SPAWN_LATE, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
freezetag_Freeze(world);
}
}
}
- if(n > 1)
- centerprint(self, strcat("^5You were revived by ^7", o.netname, "^5 et al.\n"));
- else
- centerprint(self, strcat("^5You were revived by ^7", o.netname, "^5.\n"));
- centerprint(o, strcat("^5You revived ^7", self.netname, "^5.\n"));
- if(n > 1)
- bprint("^7", o.netname, "^5 et al revived ^7", self.netname, "^5.\n");
- else
- bprint("^7", o.netname, "^5 revived ^7", self.netname, "^5.\n");
+ Send_Notification_Legacy_Wrapper(self, MSG_ONE, MSG_CENTER, CENTER_FREEZETAG_REVIVED, o.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ Send_Notification_Legacy_Wrapper(o, MSG_ONE, MSG_CENTER, CENTER_FREEZETAG_REVIVE, self.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, INFO_FREEZETAG_REVIVE, self.netname, o.netname, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
}
// now find EVERY teammate within reviving radius, set their revive_progress values correct
// messages and sounds
ka_EventLog("pickup", other);
- Send_KillNotification(other.netname, "", "", KA_PICKUPBALL, MSG_KA);
- WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
- WriteString(MSG_BROADCAST, strcat(other.netname, "^7 has picked up the ball!"));
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, INFO_KEEPAWAY_PICKUP, other.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_CENTER, CENTER_KEEPAWAY_PICKUP, other.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
sound(self.owner, CH_TRIGGER, "keepaway/pickedup.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
// scoring
// messages and sounds
ka_EventLog("dropped", plyr);
- Send_KillNotification(plyr.netname, "", "", KA_DROPBALL, MSG_KA);
- WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
- WriteString(MSG_BROADCAST, strcat(plyr.netname, "^7 has dropped the ball!"));
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, INFO_KEEPAWAY_DROPPED, plyr.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_CENTER, CENTER_KEEPAWAY_DROPPED, plyr.netname, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
sound(other, CH_TRIGGER, "keepaway/dropped.wav", VOL_BASE, ATTN_NONE); // ATTN_NONE (it's a sound intended to be heard anywhere)
// scoring
}
else if(!frag_attacker.ballcarried)
if(autocvar_g_keepaway_noncarrier_warn)
- centerprint(frag_attacker, "Killing people while you don't have the ball gives no points!");
+ Send_Notification_Legacy_Wrapper(frag_attacker, MSG_ONE, MSG_CENTER, CENTER_KEEPAWAY_WARN, NO_STR_ARG, NO_STR_ARG, NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
if(frag_attacker.ballcarried) // add to amount of kills while ballcarrier
PlayerScore_Add(frag_attacker, SP_SCORE, autocvar_g_keepaway_score_killac);
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);
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)
{
- 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:
{
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 = func_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;
}
{
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 (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;
{
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)
{
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);
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
+../common/notifications.qh
../common/explosion_equation.qh
../common/urllib.qh
../common/command/markup.qh
../warpzonelib/server.qc
../common/util.qc
+../common/notifications.qc
../common/if-this-file-errors-scroll-up-and-fix-the-warnings.fteqccfail
recorddifference = strcat(" ^1[+", TIME_ENCODED_TOSTRING(t - oldrec), "]");
bprint(mynetname, "^7 couldn't break their ", race_placeName(player_prevpos), " place record of ", TIME_ENCODED_TOSTRING(oldrec), recorddifference, "\n");
race_SendStatus(0, e); // "fail"
- Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_FAIL, MSG_RACE);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, INFO_RACE_FAIL, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
return;
} else if (!newpos) { // no ranking, time worse than the worst ranked
recorddifference = strcat(" ^1[+", TIME_ENCODED_TOSTRING(t - race_readTime(GetMapname(), RANKINGS_CNT)), "]");
bprint(mynetname, "^7 couldn't break the ", race_placeName(RANKINGS_CNT), " place record of ", TIME_ENCODED_TOSTRING(race_readTime(GetMapname(), RANKINGS_CNT)), recorddifference, "\n");
race_SendStatus(0, e); // "fail"
- Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_FAIL, MSG_RACE);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, INFO_RACE_FAIL, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
return;
}
bprint(mynetname, "^1 broke ", oldrec_holder, "^1's 1st place record with ", strcat(TIME_ENCODED_TOSTRING(t), recorddifference, "\n"));
}
race_SendStatus(3, e); // "new server record"
- Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_SERVER_RECORD, MSG_RACE);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, INFO_RACE_NEW_RECORD, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
} else {
if(newpos == player_prevpos) {
recorddifference = strcat(" ^2[-", TIME_ENCODED_TOSTRING(oldrec - t), "]");
bprint(mynetname, "^5 improved their ", race_placeName(newpos), " ^5place record with ", TIME_ENCODED_TOSTRING(t), recorddifference, "\n");
race_SendStatus(1, e); // "new time"
- Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_NEW_TIME, MSG_RACE);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, INFO_RACE_NEW_TIME, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
} else if (oldrec == 0) {
bprint(mynetname, "^2 set the ", race_placeName(newpos), " ^2place record with ", TIME_ENCODED_TOSTRING(t), "\n");
race_SendStatus(2, e); // "new rank"
- Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_NEW_RANK, MSG_RACE);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, INFO_RACE_NEW_RANK, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
} else {
recorddifference = strcat(" ^2[-", TIME_ENCODED_TOSTRING(oldrec - t), "]");
bprint(mynetname, "^2 broke ", oldrec_holder, "^2's ", race_placeName(newpos), " ^2place record with ", strcat(TIME_ENCODED_TOSTRING(t), recorddifference, "\n"));
race_SendStatus(2, e); // "new rank"
- Send_KillNotification(e.netname, TIME_ENCODED_TOSTRING(t), "", RACE_NEW_TIME, MSG_RACE);
+ Send_Notification_Legacy_Wrapper(world, MSG_BROADCAST, MSG_INFO, INFO_RACE_NEW_RANK, e.netname, TIME_ENCODED_TOSTRING(t), NO_FL_ARG, NO_FL_ARG, NO_FL_ARG);
}
}
}
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");
}
/*
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 COLOR_TEAM1:
- return '1 0.0625 0.0625';
- case COLOR_TEAM2:
- return '0.0625 0.0625 1';
- case COLOR_TEAM3:
- return '1 1 0.0625';
- case COLOR_TEAM4:
- 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();
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);
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");
}
}
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;
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
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()
}
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);
{
W_Reload(min(autocvar_g_balance_crylink_primary_ammo, autocvar_g_balance_crylink_secondary_ammo), autocvar_g_balance_crylink_reload_ammo, autocvar_g_balance_crylink_reload_time, "weapons/reload.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ return WEAPON_CRYLINK_SUICIDE;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ return WEAPON_CRYLINK_MURDER;
+ }
return TRUE;
}
#endif
precache_sound("weapons/crylink_impact2.wav");
precache_sound("weapons/crylink_impact.wav");
}
- else if (req == WR_SUICIDEMESSAGE)
- {
- w_deathtypestring = _("%s succeeded at self-destructing themself with the Crylink");
- }
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_BOUNCE)
- w_deathtypestring = _("%s could not hide from %s's Crylink"); // unchecked: SPLASH (SECONDARY can't be)
- else if(w_deathtype & HITTYPE_SPLASH)
- w_deathtypestring = _("%s was too close to %s's Crylink"); // unchecked: SECONDARY
- else
- w_deathtypestring = _("%s took a close look at %s's Crylink"); // unchecked: SECONDARY
- }
return TRUE;
}
#endif
{
W_Reload(min(autocvar_g_balance_electro_primary_ammo, autocvar_g_balance_electro_secondary_ammo), autocvar_g_balance_electro_reload_ammo, autocvar_g_balance_electro_reload_time, "weapons/reload.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ return WEAPON_ELECTRO_SUICIDE_ORBS;
+ else
+ return WEAPON_ELECTRO_SUICIDE_BOLT;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ {
+ return WEAPON_ELECTRO_MURDER_ORBS;
+ }
+ else
+ {
+ if(w_deathtype & HITTYPE_BOUNCE)
+ return WEAPON_ELECTRO_MURDER_COMBO;
+ else
+ return WEAPON_ELECTRO_MURDER_BOLT;
+ }
+ }
return TRUE;
}
#endif
precache_sound("weapons/electro_impact.wav");
precache_sound("weapons/electro_impact_combo.wav");
}
- else if (req == WR_SUICIDEMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- w_deathtypestring = _("%s could not remember where they put their electro plasma");
- else
- w_deathtypestring = _("%s played with electro plasma");
- }
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- {
- if(w_deathtype & HITTYPE_SPLASH) // unchecked: BOUNCE
- w_deathtypestring = _("%s just noticed %s's electro plasma");
- else // unchecked: BOUNCE
- w_deathtypestring = _("%s got in touch with %s's electro plasma");
- }
- else
- {
- if(w_deathtype & HITTYPE_BOUNCE) // combo
- w_deathtypestring = _("%s felt the electrifying air of %s's electro combo");
- else if(w_deathtype & HITTYPE_SPLASH)
- w_deathtypestring = _("%s got too close to %s's blue electro bolt");
- else
- w_deathtypestring = _("%s was blasted by %s's blue electro bolt");
- }
- }
return TRUE;
}
#endif
{
self.fireball_primarytime = time;
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ return WEAPON_FIREBALL_SUICIDE_FIREMINE;
+ else
+ return WEAPON_FIREBALL_SUICIDE_BLAST;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ {
+ return WEAPON_FIREBALL_MURDER_FIREMINE;
+ }
+ else
+ {
+ return WEAPON_FIREBALL_MURDER_BLAST;
+ }
+ }
return TRUE;
}
#endif
{
precache_sound("weapons/fireball_impact2.wav");
}
- else if (req == WR_SUICIDEMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- w_deathtypestring = _("%s forgot about some firemine");
- else
- w_deathtypestring = _("%s should have used a smaller gun");
- }
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- {
- if(w_deathtype & HITTYPE_HEADSHOT)
- w_deathtypestring = _("%s tried to catch %s's firemine");
- else
- w_deathtypestring = _("%s fatefully ignored %s's firemine");
- }
- else
- {
- if(w_deathtype & HITTYPE_BOUNCE)
- {
- if(w_deathtype & HITTYPE_SPLASH) // BFG effect
- w_deathtypestring = _("%s could not hide from %s's fireball");
- else // laser
- w_deathtypestring = _("%s saw the pretty lights of %s's fireball");
- }
- else if(w_deathtype & HITTYPE_SPLASH)
- w_deathtypestring = _("%s got too close to %s's fireball");
- else
- w_deathtypestring = _("%s tasted %s's fireball");
- }
- }
return TRUE;
}
#endif
{
W_Reload(min(autocvar_g_balance_grenadelauncher_primary_ammo, autocvar_g_balance_grenadelauncher_secondary_ammo), autocvar_g_balance_grenadelauncher_reload_ammo, autocvar_g_balance_grenadelauncher_reload_time, "weapons/reload.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ return WEAPON_MORTAR_SUICIDE_BOUNCE;
+ else
+ return WEAPON_MORTAR_SUICIDE_EXPLODE;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ return WEAPON_MORTAR_MURDER_BOUNCE;
+ else
+ return WEAPON_MORTAR_MURDER_EXPLODE;
+ }
return TRUE;
}
#endif
{
precache_sound("weapons/grenade_impact.wav");
}
- else if (req == WR_SUICIDEMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- w_deathtypestring = _("%s didn't see their own grenade");
- else
- w_deathtypestring = _("%s blew themself up with their grenadelauncher");
- }
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_SPLASH)
- if(w_deathtype & HITTYPE_BOUNCE) // (must be secondary then)
- w_deathtypestring = _("%s didn't see %s's grenade");
- else // unchecked: SECONDARY
- w_deathtypestring = _("%s almost dodged %s's grenade");
- else // unchecked: SECONDARY, BOUNCE
- w_deathtypestring = _("%s ate %s's grenade");
- }
return TRUE;
}
#endif
if not(self.hagar_load) // require releasing loaded rockets first
W_Reload(min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo), autocvar_g_balance_hagar_reload_ammo, autocvar_g_balance_hagar_reload_time, "weapons/reload.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ return WEAPON_HAGAR_SUICIDE;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ return WEAPON_HAGAR_MURDER_BURST;
+ else
+ return WEAPON_HAGAR_MURDER_SPRAY;
+ }
return TRUE;
}
#endif
precache_sound("weapons/hagexp2.wav");
precache_sound("weapons/hagexp3.wav");
}
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = _("%s played with tiny hagar rockets");
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_BOUNCE) // must be secondary; unchecked: SPLASH
- w_deathtypestring = _("%s was pummeled with a burst of hagar rockets by %s");
- else // unchecked: SPLASH, SECONDARY
- w_deathtypestring = _("%s was pummeled with hagar rockets by %s");
- }
return TRUE;
}
#endif
{
W_Reload(min(autocvar_g_balance_hlac_primary_ammo, autocvar_g_balance_hlac_secondary_ammo), autocvar_g_balance_hlac_reload_ammo, autocvar_g_balance_hlac_reload_time, "weapons/reload.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ return WEAPON_HLAC_SUICIDE;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ return WEAPON_HLAC_MURDER;
+ }
return TRUE;
}
#endif
{
precache_sound("weapons/laserimpact.wav");
}
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = _("%s should have used a smaller gun");
- else if (req == WR_KILLMESSAGE)
- w_deathtypestring = _("%s was cut down with a HLAC by %s");
return TRUE;
}
#endif
{
self.hook_refire = time;
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ return FALSE;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ return WEAPON_HOOK_MURDER;
+ }
return TRUE;
}
#endif
{
precache_sound("weapons/hookbomb_impact.wav");
}
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = _("%s did the impossible");
- else if (req == WR_KILLMESSAGE)
- w_deathtypestring = _("%s was caught in %s's hook gravity bomb");
return TRUE;
}
#endif
{
W_Reload(0, autocvar_g_balance_laser_reload_ammo, autocvar_g_balance_laser_reload_time, "weapons/reload.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ return WEAPON_LASER_SUICIDE;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ return WEAPON_LASER_MURDER;
+ }
return TRUE;
}
#endif
{
precache_sound("weapons/laserimpact.wav");
}
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = _("%s lasered themself to hell");
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- w_deathtypestring = _("%s was cut in half by %s's gauntlet"); // unchecked: SPLASH
- else
- w_deathtypestring = _("%s was lasered to death by %s"); // unchecked: SPLASH
- }
return TRUE;
}
#endif
{
W_Reload(autocvar_g_balance_minelayer_ammo, autocvar_g_balance_minelayer_reload_ammo, autocvar_g_balance_minelayer_reload_time, "weapons/reload.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ return WEAPON_MINELAYER_SUICIDE;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ return WEAPON_MINELAYER_MURDER;
+ }
return TRUE;
}
#endif
{
precache_sound("weapons/mine_exp.wav");
}
- else if (req == WR_SUICIDEMESSAGE)
- if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation)
- w_deathtypestring = _("%s blew themself up with their minelayer");
- else
- w_deathtypestring = _("%s forgot about their mine");
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation)
- w_deathtypestring = _("%s got too close to %s's mine");
- else if(w_deathtype & HITTYPE_SPLASH)
- w_deathtypestring = _("%s almost dodged %s's mine");
- else
- w_deathtypestring = _("%s stepped on %s's mine");
- }
return TRUE;
}
#endif
{
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
W_Reload(used_ammo, autocvar_g_balance_minstanex_reload_ammo, autocvar_g_balance_minstanex_reload_time, "weapons/reload.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ return WEAPON_THINKING_WITH_PORTALS;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ return WEAPON_MINSTANEX_MURDER;
+ }
return TRUE;
}
#endif
{
W_Reload(min(autocvar_g_balance_nex_primary_ammo, autocvar_g_balance_nex_secondary_ammo), autocvar_g_balance_nex_reload_ammo, autocvar_g_balance_nex_reload_time, "weapons/reload.wav");
}
-
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ return WEAPON_THINKING_WITH_PORTALS;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ return WEAPON_NEX_MURDER;
+ }
return TRUE;
}
#endif
{
precache_sound("weapons/neximpact.wav");
}
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = _("%s is now thinking with portals");
- else if (req == WR_KILLMESSAGE)
- w_deathtypestring = _("%s has been vaporized by %s's nex");
return TRUE;
}
#endif
{
// nothing to do
}
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = _("%s did the impossible");
- else if (req == WR_KILLMESSAGE)
- w_deathtypestring = _("%s felt %s doing the impossible to him");
return TRUE;
}
#endif
{
W_Reload(min(autocvar_g_balance_rifle_primary_ammo, autocvar_g_balance_rifle_secondary_ammo), autocvar_g_balance_rifle_reload_ammo, autocvar_g_balance_rifle_reload_time, "weapons/reload.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ return WEAPON_THINKING_WITH_PORTALS;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ {
+ if(w_deathtype & HITTYPE_BOUNCE)
+ return WEAPON_RIFLE_MURDER_HAIL_PIERCING;
+ else
+ return WEAPON_RIFLE_MURDER_HAIL;
+ }
+ else
+ {
+ if(w_deathtype & HITTYPE_BOUNCE)
+ {
+ return WEAPON_RIFLE_MURDER_PIERCING;
+ }
+ else
+ {
+ if(w_deathtype & HITTYPE_HEADSHOT)
+ return WEAPON_RIFLE_MURDER_HEADSHOT;
+ else
+ return WEAPON_RIFLE_MURDER;
+ }
+ }
+ }
return TRUE;
}
#endif
precache_sound("weapons/ric2.wav");
precache_sound("weapons/ric3.wav");
}
- else if (req == WR_SUICIDEMESSAGE)
- {
- w_deathtypestring = _("%s is now thinking with portals");
- }
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- {
- if(w_deathtype & HITTYPE_BOUNCE)
- w_deathtypestring = _("%s failed to hide from %s's rifle bullet hail");
- else
- w_deathtypestring = _("%s died in %s's rifle bullet hail");
- }
- else
- {
- if(w_deathtype & HITTYPE_BOUNCE)
- {
- // TODO special headshot message here too?
- w_deathtypestring = _("%s failed to hide from %s's rifle");
- }
- else
- {
- if(w_deathtype & HITTYPE_HEADSHOT)
- w_deathtypestring = _("%s got shot in the head with a rifle by %s");
- else
- w_deathtypestring = _("%s was sniped with a rifle by %s");
- }
- }
- }
return TRUE;
}
#endif
{
W_Reload(autocvar_g_balance_rocketlauncher_ammo, autocvar_g_balance_rocketlauncher_reload_ammo, autocvar_g_balance_rocketlauncher_reload_time, "weapons/reload.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ return WEAPON_ROCKETLAUNCHER_SUICIDE;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ if((w_deathtype & HITTYPE_BOUNCE) || (w_deathtype & HITTYPE_SPLASH))
+ return WEAPON_ROCKETLAUNCHER_MURDER_SPLASH;
+ else
+ return WEAPON_ROCKETLAUNCHER_MURDER_DIRECT;
+ }
return TRUE;
}
#endif
{
precache_sound("weapons/rocket_impact.wav");
}
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = _("%s blew themself up with their rocketlauncher");
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation)
- w_deathtypestring = _("%s got too close to %s's rocket");
- else if(w_deathtype & HITTYPE_SPLASH)
- w_deathtypestring = _("%s almost dodged %s's rocket");
- else
- w_deathtypestring = _("%s ate %s's rocket");
- }
return TRUE;
}
#endif
{
W_Reload(min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo), autocvar_g_balance_seeker_reload_ammo, autocvar_g_balance_seeker_reload_time, "weapons/reload.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ return WEAPON_SEEKER_SUICIDE;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ return WEAPON_SEEKER_MURDER_TAG;
+ else
+ return WEAPON_SEEKER_MURDER_SPRAY;
+ }
return TRUE;
}
#endif
precache_sound("weapons/tagexp3.wav");
precache_sound("weapons/tag_impact.wav");
}
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = _("%s played with tiny seeker rockets");
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- w_deathtypestring = _("%s was tagged with a seeker by %s");
- else
- w_deathtypestring = _("%s was pummeled with seeker rockets by %s");
- }
return TRUE;
}
#endif
{
W_Reload(autocvar_g_balance_shotgun_primary_ammo, autocvar_g_balance_shotgun_reload_ammo, autocvar_g_balance_shotgun_reload_time, "weapons/reload.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ return WEAPON_THINKING_WITH_PORTALS;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ return WEAPON_SHOTGUN_MURDER_SLAP;
+ else
+ return WEAPON_SHOTGUN_MURDER;
+ }
return TRUE;
}
#endif
precache_sound("weapons/ric2.wav");
precache_sound("weapons/ric3.wav");
}
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = _("%s is now thinking with portals");
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- w_deathtypestring = _("%2$s slapped %1$s around a bit with a large shotgun");
- else
- w_deathtypestring = _("%s was gunned down with a shotgun by %s");
- }
return TRUE;
}
#endif
// 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
return TRUE; // TODO use fuel?
else if (req == WR_CHECKAMMO2)
return TRUE; // TODO use fuel?
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_BOUNCE)
+ return WEAPON_ACCORDEON_SUICIDE;
+ else if(w_deathtype & HITTYPE_HEADSHOT)
+ return WEAPON_KLEINBOTTLE_SUICIDE;
+ else
+ return WEAPON_TUBA_SUICIDE;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_BOUNCE)
+ return WEAPON_ACCORDEON_MURDER;
+ else if(w_deathtype & HITTYPE_HEADSHOT)
+ return WEAPON_KLEINBOTTLE_MURDER;
+ else
+ return WEAPON_TUBA_MURDER;
+ }
return TRUE;
}
#endif
{
// nothing to do
}
- else if (req == WR_SUICIDEMESSAGE)
- {
- float instr;
- instr = 0;
- if(w_deathtype & HITTYPE_SECONDARY)
- instr |= 1;
- if(w_deathtype & HITTYPE_BOUNCE)
- instr |= 2;
- if(w_deathtype & HITTYPE_HEADSHOT)
- instr |= 4;
- switch(instr)
- {
- default:
- case 0: // Tuba
- w_deathtypestring = _("%s hurt his own ears with the @!#%%'n Tuba");
- break;
- case 1: // Accordeon
- w_deathtypestring = _("%s hurt his own ears with the @!#%%'n Accordeon");
- break;
- case 2: // Klein Bottle
- w_deathtypestring = _("%s hurt his own ears with the @!#%%'n Klein Bottle");
- break;
- }
- }
- else if (req == WR_KILLMESSAGE)
- {
- float instr;
- instr = 0;
- if(w_deathtype & HITTYPE_SECONDARY)
- instr |= 1;
- if(w_deathtype & HITTYPE_BOUNCE)
- instr |= 2;
- if(w_deathtype & HITTYPE_HEADSHOT)
- instr |= 4;
- switch(instr)
- {
- default:
- case 0: // Tuba
- w_deathtypestring = _("%s died of %s's great playing on the @!#%%'n Tuba");
- break;
- case 1: // Accordeon
- w_deathtypestring = _("%s died of %s's great playing on the @!#%%'n Accordeon");
- break;
- case 2: // Klein Bottle
- w_deathtypestring = _("%s died of %s's great playing on the @!#%%'n Klein Bottle");
- break;
- }
- }
return TRUE;
}
#endif
{
W_Reload(min(max(autocvar_g_balance_uzi_sustained_ammo, autocvar_g_balance_uzi_first_ammo), autocvar_g_balance_uzi_burst_ammo), autocvar_g_balance_uzi_reload_ammo, autocvar_g_balance_uzi_reload_time, "weapons/reload.wav");
}
+ else if (req == WR_SUICIDEMESSAGE)
+ {
+ return WEAPON_THINKING_WITH_PORTALS;
+ }
+ else if (req == WR_KILLMESSAGE)
+ {
+ if(w_deathtype & HITTYPE_SECONDARY)
+ return WEAPON_UZI_MURDER_SNIPE;
+ else
+ return WEAPON_UZI_MURDER_SPRAY;
+ }
return TRUE;
}
#endif
precache_sound("weapons/ric2.wav");
precache_sound("weapons/ric3.wav");
}
- else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = _("%s is now thinking with portals");
- else if (req == WR_KILLMESSAGE)
- {
- if(w_deathtype & HITTYPE_SECONDARY)
- w_deathtypestring = _("%s was sniped by %s's machine gun");
- else
- w_deathtypestring = _("%s was riddled full of holes by %s's machine gun");
- }
return TRUE;
}
#endif