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