]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/client/main.qh
Perfect and Defense medals don't make sense in less than 3v3 CA
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / main.qh
1 #pragma once
2
3 #include <common/constants.qh>
4 #include <common/weapons/_all.qh>
5 #include <common/items/inventory.qh>
6
7 // z411
8 string hostname_full;
9
10 bool autocvar_cl_db_saveasdump;
11 bool autocvar_cl_spawn_event_particles;
12 bool autocvar_cl_spawn_event_sound = 1;
13 // float autocvar_cl_spawn_point_model;
14 bool autocvar_cl_spawn_point_particles;
15 float autocvar_cl_spawn_point_dist_max = 1200;
16 bool autocvar_cl_unpress_zoom_on_spawn = true;
17 bool autocvar_cl_unpress_zoom_on_death = true;
18 bool autocvar_cl_unpress_zoom_on_weapon_switch = true;
19 bool autocvar_cl_unpress_attack_on_weapon_switch = false;
20 bool autocvar_hud_showbinds;
21 bool autocvar_hud_showbinds_limit;
22 bool autocvar__hud_showbinds_reload;
23 bool autocvar_developer_csqcentities;
24 bool autocvar_cl_race_cptimes_onlyself; // TODO: move to race gamemode
25 bool autocvar_cl_race_cptimes_showself = false;
26
27 // Map coordinate base calculations need these
28 vector mi_center;
29 vector mi_scale;
30 // Minimap
31 string minimapname;
32
33 bool postinit;
34 entity gametype;
35 // temporary hack
36 #define ISGAMETYPE(NAME) (gametype == MAPINFO_TYPE_##NAME)
37
38 float FONT_USER = 8;
39
40
41 void PostInit();
42
43 void Ent_Remove(entity this);
44
45 void Gamemode_Init();
46
47 entity players;
48 entity teams;
49 float team_count; // real teams
50
51 void AuditLists();
52
53 float RegisterPlayer(entity player);
54
55 void RemovePlayer(entity player);
56
57 void MoveToLast(entity e);
58
59 float RegisterTeam(entity Team);
60
61 void RemoveTeam(entity Team);
62
63 entity GetTeam(int Team, bool add);
64
65 bool SetTeam(entity pl, int Team);
66
67 vector hud_fontsize;
68
69 float RANKINGS_RECEIVED_CNT;
70 float RANKINGS_DISPLAY_CNT;
71 string grecordholder[RANKINGS_CNT];
72 float grecordtime[RANKINGS_CNT];
73
74 entity playerslots[255]; // 255 is engine limit on maxclients
75 entity teamslots[17];    // 17 teams (including "spectator team")
76 .bool gotscores;
77 .entity owner;
78 .bool ready;
79 .bool eliminated;
80
81 IntrusiveList g_drawables;
82 IntrusiveList g_drawables_2d;
83 IntrusiveList g_radarlinks;
84 IntrusiveList g_radaricons;
85 STATIC_INIT(main)
86 {
87         g_drawables = IL_NEW();
88         g_drawables_2d = IL_NEW();
89         g_radarlinks = IL_NEW();
90         g_radaricons = IL_NEW();
91 }
92
93 .void(entity) draw;
94 .void(entity) draw2d;
95 .void(entity) entremove;
96 float drawframetime;
97 vector view_origin, view_forward, view_right, view_up;
98
99 .float renderflags; // engine field
100
101 bool button_zoom;
102 bool spectatorbutton_zoom;
103 bool button_attack2;
104
105 float current_viewzoom;
106 float zoomin_effect;
107 bool warmup_stage;
108
109 void Fog_Force();
110
111 string _getcommandkey(string text, string command, bool forcename);
112 #define getcommandkey(cmd_name, command) _getcommandkey(cmd_name, command, false)
113 #define getcommandkey_forcename(cmd_name, command) _getcommandkey(cmd_name, command, true)
114
115 string vote_called_vote;
116 bool ready_waiting;
117 bool ready_waiting_for_me;
118 bool vote_waiting;
119 bool vote_waiting_for_me;
120
121 float current_zoomfraction;
122
123 int cs_project_is_b0rked;
124 int vid_width, vid_height;
125 float vid_pixelheight;
126
127 float camera_active;            // Demo camera is active if set to true
128 float chase_active_backup;
129 float camera_roll;
130 vector camera_direction;
131
132 const float ALPHA_MIN_VISIBLE = 0.003;
133
134 float armorblockpercent;
135 float damagepush_speedfactor;
136
137 //hooks
138 int calledhooks;
139 const int HOOK_START =    1;
140 const int HOOK_END =      2;
141
142 .float ping, ping_packetloss, ping_movementloss;
143
144 float g_trueaim_minrange;
145
146 int hud;
147 float view_quality;
148
149 int num_spectators;
150 const int MAX_SPECTATORS = 7;
151 int spectatorlist[MAX_SPECTATORS];
152
153 int framecount;
154
155 float GetSpeedUnitFactor(int speed_unit);
156 string GetSpeedUnit(int speed_unit);
157
158 .int enttype; // entity type sent from server
159 .int sv_entnum; // entity number sent from server
160
161 // z411 accuracy info
162 .float accuracy_frags[REGISTRY_MAX(Weapons)];
163 .float accuracy_hit[REGISTRY_MAX(Weapons)];
164 .float accuracy_cnt_hit[REGISTRY_MAX(Weapons)];
165 .float accuracy_cnt_fired[REGISTRY_MAX(Weapons)];
166
167 .int team;
168 .int team_size;
169 .int countrycode;
170
171 int binddb;
172
173 // Spectating
174 // -1 - observing
175 // 0 - playing
176 // >0 - id of spectated player
177 float spectatee_status;
178 float spectatee_status_changed_time;
179
180 #define player_currententnum (spectatee_status > 0 ? spectatee_status : player_localnum + 1)
181
182 // short mapname
183 string shortmapname;
184
185 // database for misc stuff
186 int tempdb;
187 int ClientProgsDB;
188 vector hook_shotorigin[4]; // WEAPONTODO
189 vector lightning_shotorigin[4]; // TODO: unused
190
191 float serverprevtime, serverdeltatime;
192
193 float ticrate;
194
195 int serverflags;