1 /*
2 Copyright (C) 2003 Parallel Realities
3 Copyright (C) 2011, 2012 Guus Sliepen
4 Copyright (C) 2012, 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
5 
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 3
9 of the License, or (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 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, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef DEFS_H
21 #define DEFS_H
22 
23 
24 // Macros
25 #define LIMIT(x, a, b) x = ((x) < (b) ? ((x) > (a) ? (x) : (a)) : (b))
26 #define LIMIT_ADD(x, y, a, b) x = (((x) + (y)) < (b) ? \
27 	(((x) + (y)) > (a) ? \
28 		((x) + (y)) : (a)) : (b))
29 #define WRAP_ADD(x, y, a, b) x = (((x) + (y)) + \
30 	((x) + (y) < (a) ? ((b) - (a)) : 0) + \
31 	((x) + (y) > (b) ? ((a) - (b)) : 0))
32 #define CHANCE(x) ((rand() % RAND_MAX) < ((x) * RAND_MAX))
33 #define RANDRANGE(x, y) (((x) < (y)) ? ((x) + (rand() % (long)(1 + (y) - (x)))) : (x))
34 #define DRAND ((double)rand() / RAND_MAX)
35 #define _(s) gettext(s)
36 #define CSDLP(x) (((x) == SDL_PRESSED) ? 1 : 0)
37 
38 // A soft dependency defines these as well, so check if they are
39 // defined before defining (avoids compiler warnings)
40 #ifndef MIN
41 #define MIN(a, b) ((a) < (b) ? (a) : (b))
42 #endif
43 
44 #ifndef MAX
45 #define MAX(a, b) ((a) > (b) ? (a) : (b))
46 #endif
47 
48 
49 // Compile-time options
50 #ifndef VERSION
51 #define VERSION "???"
52 #endif
53 
54 #ifndef DATADIR
55 #define DATADIR "."
56 #endif
57 
58 #ifndef SCREEN_WIDTH
59 #define SCREEN_WIDTH 800
60 #endif
61 
62 #ifndef SCREEN_HEIGHT
63 #define SCREEN_HEIGHT 600
64 #endif
65 
66 #ifndef PATH_MAX
67 #define PATH_MAX 4096
68 #endif
69 
70 #define STRMAX 2000
71 #define STRMAX_SHORT 200
72 
73 #define FULLSCREEN SDL_WINDOW_FULLSCREEN_DESKTOP
74 
75 #define DEFAULT_SCREEN_WIDTH MAX(SCREEN_WIDTH, 640)
76 #define DEFAULT_SCREEN_HEIGHT MAX(SCREEN_HEIGHT, 480)
77 #define STARS_NUM 200
78 #define X_VIEW_BORDER 100
79 #define Y_VIEW_BORDER 100
80 #define CAMERA_MAX_SPEED 3.
81 
82 #define MAX_HOMING 20
83 #define MAX_DOUBLE_HOMING (game.difficulty != DIFFICULTY_ORIGINAL ? 15 : 10)
84 #define MAX_MICRO_HOMING 10
85 
86 #define RAY_INTERVAL 250
87 #define RAY_DAMAGE_DELAY 5
88 
89 #define WARP_SPEED MAX(12, 3 * screen->w / 200)
90 #define ALIEN_WARP_SPEED MIN(-15, -3 * screen->w / 160)
91 #define ALIEN_WARP_ACCEL (game.difficulty == DIFFICULTY_ORIGINAL ? -15: -0.5)
92 
93 #define BAD_TARGET_ALLOW_TIME 30
94 
95 #define SLAVE_RESCUE_TARGET 250
96 
97 #define PIXFONT_LINE_HEIGHT 16
98 #define PIXFONT_W 8
99 #define PIXFONT_H 14
100 
101 #define MENU_Y (screen->h / 3 + 50)
102 #define MENU_W 400
103 #define MENU_SPACING 20
104 
105 #define BRIEFING_WIDTH 520
106 
107 #define JS_DEADZONE 0.05
108 #define JS_MAX (32767 - JS_DEADZONE*32767)
109 
110 #define KLINE_STAGE1_SHIELD (aliens[ALIEN_KLINE].maxShield * 3 / 4)
111 #define KLINE_STAGE2_SHIELD (aliens[ALIEN_KLINE].maxShield / 2)
112 #define KLINE_STAGE3_SHIELD (aliens[ALIEN_KLINE].maxShield / 4)
113 #define KLINE_SHIELD_TINY (aliens[ALIEN_KLINE].maxShield / 20)
114 #define KLINE_SHIELD_SMALL (aliens[ALIEN_KLINE].maxShield / 4)
115 #define KLINE_SHIELD_MEDIUM (aliens[ALIEN_KLINE].maxShield * 3 / 8)
116 
117 // Radio life/speed
118 #define RADIO_LIFE_INSTANT  60
119 #define RADIO_LIFE_FAST     120
120 #define RADIO_LIFE_NORMAL   240
121 #define RADIO_LIFE_SLOW     360
122 #define RADIO_LIFE_SLOTH    480
123 #define DEFAULT_RADIO_LIFE  RADIO_LIFE_NORMAL
124 
125 // Object Flags
126 #define FL_WEAPCO 			(1L << 0)
127 #define FL_FRIEND 			(1L << 1)
128 #define FL_IMMORTAL 		(1L << 2)
129 #define FL_NOMOVE 			(1L << 3)
130 #define FL_NOFIRE 			(1L << 4)
131 #define FL_FIRERAY 			(1L << 5)
132 #define FL_DAMAGEOWNER 		(1L << 6)
133 #define FL_LEAVESECTOR 		(1L << 7)
134 #define FL_ESCAPED 			(1L << 8)
135 #define FL_DROPMINES 		(1L << 9)
136 #define FL_AIMS 			(1L << 10)
137 #define FL_DISABLED 		(1L << 11)
138 #define FL_RUNSAWAY 		(1L << 12)
139 #define FL_ALWAYSFACE 		(1L << 13) // Kline doesn't turn his back on you! ;)
140 #define FL_CIRCLES 			(1L << 14) // Kline can circle around
141 #define FL_CONTINUOUS_FIRE 	(1L << 15) // Go absolutely nutts(!)
142 #define FL_DEPLOYDRONES 	(1L << 16) // Deploys small drone - Used by Boss 2
143 #define FL_CANCLOAK 		(1L << 17)
144 #define FL_ISCLOAKED 		(1L << 18)
145 #define FL_ACTIVATE 		(1L << 19)
146 #define FL_HASMINIMUMSPEED 	(1L << 20)
147 #define FL_FIRELASER 		(1L << 21)
148 #define FL_NOBANTER 		(1L << 22)
149 
150 // Weapon flags
151 #define WF_SPREAD 4
152 #define WF_SCATTER 8
153 #define WF_VARIABLE_SPEED 16
154 #define WF_HOMING 32
155 #define WF_SHOCKWAVE 64
156 #define WF_WEAPCO 128
157 #define WF_FRIEND 256
158 #define WF_AIMED 512
159 #define WF_DISABLE 1024
160 #define WF_TIMEDEXPLOSION 2048
161 
162 #define MT_NONE -2
163 
164 #define MAX_CARGO 20
165 #define MAX_INFOLINES 3
166 #define MAX_EVENTS 20
167 #define MAX_PLANETS 10
168 
169 
170 enum keys {
171 	KEY_UP,
172 	KEY_DOWN,
173 	KEY_LEFT,
174 	KEY_RIGHT,
175 	KEY_FIRE,
176 	KEY_ALTFIRE,
177 	KEY_SWITCH,
178 	KEY_PAUSE,
179 	KEY_ESCAPE,
180 	KEY_FULLSCREEN,
181 	KEY_DUMMY,
182 	KEY_LAST
183 };
184 
185 // AI Types
186 enum {
187 	AI_NORMAL = 1,
188 	AI_DEFENSIVE,
189 	AI_OFFENSIVE,
190 	AI_EVASIVE,
191 	AI_WANDER
192 };
193 
194 // These are for Alien *indexes* NOT classdefs!!
195 enum {
196 	ALIEN_NORMAL_LAST = 20,
197 	ALIEN_BOSS,
198 	ALIEN_BOSS_PART1,
199 	ALIEN_BOSS_PART2,
200 	ALIEN_BOSS_PART3,
201 	ALIEN_BOSS_PART4,
202 	ALIEN_BOSS_PART5,
203 	ALIEN_BOSS_PART6,
204 	ALIEN_KLINE,
205 	ALIEN_PHOEBE,
206 	ALIEN_URSULA,
207 	ALIEN_SID,
208 	ALIEN_FRIEND1,
209 	ALIEN_FRIEND2,
210 	ALIEN_MAX
211 };
212 
213 // Droppables
214 enum {
215 	P_ANYTHING = 1,
216 	P_WEAPONS,
217 	P_CASH,
218 	P_ROCKET,
219 	P_SHIELD,
220 	P_CARGO,
221 	P_PLASMA_AMMO,
222 	P_PLASMA_RATE,
223 	P_PLASMA_SHOT,
224 	P_PLASMA_DAMAGE,
225 	P_MINE,				// mines detonate when you "pick them up!"
226 	P_PHOEBE,			// only used as an attachment(!)
227 	P_SLAVES,
228 	P_ESCAPEPOD,
229 	P_ORE,
230 	P_SUPER
231 };
232 
233 // Jobs
234 enum {
235 	WT_PLASMA = 1,
236 	WT_ROCKET,
237 	WT_ENERGYRAY,
238 	WT_LASER,
239 	WT_MICROROCKET,
240 	WT_CHARGER,
241 	WT_DIRECTIONAL,
242 	WT_SPREAD
243 };
244 
245 // Weapons
246 enum {
247 	W_NONE = -1,
248 	W_PLAYER_WEAPON,
249 	W_PLAYER_WEAPON2,
250 	W_SINGLE_SHOT,
251 	W_DOUBLE_SHOT,
252 	W_TRIPLE_SHOT,
253 	W_ROCKETS,
254 	W_DOUBLE_ROCKETS,
255 	W_MICRO_ROCKETS,
256 	W_ENERGYRAY,
257 	W_LASER,
258 	W_CHARGER,
259 	W_HOMING_MISSILE,
260 	W_DOUBLE_HOMING_MISSILES,
261 	W_MICRO_HOMING_MISSILES,
262 	W_AIMED_SHOT,
263 	W_SPREADSHOT,
264 	W_IONCANNON,
265 	W_DIRSHOCKMISSILE,
266 	W_MAX
267 };
268 
269 // Mission types
270 enum {
271 	M_NONE,
272 	M_DESTROY_ALL_TARGETS,
273 	M_DESTROY_TARGET_TYPE,
274 	M_COLLECT,
275 	M_PROTECT_PICKUP,
276 	M_PROTECT_TARGET,
277 	M_DISABLE_TARGET,
278 	M_ESCAPE_TARGET
279 };
280 
281 enum {
282 	OB_JUST_FAILED = -2,
283 	OB_FAILED,
284 	OB_INCOMPLETE,
285 	OB_COMPLETED,
286 	OB_JUST_COMPLETED,
287 	OB_CONDITION,
288 	OB_HIDDEN
289 };
290 
291 // Class Defs - Some of these are just place holders
292 enum {
293 	CD_DUALFIGHTER, 	// 0
294 	CD_MISSILEBOAT,
295 	CD_PROTOFIGHTER,
296 	CD_FRIEND,
297 	CD_FRIGATE,
298 	CD_FRIGATE_WING1,
299 	CD_FRIGATE_WING2,
300 	CD_TRANSPORTSHIP,
301 	CD_CARGOSHIP,
302  	CD_MINER,
303 	CD_KLINE, 			// 10
304 	CD_AIMFIGHTER,
305 	CD_SLAVETRANSPORT,
306 	CD_GOODTRANSPORT,
307 	CD_SID,
308 	CD_MINEBOSS,
309 	CD_BOSS2_WING1,
310 	CD_BOSS2_WING2,
311 	CD_BOSS2_WING3,
312 	CD_BOSS2_WING4,
313 	CD_DRONE,			// 20
314 	CD_CLOAKFIGHTER,
315 	CD_EVILURSULA,
316 	CD_KRASS,
317 	CD_EXEC,
318 	CD_ASTEROID,
319 	CD_ASTEROID2,
320 	CD_ESCORT,
321 	CD_MOBILE_RAY,
322 	CD_REBELCARRIER,
323 	CD_PLUTOBOSS, 		// 30
324 	CD_BARRIER,
325 	CD_NEPTUNEBOSS,
326 	CD_MOBILESHIELD,
327 	CD_PIRATE,
328 	CD_FIREFLY,
329 	CD_URANUSBOSS,
330 	CD_URANUSBOSSWING1,
331 	CD_URANUSBOSSWING2,
332 	CD_MAX,
333 
334 	// Some special ones
335 	CD_ANY = 100,
336 	CD_BOSS,
337 	CD_PHOEBE,
338 	CD_URSULA
339 };
340 
341 // Sprites
342 enum {
343 	// Intermission
344 	SP_CURSOR,
345 	SP_START_MISSION,
346 	SP_MAP,
347 	SP_STATUS,
348 	SP_SAVE,
349 	SP_SHOP,
350 	SP_COMM,
351 	SP_OPTIONS,
352 	SP_EXIT,
353 	SP_PLASMA_MAX_OUTPUT,
354 	SP_PLASMA_MAX_POWER,
355 	SP_PLASMA_MAX_RATE,
356 	SP_PLASMA_AMMO,
357 	SP_ROCKET_AMMO,
358 	SP_PLASMA_MIN_OUTPUT,
359 	SP_PLASMA_MIN_POWER,
360 	SP_PLASMA_MIN_RATE,
361 	SP_PLASMA_MAX_AMMO,
362 	SP_ROCKET_MAX_AMMO,
363 	SP_DOUBLE_ROCKETS,
364 	SP_MICRO_ROCKETS,
365 	SP_LASER,
366 	SP_HOMING_MISSILE,
367 	SP_CHARGER,
368 	SP_DOUBLE_HOMING_MISSILES,
369 	SP_MICRO_HOMING_MISSILES,
370 	SP_GOTO,
371 	SP_BUY,
372 	SP_SELL,
373 	SP_FIREFLY,
374 	SP_SUN,
375 	SP_PLANET_GREEN,
376 	SP_PLANET_BLUE,
377 	SP_PLANET_RED,
378 	SP_PLANET_ORANGE,
379 
380 	// Bullets
381 	SP_PLASMA_GREEN,
382 	SP_PLASMA_RED,
383 	SP_DIR_PLASMA_GREEN,
384 	SP_DIR_PLASMA_RED,
385 	SP_ION,
386 	SP_ROCKET,
387 	SP_ROCKET_L,
388 
389 	// Explosions
390 	SP_SMALL_EXPLOSION,
391 	SP_SMALL_EXPLOSION_2,
392 	SP_SMALL_EXPLOSION_3,
393 	SP_SMALL_EXPLOSION_L,
394 	SP_BIG_EXPLOSION,
395 	SP_BIG_EXPLOSION_2,
396 	SP_BIG_EXPLOSION_3,
397 	SP_BIG_EXPLOSION_L,
398 	SP_SMOKE,
399 	SP_SMOKE_2,
400 	SP_SMOKE_3,
401 	SP_SMOKE_L,
402 	SP_TINY_EXPLOSION,
403 	SP_TINY_EXPLOSION_2,
404 	SP_TINY_EXPLOSION_3,
405 	SP_TINY_EXPLOSION_L,
406 	SP_ELECTRICAL,
407 	SP_ELECTRICAL_2,
408 	SP_ELECTRICAL_3,
409 	SP_ELECTRICAL_L,
410 
411 	// Pickups
412 	SP_PICKUP_MONEY,
413 	SP_PICKUP_PLASMA,
414 	SP_PICKUP_ROCKETS,
415 	SP_PICKUP_SHIELD,
416 	SP_PICKUP_PLASMA_OUTPUT,
417 	SP_PICKUP_PLASMA_POWER,
418 	SP_PICKUP_PLASMA_RATE,
419 	SP_SUPERCHARGE,
420 	SP_CARGO,
421 	SP_ESCAPE_POD,
422 	SP_ORE,
423 	SP_ORE_2,
424 	SP_ORE_L,
425 	SP_CHAIN_LINK,
426 	SP_MINE,
427 
428 	// Targeting system
429 	SP_ARROW_NORTH,
430 	SP_ARROW_NORTHEAST,
431 	SP_ARROW_EAST,
432 	SP_ARROW_SOUTHEAST,
433 	SP_ARROW_SOUTH,
434 	SP_ARROW_SOUTHWEST,
435 	SP_ARROW_WEST,
436 	SP_ARROW_NORTHWEST,
437 	SP_ARROW_FRIEND_NORTH,
438 	SP_ARROW_FRIEND_NORTHEAST,
439 	SP_ARROW_FRIEND_EAST,
440 	SP_ARROW_FRIEND_SOUTHEAST,
441 	SP_ARROW_FRIEND_SOUTH,
442 	SP_ARROW_FRIEND_SOUTHWEST,
443 	SP_ARROW_FRIEND_WEST,
444 	SP_ARROW_FRIEND_NORTHWEST,
445 	SP_INDICATOR_TARGET,
446 	SP_INDICATOR_SID,
447 	SP_INDICATOR_PHOEBE,
448 	SP_INDICATOR_URSULA,
449 	SP_INDICATOR_KLINE,
450 
451 	SP_MAX
452 };
453 
454 // Face sprites
455 enum {
456 	FS_CHRIS,
457 	FS_SID,
458 	FS_KRASS,
459 	FS_KLINE,
460 	FS_PHOEBE,
461 	FS_URSULA,
462 	FS_CREW,
463 	FS_MAX
464 };
465 
466 // Ship sprites
467 enum {
468 	SS_FIREFLY,
469 	SS_FIREFLY_L,
470 	SS_SID,
471 	SS_SID_L,
472 	SS_FRIEND,
473 	SS_FRIEND_L,
474 	SS_GOODTRANSPORT,
475 	SS_GOODTRANSPORT_L,
476 	SS_REBELCARRIER,
477 	SS_REBELCARRIER_L,
478 	SS_DUALFIGHTER,
479 	SS_DUALFIGHTER_L,
480 	SS_MISSILEBOAT,
481 	SS_MISSILEBOAT_L,
482 	SS_PROTOFIGHTER,
483 	SS_PROTOFIGHTER_L,
484 	SS_AIMFIGHTER,
485 	SS_AIMFIGHTER_L,
486 	SS_DRONE,
487 	SS_DRONE_L,
488 	SS_MINER,
489 	SS_MINER_L,
490 	SS_ESCORT,
491 	SS_ESCORT_L,
492 	SS_MOBILE_RAY,
493 	SS_MOBILE_RAY_L,
494 	SS_TRANSPORTSHIP,
495 	SS_TRANSPORTSHIP_L,
496 	SS_CARGOSHIP,
497 	SS_CARGOSHIP_L,
498 	SS_SLAVETRANSPORT,
499 	SS_SLAVETRANSPORT_L,
500 	SS_BARRIER,
501 	SS_MOBILESHIELD,
502 	SS_MOBILESHIELD_L,
503 	SS_ASTEROID,
504 	SS_ASTEROID_SMALL,
505 	SS_ASTEROID_SMALL_L,
506 	SS_CLOAKFIGHTER,
507 	SS_CLOAKFIGHTER_L,
508 	SS_EVILURSULA,
509 	SS_EVILURSULA_L,
510 	SS_KRASS,
511 	SS_KRASS_L,
512 	SS_FRIGATE,
513 	SS_FRIGATE_L,
514 	SS_FRIGATE_WING1,
515 	SS_FRIGATE_WING1_L,
516 	SS_FRIGATE_WING2,
517 	SS_FRIGATE_WING2_L,
518 	SS_MINERBOSS,
519 	SS_MINERBOSS_L,
520 	SS_MINERBOSS_WING1,
521 	SS_MINERBOSS_WING1_L,
522 	SS_MINERBOSS_WING2,
523 	SS_MINERBOSS_WING2_L,
524 	SS_MINERBOSS_WING3,
525 	SS_MINERBOSS_WING3_L,
526 	SS_MINERBOSS_WING4,
527 	SS_MINERBOSS_WING4_L,
528 	SS_EXEC,
529 	SS_EXEC_L,
530 	SS_PLUTOBOSS,
531 	SS_PLUTOBOSS_L,
532 	SS_URANUSBOSS,
533 	SS_URANUSBOSS_L,
534 	SS_URANUSBOSS_WING1,
535 	SS_URANUSBOSS_WING1_L,
536 	SS_URANUSBOSS_WING2,
537 	SS_URANUSBOSS_WING2_L,
538 	SS_KLINE,
539 	SS_KLINE_L,
540 	SS_HIT_INDEX,
541 	SS_MAX = SS_HIT_INDEX * 2
542 };
543 
544 // Shop sprites
545 enum {
546 	SHOP_S_PRIMARY,
547 	SHOP_S_POWERUP,
548 	SHOP_S_SECONDARY,
549 	SHOP_S_CATALOG,
550 	SHOP_S_SHIP_INFO,
551 	SHOP_S_ITEM_INFO,
552 	SHOP_S_MAX
553 };
554 
555 // Text sprites
556 enum {
557 	// Main menu
558 	TS_PRESENTS = MAX_INFOLINES,
559 	TS_AN_SDL_GAME,
560 	TS_START_NEW_GAME,
561 	TS_LOAD_GAME,
562 	TS_CONTINUE_CURRENT_GAME,
563 	TS_OPTIONS,
564 	TS_CREDITS,
565 	TS_CHEAT_OPTIONS,
566 	TS_QUIT,
567 	TS_SOUND,
568 	TS_MUSIC,
569 	TS_FULLSCREEN,
570 	TS_AUTOPAUSE,
571 	TS_RADIO_SPEED,
572 	TS_BACK_TO_MAIN_MENU,
573 	TS_SAVESLOT_0,
574 	TS_SAVESLOT_1,
575 	TS_SAVESLOT_2,
576 	TS_SAVESLOT_3,
577 	TS_SAVESLOT_4,
578 	TS_SAVESLOT_5,
579 	TS_UNLIMITED_SHIELD,
580 	TS_UNLIMITED_AMMO,
581 	TS_UNLIMITED_CASH,
582 	TS_UNLIMITED_TIME,
583 	TS_START_GAME,
584 	TS_DIFFICULTY,
585 
586 	// Intermission
587 	TS_CURRENT_SYSTEM,
588 	TS_INFO_START_MISSION,
589 	TS_INFO_GOTO,
590 	TS_INFO_MAP,
591 	TS_INFO_STATUS,
592 	TS_INFO_SAVE_GAME,
593 	TS_INFO_SHOP,
594 	TS_INFO_COMMS,
595 	TS_INFO_OPTIONS,
596 	TS_INFO_EXIT,
597 	TS_CURRENT_PLANET,
598 	TS_DEST_PLANET,
599 
600 	// Status
601 	TS_STATUS_HEADER,
602 	TS_STATUS_DIFFICULTY,
603 	TS_SHOTS_FIRED,
604 	TS_HITS_SCORED,
605 	TS_ACCURACY,
606 	TS_OTHER_KILLS,
607 	TS_CASH_EARNED,
608 	TS_CHRIS_HEADER,
609 	TS_CHRIS_KILLS,
610 	TS_CHRIS_SHIELD_PICKUPS,
611 	TS_CHRIS_PLASMA_PICKUPS,
612 	TS_CHRIS_ROCKET_PICKUPS,
613 	TS_CHRIS_POWERUP_PICKUPS,
614 	TS_CHRIS_MINES_KILLED,
615 	TS_CHRIS_SLAVES_RESCUED,
616 	TS_PHOEBE_HEADER,
617 	TS_PHOEBE_KILLS,
618 	TS_PHOEBE_DEATHS,
619 	TS_URSULA_HEADER,
620 	TS_URSULA_KILLS,
621 	TS_URSULA_DEATHS,
622 	TS_STATUS_FOOTER,
623 
624 	// Mission
625 	TS_RADIO,
626 	TS_SHIELD,
627 	TS_PLASMA_T,
628 	TS_AMMO_T,
629 	TS_TARGET,
630 	TS_TARGET_SID,
631 	TS_TARGET_PHOEBE,
632 	TS_TARGET_KLINE,
633 	TS_CASH_T,
634 	TS_OBJECTIVES_T,
635 	TS_TIME_T,
636 	TS_POWER,
637 	TS_OUTPUT,
638 	TS_COOLER,
639 	TS_PAUSED,
640 	TS_TIME,
641 	TS_PLASMA,
642 	TS_AMMO,
643 	TS_CASH,
644 	TS_OBJECTIVES,
645 
646 	TS_MAX
647 };
648 
649 // Menu types
650 enum {
651 	MENU_MAIN,
652 	MENU_DIFFICULTY,
653 	MENU_LOAD,
654 	MENU_OPTIONS,
655 	MENU_CHEAT
656 };
657 
658 // Shop items
659 // Note: The error codes are set manually because every actual items
660 // must be >= 0; the real items are used to index an array.
661 enum {
662 	SHOP_ERROR_WEAPON_CAPACITY = -9,
663 	SHOP_ERROR_ALREADY_OWNED = -8,
664 	SHOP_ERROR_IS_NOT_ROCKETS = -7,
665 	SHOP_ERROR_NOTHING_TO_SELL = -6,
666 	SHOP_ERROR_CANNOT_SELL = -5,
667 	SHOP_ERROR_AMMO_LIMIT = -4,
668 	SHOP_ERROR_CANNOT_UPGRADE = -3,
669 	SHOP_ERROR_INSUFFICIENT_FUNDS = -2,
670 	SHOP_NOTHING = -1,
671 	SHOP_PLASMA_MAX_OUTPUT,
672 	SHOP_PLASMA_MAX_DAMAGE,
673 	SHOP_PLASMA_MAX_RATE,
674 	SHOP_PLASMA_MIN_OUTPUT,
675 	SHOP_PLASMA_MIN_DAMAGE,
676 	SHOP_PLASMA_MIN_RATE,
677 	SHOP_PLASMA_AMMO,
678 	SHOP_ROCKET_AMMO,
679 	SHOP_PLASMA_MAX_AMMO,
680 	SHOP_ROCKET_MAX_AMMO,
681 	SHOP_DOUBLE_ROCKETS,
682 	SHOP_MICRO_ROCKETS,
683 	SHOP_LASER,
684 	SHOP_HOMING_MISSILE,
685 	SHOP_CHARGER,
686 	SHOP_DOUBLE_HOMING_MISSILES,
687 	SHOP_MICRO_HOMING_MISSILES,
688 	SHOP_MAX
689 };
690 
691 // Font Colors
692 enum {
693 	FONT_WHITE,
694 	FONT_RED,
695 	FONT_YELLOW,
696 	FONT_GREEN,
697 	FONT_CYAN,
698 	FONT_OUTLINE, // a dark blue color
699 	FONT_MAX
700 };
701 
702 // Sounds
703 enum {
704 	SFX_EXPLOSION,
705 	SFX_HIT,
706 	SFX_DEATH,
707 	SFX_MISSILE,
708 	SFX_PLASMA,
709 	SFX_CLOCK,
710 	SFX_FLY,
711 	SFX_ENERGYRAY,
712 	SFX_PICKUP,
713 	SFX_SHIELDUP,
714 	SFX_CLOAK,
715 	SFX_DEBRIS,
716 	SFX_DEBRIS2,
717 	SFX_LASER,
718 	SFX_PLASMA2,
719 	SFX_PLASMA3,
720 	SFX_MAX
721 };
722 
723 // Sections
724 enum {
725 	SECTION_TITLE,
726 	SECTION_INTERMISSION,
727 	SECTION_GAME
728 };
729 
730 // Systems
731 enum {
732 	SYSTEM_SPIRIT,
733 	SYSTEM_EYANANTH,
734 	SYSTEM_MORDOR,
735 	SYSTEM_SOL,
736 	SYSTEM_MAX
737 };
738 
739 // Planets (Spirit)
740 enum {
741 	PLANET_HAIL,
742 	PLANET_CERADSE,
743 	PLANET_HINSTAG,
744 	PLANET_JOLDAR,
745 	PLANET_MOEBO
746 };
747 
748 // Planets (Eyananth)
749 enum {
750 	PLANET_NEROD,
751 	PLANET_ALLEZ,
752 	PLANET_URUSOR,
753 	PLANET_DORIM,
754 	PLANET_ELAMALE,
755 	PLANET_RESCUESLAVES = 9 // For save compatibility
756 };
757 
758 // Planets (Mordor)
759 enum {
760 	PLANET_ODEON,
761 	PLANET_FELLON,
762 	PLANET_SIVEDI,
763 	PLANET_ALMARTHA,
764 	PLANET_POSWIC,
765 	PLANET_ELLESH,
766 	PLANET_CLOAKFIGHTER = 9 // For save compatibility
767 };
768 
769 // Planets (Sol)
770 enum {
771 	PLANET_MERCURY,
772 	PLANET_VENUS,
773 	PLANET_EARTH,
774 	PLANET_MARS,
775 	PLANET_JUPITER,
776 	PLANET_SATURN,
777 	PLANET_URANUS,
778 	PLANET_NEPTUNE,
779 	PLANET_PLUTO
780 };
781 
782 // Missions
783 enum {
784 	MISN_START,
785 	MISN_HAIL,
786 	MISN_CERADSE,
787 	MISN_HINSTAG,
788 	MISN_JOLDAR,
789 	MISN_MOEBO,
790 	MISN_RESCUESLAVES,
791 	MISN_NEROD,
792 	MISN_ALLEZ,
793 	MISN_URUSOR,
794 	MISN_DORIM,
795 	MISN_ELAMALE,
796 	MISN_CLOAKFIGHTER,
797 	MISN_ODEON,
798 	MISN_FELLON,
799 	MISN_SIVEDI,
800 	MISN_ALMARTHA,
801 	MISN_POSWIC,
802 	MISN_ELLESH,
803 	MISN_PLUTO,
804 	MISN_NEPTUNE,
805 	MISN_URANUS,
806 	MISN_SATURN,
807 	MISN_JUPITER,
808 	MISN_MARS,
809 	MISN_EARTH,
810 	MISN_VENUS,
811 	MISN_INTERCEPTION,
812 	MISN_MAX
813 };
814 
815 // Difficulties
816 enum {
817 	DIFFICULTY_SUPEREASY = 0,
818 	DIFFICULTY_EASY,
819 	DIFFICULTY_NORMAL,
820 	DIFFICULTY_HARD,
821 	DIFFICULTY_NIGHTMARE,
822 	DIFFICULTY_ORIGINAL,
823 	DIFFICULTY_MAX
824 };
825 
826 // Engine state values (used for engine.done)
827 enum {
828 	ENGINE_RUNNING = 0,
829 	ENGINE_CLOSING,
830 	ENGINE_SYSEXIT,
831 	ENGINE_FORMATION
832 };
833 
834 extern const char * const systemBackground[];
835 extern const int rate2reload[6];
836 
837 #endif
838