#pragma once
#include "../panel.qh"
-float autocvar_hud_panel_centerprint_fade_in = 0.2;
+ bool autocvar_hud_panel_centerprint;
+ float autocvar_hud_panel_centerprint_align;
-float autocvar_hud_panel_centerprint_fade_subsequent_minfontsize = 0.75;
-float autocvar_hud_panel_centerprint_fade_minfontsize = 0;
++//float autocvar_hud_panel_centerprint_fade_in = 0.2;
+ float autocvar_hud_panel_centerprint_fade_out = 0.5;
+ float autocvar_hud_panel_centerprint_fade_subsequent = 1;
+ float autocvar_hud_panel_centerprint_fade_subsequent_passone = 3;
+ float autocvar_hud_panel_centerprint_fade_subsequent_passone_minalpha = 0.5;
+ float autocvar_hud_panel_centerprint_fade_subsequent_passtwo = 10;
+ float autocvar_hud_panel_centerprint_fade_subsequent_passtwo_minalpha = 0.5;
++//float autocvar_hud_panel_centerprint_fade_subsequent_minfontsize = 0.75;
++//float autocvar_hud_panel_centerprint_fade_minfontsize = 0;
+ bool autocvar_hud_panel_centerprint_flip;
+ float autocvar_hud_panel_centerprint_fontscale;
+ float autocvar_hud_panel_centerprint_fontscale_bold = 1.4;
+ bool autocvar_hud_panel_centerprint_dynamichud = true;
+ float autocvar_hud_panel_centerprint_time;
+
+void centerprint_ClearTitle();
+void centerprint_SetTitle(string title);
+void centerprint_Medal(string icon, int times);
++
void centerprint_Add(int new_id, string strMessage, float duration, int countdown_num);
void centerprint_AddStandard(string strMessage);
void centerprint_Kill(int id);
#include "chat.qh"
- #include <client/autocvars.qh>
#include <client/draw.qh>
+#include <common/items/inventory.qh>
// Chat (#12)
--- /dev/null
- #include <client/autocvars.qh>
+#include "spect.qh"
+
+#include <client/hud/hud.qh>
+#include <client/view.qh>
+
+vector teamscore_size;
+vector teamscore_fontsize;
+vector teamname_fontsize;
+
+void HUD_SpectHUD_Export(int fh)
+{
+ // allow saving cvars that aesthetically change the panel into hud skin files
+}
+
+void HUD_SpectHUD_drawCurrentName(vector pos)
+{
+ string s = entcs_GetName(current_player);
+ pos.x -= stringwidth_colors(s, hud_fontsize * 2) / 2;
+ drawcolorcodedstring(pos, s, hud_fontsize * 2, panel_fg_alpha, DRAWFLAG_NORMAL);
+}
+
+void HUD_SpectHUD_drawTeamPlayers(vector pos, entity tm, vector rgb, bool invert)
+{
+ vector tmp_over;
+ vector line_sz = vec2((vid_conwidth - 1) / 7, hud_fontsize.y * 1.5);
+ vector line_sz_sub = vec2((vid_conwidth - 1) / 7, hud_fontsize.y);
+
+ string playername;
+ float a = panel_fg_alpha * 0.8;
+ entity pl;
+
+ if(invert)
+ pos.x -= line_sz.x + hud_fontsize.x;
+ else
+ pos.x += hud_fontsize.x;
+
+ for(pl = players.sort_next; pl; pl = pl.sort_next)
+ {
+ if(pl.team != tm.team)
+ continue;
+
+ float health = 0;
+ float armor = 0;
+ string icon = "";
+ vector icon_size = '0 0 0';
+ vector icon_rgb = '1 1 1';
+
+ // Position and size calculation vectors
+ tmp_over = pos;
+ vector total_sz = vec2(line_sz.x, line_sz.y + line_sz_sub.y);
+
+ if(pl.eliminated) {
+ // z411 TODO : Unhardcode luma
+ icon = "gfx/hud/luma/notify_death.tga";
+ icon_rgb = rgb;
+ } else {
+ entity entcs = entcs_receiver(pl.sv_entnum);
+ if(entcs.m_entcs_private) {
+ health = (entcs.healthvalue / autocvar_hud_panel_healtharmor_maxhealth) * line_sz.x;
+ armor = (GetResource(entcs, RES_ARMOR) / autocvar_hud_panel_healtharmor_maxarmor) * line_sz_sub.x;
+
+ Weapon wep = REGISTRY_GET(Weapons, entcs.activewepid);
+ icon = strcat("gfx/hud/luma/", wep.model2);
+ } else {
+ if(tm.team == NUM_TEAM_1)
+ icon = "gfx/hud/luma/player_red";
+ else if(tm.team == NUM_TEAM_2)
+ icon = "gfx/hud/luma/player_blue";
+ else
+ icon = "gfx/hud/luma/player_neutral";
+ }
+ }
+
+ // Draw weapon
+ if(icon != "") {
+ vector tmp_sz = draw_getimagesize(icon);
+ icon_size = vec2(total_sz.y*(tmp_sz.x/tmp_sz.y), total_sz.y);
+ total_sz.x += icon_size.x;
+
+ if(invert) {
+ pos.x -= icon_size.x;
+ tmp_over.x -= icon_size.x;
+ }
+ drawpic(pos, icon, icon_size, icon_rgb, panel_fg_alpha, DRAWFLAG_NORMAL);
+ pos.x += icon_size.x;
+ }
+
+ // Get player's name
+ playername = textShortenToWidth(entcs_GetName(pl.sv_entnum), line_sz.x * 0.8, hud_fontsize, stringwidth_colors);
+
+ // Draw health and name
+ drawfill(pos, line_sz, rgb * 0.7, a * 0.3, DRAWFLAG_NORMAL);
+ if(health)
+ drawfill(pos, vec2(health, line_sz.y), rgb * 0.7, a, DRAWFLAG_NORMAL);
+ drawcolorcodedstring(pos + eY * ((line_sz.y - hud_fontsize.y) / 2) + eX * (hud_fontsize.x * 0.5), playername, hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
+ pos.y += line_sz.y;
+
+ // Draw armor
+ if(armor)
+ drawfill(pos, vec2(armor, line_sz_sub.y), rgb, a, DRAWFLAG_NORMAL);
+
+ // Highlight current player
+ if(pl.sv_entnum == current_player && spectatee_status != -1)
+ drawfill(tmp_over, total_sz, '1 1 1', 0.3, DRAWFLAG_NORMAL);
+ if(pl.eliminated)
+ drawfill(tmp_over, total_sz, '0 0 0', 0.4, DRAWFLAG_NORMAL);
+
+ if(!invert)
+ pos.x -= icon_size.x;
+ pos.y += line_sz_sub.y * 2;
+ }
+}
+
+
+void HUD_SpectHUD_drawTeamScore(vector pos, entity tm, vector rgb, bool invert)
+{
+ if(!tm) return;
+
+ vector tmp;
+ string tmp_str;
+
+ // Team score
+ tmp_str = ftos(tm.(teamscores(ts_primary)));
+
+ if(invert)
+ pos.x -= teamscore_size.x;
+
+ drawfill(pos, teamscore_size, rgb * 0.8, 0.3, DRAWFLAG_NORMAL);
+
+ tmp = pos;
+ tmp.x += (teamscore_size.x - stringwidth(tmp_str, true, teamscore_fontsize)) / 2;
+ tmp.y += (teamscore_size.y - teamscore_fontsize.y) / 2;
+
+ draw_beginBoldFont();
+ drawstring(tmp, tmp_str, teamscore_fontsize, rgb, panel_fg_alpha, DRAWFLAG_NORMAL);
+ draw_endBoldFont();
+
+ // Team name
+ tmp_str = Team_CustomName(tm.team);
+
+ tmp = pos;
+ if(invert)
+ tmp.x -= stringwidth_colors(tmp_str, teamname_fontsize) + teamname_fontsize.x * 0.5;
+ else
+ tmp.x += teamscore_size.x + teamname_fontsize.x * 0.5;
+ tmp.y += (teamscore_size.y - teamname_fontsize.y) / 2;
+
+ drawcolorcodedstring(tmp, tmp_str, teamname_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
+}
+
+void HUD_SpectHUD()
+{
+ if(!spectatee_status) return;
+
+ vector pos, rgb;
+ float ammo_y, timer_width;
+ entity tm;
+
+ // Set main vars
+ HUD_Panel_LoadCvars();
+ HUD_Scale_Enable();
+ hud_fontsize = HUD_GetFontsize("hud_fontsize");
+
+ // Spectator name
+ if(spectatee_status != -1) {
+ ammo_y = stov(cvar_string("hud_panel_ammo_pos")).y * vid_conheight;
+ pos = panel_pos + vec2((vid_conwidth - 1) / 2, (ammo_y - (hud_fontsize.y * 2)));
+ HUD_SpectHUD_drawCurrentName(pos);
+ }
+
+ if(!teamplay) return;
+
+ // Set vars
+ teamscore_fontsize = hud_fontsize * 3;
+ teamname_fontsize = hud_fontsize * 2;
+ teamscore_size = vec2(teamscore_fontsize.x * 1.5, teamscore_fontsize.y * 1.25);
+ timer_width = stov(cvar_string("hud_panel_timer_size")).x * vid_conwidth;
+
+ // Team 1
+ pos = panel_pos + vec2((vid_conwidth - 1) / 2, 0);
+ tm = GetTeam(NUM_TEAM_1, false);
+ rgb = Team_ColorRGB(tm.team);
+ pos.x -= (timer_width * 1.3) / 2;
+ HUD_SpectHUD_drawTeamScore(pos, tm, rgb, true);
+
+ pos = panel_pos + vec2(0, (vid_conheight - 1) / 4 + hud_fontsize.y);
+ HUD_SpectHUD_drawTeamPlayers(pos, tm, rgb, false);
+
+ // Team 2
+ pos = panel_pos + vec2((vid_conwidth - 1) / 2, 0);
+ tm = GetTeam(NUM_TEAM_2, false);
+ rgb = Team_ColorRGB(tm.team);
+ pos.x += (timer_width * 1.3) / 2;
+ HUD_SpectHUD_drawTeamScore(pos, tm, rgb, false);
+
+ pos = panel_pos + vec2(vid_conwidth - 1, (vid_conheight - 1) / 4 + hud_fontsize.y);
+ HUD_SpectHUD_drawTeamPlayers(pos, tm, rgb, true);
+}
#include <common/constants.qh>
#include <common/weapons/_all.qh>
+#include <common/items/inventory.qh>
+
+// z411
+string hostname_full;
+ bool autocvar_cl_db_saveasdump;
+ bool autocvar_cl_spawn_event_particles;
+ bool autocvar_cl_spawn_event_sound = 1;
+ // float autocvar_cl_spawn_point_model;
+ bool autocvar_cl_spawn_point_particles;
+ float autocvar_cl_spawn_point_dist_max = 1200;
+ bool autocvar_cl_unpress_zoom_on_spawn = true;
+ bool autocvar_cl_unpress_zoom_on_death = true;
+ bool autocvar_cl_unpress_zoom_on_weapon_switch = true;
+ bool autocvar_cl_unpress_attack_on_weapon_switch = false;
+ bool autocvar_hud_showbinds;
+ bool autocvar_hud_showbinds_limit;
+ bool autocvar__hud_showbinds_reload;
+ bool autocvar_developer_csqcentities;
+ bool autocvar_cl_race_cptimes_onlyself; // TODO: move to race gamemode
+ bool autocvar_cl_race_cptimes_showself = false;
+
// Map coordinate base calculations need these
vector mi_center;
vector mi_scale;
#pragma once
- //void HUD_Mod_CA(vector myPos, vector mySize);
- //void HUD_Mod_CA_Draw(vector myPos, vector mySize, int layout);
- //void HUD_Mod_CA_Export(int fh);
-int autocvar_hud_panel_modicons_ca_layout;
-
-void HUD_Mod_CA(vector myPos, vector mySize);
-void HUD_Mod_CA_Draw(vector myPos, vector mySize, int layout);
-void HUD_Mod_CA_Export(int fh);
+int HUD_Scores_CA(int team);
#pragma once
- //void HUD_Mod_FreezeTag_Export(int fh);
-int autocvar_hud_panel_modicons_freezetag_layout;
-
-void HUD_Mod_FreezeTag_Export(int fh);
{
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER);
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_ROUND_OVER);
+
FOREACH_CLIENT(IS_PLAYER(it), {
it.freezetag_frozen_timeout = 0;
+ it.freezetag_revive_time = 0;
nades_Clear(it);
});
- game_stopped = true;
+ if(autocvar_g_freezetag_round_stop)
+ game_stopped = true;
round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
return true;
}
const float ICE_MIN_ALPHA = 0.1;
float freezetag_teams;
+ bool autocvar_g_freezetag_revive_auto = 1;
+ int autocvar_g_freezetag_revive_auto_progress = 1;
+ int autocvar_g_freezetag_revive_auto_reducible;
+ float autocvar_g_freezetag_revive_auto_reducible_forcefactor;
float autocvar_g_freezetag_revive_extra_size;
float autocvar_g_freezetag_revive_speed;
+ float autocvar_g_freezetag_revive_time_to_score = 1.5;
bool autocvar_g_freezetag_revive_nade;
float autocvar_g_freezetag_revive_nade_health;
+bool autocvar_g_freezetag_revive_respawn;
float game_stopped;
float game_starttime; //point in time when the countdown to game start is over
float round_starttime; //point in time when the countdown to round start is over
+float overtime_starttime; // z411 point in time where first overtime started
+
+float checkrules_overtimesadded; // z411 add
+float timeout_last;
+float timeout_total_time;
+bool game_timeout;
+
bool autocvar_g_allow_oldvortexbeam;
int autocvar_leadlimit;
+ // TODO: world.qh can't be included here due to circular includes!
+ #define autocvar_fraglimit cvar("fraglimit")
+ #define autocvar_fraglimit_override cvar("fraglimit_override")
+ #define autocvar_timelimit cvar("timelimit")
+ #define autocvar_timelimit_override cvar("timelimit_override")
#endif
REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor(this))
REGISTER_STAT(GAME_STOPPED, int, game_stopped)
#pragma once
+ float autocvar_g_chat_flood_burst;
+ float autocvar_g_chat_flood_burst_team;
+ float autocvar_g_chat_flood_burst_tell;
+ float autocvar_g_chat_flood_lmax;
+ float autocvar_g_chat_flood_lmax_team;
+ float autocvar_g_chat_flood_lmax_tell;
+ bool autocvar_g_chat_flood_notify_flooder;
+ float autocvar_g_chat_flood_spl;
+ float autocvar_g_chat_flood_spl_team;
+ float autocvar_g_chat_flood_spl_tell;
+ int autocvar_g_chat_nospectators;
+ bool autocvar_g_chat_teamcolors;
+ bool autocvar_g_chat_tellprivacy;
+
++bool autocvar_sv_chat_sounds;
++float autocvar_sv_chat_sounds_flood;
++string autocvar_sv_chat_sounds_list;
++
const float NUM_NEAREST_ENTITIES = 4;
entity nearest_entity[NUM_NEAREST_ENTITIES];
float nearest_length[NUM_NEAREST_ENTITIES];
#include <common/replicate.qh>
#include <common/sounds/all.qh>
+ bool autocvar__notarget;
+ int autocvar_g_balance_armor_start;
+ float autocvar_g_balance_pause_armor_rot_spawn;
+ float autocvar_g_balance_pause_fuel_rot_spawn;
+ float autocvar_g_balance_pause_health_regen_spawn;
+ float autocvar_g_balance_pause_health_rot_spawn;
+ bool autocvar_g_botclip_collisions;
+ bool autocvar_g_fullbrightplayers;
+ bool autocvar_g_playerclip_collisions;
+ float autocvar_g_player_alpha;
+ float autocvar_g_player_brightness;
+ float autocvar_g_player_damageforcescale = 2;
+ float autocvar_g_respawn_delay_small;
+ int autocvar_g_respawn_delay_small_count;
+ float autocvar_g_respawn_delay_large;
+ int autocvar_g_respawn_delay_large_count;
+ float autocvar_g_respawn_delay_max;
+ bool autocvar_g_respawn_delay_forced;
+ bool autocvar_g_respawn_ghosts;
+ float autocvar_g_respawn_ghosts_alpha = 1;
+ float autocvar_g_respawn_ghosts_fadetime = 1.5;
+ float autocvar_g_respawn_ghosts_time = 4.5;
+ float autocvar_g_respawn_ghosts_speed;
+ int autocvar_g_respawn_waves;
+ bool autocvar_g_nodepthtestplayers;
+ string autocvar_g_mutatormsg;
+ float autocvar_sv_foginterval;
+ float autocvar_sv_maxidle;
+ bool autocvar_sv_maxidle_spectatorsareidle;
+ int autocvar_sv_maxidle_slots;
+ bool autocvar_sv_maxidle_slots_countbots;
+ bool autocvar_g_forced_respawn;
+ int autocvar_g_maxplayers;
+ float autocvar_g_maxplayers_spectator_blocktime;
+ string autocvar_g_xonoticversion;
+ float autocvar_gameversion;
+ float autocvar_gameversion_min;
+ float autocvar_gameversion_max;
+ string autocvar_hostname;
+ int autocvar_spawn_debug;
+ string autocvar_sv_motd;
+ int autocvar_sv_name_maxlength = 64;
+ bool autocvar_sv_servermodelsonly;
+ int autocvar_sv_spectate;
+ bool autocvar_sv_teamnagger;
+ float autocvar_sv_player_scale;
+ bool autocvar_sv_showspectators;
+
++// z411
++string autocvar_hostname_full;
++string autocvar_g_teamnames_red;
++string autocvar_g_teamnames_blue;
++string autocvar_g_teamnames_yellow;
++string autocvar_g_teamnames_pink;
++
// WEAPONTODO
.string weaponorder_byimpulse;
#include <common/weapons/_all.qh>
+ bool autocvar__sv_init;
+ bool autocvar_g_use_ammunition;
+ bool autocvar_g_jetpack;
+ bool autocvar_g_warmup_allguns;
+ bool autocvar_g_warmup_allow_timeout;
+ #define autocvar_g_weaponarena cvar_string("g_weaponarena")
+ string autocvar_quit_and_redirect;
+ float autocvar_quit_and_redirect_timer;
+ bool autocvar_quit_when_empty;
+ string autocvar_sessionid;
+ bool autocvar_sv_curl_serverpackages_auto;
+ bool autocvar_sv_db_saveasdump;
+ bool autocvar_sv_logscores_bots;
+ bool autocvar_sv_logscores_console;
+ bool autocvar_sv_logscores_file;
+ string autocvar_sv_logscores_filename;
+ float autocvar_sv_mapchange_delay;
+ float autocvar_timelimit_increment;
+ float autocvar_timelimit_decrement;
+ float autocvar_timelimit_min;
+ float autocvar_timelimit_max;
+ float autocvar_timelimit_overtime;
+ int autocvar_timelimit_overtimes;
+ float autocvar_timelimit_suddendeath;
+
++// z411
++bool autocvar_sv_jingle_end;
++string autocvar_sv_jingle_end_list;
++float autocvar_sv_jingle_end_volume;
++
float checkrules_equality;
float checkrules_suddendeathwarning;
float checkrules_suddendeathend;