Added an enum for missions/areas.
Eliminating another set of magic numbers, and God, that was tedious.
This commit is contained in:
parent
576d254e4a
commit
5019244da1
|
@ -686,7 +686,8 @@ bool alien_add()
|
|||
{
|
||||
int index = alien_getFreeIndex();
|
||||
|
||||
if ((index == -1) || (currentGame.area == 23) || (currentGame.area == 26))
|
||||
if ((index == -1) || (currentGame.area == MISN_JUPITER) ||
|
||||
(currentGame.area == MISN_VENUS))
|
||||
return 0;
|
||||
|
||||
signed char *alienArray;
|
||||
|
@ -696,28 +697,28 @@ bool alien_add()
|
|||
|
||||
switch(currentGame.area)
|
||||
{
|
||||
case 0:
|
||||
case 3:
|
||||
case 11:
|
||||
case MISN_START:
|
||||
case MISN_HINSTAG:
|
||||
case MISN_ELAMALE:
|
||||
numberOfAliens = 1;
|
||||
alienArray[0] = CD_DUALFIGHTER;
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
case 4:
|
||||
case 5:
|
||||
case MISN_HAIL:
|
||||
case MISN_CERADSE:
|
||||
case MISN_JOLDAR:
|
||||
case MISN_MOEBO:
|
||||
numberOfAliens = 2;
|
||||
alienArray[0] = CD_DUALFIGHTER;
|
||||
alienArray[1] = CD_PROTOFIGHTER;
|
||||
break;
|
||||
case 7:
|
||||
case 8:
|
||||
case MISN_NEROD:
|
||||
case MISN_ALLEZ:
|
||||
numberOfAliens = 3;
|
||||
alienArray[0] = CD_DUALFIGHTER;
|
||||
alienArray[1] = CD_PROTOFIGHTER;
|
||||
alienArray[2] = CD_AIMFIGHTER;
|
||||
break;
|
||||
case 9:
|
||||
case MISN_URUSOR:
|
||||
// This is the mission where you need to disable cargo ships.
|
||||
// Missiles are extremely bad in this mission, not because
|
||||
// of the damage they do to you, but because they tend to
|
||||
|
@ -728,26 +729,36 @@ bool alien_add()
|
|||
alienArray[0] = CD_PROTOFIGHTER;
|
||||
alienArray[1] = CD_AIMFIGHTER;
|
||||
break;
|
||||
case 10:
|
||||
case 15:
|
||||
case MISN_DORIM:
|
||||
case MISN_SIVEDI:
|
||||
numberOfAliens = 1;
|
||||
alienArray[0] = CD_ASTEROID;
|
||||
break;
|
||||
case 13:
|
||||
case 14:
|
||||
case 16:
|
||||
case MISN_ODEON:
|
||||
case MISN_FELLON:
|
||||
case MISN_ALMARTHA:
|
||||
numberOfAliens = 4;
|
||||
alienArray[0] = CD_DUALFIGHTER;
|
||||
alienArray[1] = CD_PROTOFIGHTER;
|
||||
alienArray[2] = CD_MISSILEBOAT;
|
||||
alienArray[3] = CD_AIMFIGHTER;
|
||||
break;
|
||||
case 18:
|
||||
case MISN_ELLESH:
|
||||
numberOfAliens = 2;
|
||||
alienArray[0] = CD_DUALFIGHTER;
|
||||
alienArray[1] = CD_MINER;
|
||||
break;
|
||||
case 25:
|
||||
case MISN_SATURN:
|
||||
numberOfAliens = 2;
|
||||
alienArray[0] = CD_AIMFIGHTER;
|
||||
alienArray[1] = CD_DUALFIGHTER;
|
||||
break;
|
||||
case MISN_MARS:
|
||||
numberOfAliens = 2;
|
||||
alienArray[0] = CD_ASTEROID;
|
||||
alienArray[1] = CD_ASTEROID2;
|
||||
break;
|
||||
case MISN_EARTH:
|
||||
numberOfAliens = 6;
|
||||
alienArray[0] = CD_DUALFIGHTER;
|
||||
alienArray[1] = CD_PROTOFIGHTER;
|
||||
|
@ -756,17 +767,7 @@ bool alien_add()
|
|||
alienArray[4] = CD_ESCORT;
|
||||
alienArray[5] = CD_MOBILE_RAY;
|
||||
break;
|
||||
case 22:
|
||||
numberOfAliens = 2;
|
||||
alienArray[0] = CD_AIMFIGHTER;
|
||||
alienArray[1] = CD_DUALFIGHTER;
|
||||
break;
|
||||
case 24:
|
||||
numberOfAliens = 2;
|
||||
alienArray[0] = CD_ASTEROID;
|
||||
alienArray[1] = CD_ASTEROID2;
|
||||
break;
|
||||
case MAX_MISSIONS - 1:
|
||||
case MISN_INTERCEPTION:
|
||||
numberOfAliens = 3;
|
||||
alienArray[0] = CD_DUALFIGHTER;
|
||||
alienArray[1] = CD_MISSILEBOAT;
|
||||
|
@ -785,10 +786,11 @@ bool alien_add()
|
|||
|
||||
signed char randEnemy = alienArray[rand() % numberOfAliens];
|
||||
|
||||
if ((currentGame.area != 10) && (currentGame.area != 15) &&
|
||||
(currentGame.area != 24))
|
||||
if ((currentGame.area != MISN_DORIM) &&
|
||||
(currentGame.area != MISN_SIVEDI) &&
|
||||
(currentGame.area != MISN_MARS))
|
||||
{
|
||||
if ((currentGame.system == 1) && (currentGame.area == MAX_MISSIONS - 1))
|
||||
if ((currentGame.system == 1) && (currentGame.area == MISN_INTERCEPTION))
|
||||
{
|
||||
if ((rand() % 5) == 0)
|
||||
randEnemy = CD_SLAVETRANSPORT;
|
||||
|
@ -836,7 +838,7 @@ bool alien_add()
|
|||
|
||||
aliens[index].ammo[0] = 0;
|
||||
|
||||
if (currentGame.area == 18)
|
||||
if (currentGame.area == MISN_ELLESH)
|
||||
aliens[index].flags |= FL_HASMINIMUMSPEED;
|
||||
|
||||
return true;
|
||||
|
@ -925,7 +927,7 @@ void alien_addFriendly(int type)
|
|||
aliens[type].classDef = CD_URSULA;
|
||||
|
||||
// For the sake of it being the final battle :)
|
||||
if (currentGame.area == 25)
|
||||
if (currentGame.area == MISN_EARTH)
|
||||
aliens[type].flags |= FL_IMMORTAL;
|
||||
}
|
||||
|
||||
|
@ -941,7 +943,7 @@ bool alien_place(object *alien)
|
|||
else
|
||||
alien->y = RANDRANGE(-screen->h, 0);
|
||||
|
||||
if (currentGame.area == 24)
|
||||
if (currentGame.area == MISN_MARS)
|
||||
{
|
||||
alien->x = screen->w;
|
||||
alien->y = RANDRANGE(screen->h / 3, (2 * screen->h) / 3);
|
||||
|
@ -1079,7 +1081,7 @@ void alien_setKlineAI(object *alien)
|
|||
// Weapon type change
|
||||
if ((rand() % 3) == 0)
|
||||
{
|
||||
if (currentGame.area != 26)
|
||||
if (currentGame.area != MISN_VENUS)
|
||||
{
|
||||
alien->flags &= ~FL_AIMS;
|
||||
|
||||
|
@ -1112,7 +1114,8 @@ void alien_setKlineAI(object *alien)
|
|||
case 1:
|
||||
case 2:
|
||||
// Kline only attacks then he is ready!
|
||||
if ((!(alien->flags & FL_NOFIRE)) && (currentGame.area == 11))
|
||||
if ((!(alien->flags & FL_NOFIRE)) &&
|
||||
(currentGame.area == MISN_MOEBO))
|
||||
alien->flags |= FL_DROPMINES;
|
||||
break;
|
||||
case 3:
|
||||
|
@ -1150,14 +1153,14 @@ void alien_searchForTarget(object *alien)
|
|||
|
||||
// Tell Sid not to attack craft that are already disabled or can
|
||||
// return fire. This will save him from messing about (unless we're on the last mission)
|
||||
if ((alien->classDef == CD_SID) && (currentGame.area != 25))
|
||||
if ((alien->classDef == CD_SID) && (currentGame.area != MISN_EARTH))
|
||||
{
|
||||
if ((targetEnemy->flags & FL_DISABLED) || (!(targetEnemy->flags & FL_NOFIRE)))
|
||||
return;
|
||||
}
|
||||
|
||||
// Tell Phoebe and Ursula not to attack ships that cannot fire or are disabled (unless we're on the last mission)
|
||||
if (currentGame.area != 25)
|
||||
if (currentGame.area != MISN_EARTH)
|
||||
{
|
||||
if ((alien->classDef == CD_PHOEBE) || (alien->classDef == CD_URSULA))
|
||||
{
|
||||
|
@ -1370,7 +1373,7 @@ void alien_destroy(object *alien, object *attacker)
|
|||
currentGame.wingMate2Ejects++;
|
||||
|
||||
// Phoebe cannot eject on the rescue mission
|
||||
if (currentGame.area != 7)
|
||||
if (currentGame.area != MISN_NEROD)
|
||||
{
|
||||
if ((alien->classDef == CD_PHOEBE) || (alien->classDef == CD_URSULA))
|
||||
setInfoLine(">> Ally has ejected! <<\n", FONT_RED);
|
||||
|
@ -1459,7 +1462,7 @@ void alien_hurt(object *alien, object *attacker, int damage, bool ion)
|
|||
|
||||
if (alien->classDef == CD_KLINE)
|
||||
{
|
||||
if (currentGame.area == 11)
|
||||
if (currentGame.area == MISN_ELAMALE)
|
||||
{
|
||||
if ((alien->shield <= alien->maxShield - 500) &&
|
||||
!(alien->flags & FL_LEAVESECTOR))
|
||||
|
@ -1469,7 +1472,7 @@ void alien_hurt(object *alien, object *attacker, int damage, bool ion)
|
|||
setRadioMessage(FACE_KLINE, "Seems I underestimated you, Bainfield. We'll meet again!", 1);
|
||||
}
|
||||
}
|
||||
else if (currentGame.area == 25)
|
||||
else if (currentGame.area == MISN_EARTH)
|
||||
{
|
||||
if ((alien->shield <= alien->maxShield - 750) &&
|
||||
!(alien->flags & FL_LEAVESECTOR))
|
||||
|
@ -1479,7 +1482,7 @@ void alien_hurt(object *alien, object *attacker, int damage, bool ion)
|
|||
setRadioMessage(FACE_SID, "Chris, Kethlan is getting away!", 1);
|
||||
}
|
||||
}
|
||||
else if (currentGame.area == 26)
|
||||
else if (currentGame.area == MISN_VENUS)
|
||||
{
|
||||
if (alien->shield + damage > 1500 &&
|
||||
alien->shield <= 1500)
|
||||
|
|
|
@ -141,16 +141,16 @@ void audio_playRandomTrack()
|
|||
|
||||
switch(currentGame.area)
|
||||
{
|
||||
case 0:
|
||||
case MISN_START:
|
||||
audio_playMusic("music/railjet_short.ogg", -1);
|
||||
break;
|
||||
case 5:
|
||||
case 11:
|
||||
case 18:
|
||||
case 25:
|
||||
case MISN_MOEBO:
|
||||
case MISN_ELAMALE:
|
||||
case MISN_ELLESH:
|
||||
case MISN_EARTH:
|
||||
audio_playMusic("music/orbital_colossus.ogg", -1);
|
||||
break;
|
||||
case 26:
|
||||
case MISN_VENUS:
|
||||
audio_playMusic("music/RE.ogg", -1);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -45,7 +45,8 @@ void bullet_add(object *theWeapon, object *attacker, int y, int dy)
|
|||
if (attacker->face == 0)
|
||||
{
|
||||
bullet->dx = theWeapon->speed;
|
||||
if ((currentGame.area == 18) || (currentGame.area == 24))
|
||||
if ((currentGame.area == MISN_ELLESH) ||
|
||||
(currentGame.area == MISN_MARS))
|
||||
bullet->dx += fabsf(engine.ssx + engine.smx);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -53,8 +53,10 @@ void addCollectable(float x, float y, int type, int value, int life)
|
|||
if ((currentGame.difficulty == DIFFICULTY_NIGHTMARE) ||
|
||||
((currentGame.difficulty != DIFFICULTY_EASY) &&
|
||||
(currentGame.difficulty != DIFFICULTY_ORIGINAL) &&
|
||||
((currentGame.area == 5) || (currentGame.area == 11) ||
|
||||
(currentGame.area == 18) || (currentGame.area == 25))))
|
||||
((currentGame.area == MISN_MOEBO) ||
|
||||
(currentGame.area == MISN_ELAMALE) ||
|
||||
(currentGame.area == MISN_ELLESH) ||
|
||||
(currentGame.area == MISN_EARTH))))
|
||||
{
|
||||
// Deny the Super Charge in Nightmare difficulty, and on bosses.
|
||||
r = rand() % 59;
|
||||
|
@ -113,7 +115,7 @@ void addCollectable(float x, float y, int type, int value, int life)
|
|||
{
|
||||
// Cash is just rare in the original game. You can still grind,
|
||||
// just not as much.
|
||||
if ((currentGame.area == MAX_MISSIONS - 1) && (type == P_CASH))
|
||||
if ((currentGame.area == MISN_INTERCEPTION) && (type == P_CASH))
|
||||
{
|
||||
if (rand() % 10 > 0)
|
||||
return;
|
||||
|
@ -122,7 +124,7 @@ void addCollectable(float x, float y, int type, int value, int life)
|
|||
else
|
||||
{
|
||||
// No cash or ammo on interceptions. Completely stops grinding.
|
||||
if ((currentGame.area == MAX_MISSIONS - 1) &&
|
||||
if ((currentGame.area == MISN_INTERCEPTION) &&
|
||||
((type == P_CASH) || (type == P_PLASMA_AMMO) || (type == P_ROCKET)))
|
||||
{
|
||||
return;
|
||||
|
@ -334,11 +336,11 @@ void doCollectables()
|
|||
|
||||
case P_PLASMA_RATE:
|
||||
currentGame.powerups++;
|
||||
if ((currentGame.area != MAX_MISSIONS - 1) ||
|
||||
if ((currentGame.area != MISN_INTERCEPTION) ||
|
||||
(currentGame.difficulty == DIFFICULTY_ORIGINAL) ||
|
||||
(player.ammo[0] > 0))
|
||||
{
|
||||
if ((currentGame.area != MAX_MISSIONS - 1) ||
|
||||
if ((currentGame.area != MISN_INTERCEPTION) ||
|
||||
(currentGame.difficulty == DIFFICULTY_ORIGINAL))
|
||||
LIMIT_ADD(player.ammo[0], collectable->value,
|
||||
0, currentGame.maxPlasmaAmmo);
|
||||
|
@ -359,11 +361,11 @@ void doCollectables()
|
|||
|
||||
case P_PLASMA_SHOT:
|
||||
currentGame.powerups++;
|
||||
if ((currentGame.area != MAX_MISSIONS - 1) ||
|
||||
if ((currentGame.area != MISN_INTERCEPTION) ||
|
||||
(currentGame.difficulty == DIFFICULTY_ORIGINAL) ||
|
||||
(player.ammo[0] > 0))
|
||||
{
|
||||
if ((currentGame.area != MAX_MISSIONS - 1) ||
|
||||
if ((currentGame.area != MISN_INTERCEPTION) ||
|
||||
(currentGame.difficulty == DIFFICULTY_ORIGINAL))
|
||||
LIMIT_ADD(player.ammo[0], collectable->value,
|
||||
0, currentGame.maxPlasmaAmmo);
|
||||
|
@ -384,11 +386,11 @@ void doCollectables()
|
|||
|
||||
case P_PLASMA_DAMAGE:
|
||||
currentGame.powerups++;
|
||||
if ((currentGame.area != MAX_MISSIONS - 1) ||
|
||||
if ((currentGame.area != MISN_INTERCEPTION) ||
|
||||
(currentGame.difficulty == DIFFICULTY_ORIGINAL) ||
|
||||
(player.ammo[0] > 0))
|
||||
{
|
||||
if ((currentGame.area != MAX_MISSIONS - 1) ||
|
||||
if ((currentGame.area != MISN_INTERCEPTION) ||
|
||||
(currentGame.difficulty == DIFFICULTY_ORIGINAL))
|
||||
LIMIT_ADD(player.ammo[0], collectable->value,
|
||||
0, currentGame.maxPlasmaAmmo);
|
||||
|
@ -408,11 +410,11 @@ void doCollectables()
|
|||
|
||||
case P_SUPER:
|
||||
currentGame.powerups++;
|
||||
if ((currentGame.area != MAX_MISSIONS - 1) ||
|
||||
if ((currentGame.area != MISN_INTERCEPTION) ||
|
||||
(currentGame.difficulty == DIFFICULTY_ORIGINAL) ||
|
||||
(player.ammo[0] > 0))
|
||||
{
|
||||
if ((currentGame.area != MAX_MISSIONS - 1) ||
|
||||
if ((currentGame.area != MISN_INTERCEPTION) ||
|
||||
(currentGame.difficulty == DIFFICULTY_ORIGINAL))
|
||||
LIMIT_ADD(player.ammo[0], collectable->value,
|
||||
0, currentGame.maxPlasmaAmmo);
|
||||
|
|
37
src/defs.h
37
src/defs.h
|
@ -97,7 +97,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#define MAX_TEXTSHAPES 150
|
||||
#define MAX_FONTSHAPES 6
|
||||
#define MAX_SHOPSHAPES 6
|
||||
#define MAX_MISSIONS 28
|
||||
#define MAX_CARGO 20
|
||||
|
||||
#define SHIP_HIT_INDEX 60
|
||||
|
@ -355,6 +354,7 @@ enum {
|
|||
SFX_MAX
|
||||
};
|
||||
|
||||
// Sections
|
||||
enum {
|
||||
|
||||
SECTION_TITLE,
|
||||
|
@ -362,6 +362,7 @@ enum {
|
|||
SECTION_GAME
|
||||
};
|
||||
|
||||
// Faces
|
||||
enum {
|
||||
|
||||
FACE_CHRIS = 90,
|
||||
|
@ -373,6 +374,40 @@ enum {
|
|||
FACE_CREW
|
||||
};
|
||||
|
||||
// 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
|
||||
};
|
||||
|
||||
// Difficulties
|
||||
enum {
|
||||
DIFFICULTY_EASY = 0,
|
||||
|
|
136
src/game.cpp
136
src/game.cpp
|
@ -24,7 +24,7 @@ Game currentGame;
|
|||
void newGame()
|
||||
{
|
||||
currentGame.system = 0;
|
||||
currentGame.area = 0;
|
||||
currentGame.area = MISN_START;
|
||||
currentGame.sfxVolume = 0;
|
||||
currentGame.musicVolume = 0;
|
||||
|
||||
|
@ -194,9 +194,9 @@ int mainGameLoop()
|
|||
showErrorAndExit(2, "");
|
||||
}
|
||||
|
||||
if (currentGame.area == 2)
|
||||
if (currentGame.area == MISN_CERADSE)
|
||||
addCargo(&aliens[index], P_CARGO);
|
||||
else if (currentGame.area == 7)
|
||||
else if (currentGame.area == MISN_NEROD)
|
||||
addCargo(&aliens[index], P_PHOEBE);
|
||||
|
||||
if (index == ALIEN_KLINE)
|
||||
|
@ -229,16 +229,17 @@ int mainGameLoop()
|
|||
barrierSpeed++;
|
||||
}
|
||||
|
||||
if ((currentGame.area == 17) && (aliens[index].classDef == CD_BOSS))
|
||||
if ((currentGame.area == MISN_POSWIC) &&
|
||||
(aliens[index].classDef == CD_BOSS))
|
||||
{
|
||||
aliens[index].imageIndex[1] = 29;
|
||||
aliens[index].flags |= FL_IMMORTAL;
|
||||
}
|
||||
|
||||
if (currentGame.area == 18)
|
||||
if (currentGame.area == MISN_ELLESH)
|
||||
aliens[index].flags |= FL_HASMINIMUMSPEED;
|
||||
|
||||
if (currentGame.area == 23)
|
||||
if (currentGame.area == MISN_JUPITER)
|
||||
{
|
||||
aliens[index].flags = FL_WEAPCO;
|
||||
if (index == ALIEN_BOSS)
|
||||
|
@ -248,7 +249,7 @@ int mainGameLoop()
|
|||
|
||||
fclose(fp);
|
||||
|
||||
if (currentGame.area == 5)
|
||||
if (currentGame.area == MISN_MOEBO)
|
||||
{
|
||||
aliens[ALIEN_BOSS].target = &player;
|
||||
aliens[ALIEN_BOSS].x = -screen->w / 2;
|
||||
|
@ -264,7 +265,8 @@ int mainGameLoop()
|
|||
aliens[ALIEN_BOSS_PART2].dx = -20;
|
||||
aliens[ALIEN_BOSS_PART2].dy = 37;
|
||||
}
|
||||
else if ((currentGame.area == 11) || (currentGame.area == 14))
|
||||
else if ((currentGame.area == MISN_ELAMALE) ||
|
||||
(currentGame.area == MISN_FELLON))
|
||||
{
|
||||
aliens[ALIEN_BOSS].target = &player;
|
||||
aliens[ALIEN_BOSS].x = -screen->w / 2;
|
||||
|
@ -290,7 +292,7 @@ int mainGameLoop()
|
|||
aliens[ALIEN_BOSS_PART4].dx = -35;
|
||||
aliens[ALIEN_BOSS_PART4].dy = 20;
|
||||
|
||||
if (currentGame.area == 14)
|
||||
if (currentGame.area == MISN_FELLON)
|
||||
{
|
||||
aliens[ALIEN_BOSS].AIType = AI_EVASIVE;
|
||||
|
||||
|
@ -304,7 +306,7 @@ int mainGameLoop()
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (currentGame.area == 21)
|
||||
else if (currentGame.area == MISN_URANUS)
|
||||
{
|
||||
aliens[ALIEN_BOSS].target = &player;
|
||||
aliens[ALIEN_BOSS].x = -screen->w / 2;
|
||||
|
@ -319,10 +321,10 @@ int mainGameLoop()
|
|||
}
|
||||
|
||||
// specific for Phoebe being captured!
|
||||
if (currentGame.area == 7)
|
||||
if (currentGame.area == MISN_NEROD)
|
||||
currentGame.hasWingMate1 = 1;
|
||||
|
||||
if (currentGame.area == 11)
|
||||
if (currentGame.area == MISN_ELAMALE)
|
||||
aliens[ALIEN_KLINE].active = false;
|
||||
|
||||
for (int i = 0 ; i < engine.maxAliens ; i++)
|
||||
|
@ -334,34 +336,35 @@ int mainGameLoop()
|
|||
if (currentGame.hasWingMate2)
|
||||
alien_addFriendly(ALIEN_URSULA);
|
||||
|
||||
if ((currentGame.area == 9) || (currentGame.area == 17) ||
|
||||
(currentGame.area == 25))
|
||||
if ((currentGame.area == MISN_URUSOR) ||
|
||||
(currentGame.area == MISN_POSWIC) ||
|
||||
(currentGame.area == MISN_EARTH))
|
||||
alien_addFriendly(ALIEN_SID);
|
||||
|
||||
// Disable Wingmates for certain missions
|
||||
switch (currentGame.area)
|
||||
{
|
||||
case 7:
|
||||
case 9:
|
||||
case 10:
|
||||
case 15:
|
||||
case 16:
|
||||
case 18:
|
||||
case 24:
|
||||
case 26:
|
||||
case MISN_NEROD:
|
||||
case MISN_URUSOR:
|
||||
case MISN_DORIM:
|
||||
case MISN_SIVEDI:
|
||||
case MISN_ALMARTHA:
|
||||
case MISN_ELLESH:
|
||||
case MISN_MARS:
|
||||
case MISN_VENUS:
|
||||
aliens[ALIEN_PHOEBE].active = false;
|
||||
aliens[ALIEN_URSULA].active = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (currentGame.area == 10)
|
||||
if (currentGame.area == MISN_DORIM)
|
||||
{
|
||||
aliens[0].collectChance = 100;
|
||||
aliens[0].collectType = P_ESCAPEPOD;
|
||||
}
|
||||
|
||||
// Some specifics for interception missions
|
||||
if (currentGame.area == MAX_MISSIONS - 1)
|
||||
if (currentGame.area == MISN_INTERCEPTION)
|
||||
{
|
||||
if ((currentGame.system > 1) && ((rand() % 5) == 0))
|
||||
{
|
||||
|
@ -391,7 +394,7 @@ int mainGameLoop()
|
|||
}
|
||||
}
|
||||
|
||||
if (currentGame.area == 26)
|
||||
if (currentGame.area == MISN_VENUS)
|
||||
{
|
||||
aliens[ALIEN_KLINE].x = player.x + 1000;
|
||||
aliens[ALIEN_KLINE].y = player.y;
|
||||
|
@ -407,35 +410,34 @@ int mainGameLoop()
|
|||
// Set target energy meter
|
||||
switch (currentGame.area)
|
||||
{
|
||||
case 5:
|
||||
case 11:
|
||||
case 13:
|
||||
case 17:
|
||||
case 18:
|
||||
case 19:
|
||||
case 20:
|
||||
case 21:
|
||||
case 23:
|
||||
case MISN_MOEBO:
|
||||
case MISN_ELAMALE:
|
||||
case MISN_ODEON:
|
||||
case MISN_FELLON:
|
||||
case MISN_POSWIC:
|
||||
case MISN_ELLESH:
|
||||
case MISN_PLUTO:
|
||||
case MISN_NEPTUNE:
|
||||
case MISN_URANUS:
|
||||
case MISN_JUPITER:
|
||||
player_setTarget(ALIEN_BOSS);
|
||||
break;
|
||||
case 7:
|
||||
case MISN_NEROD:
|
||||
player_setTarget(ALIEN_PHOEBE);
|
||||
break;
|
||||
case 8:
|
||||
case MISN_ALLEZ:
|
||||
player_setTarget(ALIEN_GOODTRANSPORT);
|
||||
break;
|
||||
case 9:
|
||||
case MISN_URUSOR:
|
||||
player_setTarget(ALIEN_SID);
|
||||
break;
|
||||
case 10:
|
||||
case MISN_DORIM:
|
||||
player_setTarget(0);
|
||||
break;
|
||||
case 25:
|
||||
case 26:
|
||||
case MISN_EARTH:
|
||||
case MISN_VENUS:
|
||||
player_setTarget(ALIEN_KLINE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
clearInfoLines();
|
||||
|
@ -498,7 +500,7 @@ int mainGameLoop()
|
|||
|
||||
if ((missionFailed()) && (engine.missionCompleteTimer == 0))
|
||||
{
|
||||
if (currentGame.area != 5)
|
||||
if (currentGame.area != MISN_MOEBO)
|
||||
engine.missionCompleteTimer = SDL_GetTicks() + 4000;
|
||||
}
|
||||
|
||||
|
@ -509,14 +511,15 @@ int mainGameLoop()
|
|||
{
|
||||
if (SDL_GetTicks() >= engine.missionCompleteTimer)
|
||||
{
|
||||
if ((!missionFailed()) && (currentGame.area != 26))
|
||||
if ((!missionFailed()) && (currentGame.area != MISN_VENUS))
|
||||
{
|
||||
leaveSector();
|
||||
if ((engine.done == 2) && (currentGame.area != 10) &&
|
||||
(currentGame.area != 15))
|
||||
if ((engine.done == 2) &&
|
||||
(currentGame.area != MISN_DORIM) &&
|
||||
(currentGame.area != MISN_SIVEDI))
|
||||
{
|
||||
if ((aliens[ALIEN_PHOEBE].shield > 0) &&
|
||||
(currentGame.area != 25))
|
||||
(currentGame.area != MISN_EARTH))
|
||||
{
|
||||
aliens[ALIEN_PHOEBE].x = player.x - 40;
|
||||
aliens[ALIEN_PHOEBE].y = player.y - 35;
|
||||
|
@ -524,15 +527,15 @@ int mainGameLoop()
|
|||
}
|
||||
|
||||
if ((aliens[ALIEN_URSULA].shield > 0) &&
|
||||
(currentGame.area != 25))
|
||||
(currentGame.area != MISN_EARTH))
|
||||
{
|
||||
aliens[ALIEN_URSULA].x = player.x - 40;
|
||||
aliens[ALIEN_URSULA].y = player.y + 45;
|
||||
aliens[ALIEN_URSULA].face = 0;
|
||||
}
|
||||
|
||||
if ((currentGame.area == 9) ||
|
||||
(currentGame.area == 17))
|
||||
if ((currentGame.area == MISN_URUSOR) ||
|
||||
(currentGame.area == MISN_POSWIC))
|
||||
{
|
||||
aliens[ALIEN_SID].x = player.x - 100;
|
||||
aliens[ALIEN_SID].y = player.y;
|
||||
|
@ -540,7 +543,8 @@ int mainGameLoop()
|
|||
}
|
||||
}
|
||||
}
|
||||
else if ((currentGame.area == 26) && (engine.musicVolume > 0))
|
||||
else if ((currentGame.area == MISN_VENUS) &&
|
||||
(engine.musicVolume > 0))
|
||||
{
|
||||
LIMIT_ADD(engine.musicVolume, -0.2, 0, 100);
|
||||
audio_setMusicVolume((int)engine.musicVolume);
|
||||
|
@ -676,7 +680,8 @@ int mainGameLoop()
|
|||
if (alien->x > alien->target->x) alien->face = 1;
|
||||
}
|
||||
|
||||
if ((currentGame.area == 18) && (alien->classDef == CD_BOSS))
|
||||
if ((currentGame.area == MISN_ELLESH) &&
|
||||
(alien->classDef == CD_BOSS))
|
||||
alien->face = 0;
|
||||
|
||||
if ((alien->flags & FL_DEPLOYDRONES) && ((rand() % 300) == 0))
|
||||
|
@ -849,7 +854,7 @@ int mainGameLoop()
|
|||
}
|
||||
}
|
||||
|
||||
if ((currentGame.area == 24) && (alien->x < -300))
|
||||
if ((currentGame.area == MISN_MARS) && (alien->x < -300))
|
||||
alien->active = false;
|
||||
}
|
||||
else
|
||||
|
@ -886,7 +891,7 @@ int mainGameLoop()
|
|||
(!(alien->flags & FL_DISABLED)))
|
||||
alien_move(alien);
|
||||
|
||||
if ((currentGame.area != 18) || (alien->shield < 0))
|
||||
if ((currentGame.area != MISN_ELLESH) || (alien->shield < 0))
|
||||
alien->x += engine.ssx;
|
||||
|
||||
alien->x += engine.smx;
|
||||
|
@ -917,7 +922,7 @@ int mainGameLoop()
|
|||
}
|
||||
}
|
||||
|
||||
if ((currentGame.area == 24) && (engine.addAliens > -1))
|
||||
if ((currentGame.area == MISN_MARS) && (engine.addAliens > -1))
|
||||
{
|
||||
if ((rand() % 10) == 0)
|
||||
// XXX: The originally specified range for x was [800, 100],
|
||||
|
@ -943,7 +948,8 @@ int mainGameLoop()
|
|||
engine.missionCompleteTimer = SDL_GetTicks() + 7000;
|
||||
|
||||
// specific to Boss 1
|
||||
if ((currentGame.area == 5) && (aliens[ALIEN_BOSS].flags & FL_ESCAPED))
|
||||
if ((currentGame.area == MISN_MOEBO) &&
|
||||
(aliens[ALIEN_BOSS].flags & FL_ESCAPED))
|
||||
{
|
||||
audio_playSound(SFX_DEATH, aliens[ALIEN_BOSS].x);
|
||||
clearScreen(white);
|
||||
|
@ -965,33 +971,33 @@ int mainGameLoop()
|
|||
|
||||
if ((player.shield > 0) && (!missionFailed()))
|
||||
{
|
||||
if (currentGame.area < 26)
|
||||
if (currentGame.area < MISN_VENUS)
|
||||
missionFinishedScreen();
|
||||
|
||||
switch (currentGame.area)
|
||||
{
|
||||
case 5:
|
||||
case MISN_MOEBO:
|
||||
doCutscene(1);
|
||||
doCutscene(2);
|
||||
break;
|
||||
case 7:
|
||||
case MISN_NEROD:
|
||||
doCutscene(3);
|
||||
break;
|
||||
case 11:
|
||||
case MISN_ELAMALE:
|
||||
doCutscene(4);
|
||||
break;
|
||||
case 13:
|
||||
case MISN_ODEON:
|
||||
doCutscene(5);
|
||||
break;
|
||||
case 18:
|
||||
case MISN_ELLESH:
|
||||
doCutscene(6);
|
||||
break;
|
||||
case 26:
|
||||
case MISN_VENUS:
|
||||
doCredits();
|
||||
break;
|
||||
}
|
||||
|
||||
if (currentGame.area < 26)
|
||||
if (currentGame.area < MISN_VENUS)
|
||||
{
|
||||
updateSystemStatus();
|
||||
saveGame(0);
|
||||
|
@ -999,7 +1005,7 @@ int mainGameLoop()
|
|||
|
||||
rtn = 1;
|
||||
|
||||
if (currentGame.area == 26)
|
||||
if (currentGame.area == MISN_VENUS)
|
||||
rtn = 0;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -768,7 +768,7 @@ int galaxyMap()
|
|||
{
|
||||
if ((rand() % interceptionChance) == 0)
|
||||
{
|
||||
currentGame.area = MAX_MISSIONS - 1;
|
||||
currentGame.area = MISN_INTERCEPTION;
|
||||
rtn = 2;
|
||||
engine.done = 1;
|
||||
currentGame.distanceCovered = destRect.w;
|
||||
|
|
|
@ -139,7 +139,7 @@ const char *getKlineInsult()
|
|||
"And now you're nothing but a DEAD hero."
|
||||
};
|
||||
|
||||
if (currentGame.area != 26)
|
||||
if (currentGame.area != MISN_VENUS)
|
||||
return (insult[rand() % 3]);
|
||||
else
|
||||
return (insult[3 + (rand() % 2)]);
|
||||
|
@ -162,8 +162,8 @@ void getPlayerDeathMessage()
|
|||
int faceToUse = FACE_PHOEBE;
|
||||
|
||||
|
||||
if ((currentGame.area == 9) || (currentGame.area == 17) ||
|
||||
(currentGame.area == 25))
|
||||
if ((currentGame.area == MISN_URUSOR) || (currentGame.area == MISN_POSWIC) ||
|
||||
(currentGame.area == MISN_EARTH))
|
||||
{
|
||||
faceToUse = FACE_SID;
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ void doInfo()
|
|||
blitText(30);
|
||||
}
|
||||
|
||||
if (currentGame.area != MAX_MISSIONS - 1)
|
||||
if (currentGame.area != MISN_INTERCEPTION)
|
||||
{
|
||||
blitText(9); // mission objectives
|
||||
sprintf(text, "%d", (currentMission.remainingObjectives1 + currentMission.remainingObjectives2));
|
||||
|
@ -300,7 +300,7 @@ void doInfo()
|
|||
}
|
||||
|
||||
// Do the target's remaining shield (if required)
|
||||
if (currentGame.area != 10)
|
||||
if (currentGame.area != MISN_DORIM)
|
||||
{
|
||||
if ((engine.targetIndex > -1) && (aliens[engine.targetIndex].shield > 0) && (engine.targetIndex > 9))
|
||||
{
|
||||
|
|
977
src/missions.cpp
977
src/missions.cpp
File diff suppressed because it is too large
Load Diff
|
@ -224,8 +224,9 @@ void doPlayer()
|
|||
engine.keyState[KEY_PAUSE] = 0;
|
||||
}
|
||||
|
||||
if (((currentGame.area == 18) && (aliens[ALIEN_BOSS].shield > 0)) ||
|
||||
(currentGame.area == 24))
|
||||
if (((currentGame.area == MISN_ELLESH) &&
|
||||
(aliens[ALIEN_BOSS].shield > 0)) ||
|
||||
(currentGame.area == MISN_MARS))
|
||||
{
|
||||
player.face = 0;
|
||||
xmoved = true;
|
||||
|
@ -321,7 +322,7 @@ void doPlayer()
|
|||
getPlayerDeathMessage();
|
||||
|
||||
// Make it look like the ships are all still moving...
|
||||
if (currentGame.area == 18)
|
||||
if (currentGame.area == MISN_ELLESH)
|
||||
{
|
||||
for (int i = 0 ; i < ALIEN_MAX ; i++)
|
||||
aliens[i].flags |= FL_LEAVESECTOR;
|
||||
|
@ -344,14 +345,14 @@ void doPlayer()
|
|||
LIMIT(engine.ssy, -cameraMaxSpeed, cameraMaxSpeed);
|
||||
|
||||
// Specific for the mission were you have to chase the Executive Transport
|
||||
if ((currentGame.area == 18) && (aliens[ALIEN_BOSS].shield > 0) &&
|
||||
if ((currentGame.area == MISN_ELLESH) && (aliens[ALIEN_BOSS].shield > 0) &&
|
||||
(player.shield > 0))
|
||||
{
|
||||
engine.ssx = -6;
|
||||
engine.ssy = 0;
|
||||
}
|
||||
|
||||
if (currentGame.area == 24)
|
||||
if (currentGame.area == MISN_MARS)
|
||||
{
|
||||
engine.ssx = -6;
|
||||
engine.ssy = 0;
|
||||
|
|
|
@ -48,7 +48,7 @@ void loadScriptEvents()
|
|||
gameEvent[i].flag = 0;
|
||||
}
|
||||
|
||||
if ((currentGame.area == MAX_MISSIONS - 1) &&
|
||||
if ((currentGame.area == MISN_INTERCEPTION) &&
|
||||
(aliens[ALIEN_KLINE].classDef == CD_KLINE) &&
|
||||
(aliens[ALIEN_KLINE].active))
|
||||
setKlineGreeting();
|
||||
|
|
|
@ -180,7 +180,7 @@ int doTitle()
|
|||
|
||||
// required to stop the title screen crashing
|
||||
currentGame.system = 0;
|
||||
currentGame.area = 0;
|
||||
currentGame.area = MISN_START;
|
||||
|
||||
loadGameGraphics();
|
||||
|
||||
|
|
Loading…
Reference in New Issue