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