Changed all the magic number ship indexes to named ship indexes.
Also, now that the magic numbers are gone, I was able to get rid of all the hardsetting of numbers for the special ship indexes (which was only in place to avoid breaking the magic numbers).
This commit is contained in:
parent
5400ce6205
commit
56240606e9
|
@ -743,15 +743,15 @@ void aliens_init()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MISN_ALLEZ:
|
case MISN_ALLEZ:
|
||||||
aliens[ALIEN_GOODTRANSPORT] = alien_defs[CD_GOODTRANSPORT];
|
aliens[ALIEN_FRIEND1] = alien_defs[CD_GOODTRANSPORT];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MISN_URUSOR:
|
case MISN_URUSOR:
|
||||||
aliens[20] = alien_defs[CD_CARGOSHIP];
|
aliens[ALIEN_BOSS_PART1] = alien_defs[CD_CARGOSHIP];
|
||||||
aliens[21] = alien_defs[CD_CARGOSHIP];
|
aliens[ALIEN_BOSS_PART2] = alien_defs[CD_CARGOSHIP];
|
||||||
aliens[22] = alien_defs[CD_CARGOSHIP];
|
aliens[ALIEN_BOSS_PART3] = alien_defs[CD_CARGOSHIP];
|
||||||
aliens[23] = alien_defs[CD_CARGOSHIP];
|
aliens[ALIEN_BOSS_PART4] = alien_defs[CD_CARGOSHIP];
|
||||||
aliens[24] = alien_defs[CD_CARGOSHIP];
|
aliens[ALIEN_BOSS_PART5] = alien_defs[CD_CARGOSHIP];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MISN_ELAMALE:
|
case MISN_ELAMALE:
|
||||||
|
@ -761,8 +761,8 @@ void aliens_init()
|
||||||
aliens[ALIEN_BOSS_PART3] = alien_defs[CD_BOSS2_WING3];
|
aliens[ALIEN_BOSS_PART3] = alien_defs[CD_BOSS2_WING3];
|
||||||
aliens[ALIEN_BOSS_PART4] = alien_defs[CD_BOSS2_WING4];
|
aliens[ALIEN_BOSS_PART4] = alien_defs[CD_BOSS2_WING4];
|
||||||
aliens[ALIEN_KLINE] = alien_defs[CD_KLINE];
|
aliens[ALIEN_KLINE] = alien_defs[CD_KLINE];
|
||||||
aliens[20] = alien_defs[CD_SLAVETRANSPORT];
|
aliens[ALIEN_BOSS_PART5] = alien_defs[CD_SLAVETRANSPORT];
|
||||||
aliens[21] = alien_defs[CD_SLAVETRANSPORT];
|
aliens[ALIEN_BOSS_PART6] = alien_defs[CD_SLAVETRANSPORT];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MISN_ODEON:
|
case MISN_ODEON:
|
||||||
|
@ -775,15 +775,15 @@ void aliens_init()
|
||||||
aliens[ALIEN_BOSS_PART2] = alien_defs[CD_BOSS2_WING2];
|
aliens[ALIEN_BOSS_PART2] = alien_defs[CD_BOSS2_WING2];
|
||||||
aliens[ALIEN_BOSS_PART3] = alien_defs[CD_BOSS2_WING3];
|
aliens[ALIEN_BOSS_PART3] = alien_defs[CD_BOSS2_WING3];
|
||||||
aliens[ALIEN_BOSS_PART4] = alien_defs[CD_BOSS2_WING4];
|
aliens[ALIEN_BOSS_PART4] = alien_defs[CD_BOSS2_WING4];
|
||||||
aliens[ALIEN_GOODTRANSPORT] = alien_defs[CD_REBELCARRIER];
|
aliens[ALIEN_FRIEND1] = alien_defs[CD_REBELCARRIER];
|
||||||
aliens[20] = alien_defs[CD_REBELCARRIER];
|
aliens[ALIEN_FRIEND2] = alien_defs[CD_REBELCARRIER];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MISN_ALMARTHA:
|
case MISN_ALMARTHA:
|
||||||
aliens[ALIEN_BOSS_PART1] = alien_defs[CD_CLOAKFIGHTER];
|
aliens[ALIEN_BOSS_PART1] = alien_defs[CD_CLOAKFIGHTER];
|
||||||
aliens[ALIEN_BOSS_PART2] = alien_defs[CD_CLOAKFIGHTER];
|
aliens[ALIEN_BOSS_PART2] = alien_defs[CD_CLOAKFIGHTER];
|
||||||
aliens[ALIEN_BOSS_PART3] = alien_defs[CD_CLOAKFIGHTER];
|
aliens[ALIEN_BOSS_PART3] = alien_defs[CD_CLOAKFIGHTER];
|
||||||
aliens[ALIEN_GOODTRANSPORT] = alien_defs[CD_KRASS];
|
aliens[ALIEN_FRIEND1] = alien_defs[CD_KRASS];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MISN_POSWIC:
|
case MISN_POSWIC:
|
||||||
|
@ -805,8 +805,8 @@ void aliens_init()
|
||||||
aliens[ALIEN_BOSS_PART2] = alien_defs[CD_BARRIER];
|
aliens[ALIEN_BOSS_PART2] = alien_defs[CD_BARRIER];
|
||||||
aliens[ALIEN_BOSS_PART3] = alien_defs[CD_BARRIER];
|
aliens[ALIEN_BOSS_PART3] = alien_defs[CD_BARRIER];
|
||||||
aliens[ALIEN_BOSS_PART4] = alien_defs[CD_BARRIER];
|
aliens[ALIEN_BOSS_PART4] = alien_defs[CD_BARRIER];
|
||||||
aliens[20] = alien_defs[CD_BARRIER];
|
aliens[ALIEN_BOSS_PART5] = alien_defs[CD_BARRIER];
|
||||||
aliens[21] = alien_defs[CD_BARRIER];
|
aliens[ALIEN_BOSS_PART6] = alien_defs[CD_BARRIER];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MISN_NEPTUNE:
|
case MISN_NEPTUNE:
|
||||||
|
@ -815,7 +815,7 @@ void aliens_init()
|
||||||
aliens[ALIEN_BOSS_PART2] = alien_defs[CD_MOBILESHIELD];
|
aliens[ALIEN_BOSS_PART2] = alien_defs[CD_MOBILESHIELD];
|
||||||
aliens[ALIEN_BOSS_PART3] = alien_defs[CD_MOBILESHIELD];
|
aliens[ALIEN_BOSS_PART3] = alien_defs[CD_MOBILESHIELD];
|
||||||
aliens[ALIEN_BOSS_PART4] = alien_defs[CD_MOBILESHIELD];
|
aliens[ALIEN_BOSS_PART4] = alien_defs[CD_MOBILESHIELD];
|
||||||
aliens[20] = alien_defs[CD_MOBILESHIELD];
|
aliens[ALIEN_BOSS_PART5] = alien_defs[CD_MOBILESHIELD];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MISN_URANUS:
|
case MISN_URANUS:
|
||||||
|
@ -825,12 +825,12 @@ void aliens_init()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MISN_SATURN:
|
case MISN_SATURN:
|
||||||
aliens[9] = alien_defs[CD_MOBILE_RAY];
|
aliens[ALIEN_BOSS_PART1] = alien_defs[CD_MOBILE_RAY];
|
||||||
aliens[10] = alien_defs[CD_MOBILE_RAY];
|
aliens[ALIEN_BOSS_PART2] = alien_defs[CD_MOBILE_RAY];
|
||||||
aliens[11] = alien_defs[CD_MOBILE_RAY];
|
aliens[ALIEN_BOSS_PART3] = alien_defs[CD_MOBILE_RAY];
|
||||||
aliens[12] = alien_defs[CD_MOBILE_RAY];
|
aliens[ALIEN_BOSS_PART4] = alien_defs[CD_MOBILE_RAY];
|
||||||
aliens[13] = alien_defs[CD_MOBILE_RAY];
|
aliens[ALIEN_BOSS_PART5] = alien_defs[CD_MOBILE_RAY];
|
||||||
aliens[14] = alien_defs[CD_MOBILE_RAY];
|
aliens[ALIEN_BOSS_PART6] = alien_defs[CD_MOBILE_RAY];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MISN_JUPITER:
|
case MISN_JUPITER:
|
||||||
|
@ -893,7 +893,7 @@ void aliens_init()
|
||||||
aliens[i].speed = 3;
|
aliens[i].speed = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((aliens[i].classDef == CD_MOBILE_RAY) && (i >= 11))
|
if ((aliens[i].classDef == CD_MOBILE_RAY) && (i >= ALIEN_BOSS_PART3))
|
||||||
{
|
{
|
||||||
aliens[i].active = false;
|
aliens[i].active = false;
|
||||||
}
|
}
|
||||||
|
|
15
src/defs.h
15
src/defs.h
|
@ -133,16 +133,19 @@ enum {
|
||||||
|
|
||||||
// These are for Alien *indexes* NOT classdefs!!
|
// These are for Alien *indexes* NOT classdefs!!
|
||||||
enum {
|
enum {
|
||||||
ALIEN_BOSS_PART4 = 10,
|
ALIEN_BOSS = 10,
|
||||||
ALIEN_BOSS_PART3 = 11,
|
ALIEN_BOSS_PART1,
|
||||||
ALIEN_BOSS_PART2 = 12,
|
ALIEN_BOSS_PART2,
|
||||||
ALIEN_BOSS_PART1 = 13,
|
ALIEN_BOSS_PART3,
|
||||||
ALIEN_BOSS = 14,
|
ALIEN_BOSS_PART4,
|
||||||
|
ALIEN_BOSS_PART5,
|
||||||
|
ALIEN_BOSS_PART6,
|
||||||
ALIEN_KLINE,
|
ALIEN_KLINE,
|
||||||
ALIEN_PHOEBE,
|
ALIEN_PHOEBE,
|
||||||
ALIEN_URSULA,
|
ALIEN_URSULA,
|
||||||
ALIEN_SID,
|
ALIEN_SID,
|
||||||
ALIEN_GOODTRANSPORT = 19,
|
ALIEN_FRIEND1,
|
||||||
|
ALIEN_FRIEND2,
|
||||||
ALIEN_MAX = 25
|
ALIEN_MAX = 25
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -97,19 +97,19 @@ void events_init()
|
||||||
events[3].time = 60;
|
events[3].time = 60;
|
||||||
events[3].face = FACE_CREW;
|
events[3].face = FACE_CREW;
|
||||||
strcpy(events[3].message, "Alright! We've got the weapons working again! Now to look at the engines...");
|
strcpy(events[3].message, "Alright! We've got the weapons working again! Now to look at the engines...");
|
||||||
events[3].entity = ALIEN_GOODTRANSPORT;
|
events[3].entity = ALIEN_FRIEND1;
|
||||||
events[3].flag = -FL_NOFIRE;
|
events[3].flag = -FL_NOFIRE;
|
||||||
|
|
||||||
events[4].time = 80;
|
events[4].time = 80;
|
||||||
events[4].face = FACE_CREW;
|
events[4].face = FACE_CREW;
|
||||||
strcpy(events[4].message, "DAMN! The guns are offline again! What you guys doing back there?!");
|
strcpy(events[4].message, "DAMN! The guns are offline again! What you guys doing back there?!");
|
||||||
events[4].entity = ALIEN_GOODTRANSPORT;
|
events[4].entity = ALIEN_FRIEND1;
|
||||||
events[4].flag = FL_NOFIRE;
|
events[4].flag = FL_NOFIRE;
|
||||||
|
|
||||||
events[5].time = 100;
|
events[5].time = 100;
|
||||||
events[5].face = FACE_CREW;
|
events[5].face = FACE_CREW;
|
||||||
strcpy(events[5].message, "Chris, HELP!! We've lost all system power! We're a sitting duck out here!");
|
strcpy(events[5].message, "Chris, HELP!! We've lost all system power! We're a sitting duck out here!");
|
||||||
events[5].entity = ALIEN_GOODTRANSPORT;
|
events[5].entity = ALIEN_FRIEND1;
|
||||||
events[5].flag = FL_DISABLED;
|
events[5].flag = FL_DISABLED;
|
||||||
|
|
||||||
events[6].time = 120;
|
events[6].time = 120;
|
||||||
|
@ -119,7 +119,7 @@ void events_init()
|
||||||
events[7].time = 140;
|
events[7].time = 140;
|
||||||
events[7].face = FACE_CREW;
|
events[7].face = FACE_CREW;
|
||||||
strcpy(events[7].message, "Okay! We've fixed that one. We think we've found the problem with the engines too...");
|
strcpy(events[7].message, "Okay! We've fixed that one. We think we've found the problem with the engines too...");
|
||||||
events[7].entity = ALIEN_GOODTRANSPORT;
|
events[7].entity = ALIEN_FRIEND1;
|
||||||
events[7].flag = -FL_DISABLED;
|
events[7].flag = -FL_DISABLED;
|
||||||
|
|
||||||
events[8].time = 177;
|
events[8].time = 177;
|
||||||
|
@ -127,7 +127,7 @@ void events_init()
|
||||||
strcpy(events[8].message, "Engines fixed! Let's move!");
|
strcpy(events[8].message, "Engines fixed! Let's move!");
|
||||||
|
|
||||||
events[9].time = 180;
|
events[9].time = 180;
|
||||||
events[9].entity = ALIEN_GOODTRANSPORT;
|
events[9].entity = ALIEN_FRIEND1;
|
||||||
events[9].flag = FL_LEAVESECTOR | FL_IMMORTAL;
|
events[9].flag = FL_LEAVESECTOR | FL_IMMORTAL;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -230,7 +230,7 @@ void events_init()
|
||||||
events[8].time = 150;
|
events[8].time = 150;
|
||||||
events[8].face = FACE_KRASS;
|
events[8].face = FACE_KRASS;
|
||||||
strcpy(events[8].message, "I've earned my fee. I'll see you around, boy!");
|
strcpy(events[8].message, "I've earned my fee. I'll see you around, boy!");
|
||||||
events[8].entity = ALIEN_GOODTRANSPORT;
|
events[8].entity = ALIEN_FRIEND1;
|
||||||
events[8].flag = FL_LEAVESECTOR;
|
events[8].flag = FL_LEAVESECTOR;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -248,28 +248,28 @@ void events_init()
|
||||||
events[0].time = 45;
|
events[0].time = 45;
|
||||||
events[0].face = FACE_SID;
|
events[0].face = FACE_SID;
|
||||||
strcpy(events[0].message, "Chris! Another two of those ray cannons just arrived in your sector!");
|
strcpy(events[0].message, "Chris! Another two of those ray cannons just arrived in your sector!");
|
||||||
events[0].entity = 11;
|
events[0].entity = ALIEN_BOSS_PART3;
|
||||||
events[0].flag = -FL_ACTIVATE;
|
events[0].flag = -FL_ACTIVATE;
|
||||||
|
|
||||||
events[1].time = 45;
|
events[1].time = 45;
|
||||||
events[1].entity = 12;
|
events[1].entity = ALIEN_BOSS_PART4;
|
||||||
events[1].flag = -FL_ACTIVATE;
|
events[1].flag = -FL_ACTIVATE;
|
||||||
|
|
||||||
events[2].time = 90;
|
events[2].time = 90;
|
||||||
events[2].face = FACE_SID;
|
events[2].face = FACE_SID;
|
||||||
strcpy(events[2].message, "Two more!");
|
strcpy(events[2].message, "Two more!");
|
||||||
events[2].entity = 13;
|
events[2].entity = ALIEN_BOSS_PART5;
|
||||||
events[2].flag = -FL_ACTIVATE;
|
events[2].flag = -FL_ACTIVATE;
|
||||||
|
|
||||||
events[3].time = 90;
|
events[3].time = 90;
|
||||||
events[3].entity = 14;
|
events[3].entity = ALIEN_BOSS_PART6;
|
||||||
events[3].flag = -FL_ACTIVATE;
|
events[3].flag = -FL_ACTIVATE;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MISN_JUPITER:
|
case MISN_JUPITER:
|
||||||
events[0].time = 1;
|
events[0].time = 1;
|
||||||
events[0].entity = 10;
|
events[0].entity = ALIEN_BOSS_PART1;
|
||||||
events[0].flag = -FL_ACTIVATE;
|
events[0].flag = -FL_ACTIVATE;
|
||||||
|
|
||||||
events[1].time = 2;
|
events[1].time = 2;
|
||||||
|
@ -285,7 +285,7 @@ void events_init()
|
||||||
strcpy(events[3].message, "Good point. It would be foolish to expect anything else.");
|
strcpy(events[3].message, "Good point. It would be foolish to expect anything else.");
|
||||||
|
|
||||||
events[4].time = 15;
|
events[4].time = 15;
|
||||||
events[4].entity = 11;
|
events[4].entity = ALIEN_BOSS_PART2;
|
||||||
events[4].flag = -FL_ACTIVATE;
|
events[4].flag = -FL_ACTIVATE;
|
||||||
|
|
||||||
events[5].time = 20;
|
events[5].time = 20;
|
||||||
|
@ -297,11 +297,11 @@ void events_init()
|
||||||
strcpy(events[6].message, "I have a name, you know. Do you remember it?");
|
strcpy(events[6].message, "I have a name, you know. Do you remember it?");
|
||||||
|
|
||||||
events[4].time = 45;
|
events[4].time = 45;
|
||||||
events[4].entity = 12;
|
events[4].entity = ALIEN_BOSS_PART3;
|
||||||
events[4].flag = -FL_ACTIVATE;
|
events[4].flag = -FL_ACTIVATE;
|
||||||
|
|
||||||
events[4].time = 45;
|
events[4].time = 45;
|
||||||
events[4].entity = 13;
|
events[4].entity = ALIEN_BOSS_PART4;
|
||||||
events[4].flag = -FL_ACTIVATE;
|
events[4].flag = -FL_ACTIVATE;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
20
src/game.cpp
20
src/game.cpp
|
@ -2041,15 +2041,15 @@ int game_mainLoop()
|
||||||
{
|
{
|
||||||
if ((rand() % 5) > 0)
|
if ((rand() % 5) > 0)
|
||||||
{
|
{
|
||||||
aliens[10] = alien_defs[CD_CLOAKFIGHTER];
|
aliens[ALIEN_BOSS] = alien_defs[CD_CLOAKFIGHTER];
|
||||||
aliens[10].owner = &aliens[10];
|
aliens[ALIEN_BOSS].owner = &aliens[ALIEN_BOSS];
|
||||||
aliens[10].target = &aliens[10];
|
aliens[ALIEN_BOSS].target = &aliens[ALIEN_BOSS];
|
||||||
aliens[10].shield = 1000;
|
aliens[ALIEN_BOSS].shield = 1000;
|
||||||
aliens[10].active = true;
|
aliens[ALIEN_BOSS].active = true;
|
||||||
aliens[10].x = player.x - 1000;
|
aliens[ALIEN_BOSS].x = player.x - 1000;
|
||||||
aliens[10].y = player.y;
|
aliens[ALIEN_BOSS].y = player.y;
|
||||||
player_setTarget(10);
|
player_setTarget(ALIEN_BOSS);
|
||||||
aliens[10].shield = game.experimentalShield;
|
aliens[ALIEN_BOSS].shield = game.experimentalShield;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2086,7 +2086,7 @@ int game_mainLoop()
|
||||||
player_setTarget(ALIEN_PHOEBE);
|
player_setTarget(ALIEN_PHOEBE);
|
||||||
break;
|
break;
|
||||||
case MISN_ALLEZ:
|
case MISN_ALLEZ:
|
||||||
player_setTarget(ALIEN_GOODTRANSPORT);
|
player_setTarget(ALIEN_FRIEND1);
|
||||||
break;
|
break;
|
||||||
case MISN_URUSOR:
|
case MISN_URUSOR:
|
||||||
player_setTarget(ALIEN_SID);
|
player_setTarget(ALIEN_SID);
|
||||||
|
|
Loading…
Reference in New Issue