2011-08-24 14:14:44 +02:00
|
|
|
/*
|
|
|
|
Copyright (C) 2003 Parallel Realities
|
2015-03-01 21:37:32 +01:00
|
|
|
Copyright (C) 2011, 2012 Guus Sliepen
|
2016-11-17 01:43:03 +01:00
|
|
|
Copyright (C) 2012, 2015, 2016 Julie Marchant <onpon4@riseup.net>
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
2015-02-26 17:20:36 +01:00
|
|
|
as published by the Free Software Foundation; either version 3
|
2011-08-24 14:14:44 +02:00
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2015-02-26 17:20:36 +01:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2015-02-26 17:20:36 +01:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2011-08-24 14:14:44 +02:00
|
|
|
*/
|
|
|
|
|
2015-03-04 15:11:04 +01:00
|
|
|
#ifndef DEFS_H
|
|
|
|
#define DEFS_H
|
|
|
|
|
2016-01-05 12:59:37 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
|
|
|
|
// Macros
|
2015-03-17 21:54:00 +01:00
|
|
|
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
|
|
|
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
2015-03-18 00:00:13 +01:00
|
|
|
#define LIMIT(x, a, b) x = ((x) < (b) ? ((x) > (a) ? (x) : (a)) : (b))
|
|
|
|
#define LIMIT_ADD(x, y, a, b) x = (((x) + (y)) < (b) ? \
|
|
|
|
(((x) + (y)) > (a) ? \
|
|
|
|
((x) + (y)) : (a)) : (b))
|
2015-03-24 23:51:12 +01:00
|
|
|
#define WRAP_ADD(x, y, a, b) x = (((x) + (y)) + \
|
|
|
|
((x) + (y) < (a) ? ((b) - (a)) : 0) + \
|
|
|
|
((x) + (y) > (b) ? ((a) - (b)) : 0))
|
2016-01-05 12:59:37 +01:00
|
|
|
#define CHANCE(x) ((rand() % RAND_MAX) < ((x) * RAND_MAX))
|
2016-01-07 02:35:37 +01:00
|
|
|
#define RANDRANGE(x, y) (((x) < (y)) ? ((x) + (rand() % (long)(1 + (y) - (x)))) : (x))
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
|
2015-03-01 10:30:11 +01:00
|
|
|
// Compile-time options
|
|
|
|
#ifndef VERSION
|
2015-03-31 19:02:09 +02:00
|
|
|
#define VERSION "???"
|
2015-03-01 10:30:11 +01:00
|
|
|
#endif
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-01 10:30:11 +01:00
|
|
|
#ifndef DATADIR
|
|
|
|
#define DATADIR "."
|
|
|
|
#endif
|
|
|
|
|
2016-01-04 03:36:34 +01:00
|
|
|
#ifndef SCREEN_WIDTH
|
|
|
|
#define SCREEN_WIDTH 800
|
2016-01-04 02:41:48 +01:00
|
|
|
#endif
|
|
|
|
|
2016-01-04 03:36:34 +01:00
|
|
|
#ifndef SCREEN_HEIGHT
|
|
|
|
#define SCREEN_HEIGHT 600
|
2016-01-04 02:41:48 +01:00
|
|
|
#endif
|
|
|
|
|
2015-03-01 10:30:11 +01:00
|
|
|
#ifndef PATH_MAX
|
2015-06-20 17:58:37 +02:00
|
|
|
#define PATH_MAX 4096
|
2015-03-01 10:30:11 +01:00
|
|
|
#endif
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-06-20 17:58:37 +02:00
|
|
|
#define STARS_NUM 200
|
|
|
|
|
2011-08-24 14:14:44 +02:00
|
|
|
// Object Flags
|
|
|
|
#define FL_WEAPCO 1
|
|
|
|
#define FL_FRIEND 2
|
|
|
|
#define FL_IMMORTAL 4
|
|
|
|
#define FL_NOMOVE 8
|
|
|
|
#define FL_NOFIRE 16
|
|
|
|
#define FL_FIRERAY 32
|
|
|
|
#define FL_DAMAGEOWNER 64
|
|
|
|
#define FL_LEAVESECTOR 128
|
|
|
|
#define FL_ESCAPED 256
|
|
|
|
#define FL_DROPMINES 512
|
|
|
|
#define FL_AIMS 1024
|
|
|
|
#define FL_DISABLED 2048
|
2016-01-09 00:09:35 +01:00
|
|
|
#define FL_CANNOTDIE 4096 // No longer used
|
2011-08-24 14:14:44 +02:00
|
|
|
#define FL_RUNSAWAY 8192
|
|
|
|
#define FL_ALWAYSFACE 16384 // Kline doesn't turn his back on you! ;)
|
2015-03-31 19:15:08 +02:00
|
|
|
#define FL_CIRCLES 32768L // Kline can circle around
|
2015-03-31 19:02:09 +02:00
|
|
|
#define FL_CONTINUOUS_FIRE 65536L // Go absolutely nutts(!)
|
|
|
|
#define FL_DEPLOYDRONES 131072L // Deploys small drone - Used by Boss 2
|
|
|
|
#define FL_CANCLOAK 262144L
|
|
|
|
#define FL_ISCLOAKED 524288L
|
|
|
|
#define FL_ACTIVATE 1048576L
|
|
|
|
#define FL_HASMINIMUMSPEED 2097152L
|
|
|
|
#define FL_FIRELASER 4194304L
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-01 10:30:11 +01:00
|
|
|
// Weapon flags
|
|
|
|
#define WF_SPREAD 4
|
|
|
|
#define WF_SCATTER 8
|
|
|
|
#define WF_VARIABLE_SPEED 16
|
|
|
|
#define WF_HOMING 32
|
|
|
|
#define WF_SHOCKWAVE 64
|
|
|
|
#define WF_WEAPCO 128
|
|
|
|
#define WF_FRIEND 256
|
|
|
|
#define WF_AIMED 512
|
|
|
|
#define WF_DISABLE 1024
|
|
|
|
#define WF_TIMEDEXPLOSION 2048
|
|
|
|
|
|
|
|
#define MAX_CARGO 20
|
2015-12-31 16:47:27 +01:00
|
|
|
#define MAX_INFOLINES 3
|
2016-01-03 20:31:39 +01:00
|
|
|
#define MAX_EVENTS 20
|
2015-03-01 10:30:11 +01:00
|
|
|
|
2016-01-02 23:37:19 +01:00
|
|
|
|
|
|
|
enum keys {
|
|
|
|
KEY_UP,
|
|
|
|
KEY_DOWN,
|
|
|
|
KEY_LEFT,
|
|
|
|
KEY_RIGHT,
|
|
|
|
KEY_FIRE,
|
|
|
|
KEY_ALTFIRE,
|
|
|
|
KEY_SWITCH,
|
|
|
|
KEY_PAUSE,
|
|
|
|
KEY_ESCAPE,
|
|
|
|
KEY_FULLSCREEN,
|
|
|
|
KEY_DUMMY,
|
|
|
|
KEY_LAST
|
|
|
|
};
|
|
|
|
|
2015-03-01 10:30:11 +01:00
|
|
|
// AI Types
|
|
|
|
enum {
|
|
|
|
AI_NORMAL = 1,
|
|
|
|
AI_DEFENSIVE,
|
|
|
|
AI_OFFENSIVE,
|
|
|
|
AI_EVASIVE,
|
|
|
|
AI_WANDER
|
|
|
|
};
|
|
|
|
|
2011-08-24 14:14:44 +02:00
|
|
|
// These are for Alien *indexes* NOT classdefs!!
|
|
|
|
enum {
|
2016-01-08 18:10:50 +01:00
|
|
|
ALIEN_NORMAL_LAST = 20,
|
|
|
|
ALIEN_BOSS,
|
2016-01-03 22:20:22 +01:00
|
|
|
ALIEN_BOSS_PART1,
|
|
|
|
ALIEN_BOSS_PART2,
|
|
|
|
ALIEN_BOSS_PART3,
|
|
|
|
ALIEN_BOSS_PART4,
|
|
|
|
ALIEN_BOSS_PART5,
|
|
|
|
ALIEN_BOSS_PART6,
|
2015-03-09 01:59:33 +01:00
|
|
|
ALIEN_KLINE,
|
|
|
|
ALIEN_PHOEBE,
|
|
|
|
ALIEN_URSULA,
|
|
|
|
ALIEN_SID,
|
2016-01-03 22:20:22 +01:00
|
|
|
ALIEN_FRIEND1,
|
|
|
|
ALIEN_FRIEND2,
|
2016-01-05 02:17:06 +01:00
|
|
|
ALIEN_MAX
|
2011-08-24 14:14:44 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
// Droppables
|
|
|
|
enum {
|
|
|
|
P_ANYTHING = 1,
|
|
|
|
P_WEAPONS,
|
|
|
|
P_CASH,
|
|
|
|
P_ROCKET,
|
|
|
|
P_SHIELD,
|
|
|
|
P_CARGO,
|
|
|
|
P_PLASMA_AMMO,
|
|
|
|
P_PLASMA_RATE,
|
|
|
|
P_PLASMA_SHOT,
|
|
|
|
P_PLASMA_DAMAGE,
|
|
|
|
P_MINE, // mines detonate when you "pick them up!"
|
|
|
|
P_PHOEBE, // only used as an attachment(!)
|
|
|
|
P_SLAVES,
|
|
|
|
P_ESCAPEPOD,
|
|
|
|
P_ORE,
|
|
|
|
P_SUPER
|
|
|
|
};
|
|
|
|
|
|
|
|
// Jobs
|
|
|
|
enum {
|
|
|
|
WT_PLASMA = 1,
|
|
|
|
WT_ROCKET,
|
|
|
|
WT_ENERGYRAY,
|
|
|
|
WT_LASER,
|
|
|
|
WT_MICROROCKET,
|
|
|
|
WT_CHARGER,
|
|
|
|
WT_DIRECTIONAL,
|
|
|
|
WT_SPREAD
|
|
|
|
};
|
|
|
|
|
|
|
|
// Weapons
|
|
|
|
enum {
|
|
|
|
W_NONE = -1,
|
|
|
|
W_PLAYER_WEAPON,
|
|
|
|
W_PLAYER_WEAPON2,
|
|
|
|
W_SINGLE_SHOT,
|
|
|
|
W_DOUBLE_SHOT,
|
|
|
|
W_TRIPLE_SHOT,
|
|
|
|
W_ROCKETS,
|
|
|
|
W_DOUBLE_ROCKETS,
|
|
|
|
W_MICRO_ROCKETS,
|
|
|
|
W_ENERGYRAY,
|
|
|
|
W_LASER,
|
|
|
|
W_CHARGER,
|
|
|
|
W_HOMING_MISSILE,
|
|
|
|
W_DOUBLE_HOMING_MISSILES,
|
|
|
|
W_MICRO_HOMING_MISSILES,
|
|
|
|
W_AIMED_SHOT,
|
|
|
|
W_SPREADSHOT,
|
|
|
|
W_IONCANNON,
|
2016-01-07 02:35:37 +01:00
|
|
|
W_DIRSHOCKMISSILE,
|
|
|
|
W_MAX
|
2011-08-24 14:14:44 +02:00
|
|
|
};
|
|
|
|
|
2015-03-09 03:01:37 +01:00
|
|
|
// Mission types
|
2011-08-24 14:14:44 +02:00
|
|
|
enum {
|
2016-01-05 13:07:04 +01:00
|
|
|
M_NONE,
|
|
|
|
M_DESTROY_ALL_TARGETS,
|
2011-08-24 14:14:44 +02:00
|
|
|
M_DESTROY_TARGET_TYPE,
|
|
|
|
M_COLLECT,
|
|
|
|
M_PROTECT_PICKUP,
|
|
|
|
M_PROTECT_TARGET,
|
|
|
|
M_DISABLE_TARGET,
|
|
|
|
M_ESCAPE_TARGET
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
OB_JUST_FAILED = -2,
|
|
|
|
OB_FAILED,
|
|
|
|
OB_INCOMPLETE,
|
|
|
|
OB_COMPLETED,
|
|
|
|
OB_JUST_COMPLETED,
|
|
|
|
OB_CONDITION,
|
|
|
|
OB_HIDDEN
|
|
|
|
};
|
|
|
|
|
|
|
|
// Class Defs - Some of these are just place holders
|
|
|
|
enum {
|
|
|
|
CD_DUALFIGHTER, // 0
|
|
|
|
CD_MISSILEBOAT,
|
|
|
|
CD_PROTOFIGHTER,
|
|
|
|
CD_FRIEND,
|
|
|
|
CD_FRIGATE,
|
|
|
|
CD_FRIGATE_WING1,
|
|
|
|
CD_FRIGATE_WING2,
|
|
|
|
CD_TRANSPORTSHIP,
|
|
|
|
CD_CARGOSHIP,
|
|
|
|
CD_MINER,
|
|
|
|
CD_KLINE, // 10
|
|
|
|
CD_AIMFIGHTER,
|
|
|
|
CD_SLAVETRANSPORT,
|
|
|
|
CD_GOODTRANSPORT,
|
|
|
|
CD_SID,
|
|
|
|
CD_MINEBOSS,
|
|
|
|
CD_BOSS2_WING1,
|
|
|
|
CD_BOSS2_WING2,
|
|
|
|
CD_BOSS2_WING3,
|
|
|
|
CD_BOSS2_WING4,
|
|
|
|
CD_DRONE, // 20
|
|
|
|
CD_CLOAKFIGHTER,
|
|
|
|
CD_EVILURSULA,
|
|
|
|
CD_KRASS,
|
|
|
|
CD_EXEC,
|
|
|
|
CD_ASTEROID,
|
|
|
|
CD_ASTEROID2,
|
|
|
|
CD_ESCORT,
|
|
|
|
CD_MOBILE_RAY,
|
|
|
|
CD_REBELCARRIER,
|
|
|
|
CD_PLUTOBOSS, // 30
|
|
|
|
CD_BARRIER,
|
|
|
|
CD_NEPTUNEBOSS,
|
|
|
|
CD_MOBILESHIELD,
|
|
|
|
CD_PIRATE,
|
|
|
|
CD_FIREFLY,
|
|
|
|
CD_URANUSBOSS,
|
|
|
|
CD_URANUSBOSSWING1,
|
|
|
|
CD_URANUSBOSSWING2,
|
2015-03-07 15:42:24 +01:00
|
|
|
CD_MAX,
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
// Some special ones
|
|
|
|
CD_ANY = 100,
|
|
|
|
CD_BOSS,
|
|
|
|
CD_PHOEBE,
|
|
|
|
CD_URSULA
|
|
|
|
};
|
|
|
|
|
2016-01-04 22:34:29 +01:00
|
|
|
// Sprites
|
|
|
|
enum {
|
2016-01-09 03:33:40 +01:00
|
|
|
// Intermission
|
2016-01-05 04:25:00 +01:00
|
|
|
SP_CURSOR,
|
|
|
|
SP_START_MISSION,
|
|
|
|
SP_MAP,
|
|
|
|
SP_STATUS,
|
|
|
|
SP_SAVE,
|
|
|
|
SP_SHOP,
|
|
|
|
SP_COMM,
|
|
|
|
SP_OPTIONS,
|
|
|
|
SP_EXIT,
|
|
|
|
SP_PLASMA_MAX_OUTPUT,
|
|
|
|
SP_PLASMA_MAX_POWER,
|
|
|
|
SP_PLASMA_MAX_RATE,
|
|
|
|
SP_PLASMA_AMMO,
|
|
|
|
SP_ROCKET_AMMO,
|
|
|
|
SP_PLASMA_MIN_OUTPUT,
|
|
|
|
SP_PLASMA_MIN_POWER,
|
|
|
|
SP_PLASMA_MIN_RATE,
|
|
|
|
SP_PLASMA_MAX_AMMO,
|
|
|
|
SP_ROCKET_MAX_AMMO,
|
|
|
|
SP_DOUBLE_ROCKETS,
|
|
|
|
SP_MICRO_ROCKETS,
|
|
|
|
SP_LASER,
|
|
|
|
SP_HOMING_MISSILE,
|
|
|
|
SP_CHARGER,
|
|
|
|
SP_DOUBLE_HOMING_MISSILES,
|
|
|
|
SP_MICRO_HOMING_MISSILES,
|
|
|
|
SP_GOTO,
|
|
|
|
SP_BUY,
|
|
|
|
SP_SELL,
|
|
|
|
SP_FIREFLY,
|
|
|
|
SP_SUN,
|
|
|
|
SP_PLANET_GREEN,
|
|
|
|
SP_PLANET_BLUE,
|
|
|
|
SP_PLANET_RED,
|
|
|
|
SP_PLANET_ORANGE,
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
|
|
|
|
// Bullets
|
|
|
|
SP_PLASMA_GREEN,
|
|
|
|
SP_PLASMA_RED,
|
|
|
|
SP_DIR_PLASMA_GREEN,
|
|
|
|
SP_DIR_PLASMA_RED,
|
|
|
|
SP_ION,
|
|
|
|
SP_ROCKET,
|
|
|
|
SP_ROCKET_L,
|
|
|
|
|
|
|
|
// Explosions
|
|
|
|
SP_SMALL_EXPLOSION,
|
|
|
|
SP_SMALL_EXPLOSION_2,
|
|
|
|
SP_SMALL_EXPLOSION_3,
|
|
|
|
SP_SMALL_EXPLOSION_L,
|
|
|
|
SP_BIG_EXPLOSION,
|
|
|
|
SP_BIG_EXPLOSION_2,
|
|
|
|
SP_BIG_EXPLOSION_3,
|
|
|
|
SP_BIG_EXPLOSION_L,
|
|
|
|
SP_SMOKE,
|
|
|
|
SP_SMOKE_2,
|
|
|
|
SP_SMOKE_3,
|
|
|
|
SP_SMOKE_L,
|
|
|
|
SP_TINY_EXPLOSION,
|
|
|
|
SP_TINY_EXPLOSION_2,
|
|
|
|
SP_TINY_EXPLOSION_3,
|
|
|
|
SP_TINY_EXPLOSION_L,
|
|
|
|
SP_ELECTRICAL,
|
|
|
|
SP_ELECTRICAL_2,
|
|
|
|
SP_ELECTRICAL_3,
|
|
|
|
SP_ELECTRICAL_L,
|
|
|
|
|
|
|
|
// Pickups
|
|
|
|
SP_PICKUP_MONEY,
|
|
|
|
SP_PICKUP_PLASMA,
|
|
|
|
SP_PICKUP_ROCKETS,
|
|
|
|
SP_PICKUP_SHIELD,
|
|
|
|
SP_PICKUP_PLASMA_OUTPUT,
|
|
|
|
SP_PICKUP_PLASMA_POWER,
|
|
|
|
SP_PICKUP_PLASMA_RATE,
|
|
|
|
SP_SUPERCHARGE,
|
|
|
|
SP_CARGO,
|
|
|
|
SP_ESCAPE_POD,
|
|
|
|
SP_ORE,
|
|
|
|
SP_ORE_2,
|
|
|
|
SP_ORE_L,
|
|
|
|
SP_CHAIN_LINK,
|
|
|
|
SP_MINE,
|
|
|
|
|
|
|
|
// Targeting system
|
|
|
|
SP_ARROW_NORTH,
|
|
|
|
SP_ARROW_NORTHEAST,
|
|
|
|
SP_ARROW_EAST,
|
|
|
|
SP_ARROW_SOUTHEAST,
|
|
|
|
SP_ARROW_SOUTH,
|
|
|
|
SP_ARROW_SOUTHWEST,
|
|
|
|
SP_ARROW_WEST,
|
|
|
|
SP_ARROW_NORTHWEST,
|
2016-01-08 15:39:12 +01:00
|
|
|
SP_ARROW_FRIEND_NORTH,
|
|
|
|
SP_ARROW_FRIEND_NORTHEAST,
|
|
|
|
SP_ARROW_FRIEND_EAST,
|
|
|
|
SP_ARROW_FRIEND_SOUTHEAST,
|
|
|
|
SP_ARROW_FRIEND_SOUTH,
|
|
|
|
SP_ARROW_FRIEND_SOUTHWEST,
|
|
|
|
SP_ARROW_FRIEND_WEST,
|
|
|
|
SP_ARROW_FRIEND_NORTHWEST,
|
2016-01-08 16:31:01 +01:00
|
|
|
SP_INDICATOR_TARGET,
|
|
|
|
SP_INDICATOR_SID,
|
|
|
|
SP_INDICATOR_PHOEBE,
|
|
|
|
SP_INDICATOR_URSULA,
|
2016-01-08 17:09:13 +01:00
|
|
|
SP_INDICATOR_KLINE,
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
|
2016-01-05 04:25:00 +01:00
|
|
|
SP_MAX
|
2016-01-04 22:34:29 +01:00
|
|
|
};
|
|
|
|
|
2016-01-04 15:07:30 +01:00
|
|
|
// Face sprites
|
|
|
|
enum {
|
2016-01-04 22:34:29 +01:00
|
|
|
FS_CHRIS,
|
2016-01-04 15:07:30 +01:00
|
|
|
FS_SID,
|
|
|
|
FS_KRASS,
|
|
|
|
FS_KLINE,
|
|
|
|
FS_PHOEBE,
|
|
|
|
FS_URSULA,
|
|
|
|
FS_CREW,
|
|
|
|
FS_MAX
|
|
|
|
};
|
|
|
|
|
2016-01-04 22:34:29 +01:00
|
|
|
// Ship sprites
|
|
|
|
enum {
|
|
|
|
SS_FIREFLY,
|
|
|
|
SS_FIREFLY_L,
|
|
|
|
SS_SID,
|
|
|
|
SS_SID_L,
|
|
|
|
SS_FRIEND,
|
|
|
|
SS_FRIEND_L,
|
|
|
|
SS_GOODTRANSPORT,
|
|
|
|
SS_GOODTRANSPORT_L,
|
|
|
|
SS_REBELCARRIER,
|
|
|
|
SS_REBELCARRIER_L,
|
|
|
|
SS_DUALFIGHTER,
|
|
|
|
SS_DUALFIGHTER_L,
|
|
|
|
SS_MISSILEBOAT,
|
|
|
|
SS_MISSILEBOAT_L,
|
|
|
|
SS_PROTOFIGHTER,
|
|
|
|
SS_PROTOFIGHTER_L,
|
|
|
|
SS_AIMFIGHTER,
|
|
|
|
SS_AIMFIGHTER_L,
|
|
|
|
SS_DRONE,
|
|
|
|
SS_DRONE_L,
|
|
|
|
SS_MINER,
|
|
|
|
SS_MINER_L,
|
|
|
|
SS_ESCORT,
|
|
|
|
SS_ESCORT_L,
|
|
|
|
SS_MOBILE_RAY,
|
|
|
|
SS_MOBILE_RAY_L,
|
|
|
|
SS_TRANSPORTSHIP,
|
|
|
|
SS_TRANSPORTSHIP_L,
|
|
|
|
SS_CARGOSHIP,
|
|
|
|
SS_CARGOSHIP_L,
|
|
|
|
SS_SLAVETRANSPORT,
|
|
|
|
SS_SLAVETRANSPORT_L,
|
|
|
|
SS_BARRIER,
|
|
|
|
SS_MOBILESHIELD,
|
|
|
|
SS_MOBILESHIELD_L,
|
|
|
|
SS_ASTEROID,
|
|
|
|
SS_ASTEROID_SMALL,
|
|
|
|
SS_ASTEROID_SMALL_L,
|
|
|
|
SS_CLOAKFIGHTER,
|
|
|
|
SS_CLOAKFIGHTER_L,
|
|
|
|
SS_EVILURSULA,
|
|
|
|
SS_EVILURSULA_L,
|
|
|
|
SS_KRASS,
|
|
|
|
SS_KRASS_L,
|
|
|
|
SS_FRIGATE,
|
|
|
|
SS_FRIGATE_L,
|
|
|
|
SS_FRIGATE_WING1,
|
|
|
|
SS_FRIGATE_WING1_L,
|
|
|
|
SS_FRIGATE_WING2,
|
|
|
|
SS_FRIGATE_WING2_L,
|
|
|
|
SS_MINERBOSS,
|
|
|
|
SS_MINERBOSS_L,
|
|
|
|
SS_MINERBOSS_WING1,
|
|
|
|
SS_MINERBOSS_WING1_L,
|
|
|
|
SS_MINERBOSS_WING2,
|
|
|
|
SS_MINERBOSS_WING2_L,
|
|
|
|
SS_MINERBOSS_WING3,
|
|
|
|
SS_MINERBOSS_WING3_L,
|
|
|
|
SS_MINERBOSS_WING4,
|
|
|
|
SS_MINERBOSS_WING4_L,
|
|
|
|
SS_EXEC,
|
|
|
|
SS_EXEC_L,
|
|
|
|
SS_PLUTOBOSS,
|
|
|
|
SS_PLUTOBOSS_L,
|
|
|
|
SS_URANUSBOSS,
|
|
|
|
SS_URANUSBOSS_L,
|
|
|
|
SS_URANUSBOSS_WING1,
|
|
|
|
SS_URANUSBOSS_WING1_L,
|
|
|
|
SS_URANUSBOSS_WING2,
|
|
|
|
SS_URANUSBOSS_WING2_L,
|
|
|
|
SS_KLINE,
|
|
|
|
SS_KLINE_L,
|
|
|
|
SS_HIT_INDEX,
|
|
|
|
SS_MAX = SS_HIT_INDEX * 2
|
|
|
|
};
|
|
|
|
|
|
|
|
// Shop sprites
|
|
|
|
enum {
|
2016-01-05 04:25:00 +01:00
|
|
|
SHOP_S_PRIMARY,
|
|
|
|
SHOP_S_POWERUP,
|
|
|
|
SHOP_S_SECONDARY,
|
|
|
|
SHOP_S_CATALOG,
|
|
|
|
SHOP_S_SHIP_INFO,
|
|
|
|
SHOP_S_ITEM_INFO,
|
|
|
|
SHOP_S_MAX
|
2016-01-04 22:34:29 +01:00
|
|
|
};
|
|
|
|
|
2016-01-10 04:15:28 +01:00
|
|
|
// Text sprites
|
2015-03-03 05:32:48 +01:00
|
|
|
enum {
|
2016-01-04 18:41:19 +01:00
|
|
|
// Main menu
|
|
|
|
TS_PRESENTS = MAX_INFOLINES,
|
2015-03-03 05:32:48 +01:00
|
|
|
TS_AN_SDL_GAME,
|
|
|
|
TS_START_NEW_GAME,
|
|
|
|
TS_LOAD_GAME,
|
|
|
|
TS_CONTINUE_CURRENT_GAME,
|
|
|
|
TS_OPTIONS,
|
|
|
|
TS_CHEAT_OPTIONS,
|
|
|
|
TS_QUIT,
|
|
|
|
TS_SOUND,
|
|
|
|
TS_MUSIC,
|
|
|
|
TS_FULLSCREEN,
|
2015-05-22 00:49:04 +02:00
|
|
|
TS_AUTOPAUSE,
|
2015-03-03 05:32:48 +01:00
|
|
|
TS_BACK_TO_MAIN_MENU,
|
|
|
|
TS_SAVESLOT_0,
|
|
|
|
TS_SAVESLOT_1,
|
|
|
|
TS_SAVESLOT_2,
|
|
|
|
TS_SAVESLOT_3,
|
|
|
|
TS_SAVESLOT_4,
|
|
|
|
TS_SAVESLOT_5,
|
|
|
|
TS_UNLIMITED_SHIELD,
|
|
|
|
TS_UNLIMITED_AMMO,
|
|
|
|
TS_UNLIMITED_CASH,
|
|
|
|
TS_UNLIMITED_TIME,
|
|
|
|
TS_START_GAME,
|
2016-01-04 18:41:19 +01:00
|
|
|
TS_DIFFICULTY,
|
|
|
|
|
|
|
|
// Intermission
|
|
|
|
TS_CURRENT_SYSTEM,
|
|
|
|
TS_INFO_START_MISSION,
|
|
|
|
TS_INFO_GOTO,
|
|
|
|
TS_INFO_MAP,
|
|
|
|
TS_INFO_STATUS,
|
|
|
|
TS_INFO_SAVE_GAME,
|
|
|
|
TS_INFO_SHOP,
|
|
|
|
TS_INFO_COMMS,
|
|
|
|
TS_INFO_OPTIONS,
|
|
|
|
TS_INFO_EXIT,
|
|
|
|
TS_CURRENT_PLANET,
|
|
|
|
TS_DEST_PLANET,
|
|
|
|
|
|
|
|
// Status
|
|
|
|
TS_STATUS_HEADER,
|
|
|
|
TS_SHOTS_FIRED,
|
|
|
|
TS_HITS_SCORED,
|
|
|
|
TS_ACCURACY,
|
|
|
|
TS_OTHER_KILLS,
|
|
|
|
TS_CASH_EARNED,
|
|
|
|
TS_CHRIS_HEADER,
|
|
|
|
TS_CHRIS_KILLS,
|
|
|
|
TS_CHRIS_SHIELD_PICKUPS,
|
|
|
|
TS_CHRIS_PLASMA_PICKUPS,
|
|
|
|
TS_CHRIS_ROCKET_PICKUPS,
|
|
|
|
TS_CHRIS_POWERUP_PICKUPS,
|
|
|
|
TS_CHRIS_MINES_KILLED,
|
|
|
|
TS_CHRIS_SLAVES_RESCUED,
|
|
|
|
TS_PHOEBE_HEADER,
|
|
|
|
TS_PHOEBE_KILLS,
|
|
|
|
TS_PHOEBE_DEATHS,
|
|
|
|
TS_URSULA_HEADER,
|
|
|
|
TS_URSULA_KILLS,
|
|
|
|
TS_URSULA_DEATHS,
|
|
|
|
TS_STATUS_FOOTER,
|
|
|
|
|
|
|
|
// Mission
|
|
|
|
TS_RADIO,
|
2015-12-31 16:47:27 +01:00
|
|
|
TS_SHIELD,
|
|
|
|
TS_PLASMA_T,
|
|
|
|
TS_AMMO_T,
|
|
|
|
TS_TARGET,
|
2016-01-08 16:52:34 +01:00
|
|
|
TS_TARGET_SID,
|
|
|
|
TS_TARGET_PHOEBE,
|
2016-01-08 17:09:13 +01:00
|
|
|
TS_TARGET_KLINE,
|
2015-12-31 16:47:27 +01:00
|
|
|
TS_CASH_T,
|
|
|
|
TS_OBJECTIVES_T,
|
|
|
|
TS_TIME_T,
|
|
|
|
TS_POWER,
|
|
|
|
TS_OUTPUT,
|
|
|
|
TS_COOLER,
|
|
|
|
TS_PAUSED,
|
|
|
|
TS_TIME,
|
|
|
|
TS_PLASMA,
|
|
|
|
TS_AMMO,
|
|
|
|
TS_CASH,
|
2016-01-04 18:41:19 +01:00
|
|
|
TS_OBJECTIVES,
|
|
|
|
|
|
|
|
TS_MAX
|
2015-12-31 16:47:27 +01:00
|
|
|
};
|
|
|
|
|
2015-03-03 05:32:48 +01:00
|
|
|
// Menu types
|
|
|
|
enum {
|
|
|
|
MENU_MAIN,
|
|
|
|
MENU_DIFFICULTY,
|
|
|
|
MENU_LOAD,
|
|
|
|
MENU_OPTIONS,
|
|
|
|
MENU_CHEAT
|
|
|
|
};
|
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
// Shop items
|
|
|
|
enum {
|
|
|
|
SHOP_PLASMA_MAX_OUTPUT,
|
|
|
|
SHOP_PLASMA_MAX_DAMAGE,
|
|
|
|
SHOP_PLASMA_MAX_RATE,
|
|
|
|
SHOP_PLASMA_MIN_OUTPUT,
|
|
|
|
SHOP_PLASMA_MIN_DAMAGE,
|
|
|
|
SHOP_PLASMA_MIN_RATE,
|
2015-03-06 22:25:12 +01:00
|
|
|
SHOP_PLASMA_AMMO,
|
|
|
|
SHOP_ROCKET_AMMO,
|
2015-03-06 21:22:10 +01:00
|
|
|
SHOP_PLASMA_MAX_AMMO,
|
|
|
|
SHOP_ROCKET_MAX_AMMO,
|
|
|
|
SHOP_DOUBLE_ROCKETS,
|
|
|
|
SHOP_MICRO_ROCKETS,
|
|
|
|
SHOP_LASER,
|
|
|
|
SHOP_HOMING_MISSILE,
|
|
|
|
SHOP_CHARGER,
|
|
|
|
SHOP_DOUBLE_HOMING_MISSILES,
|
|
|
|
SHOP_MICRO_HOMING_MISSILES,
|
2016-01-05 04:25:00 +01:00
|
|
|
SHOP_MAX
|
2015-03-06 21:22:10 +01:00
|
|
|
};
|
|
|
|
|
2011-08-24 14:14:44 +02:00
|
|
|
// Font Colors
|
|
|
|
enum {
|
|
|
|
FONT_WHITE,
|
|
|
|
FONT_RED,
|
|
|
|
FONT_YELLOW,
|
|
|
|
FONT_GREEN,
|
|
|
|
FONT_CYAN,
|
Fixed more magic numbers.
God, this one was definitely the biggest headache of all of the
magic number erasing. Never did I expect such cryptic problems.
The first problem was that the entirety of the player's weapon
struct was a part of the save file, *including the weapon's "image
indexes"*. Since the indexes have been changed, and the originally
used one is now unavailable when it's requested, this was causing
a segfault later on. Had to fix this by setting the image index
when the game is loaded.
The second problem was related to another bug I've been confused
about for years: the one that causes mobile rays to fire 5 green
shots. The entire reason those shots were green was because
the weapon's image indexes were undefined, and *that was causing
them to default to 0*. 0 was simply the index of green plasma.
Of course, though, now attempting to use that image causes a
segfault, so for now, I've fixed this by changing the image index
of the mobile rays to the red plasma bolts.
There are still some magic numbers left, related to the intermission
screen. But the hardest part is now done, thank God.
2016-01-06 04:12:29 +01:00
|
|
|
FONT_OUTLINE, // a dark blue color
|
|
|
|
FONT_MAX
|
2011-08-24 14:14:44 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
// Sounds
|
|
|
|
enum {
|
|
|
|
SFX_EXPLOSION,
|
|
|
|
SFX_HIT,
|
|
|
|
SFX_DEATH,
|
|
|
|
SFX_MISSILE,
|
|
|
|
SFX_PLASMA,
|
|
|
|
SFX_CLOCK,
|
|
|
|
SFX_FLY,
|
|
|
|
SFX_ENERGYRAY,
|
|
|
|
SFX_PICKUP,
|
|
|
|
SFX_SHIELDUP,
|
|
|
|
SFX_CLOAK,
|
|
|
|
SFX_DEBRIS,
|
|
|
|
SFX_DEBRIS2,
|
|
|
|
SFX_LASER,
|
|
|
|
SFX_PLASMA2,
|
2015-03-08 15:38:58 +01:00
|
|
|
SFX_PLASMA3,
|
|
|
|
SFX_MAX
|
2011-08-24 14:14:44 +02:00
|
|
|
};
|
|
|
|
|
2015-03-29 19:11:12 +02:00
|
|
|
// Sections
|
2011-08-24 14:14:44 +02:00
|
|
|
enum {
|
|
|
|
SECTION_TITLE,
|
|
|
|
SECTION_INTERMISSION,
|
|
|
|
SECTION_GAME
|
|
|
|
};
|
|
|
|
|
2016-01-05 12:44:26 +01:00
|
|
|
// Systems
|
|
|
|
enum {
|
|
|
|
SYSTEM_SPIRIT,
|
|
|
|
SYSTEM_EYANANTH,
|
|
|
|
SYSTEM_MORDOR,
|
|
|
|
SYSTEM_SOL
|
|
|
|
};
|
|
|
|
|
2016-01-09 03:33:40 +01:00
|
|
|
// Planets (Spirit)
|
|
|
|
enum {
|
|
|
|
PLANET_HAIL,
|
|
|
|
PLANET_CERADSE,
|
|
|
|
PLANET_HINSTAG,
|
|
|
|
PLANET_JOLDAR,
|
|
|
|
PLANET_MOEBO
|
|
|
|
};
|
|
|
|
|
|
|
|
// Planets (Eyananth)
|
|
|
|
enum {
|
|
|
|
PLANET_NEROD,
|
|
|
|
PLANET_ALLEZ,
|
|
|
|
PLANET_URUSOR,
|
|
|
|
PLANET_DORIM,
|
|
|
|
PLANET_ELAMALE,
|
|
|
|
PLANET_RESCUESLAVES = 9 // For save compatibility
|
|
|
|
};
|
|
|
|
|
|
|
|
// Planets (Mordor)
|
|
|
|
enum {
|
|
|
|
PLANET_ODEON,
|
|
|
|
PLANET_FELLON,
|
|
|
|
PLANET_SIVEDI,
|
|
|
|
PLANET_ALMARTHA,
|
|
|
|
PLANET_POSWIC,
|
|
|
|
PLANET_ELLESH,
|
|
|
|
PLANET_CLOAKFIGHTER = 9 // For save compatibility
|
|
|
|
};
|
|
|
|
|
|
|
|
// Planets (Sol)
|
|
|
|
enum {
|
|
|
|
PLANET_MERCURY,
|
|
|
|
PLANET_VENUS,
|
|
|
|
PLANET_EARTH,
|
|
|
|
PLANET_MARS,
|
|
|
|
PLANET_JUPITER,
|
|
|
|
PLANET_SATURN,
|
|
|
|
PLANET_URANUS,
|
|
|
|
PLANET_NEPTUNE,
|
|
|
|
PLANET_PLUTO
|
|
|
|
};
|
|
|
|
|
2015-03-29 19:11:12 +02:00
|
|
|
// Missions
|
|
|
|
enum {
|
|
|
|
MISN_START,
|
|
|
|
MISN_HAIL,
|
|
|
|
MISN_CERADSE,
|
|
|
|
MISN_HINSTAG,
|
|
|
|
MISN_JOLDAR,
|
|
|
|
MISN_MOEBO,
|
|
|
|
MISN_RESCUESLAVES,
|
|
|
|
MISN_NEROD,
|
|
|
|
MISN_ALLEZ,
|
|
|
|
MISN_URUSOR,
|
|
|
|
MISN_DORIM,
|
|
|
|
MISN_ELAMALE,
|
|
|
|
MISN_CLOAKFIGHTER,
|
|
|
|
MISN_ODEON,
|
|
|
|
MISN_FELLON,
|
|
|
|
MISN_SIVEDI,
|
|
|
|
MISN_ALMARTHA,
|
|
|
|
MISN_POSWIC,
|
|
|
|
MISN_ELLESH,
|
|
|
|
MISN_PLUTO,
|
|
|
|
MISN_NEPTUNE,
|
|
|
|
MISN_URANUS,
|
|
|
|
MISN_SATURN,
|
|
|
|
MISN_JUPITER,
|
|
|
|
MISN_MARS,
|
|
|
|
MISN_EARTH,
|
|
|
|
MISN_VENUS,
|
|
|
|
MISN_INTERCEPTION,
|
|
|
|
MISN_MAX
|
|
|
|
};
|
|
|
|
|
2015-02-27 02:51:30 +01:00
|
|
|
// Difficulties
|
|
|
|
enum {
|
2015-03-28 14:51:49 +01:00
|
|
|
DIFFICULTY_EASY = 0,
|
2015-02-27 02:51:30 +01:00
|
|
|
DIFFICULTY_NORMAL,
|
|
|
|
DIFFICULTY_HARD,
|
2015-03-28 14:51:49 +01:00
|
|
|
DIFFICULTY_NIGHTMARE,
|
|
|
|
DIFFICULTY_ORIGINAL,
|
|
|
|
DIFFICULTY_MAX
|
2015-02-27 02:51:30 +01:00
|
|
|
};
|
|
|
|
|
2015-05-28 12:51:45 +02:00
|
|
|
const char * const systemNames[] = {"Spirit", "Eyananth", "Mordor", "Sol"};
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-05-28 12:51:45 +02:00
|
|
|
const char * const systemBackground[] = {
|
|
|
|
"gfx/spirit.jpg", "gfx/eyananth.jpg", "gfx/mordor.jpg", "gfx/sol.jpg"
|
|
|
|
};
|
2011-09-11 21:57:57 +02:00
|
|
|
|
2015-04-26 13:36:25 +02:00
|
|
|
const int rate2reload[6] = {15, 15, 13, 11, 9, 7};
|
2016-01-04 03:36:34 +01:00
|
|
|
const int screenWidth = SCREEN_WIDTH;
|
|
|
|
const int screenHeight = SCREEN_HEIGHT;
|
2015-02-27 05:28:31 +01:00
|
|
|
const int xViewBorder = 100;
|
|
|
|
const int yViewBorder = 100;
|
2015-02-27 06:25:00 +01:00
|
|
|
const float cameraMaxSpeed = 3.;
|
2015-03-03 15:25:32 +01:00
|
|
|
const int maxHoming = 20;
|
|
|
|
const int maxDoubleHoming = 15;
|
|
|
|
const int maxMicroHoming = 10;
|
2015-03-04 15:11:04 +01:00
|
|
|
|
|
|
|
#endif
|