]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/constants.qh
Merge branch 'terencehill/csqc_cursor' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / constants.qh
1 #ifndef CONSTANTS_H
2 #define CONSTANTS_H
3
4 // COMMIT-TODO: Update if necessary before committing
5 // Revision 1: additional statistics sent (flag caps, returns, deaths)
6 // Revision 2: Mapvote preview pictures
7 // Revision 3: optimized map vote protocol
8 // Revision 4: CSQC config var system
9 // Revision 5: mapvote time fix
10 // Revision 6: more robust against packet loss/delays, also show not yet connected clients
11 // Revision 7: packet loss column
12 // Revision 8: race
13 // Revision 9: race delta
14 // Revision 10: scoreboard force
15 // Revision 11: scoreboard unforce; spectator support beginning
16 // Revision 12: smaller scores updates (SERVER: requires new engine)
17 // Revision 13: pointparticles
18 // Revision 14: laser
19 // Revision 15: zoom
20 // Revision 16: multi-weapons
21 // Revision 17: multi-weaponimpulses
22 // Revision 18: warmup
23 // Revision 19: fog
24 // Revision 20: naggers
25 // Revision 21: entcs for players optimized (position data down from 12 to 7 bytes); waypointsprites in csqc for team radar
26 // Revision 22: hook shot origin
27 #define CSQC_REVISION 22
28
29 REGISTER_NET_TEMP(TE_CSQC_PICTURE)
30 REGISTER_NET_TEMP(TE_CSQC_RACE)
31 REGISTER_NET_TEMP(TE_CSQC_TEAMNAGGER)
32 REGISTER_NET_TEMP(TE_CSQC_PINGPLREPORT)
33 REGISTER_NET_TEMP(TE_CSQC_WEAPONCOMPLAIN)
34 REGISTER_NET_TEMP(TE_CSQC_VEHICLESETUP)
35
36 const int RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
37 const int RACE_NET_CHECKPOINT_CLEAR = 1;
38 const int RACE_NET_CHECKPOINT_NEXT_QUALIFYING = 2; // byte nextcheckpoint, short recordtime, string recordholder
39 const int RACE_NET_CHECKPOINT_HIT_RACE = 3; // byte checkpoint, short delta, byte lapsdelta, string opponent
40 const int RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT = 4; // byte checkpoint, short delta, byte lapsdelta, string opponent
41 const int RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING = 5; // byte nextcheckpoint, float laptime, short recordtime, string recordholder
42 const int RACE_NET_PENALTY_RACE = 6; // byte penaltytime, string reason
43 const int RACE_NET_PENALTY_QUALIFYING = 7; // byte penaltytime, string reason
44 const int RACE_NET_SERVER_RECORD = 8; // server record, sent to client
45 const int RACE_NET_SPEED_AWARD = 9; // speed award, sent to client
46 const int RACE_NET_SPEED_AWARD_BEST = 10; // all time best speed award, sent to client
47 const int RACE_NET_SERVER_RANKINGS = 11;
48 const int RACE_NET_SERVER_STATUS = 12;
49 const int RANKINGS_CNT = 15;
50
51 REGISTER_NET_LINKED(_ENT_CLIENT_INIT)
52 #ifdef CSQC
53 NET_HANDLE(_ENT_CLIENT_INIT, bool isnew) { return true; }
54 #endif
55 /** Sent as a temp entity from a persistent linked entity */
56 REGISTER_NET_TEMP(ENT_CLIENT_INIT)
57
58 REGISTER_NET_LINKED(ENT_CLIENT_SCORES_INFO)
59 REGISTER_NET_LINKED(ENT_CLIENT_SCORES)
60 REGISTER_NET_LINKED(ENT_CLIENT_TEAMSCORES)
61 REGISTER_NET_LINKED(ENT_CLIENT_NAGGER) // flags [votecalledvote]
62 REGISTER_NET_LINKED(ENT_CLIENT_RADARLINK) // flags [startorigin] [endorigin] [startcolor+16*endcolor]
63 REGISTER_NET_LINKED(ENT_CLIENT_PROJECTILE)
64 REGISTER_NET_LINKED(ENT_CLIENT_MAPVOTE)
65 REGISTER_NET_LINKED(ENT_CLIENT_CLIENTDATA)
66 REGISTER_NET_LINKED(ENT_CLIENT_RANDOMSEED)
67 REGISTER_NET_LINKED(ENT_CLIENT_ACCURACY)
68 REGISTER_NET_LINKED(ENT_CLIENT_ELIMINATEDPLAYERS)
69
70 REGISTER_NET_LINKED(ENT_CLIENT_MODEL)
71
72 REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE)
73 REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE_CAMERA)
74 REGISTER_NET_LINKED(ENT_CLIENT_WARPZONE_TELEPORTED)
75
76 REGISTER_NET_LINKED(ENT_CLIENT_ARC_BEAM)
77 REGISTER_NET_LINKED(ENT_CLIENT_HOOK)
78 REGISTER_NET_LINKED(ENT_CLIENT_TUBANOTE)
79
80 REGISTER_NET_LINKED(ENT_CLIENT_SPAWNPOINT)
81 REGISTER_NET_LINKED(ENT_CLIENT_SPAWNEVENT)
82 REGISTER_NET_LINKED(ENT_CLIENT_WALL)
83
84 const int SPRITERULE_DEFAULT = 0;
85 const int SPRITERULE_TEAMPLAY = 1;
86 const int SPRITERULE_SPECTATOR = 2;
87
88 ///////////////////////////
89 // keys pressed
90 const int KEY_FORWARD = BIT(0);
91 const int KEY_BACKWARD = BIT(1);
92 const int KEY_LEFT = BIT(2);
93 const int KEY_RIGHT = BIT(3);
94 const int KEY_JUMP = BIT(4);
95 const int KEY_CROUCH = BIT(5);
96 const int KEY_ATCK = BIT(6);
97 const int KEY_ATCK2 = BIT(7);
98
99 ///////////////////////////
100 // cvar constants
101
102 const int CVAR_SAVE = 1;
103 const int CVAR_NOTIFY = 2;
104 const int CVAR_READONLY = 4;
105
106 ///////////////////////////
107 // csqc communication stuff
108
109 const int HUD_NORMAL = 0;
110 const int HUD_BUMBLEBEE_GUN = 25;
111
112 // moved that here so the client knows the max.
113 // # of maps, I'll use arrays for them :P
114 const int MAPVOTE_COUNT = 30;
115
116 /**
117  * Lower scores are better (e.g. suicides)
118  */
119 const int SFL_LOWER_IS_BETTER = BIT(0);
120
121 /**
122  * Don't show zero values as scores
123  */
124 const int SFL_HIDE_ZERO = BIT(1);
125
126 /**
127  * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
128  */
129 const int SFL_ALLOW_HIDE = BIT(4);
130
131 /**
132  * Display as a rank (with st, nd, rd, th suffix)
133  */
134 const int SFL_RANK = BIT(5);
135
136 /**
137  * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
138  */
139 const int SFL_TIME = BIT(6);
140
141 // not an extra constant yet
142 #define SFL_ZERO_IS_WORST SFL_TIME
143
144 /**
145  * Scoring priority (NOTE: PRIMARY is used for fraglimit)
146  */
147 const int SFL_SORT_PRIO_SECONDARY = 4;
148 const int SFL_SORT_PRIO_PRIMARY = 8;
149 const int SFL_SORT_PRIO_MASK = 12;
150
151 /**
152  * Score indices
153  */
154 #define MAX_SCORE 12
155 #define MAX_TEAMSCORE 2
156
157 const int ST_SCORE = 0;
158 const int SP_KILLS = 0;
159 const int SP_DEATHS = 1;
160 const int SP_SUICIDES = 2;
161 const int SP_SCORE = 3;
162 const int SP_DMG = 10;
163 const int SP_DMGTAKEN = 11;
164 // game mode specific indices are not in common/, but in server/scores_rules.qc!
165
166 // WEAPONTODO: move this into separate/new projectile handling code // this sets sounds and other properties of the projectiles in csqc
167 const int PROJECTILE_ELECTRO = 1;
168 const int PROJECTILE_ROCKET = 2;
169 const int PROJECTILE_TAG = 3;
170 const int PROJECTILE_CRYLINK = 5;
171 const int PROJECTILE_ELECTRO_BEAM = 6;
172 const int PROJECTILE_GRENADE = 7;
173 const int PROJECTILE_GRENADE_BOUNCING = 8;
174 const int PROJECTILE_MINE = 9;
175 const int PROJECTILE_BLASTER = 10;
176 const int PROJECTILE_HLAC = 11;
177 const int PROJECTILE_SEEKER = 12;
178 const int PROJECTILE_FLAC = 13;
179 const int PROJECTILE_PORTO_RED = 14;
180 const int PROJECTILE_PORTO_BLUE = 15;
181 const int PROJECTILE_HOOKBOMB = 16;
182 const int PROJECTILE_HAGAR = 17;
183 const int PROJECTILE_HAGAR_BOUNCING = 18;
184 const int PROJECTILE_CRYLINK_BOUNCING = 20;
185 const int PROJECTILE_FIREBALL = 21;
186 const int PROJECTILE_FIREMINE = 22;
187
188 const int PROJECTILE_RAPTORCANNON = 24;
189 const int PROJECTILE_RAPTORBOMB = 25;
190 const int PROJECTILE_RAPTORBOMBLET = 26;
191 const int PROJECTILE_SPIDERROCKET = 27;
192 const int PROJECTILE_WAKIROCKET = 28;
193 const int PROJECTILE_WAKICANNON = 29;
194
195 const int PROJECTILE_BUMBLE_GUN = 30;
196 const int PROJECTILE_BUMBLE_BEAM = 31;
197
198 const int PROJECTILE_MAGE_SPIKE = 32;
199 const int PROJECTILE_SHAMBLER_LIGHTNING = 33;
200
201 const int PROJECTILE_ROCKETMINSTA_LASER = 34;
202
203 const int PROJECTILE_ARC_BOLT = 35;
204
205 // projectile IDs 40-50 reserved
206
207 const int PROJECTILE_RPC = 60;
208
209 const int SPECIES_HUMAN = 0;
210 const int SPECIES_ROBOT_SOLID = 1;
211 const int SPECIES_ALIEN = 2;
212 const int SPECIES_ANIMAL = 3;
213 const int SPECIES_ROBOT_RUSTY = 4;
214 const int SPECIES_ROBOT_SHINY = 5;
215 const int SPECIES_RESERVED = 15;
216
217 const int FRAGS_PLAYER = 0;
218 const int FRAGS_SPECTATOR = -666;
219 const int FRAGS_LMS_LOSER = -616;
220 const int FRAGS_PLAYER_NONSOLID = -616;
221 // we can use this frags value for both
222
223 // water levels
224 const int WATERLEVEL_NONE = 0;
225 const int WATERLEVEL_WETFEET = 1;
226 const int WATERLEVEL_SWIMMING = 2;
227 const int WATERLEVEL_SUBMERGED = 3;
228
229 // server flags
230 const int SERVERFLAG_ALLOW_FULLBRIGHT = 1;
231 const int SERVERFLAG_TEAMPLAY = 2;
232 const int SERVERFLAG_PLAYERSTATS = 4;
233
234 // FIXME/EXPLAINME: why? Mario: because
235 vector autocvar_sv_player_maxs = '16 16 45';
236 vector autocvar_sv_player_mins = '-16 -16 -24';
237 vector autocvar_sv_player_viewoffset = '0 0 20';
238 vector autocvar_sv_player_crouch_maxs = '16 16 25';
239 vector autocvar_sv_player_crouch_mins = '-16 -16 -24';
240 vector autocvar_sv_player_crouch_viewoffset = '0 0 20';
241 vector autocvar_sv_player_headsize = '24 24 12';
242
243
244 // a bit more constant
245 const vector PL_MAX_CONST = '16 16 45';
246 const vector PL_MIN_CONST = '-16 -16 -24';
247
248 // spawnpoint prios
249 const int SPAWN_PRIO_NEAR_TEAMMATE_FOUND = 200;
250 const int SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM = 100;
251 const int SPAWN_PRIO_RACE_PREVIOUS_SPAWN = 50;
252 const int SPAWN_PRIO_GOOD_DISTANCE = 10;
253
254 // gametype vote flags
255 const int GTV_FORBIDDEN = 0; // Cannot be voted
256 const int GTV_AVAILABLE = 1; // Can be voted
257 const int GTV_CUSTOM    = 2; // Custom entry
258 #endif