]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/constants.qh
Make it compile without XONOTIC defined
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / constants.qh
1 #pragma once
2
3 const int SPRITERULE_DEFAULT = 0;
4 const int SPRITERULE_TEAMPLAY = 1;
5 const int SPRITERULE_SPECTATOR = 2;
6
7 ///////////////////////////
8 // keys pressed
9 const int KEY_FORWARD = BIT(0);
10 const int KEY_BACKWARD = BIT(1);
11 const int KEY_LEFT = BIT(2);
12 const int KEY_RIGHT = BIT(3);
13 const int KEY_JUMP = BIT(4);
14 const int KEY_CROUCH = BIT(5);
15 const int KEY_ATCK = BIT(6);
16 const int KEY_ATCK2 = BIT(7);
17
18 ///////////////////////////
19 // cvar constants
20
21 const int CVAR_SAVE = 1;
22 const int CVAR_NOTIFY = 2;
23 const int CVAR_READONLY = 4;
24
25 ///////////////////////////
26 // csqc communication stuff
27
28 const int HUD_NORMAL = 0;
29 const int HUD_BUMBLEBEE_GUN = 25;
30
31 // moved that here so the client knows the max.
32 // # of maps, I'll use arrays for them :P
33 const int MAPVOTE_COUNT = 30;
34
35 /**
36  * Lower scores are better (e.g. suicides)
37  */
38 const int SFL_LOWER_IS_BETTER = BIT(0);
39
40 /**
41  * Don't show zero values as scores
42  */
43 const int SFL_HIDE_ZERO = BIT(1);
44
45 /**
46  * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
47  */
48 const int SFL_ALLOW_HIDE = BIT(4);
49
50 /**
51  * Display as a rank (with st, nd, rd, th suffix)
52  */
53 const int SFL_RANK = BIT(5);
54
55 /**
56  * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
57  */
58 const int SFL_TIME = BIT(6);
59
60 // not an extra constant yet
61 #define SFL_ZERO_IS_WORST SFL_TIME
62
63 /**
64  * Scoring priority (NOTE: PRIMARY is used for fraglimit)
65  */
66 const int SFL_SORT_PRIO_SECONDARY = 4;
67 const int SFL_SORT_PRIO_PRIMARY = 8;
68 const int SFL_SORT_PRIO_MASK = 12;
69
70 /*
71  * Score indices
72  */
73
74 #ifdef GAMEQC
75
76 #define IS_INCREASING(x) ( (x) & SFL_LOWER_IS_BETTER )
77 #define IS_DECREASING(x) ( !((x) & SFL_LOWER_IS_BETTER) )
78
79
80 #define MAX_SCORE 64
81
82 #define REGISTER_SP(id) REGISTER(Scores, SP, id, m_id, new_pure(PlayerScoreField))
83 REGISTRY(Scores, MAX_SCORE);
84 #define Scores_from(i) _Scores_from(i, NULL)
85 REGISTER_REGISTRY(Scores)
86 REGISTRY_SORT(Scores);
87 REGISTRY_CHECK(Scores);
88 STATIC_INIT(Scores_renumber) { FOREACH(Scores, true, it.m_id = i); }
89
90 USING(PlayerScoreField, entity);
91 .int _scores[MAX_SCORE];
92 .string m_name;
93 .int m_flags;
94
95 #define scores(this) _scores[(this).m_id]
96 #define scores_label(this) ((this).m_name)
97 #define scores_flags(this) ((this).m_flags)
98
99 REGISTER_SP(END);
100
101 REGISTER_SP(PING);
102 REGISTER_SP(PL);
103 REGISTER_SP(NAME);
104 REGISTER_SP(KDRATIO);
105 REGISTER_SP(SUM);
106
107 REGISTER_SP(SEPARATOR);
108
109 REGISTER_SP(SCORE);
110
111 REGISTER_SP(DMG);
112 REGISTER_SP(DMGTAKEN);
113
114 REGISTER_SP(KILLS);
115 REGISTER_SP(DEATHS);
116 REGISTER_SP(SUICIDES);
117 REGISTER_SP(FRAGS);
118
119 REGISTER_SP(ELO);
120
121 // TODO: move to common mutators
122
123 REGISTER_SP(RACE_TIME);
124 REGISTER_SP(RACE_LAPS);
125 REGISTER_SP(RACE_FASTEST);
126
127 //REGISTER_SP(CTS_TIME);
128 //REGISTER_SP(CTS_LAPS);
129 //REGISTER_SP(CTS_FASTEST);
130
131 REGISTER_SP(ASSAULT_OBJECTIVES);
132
133 REGISTER_SP(CTF_PICKUPS);
134 REGISTER_SP(CTF_FCKILLS);
135 REGISTER_SP(CTF_RETURNS);
136 REGISTER_SP(CTF_CAPS);
137 REGISTER_SP(CTF_CAPTIME);
138 REGISTER_SP(CTF_DROPS);
139
140 REGISTER_SP(DOM_TAKES);
141 REGISTER_SP(DOM_TICKS);
142
143 REGISTER_SP(FREEZETAG_REVIVALS);
144
145 REGISTER_SP(KEEPAWAY_PICKUPS);
146 REGISTER_SP(KEEPAWAY_BCTIME);
147 REGISTER_SP(KEEPAWAY_CARRIERKILLS);
148
149 REGISTER_SP(KH_PICKUPS);
150 REGISTER_SP(KH_CAPS);
151 REGISTER_SP(KH_KCKILLS);
152 REGISTER_SP(KH_PUSHES);
153 REGISTER_SP(KH_DESTROYS);
154 REGISTER_SP(KH_LOSSES);
155
156 REGISTER_SP(LMS_RANK);
157 REGISTER_SP(LMS_LIVES);
158
159 REGISTER_SP(NEXBALL_GOALS);
160 REGISTER_SP(NEXBALL_FAULTS);
161
162 REGISTER_SP(ONS_TAKES);
163 REGISTER_SP(ONS_CAPS);
164
165 #define MAX_TEAMSCORE 2
166 USING(ScoreTeam, string);
167 .int _teamscores[MAX_TEAMSCORE];
168 #define teamscores(i) _teamscores[i]
169 string _teamscores_label[MAX_TEAMSCORE];
170 #define teamscores_label(i) _teamscores_label[i]
171 int _teamscores_flags[MAX_TEAMSCORE];
172 #define teamscores_flags(i) _teamscores_flags[i]
173
174 #endif
175
176 const int ST_SCORE = 0;
177
178 // game mode specific indices are not in common/, but in server/scores_rules.qc!
179
180 // WEAPONTODO: move this into separate/new projectile handling code // this sets sounds and other properties of the projectiles in csqc
181 const int PROJECTILE_ELECTRO = 1;
182 const int PROJECTILE_ROCKET = 2;
183 const int PROJECTILE_TAG = 3;
184 const int PROJECTILE_CRYLINK = 5;
185 const int PROJECTILE_ELECTRO_BEAM = 6;
186 const int PROJECTILE_GRENADE = 7;
187 const int PROJECTILE_GRENADE_BOUNCING = 8;
188 const int PROJECTILE_MINE = 9;
189 const int PROJECTILE_BLASTER = 10;
190 const int PROJECTILE_HLAC = 11;
191 const int PROJECTILE_SEEKER = 12;
192 const int PROJECTILE_FLAC = 13;
193 const int PROJECTILE_PORTO_RED = 14;
194 const int PROJECTILE_PORTO_BLUE = 15;
195 const int PROJECTILE_HOOKBOMB = 16;
196 const int PROJECTILE_HAGAR = 17;
197 const int PROJECTILE_HAGAR_BOUNCING = 18;
198 const int PROJECTILE_CRYLINK_BOUNCING = 20;
199 const int PROJECTILE_FIREBALL = 21;
200 const int PROJECTILE_FIREMINE = 22;
201
202 const int PROJECTILE_RAPTORCANNON = 24;
203 const int PROJECTILE_RAPTORBOMB = 25;
204 const int PROJECTILE_RAPTORBOMBLET = 26;
205 const int PROJECTILE_SPIDERROCKET = 27;
206 const int PROJECTILE_WAKIROCKET = 28;
207 const int PROJECTILE_WAKICANNON = 29;
208
209 const int PROJECTILE_BUMBLE_GUN = 30;
210 const int PROJECTILE_BUMBLE_BEAM = 31;
211
212 const int PROJECTILE_MAGE_SPIKE = 32;
213 const int PROJECTILE_SHAMBLER_LIGHTNING = 33;
214
215 const int PROJECTILE_ROCKETMINSTA_LASER = 34;
216
217 const int PROJECTILE_ARC_BOLT = 35;
218
219 // projectile IDs 40-50 reserved
220
221 const int PROJECTILE_RPC = 60;
222
223 const int SPECIES_HUMAN = 0;
224 const int SPECIES_ROBOT_SOLID = 1;
225 const int SPECIES_ALIEN = 2;
226 const int SPECIES_ANIMAL = 3;
227 const int SPECIES_ROBOT_RUSTY = 4;
228 const int SPECIES_ROBOT_SHINY = 5;
229 const int SPECIES_RESERVED = 15;
230
231 const int FRAGS_PLAYER = 0;
232 const int FRAGS_SPECTATOR = -666;
233 const int FRAGS_LMS_LOSER = -616;
234 const int FRAGS_PLAYER_NONSOLID = -616;
235 // we can use this frags value for both
236
237 // water levels
238 const int WATERLEVEL_NONE = 0;
239 const int WATERLEVEL_WETFEET = 1;
240 const int WATERLEVEL_SWIMMING = 2;
241 const int WATERLEVEL_SUBMERGED = 3;
242
243 // server flags
244 const int SERVERFLAG_ALLOW_FULLBRIGHT = 1;
245 const int SERVERFLAG_TEAMPLAY = 2;
246 const int SERVERFLAG_PLAYERSTATS = 4;
247
248 // FIXME/EXPLAINME: why? Mario: because
249 vector autocvar_sv_player_maxs = '16 16 45';
250 vector autocvar_sv_player_mins = '-16 -16 -24';
251 vector autocvar_sv_player_viewoffset = '0 0 20';
252 vector autocvar_sv_player_crouch_maxs = '16 16 25';
253 vector autocvar_sv_player_crouch_mins = '-16 -16 -24';
254 vector autocvar_sv_player_crouch_viewoffset = '0 0 20';
255 vector autocvar_sv_player_headsize = '24 24 12';
256
257
258 // a bit more constant
259 const vector PL_MAX_CONST = '16 16 45';
260 const vector PL_MIN_CONST = '-16 -16 -24';
261
262 // spawnpoint prios
263 const int SPAWN_PRIO_NEAR_TEAMMATE_FOUND = 200;
264 const int SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM = 100;
265 const int SPAWN_PRIO_RACE_PREVIOUS_SPAWN = 50;
266 const int SPAWN_PRIO_GOOD_DISTANCE = 10;
267
268 // gametype vote flags
269 const int GTV_FORBIDDEN = 0; // Cannot be voted
270 const int GTV_AVAILABLE = 1; // Can be voted
271 const int GTV_CUSTOM    = 2; // Custom entry