3 const int RANKINGS_CNT = 15;
5 const int SPRITERULE_DEFAULT = 0;
6 const int SPRITERULE_TEAMPLAY = 1;
7 const int SPRITERULE_SPECTATOR = 2;
9 ///////////////////////////
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);
20 ///////////////////////////
23 const int CVAR_SAVE = 1;
24 const int CVAR_NOTIFY = 2;
25 const int CVAR_READONLY = 4;
27 ///////////////////////////
28 // csqc communication stuff
30 const int HUD_NORMAL = 0;
31 const int HUD_BUMBLEBEE_GUN = 25;
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;
38 * Lower scores are better (e.g. suicides)
40 const int SFL_LOWER_IS_BETTER = BIT(0);
43 * Don't show zero values as scores
45 const int SFL_HIDE_ZERO = BIT(1);
48 * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
50 const int SFL_ALLOW_HIDE = BIT(4);
53 * Display as a rank (with st, nd, rd, th suffix)
55 const int SFL_RANK = BIT(5);
58 * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
60 const int SFL_TIME = BIT(6);
62 // not an extra constant yet
63 #define SFL_ZERO_IS_WORST SFL_TIME
66 * Scoring priority (NOTE: PRIMARY is used for fraglimit)
68 const int SFL_SORT_PRIO_SECONDARY = 4;
69 const int SFL_SORT_PRIO_PRIMARY = 8;
70 const int SFL_SORT_PRIO_MASK = 12;
78 #define IS_INCREASING(x) ( (x) & SFL_LOWER_IS_BETTER )
79 #define IS_DECREASING(x) ( !((x) & SFL_LOWER_IS_BETTER) )
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); }
92 USING(PlayerScoreField, entity);
93 .int _scores[MAX_SCORE];
97 #define scores(this) _scores[(this).m_id]
98 #define scores_label(this) ((this).m_name)
99 #define scores_flags(this) ((this).m_flags)
106 REGISTER_SP(KDRATIO);
109 REGISTER_SP(SEPARATOR);
114 REGISTER_SP(DMGTAKEN);
118 REGISTER_SP(SUICIDES);
123 // TODO: move to common mutators
125 REGISTER_SP(RACE_TIME);
126 REGISTER_SP(RACE_LAPS);
127 REGISTER_SP(RACE_FASTEST);
129 //REGISTER_SP(CTS_TIME);
130 //REGISTER_SP(CTS_LAPS);
131 //REGISTER_SP(CTS_FASTEST);
133 REGISTER_SP(ASSAULT_OBJECTIVES);
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);
142 REGISTER_SP(DOM_TAKES);
143 REGISTER_SP(DOM_TICKS);
145 REGISTER_SP(FREEZETAG_REVIVALS);
147 REGISTER_SP(KEEPAWAY_PICKUPS);
148 REGISTER_SP(KEEPAWAY_BCTIME);
149 REGISTER_SP(KEEPAWAY_CARRIERKILLS);
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);
158 REGISTER_SP(LMS_RANK);
159 REGISTER_SP(LMS_LIVES);
161 REGISTER_SP(NEXBALL_GOALS);
162 REGISTER_SP(NEXBALL_FAULTS);
164 REGISTER_SP(ONS_TAKES);
165 REGISTER_SP(ONS_CAPS);
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]
178 const int ST_SCORE = 0;
180 // game mode specific indices are not in common/, but in server/scores_rules.qc!
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;
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;
211 const int PROJECTILE_BUMBLE_GUN = 30;
212 const int PROJECTILE_BUMBLE_BEAM = 31;
214 const int PROJECTILE_MAGE_SPIKE = 32;
215 const int PROJECTILE_SHAMBLER_LIGHTNING = 33;
217 const int PROJECTILE_ROCKETMINSTA_LASER = 34;
219 const int PROJECTILE_ARC_BOLT = 35;
221 // projectile IDs 40-50 reserved
223 const int PROJECTILE_RPC = 60;
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;
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
240 const int WATERLEVEL_NONE = 0;
241 const int WATERLEVEL_WETFEET = 1;
242 const int WATERLEVEL_SWIMMING = 2;
243 const int WATERLEVEL_SUBMERGED = 3;
246 const int SERVERFLAG_ALLOW_FULLBRIGHT = 1;
247 const int SERVERFLAG_TEAMPLAY = 2;
248 const int SERVERFLAG_PLAYERSTATS = 4;
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';
262 // a bit more constant
263 const vector PL_MAX_CONST = '16 16 45';
264 const vector PL_MIN_CONST = '-16 -16 -24';
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;
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