]> git.mxchange.org Git - quix0rs-blobwars.git/blob - src/defs.h
Fix posting medals to the medal server.
[quix0rs-blobwars.git] / src / defs.h
1 /*
2 Copyright (C) 2004-2010 Parallel Realities
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19 */
20
21 // Read in the define list used by the map data also
22 #include "defines.h"
23
24 #define min(a, b) ((a) < (b) ? (a) : (b))
25 #define max(a, b) ((a) > (b) ? (a) : (b))
26
27 #define PI 3.14159265359
28
29 /* ############## errors ########### */
30
31 #define ERR_FILE                "A required file (%s) was not found in PAK file"
32 #define ERR_LOCALE      "Locale information missing for section '%s' (contains only partial translation)"
33
34 /* ########### maximums ############ */
35
36 #define MAX_SOUNDS              75
37 #define MAX_TILES               256
38 #define MAX_WEAPONS     25
39 #define MAX_ITEMS               25
40 #define MAX_ENEMIES             25
41
42 #define MAX_HEALTH              10
43
44 #define MAX_FPS                 62
45
46 /* ########### dead flags ############ */
47
48 #define DEAD_ALIVE      0
49 #define DEAD_DYING      1
50 #define DEAD_DEAD       2
51
52 /* ########### game sections ######## */
53
54 #define SECTION_INTRO           0
55 #define SECTION_TITLE           1
56 #define SECTION_HUB             2
57 #define SECTION_GAME            3
58 #define SECTION_GAMEOVER        4
59 #define SECTION_CREDITS         5
60 #define SECTION_EASYOVER        6
61
62 /* ############ sounds ############ */
63
64
65
66 enum {
67         
68         SND_WATERIN,
69         SND_WATEROUT,
70         SND_ITEM,
71         SND_PISTOL,
72         SND_RICO1,
73         SND_RICO2,
74         SND_MACHINEGUN,
75         SND_DEATH1,
76         SND_DEATH2,
77         SND_DEATH3,
78         SND_GRENADE,
79         SND_ROCKET,
80         SND_FIREBALL,
81         SND_HIT,
82         SND_SPLAT,
83         SND_TELEPORT1,
84         SND_TELEPORT2,
85         SND_TELEPORT3,
86         SND_GETWEAPON,
87         SND_LASER,
88         SND_ELECDEATH1,
89         SND_ELECDEATH2,
90         SND_ELECDEATH3,
91         SND_LOCKEDDOOR,
92         SND_OPENDOOR,
93         SND_SWITCH1,
94         SND_SWITCH2,
95         SND_DROWNING,
96         SND_AMBIANCE,
97         SND_GULP,
98         SND_EAT,
99         SND_THROW,
100         SND_GRBOUNCE,
101         SND_DOOROPENED,
102         SND_SPREADGUN,
103         SND_ELECTRICITY1,
104         SND_ELECTRICITY2,
105         SND_ELECTRICITY3,
106         SND_CLANG,
107         SND_FIRECRACKLE,
108         SND_CLOCK,
109         SND_BOSSCUSTOM1,
110         SND_BOSSCUSTOM2,
111         SND_BOSSCUSTOM3,
112         SND_BOSSCUSTOM4,
113         SND_BOSSCUSTOM5,
114         SND_POP,
115         SND_STONEBREAK,
116         SND_CHEAT = MAX_SOUNDS - 3,
117         SND_HIGHLIGHT = MAX_SOUNDS - 2,
118         SND_SELECT = MAX_SOUNDS - 1
119
120 };
121
122 /* ########### channels ########### */
123
124 #define CH_ANY                  -1
125 #define CH_WEAPON               0
126 #define CH_ITEM                 1
127 #define CH_EXPLODE              3
128 #define CH_DEATH                4
129 #define CH_TOUCH                5
130 #define CH_AMBIANCE             6
131 #define CH_SPAWN                7
132
133 /* ########## keyboard ############# */
134
135 struct CONTROL
136 {
137         enum TYPE
138         {
139                 UP,
140                 DOWN,
141                 LEFT,
142                 RIGHT,
143                 FIRE,
144                 JUMP,
145                 MAP,
146                 PAUSE,
147                 JETPACK,
148                 MAX
149         };
150 };
151
152 /* ############ replay ############ */
153
154 struct REPLAY_MODE
155 {
156         enum TYPE
157         {
158                 NONE,
159                 RECORD,
160                 PLAYBACK
161         };
162 };
163
164 /* ########### widgets ############ */
165
166 const char widgetName[][25] = {
167
168         "BUTTON",
169         "RADIO",
170         "SMOOTH_SLIDER",
171         "SLIDER",
172         "LABEL",
173         "KEYBOARD",
174         "JOYPAD",
175         "-1"
176
177 };
178
179 #define WG_BUTTON                               0
180 #define WG_RADIO                                1
181 #define WG_SMOOTH_SLIDER                2
182 #define WG_SLIDER                               3
183 #define WG_LABEL                                4
184 #define WG_KEYBOARD                             5
185 #define WG_JOYPAD                               6
186
187 /* ############## skill ############# */
188
189 const char skill[][10] = {
190
191         "Easy",
192         "Normal",
193         "Hard",
194         "Extreme"
195
196 };
197
198 /* ############## text ############## */
199
200 #define TXT_LEFT                0
201 #define TXT_CENTERED    1
202 #define TXT_RIGHT               2
203
204 #define INFO_NORMAL                     0
205 #define INFO_OBJECTIVE          1
206 #define INFO_HINT                       2
207 #define INFO_ACTIVATE           3
208 #define INFO_BAD                        4
209
210 /* ########## weapons ############# */
211
212 #define WP_PISTOL                       0
213 #define WP_MACHINEGUN           1
214 #define WP_LASER                        2
215 #define WP_GRENADES             3
216 #define WP_SPREAD                       4
217
218 #define WP_ROCKETS                      5
219 #define WP_PLASMARIFLE          6
220 #define WP_FLAMETHROWER         7
221 #define WP_ICEGUN                       8
222 #define WP_LAVABALL1            9
223 #define WP_LAVABALL2            10
224 #define WP_AIMEDPISTOL          11
225 #define WP_ALIENSPREAD          12
226 #define WP_SHELLS                       13
227 #define WP_ROCK1                        14
228 #define WP_STALAGTITE           15
229 #define WP_BOMB                         16
230 #define WP_ALIENLASER           17
231 #define WP_ALIENGRENADE         18
232 #define WP_AIMEDMACHINE         19
233
234 /* ########### entity defs ######### */
235
236 #define OBJ_UP          0
237 #define OBJ_DOWN        1
238 #define OBJ_LEFT        2
239 #define OBJ_RIGHT       3
240
241 #define ENV_AIR         0
242 #define ENV_WATER       1
243 #define ENV_SLIME       2
244 #define ENV_LAVA        3
245
246 #define PLAYER_WALK_SPEED       4
247 #define PLAYER_FLY_SPEED        8
248 #define PLAYER_JUMP_SPEED       -10.25
249
250 /* ######### paticle flags ########### */
251
252 #define PAR_WEIGHTLESS  1
253 #define PAR_COLLIDES    2
254
255 /* ######### effect flags ########### */
256
257 #define EFF_BLEEDS              1
258 #define EFF_TRAILSFIRE  2
259 #define EFF_SMOKES              4
260 #define EFF_WEIGHTLESS  8
261 #define EFF_COLORED             16
262
263 /* ########## item defs ############ */
264
265 enum {
266
267         ITEM_PISTOL,
268         ITEM_MACHINEGUN,
269         ITEM_LASER,
270         ITEM_GRENADES,
271         ITEM_SPREAD,
272         ITEM_CHERRY,
273         ITEM_DOUBLECHERRY,
274         ITEM_TRIPLECHERRY,
275         ITEM_POINTS,
276         ITEM_POINTS2,
277         ITEM_POINTS3,
278         ITEM_POINTS4,
279         ITEM_POINTS5,
280         ITEM_POINTS6,
281         ITEM_POINTS7,
282         ITEM_MISC = 100,
283         ITEM_MISC_NOSHOW,
284         ITEM_MISC_INVISIBLE
285
286 };
287
288 /* ########### map ############ */
289
290 #define MAPWIDTH        400
291 #define MAPHEIGHT       300
292 #define BRICKSIZE       32
293 #define BRICKSHIFT      5
294
295 #define OFFSETX 320
296 #define OFFSETY 240
297
298 #define MAP_AIR                 0
299 #define MAP_WATER               1
300 #define MAP_SLIME               2
301 #define MAP_LAVA                3
302 #define MAP_BREAKABLE   4
303 #define MAP_BREAKABLE2  8
304 #define MAP_SOLID               9
305 #define MAP_NORESET             115
306 #define MAP_DECORATION  120
307 #define MAP_EXITSIGN    196
308 #define MAP_WATERANIM   200
309 #define MAP_SLIMEANIM   207
310 #define MAP_LAVAANIM    214
311 #define MAP_TOPLAYER    221
312
313 #define MAP_AIR_WALL_1  127
314 #define MAP_AIR_WALL_2  129
315 #define MAP_AIR_CEILING_1       242
316 #define MAP_AIR_WALL_3  243
317 #define MAP_AIR_WALL_4  244
318 #define MAP_AIR_CEILING_2       247
319
320 #define MAP_WATER_WALL  246
321
322 #define MAP_SHAKEAMOUNT 2
323
324 /* ########### mia stuff ############## */
325
326 #define MIAPERCENT 0.70
327
328 /* ########### mission stuff ############ */
329
330 #define MIS_INPROGRESS          0
331 #define MIS_COMPLETE            1
332 #define MIS_PLAYEROUT           2
333 #define MIS_PLAYERDEAD          3
334 #define MIS_PLAYERQUIT          4
335 #define MIS_PLAYERESCAPE        5
336 #define MIS_GAMECOMPLETE        6
337 #define MIS_TIMEUP                      7
338 #define MIS_PLAYERRESTART       8
339
340 /* ########### pak file stuff ######## */
341
342 #define PAK_MAX_FILENAME        60
343
344 #ifndef USEPAK
345         #define USEPAK 1
346 #endif
347 #ifndef PAKLOCATION
348         #define PAKLOCATION ""
349 #endif
350 #ifndef PAKNAME
351         #define PAKNAME "blobwars.pak"
352 #endif
353 #ifndef PAKFULLPATH
354         #define PAKFULLPATH PAKLOCATION PAKNAME
355 #endif
356 #ifndef PATH_MAX
357         #define PATH_MAX        4096
358 #endif
359 #ifndef GAMEPLAYMANUAL
360         #define GAMEPLAYMANUAL "manual.html"
361 #endif
362 #ifndef MEDAL_SERVER_HOST
363         #define MEDAL_SERVER_HOST "localhost"
364 #endif
365 #ifndef MEDAL_SERVER_PORT
366         #define MEDAL_SERVER_PORT 80
367 #endif
368
369 enum {
370
371         PAK_IMG,
372         PAK_SOUND,
373         PAK_MUSIC,
374         PAK_DATA,
375         PAK_FONT,
376         PAK_TAGS
377 };
378
379 /* ############# debug ################## */
380
381 #if DEBUG
382         #define debug(x) {printf("*** DEBUG: "); printf x;}
383 #else
384         #define debug(x) {}
385 #endif
386
387 #ifndef IGNORE_FLAGTOKEN_ERRORS
388         #define IGNORE_FLAGTOKEN_ERRORS 0
389 #endif
390