3 const int SPRITERULE_DEFAULT = 0;
4 const int SPRITERULE_TEAMPLAY = 1;
5 const int SPRITERULE_SPECTATOR = 2;
7 ///////////////////////////
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);
18 ///////////////////////////
21 const int CVAR_SAVE = 1;
22 const int CVAR_NOTIFY = 2;
23 const int CVAR_READONLY = 4;
25 ///////////////////////////
26 // csqc communication stuff
28 const int HUD_NORMAL = 0;
29 const int HUD_BUMBLEBEE_GUN = 25;
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;
36 * Lower scores are better (e.g. suicides)
38 const int SFL_LOWER_IS_BETTER = BIT(0);
41 * Don't show zero values as scores
43 const int SFL_HIDE_ZERO = BIT(1);
46 * Allow a column to be hidden (do not automatically add it even if it is a sorting key)
48 const int SFL_ALLOW_HIDE = BIT(4);
51 * Display as a rank (with st, nd, rd, th suffix)
53 const int SFL_RANK = BIT(5);
56 * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!)
58 const int SFL_TIME = BIT(6);
60 // not an extra constant yet
61 #define SFL_ZERO_IS_WORST SFL_TIME
64 * Scoring priority (NOTE: PRIMARY is used for fraglimit)
66 const int SFL_SORT_PRIO_SECONDARY = 4;
67 const int SFL_SORT_PRIO_PRIMARY = 8;
68 const int SFL_SORT_PRIO_MASK = 12;
76 #define IS_INCREASING(x) ( (x) & SFL_LOWER_IS_BETTER )
77 #define IS_DECREASING(x) ( !((x) & SFL_LOWER_IS_BETTER) )
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); }
90 USING(PlayerScoreField, entity);
91 .int _scores[MAX_SCORE];
95 #define scores(this) _scores[(this).m_id]
96 #define scores_label(this) ((this).m_name)
97 #define scores_flags(this) ((this).m_flags)
104 REGISTER_SP(KDRATIO);
107 REGISTER_SP(SEPARATOR);
112 REGISTER_SP(DMGTAKEN);
116 REGISTER_SP(SUICIDES);
121 // TODO: move to common mutators
123 REGISTER_SP(RACE_TIME);
124 REGISTER_SP(RACE_LAPS);
125 REGISTER_SP(RACE_FASTEST);
127 //REGISTER_SP(CTS_TIME);
128 //REGISTER_SP(CTS_LAPS);
129 //REGISTER_SP(CTS_FASTEST);
131 REGISTER_SP(ASSAULT_OBJECTIVES);
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);
140 REGISTER_SP(DOM_TAKES);
141 REGISTER_SP(DOM_TICKS);
143 REGISTER_SP(FREEZETAG_REVIVALS);
145 REGISTER_SP(KEEPAWAY_PICKUPS);
146 REGISTER_SP(KEEPAWAY_BCTIME);
147 REGISTER_SP(KEEPAWAY_CARRIERKILLS);
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);
156 REGISTER_SP(LMS_RANK);
157 REGISTER_SP(LMS_LIVES);
159 REGISTER_SP(NEXBALL_GOALS);
160 REGISTER_SP(NEXBALL_FAULTS);
162 REGISTER_SP(ONS_TAKES);
163 REGISTER_SP(ONS_CAPS);
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]
176 const int ST_SCORE = 0;
178 // game mode specific indices are not in common/, but in server/scores_rules.qc!
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;
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;
209 const int PROJECTILE_BUMBLE_GUN = 30;
210 const int PROJECTILE_BUMBLE_BEAM = 31;
212 const int PROJECTILE_MAGE_SPIKE = 32;
213 const int PROJECTILE_SHAMBLER_LIGHTNING = 33;
215 const int PROJECTILE_ROCKETMINSTA_LASER = 34;
217 const int PROJECTILE_ARC_BOLT = 35;
219 // projectile IDs 40-50 reserved
221 const int PROJECTILE_RPC = 60;
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;
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
238 const int WATERLEVEL_NONE = 0;
239 const int WATERLEVEL_WETFEET = 1;
240 const int WATERLEVEL_SWIMMING = 2;
241 const int WATERLEVEL_SUBMERGED = 3;
244 const int SERVERFLAG_ALLOW_FULLBRIGHT = 1;
245 const int SERVERFLAG_TEAMPLAY = 2;
246 const int SERVERFLAG_PLAYERSTATS = 4;
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';
258 // a bit more constant
259 const vector PL_MAX_CONST = '16 16 45';
260 const vector PL_MIN_CONST = '-16 -16 -24';
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;
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