Substantially increased the cost of plasma upgrades.

I feel these were extremely underpriced. $1000 for triple bullets?
That's dirt-cheap! Even in hard mode, I have no trouble getting that.
This commit is contained in:
onpon4 2015-03-07 09:42:24 -05:00
parent 9974848ce8
commit a3efbc06cc
16 changed files with 1011 additions and 953 deletions

File diff suppressed because it is too large Load Diff

View File

@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "Starfighter.h" #include "Starfighter.h"
object defEnemy[MAX_DEFALIENS]; object alien_defs[CD_MAX];
object enemy[MAX_ALIENS]; object aliens[MAX_ALIENS];
/* /*
This simply pulls back an alien from the array that is This simply pulls back an alien from the array that is
@ -31,7 +31,7 @@ static int alien_getFreeIndex()
{ {
for (int i = 0 ; i < engine.maxAliens ; i++) for (int i = 0 ; i < engine.maxAliens ; i++)
{ {
if (!enemy[i].active) if (!aliens[i].active)
{ {
return i; return i;
} }
@ -164,44 +164,44 @@ bool alien_add()
delete[] alienArray; delete[] alienArray;
enemy[index] = defEnemy[randEnemy]; aliens[index] = alien_defs[randEnemy];
enemy[index].active = true; aliens[index].active = true;
enemy[index].face = rand() % 2; aliens[index].face = rand() % 2;
enemy[index].owner = &enemy[index]; // Most enemies will own themselves aliens[index].owner = &aliens[index]; // Most enemies will own themselves
enemy[index].target = &enemy[index]; aliens[index].target = &aliens[index];
enemy[index].thinktime = (50 + rand() % 50); aliens[index].thinktime = (50 + rand() % 50);
enemy[index].systemPower = enemy[index].maxShield; aliens[index].systemPower = aliens[index].maxShield;
enemy[index].deathCounter = 0 - (enemy[index].maxShield * 3); aliens[index].deathCounter = 0 - (aliens[index].maxShield * 3);
enemy[index].hit = 0; aliens[index].hit = 0;
limitInt(&enemy[index].deathCounter, -250, 0); limitInt(&aliens[index].deathCounter, -250, 0);
// Attempts to place an alien. If it fails, the alien is deactivated. // Attempts to place an alien. If it fails, the alien is deactivated.
for (int i = 0 ; i < 100 ; i++) for (int i = 0 ; i < 100 ; i++)
{ {
if (alien_place(&enemy[index])) if (alien_place(&aliens[index]))
break; break;
enemy[index].active = false; aliens[index].active = false;
return false; return false;
} }
if (enemy[index].classDef == CD_CARGOSHIP) if (aliens[index].classDef == CD_CARGOSHIP)
addCargo(&enemy[index], P_CARGO); addCargo(&aliens[index], P_CARGO);
if (enemy[index].classDef == CD_MOBILE_RAY) if (aliens[index].classDef == CD_MOBILE_RAY)
enemy[index].shield = 25; aliens[index].shield = 25;
if (enemy[index].classDef == CD_ESCORT) if (aliens[index].classDef == CD_ESCORT)
enemy[index].shield = 50; aliens[index].shield = 50;
enemy[index].dx = rrand(-2, 2); aliens[index].dx = rrand(-2, 2);
enemy[index].dy = rrand(-2, 2); aliens[index].dy = rrand(-2, 2);
enemy[index].ammo[0] = 0; aliens[index].ammo[0] = 0;
if (currentGame.area == 18) if (currentGame.area == 18)
enemy[index].flags |= FL_HASMINIMUMSPEED; aliens[index].flags |= FL_HASMINIMUMSPEED;
return true; return true;
} }
@ -213,18 +213,18 @@ void alien_addDrone(object *hostAlien)
if (index == -1) if (index == -1)
return; return;
enemy[index] = defEnemy[CD_DRONE]; aliens[index] = alien_defs[CD_DRONE];
enemy[index].active = true; aliens[index].active = true;
enemy[index].face = rand() % 2; aliens[index].face = rand() % 2;
enemy[index].owner = &enemy[index]; // Most enemies will own themselves aliens[index].owner = &aliens[index]; // Most enemies will own themselves
enemy[index].target = &enemy[index]; aliens[index].target = &aliens[index];
enemy[index].thinktime = (50 + rand() % 50); aliens[index].thinktime = (50 + rand() % 50);
enemy[index].systemPower = enemy[index].maxShield; aliens[index].systemPower = aliens[index].maxShield;
enemy[index].deathCounter = 0 - (enemy[index].maxShield * 3); aliens[index].deathCounter = 0 - (aliens[index].maxShield * 3);
enemy[index].hit = 0; aliens[index].hit = 0;
enemy[index].x = hostAlien->x + rand() % 50; aliens[index].x = hostAlien->x + rand() % 50;
enemy[index].y = hostAlien->y + rand() % 50; aliens[index].y = hostAlien->y + rand() % 50;
} }
void alien_addSmallAsteroid(object *hostAlien) void alien_addSmallAsteroid(object *hostAlien)
@ -239,7 +239,7 @@ void alien_addSmallAsteroid(object *hostAlien)
addBullet(&weapon[W_ROCKETS], hostAlien, 0, 0); addBullet(&weapon[W_ROCKETS], hostAlien, 0, 0);
for (int i = 10 ; i < 20 ; i++) for (int i = 10 ; i < 20 ; i++)
if (!enemy[i].active) if (!aliens[i].active)
index = i; index = i;
if (index == -1) if (index == -1)
@ -247,58 +247,58 @@ void alien_addSmallAsteroid(object *hostAlien)
if ((rand() % 10) > 3) if ((rand() % 10) > 3)
{ {
enemy[index] = defEnemy[CD_ASTEROID2]; aliens[index] = alien_defs[CD_ASTEROID2];
enemy[index].imageIndex[0] = enemy[index].imageIndex[1] = 39 + rand() % 2; aliens[index].imageIndex[0] = aliens[index].imageIndex[1] = 39 + rand() % 2;
enemy[index].image[0] = shipShape[enemy[index].imageIndex[0]]; aliens[index].image[0] = shipShape[aliens[index].imageIndex[0]];
enemy[index].image[1] = shipShape[enemy[index].imageIndex[1]]; aliens[index].image[1] = shipShape[aliens[index].imageIndex[1]];
} }
else else
{ {
enemy[index] = defEnemy[CD_DRONE]; aliens[index] = alien_defs[CD_DRONE];
} }
enemy[index].owner = &enemy[index]; // Most enemies will own themselves aliens[index].owner = &aliens[index]; // Most enemies will own themselves
enemy[index].target = &enemy[index]; aliens[index].target = &aliens[index];
enemy[index].thinktime = 1; aliens[index].thinktime = 1;
enemy[index].systemPower = enemy[index].maxShield; aliens[index].systemPower = aliens[index].maxShield;
enemy[index].deathCounter = 0 - (enemy[index].maxShield * 3); aliens[index].deathCounter = 0 - (aliens[index].maxShield * 3);
enemy[index].hit = 0; aliens[index].hit = 0;
enemy[index].x = hostAlien->x; aliens[index].x = hostAlien->x;
enemy[index].y = hostAlien->y; aliens[index].y = hostAlien->y;
enemy[index].active = true; aliens[index].active = true;
} }
void alien_addFriendly(int type) void alien_addFriendly(int type)
{ {
if (type != FR_SID) if (type != FR_SID)
enemy[type] = defEnemy[CD_FRIEND]; aliens[type] = alien_defs[CD_FRIEND];
else else
enemy[type] = defEnemy[CD_SID]; aliens[type] = alien_defs[CD_SID];
enemy[type].owner = &enemy[type]; aliens[type].owner = &aliens[type];
enemy[type].target = &enemy[type]; aliens[type].target = &aliens[type];
enemy[type].active = true; aliens[type].active = true;
if (rand() % 2 == 0) if (rand() % 2 == 0)
enemy[type].x = rrand((int)(screen->w / 2), (int)(screen->w / 2) + 150); aliens[type].x = rrand((int)(screen->w / 2), (int)(screen->w / 2) + 150);
else else
enemy[type].x = rrand((int)(screen->w / 2) - 150, (int)(screen->w / 2)); aliens[type].x = rrand((int)(screen->w / 2) - 150, (int)(screen->w / 2));
if (rand() % 2 == 0) if (rand() % 2 == 0)
enemy[type].y = rrand((int)(screen->h / 2), (int)(screen->h / 2) + 150); aliens[type].y = rrand((int)(screen->h / 2), (int)(screen->h / 2) + 150);
else else
enemy[type].y = rrand((int)(screen->h / 2) - 150, (int)(screen->h / 2)); aliens[type].y = rrand((int)(screen->h / 2) - 150, (int)(screen->h / 2));
if (type == FR_PHOEBE) if (type == FR_PHOEBE)
enemy[type].classDef = CD_PHOEBE; aliens[type].classDef = CD_PHOEBE;
if (type == FR_URSULA) if (type == FR_URSULA)
enemy[type].classDef = CD_URSULA; aliens[type].classDef = CD_URSULA;
// For the sake of it being the final battle :) // For the sake of it being the final battle :)
if (currentGame.area == 25) if (currentGame.area == 25)
enemy[type].flags |= FL_IMMORTAL; aliens[type].flags |= FL_IMMORTAL;
} }
bool alien_place(object *alien) bool alien_place(object *alien)
@ -321,9 +321,11 @@ bool alien_place(object *alien)
for (int i = 0 ; i < MAX_ALIENS ; i++) for (int i = 0 ; i < MAX_ALIENS ; i++)
{ {
if ((enemy[i].owner != alien) && (enemy[i].shield > 0)) if ((aliens[i].owner != alien) && (aliens[i].shield > 0))
{ {
if (collision(alien->x, alien->y, alien->image[0]->w, alien->image[0]->h, enemy[i].x, enemy[i].y, enemy[i].image[0]->w, enemy[i].image[0]->h)) if (collision(alien->x, alien->y, alien->image[0]->w,
alien->image[0]->h, aliens[i].x, aliens[i].y,
aliens[i].image[0]->w, aliens[i].image[0]->h))
return false; return false;
} }
} }
@ -334,7 +336,7 @@ bool alien_place(object *alien)
void alien_setAI(object *alien) void alien_setAI(object *alien)
{ {
// Make friendly craft generally concentrate on smaller fighters // Make friendly craft generally concentrate on smaller fighters
if ((alien->flags & FL_FRIEND) && (alien->target == &enemy[WC_BOSS])) if ((alien->flags & FL_FRIEND) && (alien->target == &aliens[WC_BOSS]))
{ {
if ((rand() % 5) == 0) if ((rand() % 5) == 0)
{ {
@ -476,10 +478,13 @@ void alien_setKlineAI(object *alien)
switch(rand() % 10) switch(rand() % 10)
{ {
case 0: case 0:
if ((alien->weaponType[0] != W_DIRSHOCKMISSILE) && (alien->weaponType[1] != W_MICRO_HOMING_MISSILES)) if ((alien->weaponType[0] != W_DIRSHOCKMISSILE) &&
(alien->weaponType[1] != W_MICRO_HOMING_MISSILES))
alien->flags |= FL_CONTINUOUS_FIRE; alien->flags |= FL_CONTINUOUS_FIRE;
alien->dx = ((alien->x - alien->target->x) / ((300 / alien->speed) + rand() % 100)); alien->dx = ((alien->x - alien->target->x) /
alien->dy = ((alien->y - alien->target->y) / ((300 / alien->speed) + rand() % 100)); ((300 / alien->speed) + rand() % 100));
alien->dy = ((alien->y - alien->target->y) /
((300 / alien->speed) + rand() % 100));
break; break;
case 1: case 1:
case 2: case 2:
@ -518,7 +523,7 @@ void alien_searchForTarget(object *alien)
i = rand() % MAX_ALIENS; i = rand() % MAX_ALIENS;
object *targetEnemy = &enemy[i]; object *targetEnemy = &aliens[i];
// Tell Sid not to attack craft that are already disabled or can // 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) // return fire. This will save him from messing about (unless we're on the last mission)
@ -537,7 +542,8 @@ void alien_searchForTarget(object *alien)
if (targetEnemy->classDef == CD_BOSS) if (targetEnemy->classDef == CD_BOSS)
return; return;
if ((targetEnemy->flags & FL_DISABLED) || (targetEnemy->flags & FL_NOFIRE)) if ((targetEnemy->flags & FL_DISABLED) ||
(targetEnemy->flags & FL_NOFIRE))
return; return;
} }
} }
@ -593,7 +599,8 @@ int alien_checkTarget(object *alien)
return 1; return 1;
// Not at the correct vertical height // Not at the correct vertical height
if ((alien->y < alien->target->y - 15) || (alien->y > alien->target->y + alien->target->image[0]->h + 15)) if ((alien->y < alien->target->y - 15) ||
(alien->y > alien->target->y + alien->target->image[0]->h + 15))
return 0; return 0;
return 1; return 1;
@ -605,13 +612,15 @@ any enemy craft that enter their line of sight.
*/ */
int alien_enemiesInFront(object *alien) int alien_enemiesInFront(object *alien)
{ {
object *anEnemy = enemy; object *anEnemy = aliens;
for (int i = 0 ; i < MAX_ALIENS ; i++) for (int i = 0 ; i < MAX_ALIENS ; i++)
{ {
if ((alien != anEnemy) && (anEnemy->flags & FL_WEAPCO) && (anEnemy->shield > 0)) if ((alien != anEnemy) && (anEnemy->flags & FL_WEAPCO) &&
(anEnemy->shield > 0))
{ {
if ((alien->y > anEnemy->y - 15) && (alien->y < anEnemy->y + anEnemy->image[0]->h + 15)) if ((alien->y > anEnemy->y - 15) &&
(alien->y < anEnemy->y + anEnemy->image[0]->h + 15))
{ {
if ((alien->face == 1) && (anEnemy->x < alien->x)) if ((alien->face == 1) && (anEnemy->x < alien->x))
return 1; return 1;
@ -660,13 +669,18 @@ void alien_move(object *alien)
} }
} }
object *anEnemy = enemy; object *anEnemy = aliens;
if (checkCollisions) if (checkCollisions)
{ {
for (int i = 0 ; i < MAX_ALIENS ; i++) for (int i = 0 ; i < MAX_ALIENS ; i++)
{ {
if ((alien->flags & FL_LEAVESECTOR) || (alien->classDef == CD_DRONE) || (alien->classDef == CD_ASTEROID2) || (alien->owner == anEnemy->owner) || (alien->owner->owner == anEnemy->owner) || (anEnemy->shield < 1)) if ((alien->flags & FL_LEAVESECTOR) ||
(alien->classDef == CD_DRONE) ||
(alien->classDef == CD_ASTEROID2) ||
(alien->owner == anEnemy->owner) ||
(alien->owner->owner == anEnemy->owner) ||
(anEnemy->shield < 1))
{ {
anEnemy++; anEnemy++;
continue; continue;
@ -674,7 +688,8 @@ void alien_move(object *alien)
if (collision(alien, anEnemy)) if (collision(alien, anEnemy))
{ {
if ((anEnemy->classDef == CD_BARRIER) && (anEnemy->owner != alien)) if ((anEnemy->classDef == CD_BARRIER) &&
(anEnemy->owner != alien))
{ {
alien->shield--; alien->shield--;
alien->hit = 3; alien->hit = 3;

View File

@ -20,8 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef ALIEN_H #ifndef ALIEN_H
#define ALIEN_H #define ALIEN_H
extern object defEnemy[MAX_DEFALIENS]; extern object alien_defs[CD_MAX];
extern object enemy[MAX_ALIENS]; extern object aliens[MAX_ALIENS];
bool alien_add(); bool alien_add();
void alien_addDrone(object *hostAlien); void alien_addDrone(object *hostAlien);

View File

@ -204,7 +204,7 @@ void fireBullet(object *attacker, int weaponType)
// Reset the weapon reload time. Double it if it is not friendly or a boss or Kline // Reset the weapon reload time. Double it if it is not friendly or a boss or Kline
attacker->reload[weaponType] = theWeapon->reload[0]; attacker->reload[weaponType] = theWeapon->reload[0];
if ((attacker->flags & FL_WEAPCO) && (attacker != &enemy[WC_BOSS]) && (attacker != &enemy[WC_KLINE]) && (theWeapon->id != W_LASER)) if ((attacker->flags & FL_WEAPCO) && (attacker != &aliens[WC_BOSS]) && (attacker != &aliens[WC_KLINE]) && (theWeapon->id != W_LASER))
attacker->reload[weaponType] *= 2; attacker->reload[weaponType] *= 2;
if ((engine.cheatAmmo) || (theWeapon->id == WT_LASER)) if ((engine.cheatAmmo) || (theWeapon->id == WT_LASER))
@ -248,22 +248,22 @@ static object *getRandomEnemy(object *bullet)
i = rand() % MAX_ALIENS; i = rand() % MAX_ALIENS;
if ((enemy[i].shield < 1) || (!enemy[i].active)) if ((aliens[i].shield < 1) || (!aliens[i].active))
return NULL; return NULL;
if ((bullet->owner->flags & FL_WEAPCO) && (enemy[i].flags & FL_WEAPCO)) if ((bullet->owner->flags & FL_WEAPCO) && (aliens[i].flags & FL_WEAPCO))
return NULL; return NULL;
if ((bullet->owner->flags & FL_FRIEND) && (enemy[i].flags & FL_FRIEND)) if ((bullet->owner->flags & FL_FRIEND) && (aliens[i].flags & FL_FRIEND))
return NULL; return NULL;
if (abs((int)bullet->x - (int)enemy[i].target->x) > 800) if (abs((int)bullet->x - (int)aliens[i].target->x) > 800)
return NULL; return NULL;
if (abs((int)bullet->y - (int)enemy[i].target->y) > 200) if (abs((int)bullet->y - (int)aliens[i].target->y) > 200)
return NULL; return NULL;
return &enemy[i]; return &aliens[i];
} }
/* /*
@ -447,7 +447,7 @@ void fireRay(object *attacker)
} }
} }
object *anEnemy = enemy; object *anEnemy = aliens;
for (int i = 0 ; i < MAX_ALIENS ; i++) for (int i = 0 ; i < MAX_ALIENS ; i++)
{ {
@ -567,7 +567,7 @@ void doBullets()
for (int i = 0 ; i < MAX_ALIENS ; i++) for (int i = 0 ; i < MAX_ALIENS ; i++)
{ {
alien = &enemy[i]; alien = &aliens[i];
if ((alien->shield < 1) || (!alien->active)) if ((alien->shield < 1) || (!alien->active))
continue; continue;

View File

@ -73,9 +73,9 @@ static void becomeCollectable(int i)
} }
else else
{ {
enemy[FR_PHOEBE].active = true; aliens[FR_PHOEBE].active = true;
enemy[FR_PHOEBE].x = cargo[i].x; aliens[FR_PHOEBE].x = cargo[i].x;
enemy[FR_PHOEBE].y = cargo[i].y; aliens[FR_PHOEBE].y = cargo[i].y;
setRadioMessage(FACE_PHOEBE, "Thanks!! Watch out, WEAPCO! Phoebe's loose and she's ANGRY!!!", 1); setRadioMessage(FACE_PHOEBE, "Thanks!! Watch out, WEAPCO! Phoebe's loose and she's ANGRY!!!", 1);
} }

View File

@ -91,7 +91,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MAX_TEXTSHAPES 150 #define MAX_TEXTSHAPES 150
#define MAX_FONTSHAPES 6 #define MAX_FONTSHAPES 6
#define MAX_SHOPSHAPES 6 #define MAX_SHOPSHAPES 6
#define MAX_DEFALIENS 40
#define MAX_MISSIONS 28 #define MAX_MISSIONS 28
#define MAX_CARGO 20 #define MAX_CARGO 20
@ -240,6 +239,7 @@ enum {
CD_URANUSBOSS, CD_URANUSBOSS,
CD_URANUSBOSSWING1, CD_URANUSBOSSWING1,
CD_URANUSBOSSWING2, CD_URANUSBOSSWING2,
CD_MAX,
// Some special ones // Some special ones
CD_ANY = 100, CD_ANY = 100,

View File

@ -143,9 +143,9 @@ int mainGameLoop()
// Init aliens // Init aliens
for (int i = 0 ; i < MAX_ALIENS ; i++) for (int i = 0 ; i < MAX_ALIENS ; i++)
{ {
enemy[i].active = false; aliens[i].active = false;
enemy[i].shield = -1; aliens[i].shield = -1;
enemy[i].flags = 0; aliens[i].flags = 0;
} }
engine.targetIndex = -1; engine.targetIndex = -1;
@ -162,11 +162,11 @@ int mainGameLoop()
{ {
placeAttempt = 0; placeAttempt = 0;
enemy[index] = defEnemy[alienType]; aliens[index] = alien_defs[alienType];
enemy[index].owner = &enemy[index]; aliens[index].owner = &aliens[index];
enemy[index].target = &enemy[index]; aliens[index].target = &aliens[index];
enemy[index].face = rand() % 2; aliens[index].face = rand() % 2;
enemy[index].active = true; aliens[index].active = true;
/* /*
we make 1000 attempts to place this enemy since it is required. If after we make 1000 attempts to place this enemy since it is required. If after
@ -178,7 +178,7 @@ int mainGameLoop()
{ {
placeAttempt++; placeAttempt++;
if (alien_place(&enemy[index])) if (alien_place(&aliens[index]))
break; break;
if (placeAttempt > 1000) if (placeAttempt > 1000)
@ -186,56 +186,56 @@ int mainGameLoop()
} }
if (currentGame.area == 2) if (currentGame.area == 2)
addCargo(&enemy[index], P_CARGO); addCargo(&aliens[index], P_CARGO);
else if (currentGame.area == 7) else if (currentGame.area == 7)
addCargo(&enemy[index], P_PHOEBE); addCargo(&aliens[index], P_PHOEBE);
if (index == WC_KLINE) if (index == WC_KLINE)
{ {
enemy[WC_KLINE].target = &player; aliens[WC_KLINE].target = &player;
if (currentGame.area == 25) if (currentGame.area == 25)
enemy[WC_KLINE].shield = 500; aliens[WC_KLINE].shield = 500;
} }
if (enemy[index].classDef == CD_CLOAKFIGHTER) if (aliens[index].classDef == CD_CLOAKFIGHTER)
{ {
enemy[index].active = false; aliens[index].active = false;
enemy[index].maxShield = enemy[index].shield = 400; aliens[index].maxShield = aliens[index].shield = 400;
enemy[index].flags &= ~FL_RUNSAWAY; aliens[index].flags &= ~FL_RUNSAWAY;
enemy[index].speed = 3; aliens[index].speed = 3;
} }
if ((enemy[index].classDef == CD_MOBILE_RAY) && (index >= 11)) if ((aliens[index].classDef == CD_MOBILE_RAY) && (index >= 11))
{ {
enemy[index].active = false; aliens[index].active = false;
} }
if (enemy[index].classDef == CD_FIREFLY) if (aliens[index].classDef == CD_FIREFLY)
{ {
enemy[index].active = false; aliens[index].active = false;
} }
if (enemy[index].classDef == CD_BARRIER) if (aliens[index].classDef == CD_BARRIER)
{ {
enemy[index].owner = &enemy[WC_BOSS]; aliens[index].owner = &aliens[WC_BOSS];
enemy[index].speed = barrierSpeed; aliens[index].speed = barrierSpeed;
barrierSpeed++; barrierSpeed++;
} }
if ((currentGame.area == 17) && (enemy[index].classDef == CD_BOSS)) if ((currentGame.area == 17) && (aliens[index].classDef == CD_BOSS))
{ {
enemy[index].imageIndex[1] = 29; aliens[index].imageIndex[1] = 29;
enemy[index].flags |= FL_IMMORTAL; aliens[index].flags |= FL_IMMORTAL;
} }
if (currentGame.area == 18) if (currentGame.area == 18)
enemy[index].flags |= FL_HASMINIMUMSPEED; aliens[index].flags |= FL_HASMINIMUMSPEED;
if (currentGame.area == 23) if (currentGame.area == 23)
{ {
enemy[index].flags = FL_WEAPCO; aliens[index].flags = FL_WEAPCO;
if (index == WC_BOSS) if (index == WC_BOSS)
enemy[index].chance[1] = 5; aliens[index].chance[1] = 5;
} }
} }
@ -243,71 +243,71 @@ int mainGameLoop()
if (currentGame.area == 5) if (currentGame.area == 5)
{ {
enemy[WC_BOSS].target = &player; aliens[WC_BOSS].target = &player;
enemy[WC_BOSS].x = -screen->w / 2; aliens[WC_BOSS].x = -screen->w / 2;
enemy[WC_BOSS].y = screen->h / 2; aliens[WC_BOSS].y = screen->h / 2;
enemy[13].owner = &enemy[WC_BOSS]; aliens[13].owner = &aliens[WC_BOSS];
enemy[13].target = &player; aliens[13].target = &player;
enemy[13].dx = -25; aliens[13].dx = -25;
enemy[13].dy = -21; aliens[13].dy = -21;
enemy[12].owner = &enemy[WC_BOSS]; aliens[12].owner = &aliens[WC_BOSS];
enemy[12].target = &player; aliens[12].target = &player;
enemy[12].dx = -20; aliens[12].dx = -20;
enemy[12].dy = 37; aliens[12].dy = 37;
} }
else if ((currentGame.area == 11) || (currentGame.area == 14)) else if ((currentGame.area == 11) || (currentGame.area == 14))
{ {
enemy[WC_BOSS].target = &player; aliens[WC_BOSS].target = &player;
enemy[WC_BOSS].x = -screen->w / 2; aliens[WC_BOSS].x = -screen->w / 2;
enemy[WC_BOSS].y = screen->h / 2; aliens[WC_BOSS].y = screen->h / 2;
enemy[13].owner = &enemy[WC_BOSS]; aliens[13].owner = &aliens[WC_BOSS];
enemy[13].target = &player; aliens[13].target = &player;
enemy[13].dx = 15; aliens[13].dx = 15;
enemy[13].dy = -22; aliens[13].dy = -22;
enemy[12].owner = &enemy[WC_BOSS]; aliens[12].owner = &aliens[WC_BOSS];
enemy[12].target = &player; aliens[12].target = &player;
enemy[12].dx = 15; aliens[12].dx = 15;
enemy[12].dy = 22; aliens[12].dy = 22;
enemy[11].owner = &enemy[13]; aliens[11].owner = &aliens[13];
enemy[11].target = &player; aliens[11].target = &player;
enemy[11].dx = -35; aliens[11].dx = -35;
enemy[11].dy = -12; aliens[11].dy = -12;
enemy[10].owner = &enemy[12]; aliens[10].owner = &aliens[12];
enemy[10].target = &player; aliens[10].target = &player;
enemy[10].dx = -35; aliens[10].dx = -35;
enemy[10].dy = 20; aliens[10].dy = 20;
if (currentGame.area == 14) if (currentGame.area == 14)
{ {
enemy[WC_BOSS].AIType = AI_EVASIVE; aliens[WC_BOSS].AIType = AI_EVASIVE;
for (int i = 10 ; i < 15 ; i++) for (int i = 10 ; i < 15 ; i++)
{ {
enemy[i].imageIndex[0] += 15; aliens[i].imageIndex[0] += 15;
enemy[i].imageIndex[1] += 15; aliens[i].imageIndex[1] += 15;
enemy[i].image[0] = shipShape[enemy[i].imageIndex[0]]; aliens[i].image[0] = shipShape[aliens[i].imageIndex[0]];
enemy[i].image[1] = shipShape[enemy[i].imageIndex[1]]; aliens[i].image[1] = shipShape[aliens[i].imageIndex[1]];
} }
} }
} }
else if (currentGame.area == 21) else if (currentGame.area == 21)
{ {
enemy[WC_BOSS].target = &player; aliens[WC_BOSS].target = &player;
enemy[WC_BOSS].x = -screen->w / 2; aliens[WC_BOSS].x = -screen->w / 2;
enemy[WC_BOSS].y = screen->h / 2; aliens[WC_BOSS].y = screen->h / 2;
enemy[13].owner = &enemy[WC_BOSS]; aliens[13].owner = &aliens[WC_BOSS];
enemy[13].dy = 20; aliens[13].dy = 20;
enemy[12].owner = &enemy[WC_BOSS]; aliens[12].owner = &aliens[WC_BOSS];
enemy[12].dy = -16; aliens[12].dy = -16;
} }
} }
@ -316,7 +316,7 @@ int mainGameLoop()
currentGame.hasWingMate1 = 1; currentGame.hasWingMate1 = 1;
if (currentGame.area == 11) if (currentGame.area == 11)
enemy[WC_KLINE].active = false; aliens[WC_KLINE].active = false;
for (int i = 0 ; i < engine.maxAliens ; i++) for (int i = 0 ; i < engine.maxAliens ; i++)
alien_add(); alien_add();
@ -342,15 +342,15 @@ int mainGameLoop()
case 18: case 18:
case 24: case 24:
case 26: case 26:
enemy[FR_PHOEBE].active = false; aliens[FR_PHOEBE].active = false;
enemy[FR_URSULA].active = false; aliens[FR_URSULA].active = false;
break; break;
} }
if (currentGame.area == 10) if (currentGame.area == 10)
{ {
enemy[0].collectChance = 100; aliens[0].collectChance = 100;
enemy[0].collectType = P_ESCAPEPOD; aliens[0].collectType = P_ESCAPEPOD;
} }
// Some specifics for interception missions // Some specifics for interception missions
@ -358,13 +358,13 @@ int mainGameLoop()
{ {
if ((currentGame.system > 1) && ((rand() % 5) == 0)) if ((currentGame.system > 1) && ((rand() % 5) == 0))
{ {
enemy[WC_KLINE] = defEnemy[CD_KLINE]; aliens[WC_KLINE] = alien_defs[CD_KLINE];
enemy[WC_KLINE].owner = &enemy[WC_KLINE]; aliens[WC_KLINE].owner = &aliens[WC_KLINE];
enemy[WC_KLINE].target = &player; aliens[WC_KLINE].target = &player;
enemy[WC_KLINE].shield = 100; aliens[WC_KLINE].shield = 100;
enemy[WC_KLINE].active = true; aliens[WC_KLINE].active = true;
enemy[WC_KLINE].x = player.x + 1000; aliens[WC_KLINE].x = player.x + 1000;
enemy[WC_KLINE].y = player.y; aliens[WC_KLINE].y = player.y;
player_setTarget(WC_KLINE); player_setTarget(WC_KLINE);
} }
@ -372,36 +372,36 @@ int mainGameLoop()
{ {
if ((rand() % 2) == 0) if ((rand() % 2) == 0)
{ {
enemy[10] = defEnemy[CD_CLOAKFIGHTER]; aliens[10] = alien_defs[CD_CLOAKFIGHTER];
enemy[10].owner = &enemy[10]; aliens[10].owner = &aliens[10];
enemy[10].target = &enemy[10]; aliens[10].target = &aliens[10];
enemy[10].shield = 1000; aliens[10].shield = 1000;
enemy[10].active = true; aliens[10].active = true;
enemy[10].x = player.x - 1000; aliens[10].x = player.x - 1000;
enemy[10].y = player.y; aliens[10].y = player.y;
player_setTarget(10); player_setTarget(10);
enemy[10].shield = currentGame.experimentalShield; aliens[10].shield = currentGame.experimentalShield;
} }
} }
} }
if (currentGame.area == 26) if (currentGame.area == 26)
{ {
enemy[WC_KLINE].flags |= FL_IMMORTAL | FL_NOFIRE | FL_NOMOVE; aliens[WC_KLINE].flags |= FL_IMMORTAL | FL_NOFIRE | FL_NOMOVE;
enemy[WC_KLINE].x = screen->w * 2 / 3; aliens[WC_KLINE].x = screen->w * 2 / 3;
enemy[WC_KLINE].y = screen->h * 2 / 3; aliens[WC_KLINE].y = screen->h * 2 / 3;
enemy[WC_KLINE].deathCounter = -250; aliens[WC_KLINE].deathCounter = -250;
enemy[WC_KLINE].maxShield = 1500; aliens[WC_KLINE].maxShield = 1500;
enemy[WC_KLINE].shield = 500; aliens[WC_KLINE].shield = 500;
} }
for (int i = 0 ; i < MAX_ALIENS ; i++) for (int i = 0 ; i < MAX_ALIENS ; i++)
{ {
enemy[i].systemPower = enemy[i].maxShield; aliens[i].systemPower = aliens[i].maxShield;
enemy[i].deathCounter = 0 - (enemy[i].maxShield * 3); aliens[i].deathCounter = 0 - (aliens[i].maxShield * 3);
limitInt(&enemy[i].deathCounter, -350, 0); limitInt(&aliens[i].deathCounter, -350, 0);
} }
// Set target energy meter // Set target energy meter
@ -461,7 +461,8 @@ int mainGameLoop()
for (int i = 0 ; i < 3 ; i++) for (int i = 0 ; i < 3 ; i++)
{ {
if ((currentMission.primaryType[i] == M_DESTROY_TARGET_TYPE) && (currentMission.target1[i] == CD_ANY)) if ((currentMission.primaryType[i] == M_DESTROY_TARGET_TYPE) &&
(currentMission.target1[i] == CD_ANY))
allowableAliens = currentMission.targetValue1[i]; allowableAliens = currentMission.targetValue1[i];
if (currentMission.primaryType[i] == M_DESTROY_ALL_TARGETS) if (currentMission.primaryType[i] == M_DESTROY_ALL_TARGETS)
@ -470,7 +471,7 @@ int mainGameLoop()
for (int i = 0 ; i < MAX_ALIENS ; i++) for (int i = 0 ; i < MAX_ALIENS ; i++)
{ {
if ((enemy[i].active) && (enemy[i].flags & FL_WEAPCO)) if ((aliens[i].active) && (aliens[i].flags & FL_WEAPCO))
{ {
allowableAliens--; allowableAliens--;
} }
@ -513,25 +514,25 @@ int mainGameLoop()
leaveSector(); leaveSector();
if ((engine.done == 2) && (currentGame.area != 10) && (currentGame.area != 15)) if ((engine.done == 2) && (currentGame.area != 10) && (currentGame.area != 15))
{ {
if ((enemy[FR_PHOEBE].shield > 0) && (currentGame.area != 25)) if ((aliens[FR_PHOEBE].shield > 0) && (currentGame.area != 25))
{ {
enemy[FR_PHOEBE].x = player.x - 40; aliens[FR_PHOEBE].x = player.x - 40;
enemy[FR_PHOEBE].y = player.y - 35; aliens[FR_PHOEBE].y = player.y - 35;
enemy[FR_PHOEBE].face = 0; aliens[FR_PHOEBE].face = 0;
} }
if ((enemy[FR_URSULA].shield > 0) && (currentGame.area != 25)) if ((aliens[FR_URSULA].shield > 0) && (currentGame.area != 25))
{ {
enemy[FR_URSULA].x = player.x - 40; aliens[FR_URSULA].x = player.x - 40;
enemy[FR_URSULA].y = player.y + 45; aliens[FR_URSULA].y = player.y + 45;
enemy[FR_URSULA].face = 0; aliens[FR_URSULA].face = 0;
} }
if ((currentGame.area == 9) || (currentGame.area == 17)) if ((currentGame.area == 9) || (currentGame.area == 17))
{ {
enemy[FR_SID].x = player.x - 100; aliens[FR_SID].x = player.x - 100;
enemy[FR_SID].y = player.y; aliens[FR_SID].y = player.y;
enemy[FR_SID].face = 0; aliens[FR_SID].face = 0;
} }
} }
} }
@ -575,7 +576,7 @@ int mainGameLoop()
// A global variable for checking if all the aliens are dead // A global variable for checking if all the aliens are dead
engine.allAliensDead = 1; engine.allAliensDead = 1;
object *alien = enemy; object *alien = aliens;
for (int i = 0 ; i < MAX_ALIENS ; i++) for (int i = 0 ; i < MAX_ALIENS ; i++)
{ {
@ -729,7 +730,7 @@ int mainGameLoop()
if (alien->classDef == CD_MOBILESHIELD) if (alien->classDef == CD_MOBILESHIELD)
{ {
limitInt(&(++enemy[WC_BOSS].shield), 0, enemy[WC_BOSS].maxShield); limitInt(&(++aliens[WC_BOSS].shield), 0, aliens[WC_BOSS].maxShield);
} }
limitCharAdd(&alien->reload[0], -1, 0, 999); limitCharAdd(&alien->reload[0], -1, 0, 999);
@ -805,7 +806,7 @@ int mainGameLoop()
600 + rand() % 2400); 600 + rand() % 2400);
// Kline drops mines a lot more often // Kline drops mines a lot more often
if ((alien == &enemy[WC_KLINE])) if ((alien == &aliens[WC_KLINE]))
{ {
if ((rand() % 10) == 0) if ((rand() % 10) == 0)
addCollectable(alien->x, alien->y, P_MINE, 25, addCollectable(alien->x, alien->y, P_MINE, 25,
@ -855,7 +856,7 @@ int mainGameLoop()
{ {
alien->active = false; alien->active = false;
if ((alien->classDef == CD_BOSS) || if ((alien->classDef == CD_BOSS) ||
(alien->owner == &enemy[WC_BOSS]) || (alien->owner == &aliens[WC_BOSS]) ||
(alien->flags & FL_FRIEND) || (alien->flags & FL_FRIEND) ||
(alien->classDef == CD_ASTEROID) || (alien->classDef == CD_ASTEROID) ||
(alien->classDef == CD_KLINE)) (alien->classDef == CD_KLINE))
@ -927,16 +928,16 @@ int mainGameLoop()
engine.missionCompleteTimer = SDL_GetTicks() + 7000; engine.missionCompleteTimer = SDL_GetTicks() + 7000;
// specific to Boss 1 // specific to Boss 1
if ((currentGame.area == 5) && (enemy[WC_BOSS].flags & FL_ESCAPED)) if ((currentGame.area == 5) && (aliens[WC_BOSS].flags & FL_ESCAPED))
{ {
playSound(SFX_DEATH, enemy[WC_BOSS].x); playSound(SFX_DEATH, aliens[WC_BOSS].x);
clearScreen(white); clearScreen(white);
updateScreen(); updateScreen();
for (int i = 0 ; i < 300 ; i++) for (int i = 0 ; i < 300 ; i++)
{ {
SDL_Delay(10); SDL_Delay(10);
if ((rand() % 25) == 0) if ((rand() % 25) == 0)
playSound(SFX_EXPLOSION, enemy[WC_BOSS].x); playSound(SFX_EXPLOSION, aliens[WC_BOSS].x);
} }
SDL_Delay(1000); SDL_Delay(1000);
break; break;

View File

@ -64,12 +64,13 @@ void getKillMessage(object *ally)
bool firstPlace = false; bool firstPlace = false;
int faceToUse = FACE_PHOEBE; int faceToUse = FACE_PHOEBE;
if (ally == &enemy[FR_PHOEBE]) if (ally == &aliens[FR_PHOEBE])
{ {
strcpy(otherName, "Ursula"); strcpy(otherName, "Ursula");
kills = currentGame.wingMate1Kills; kills = currentGame.wingMate1Kills;
difference = currentGame.wingMate1Kills - currentGame.wingMate2Kills; difference = currentGame.wingMate1Kills - currentGame.wingMate2Kills;
if ((currentGame.wingMate1Kills > currentGame.wingMate2Kills) && (currentGame.wingMate1Kills > currentGame.totalKills)) if ((currentGame.wingMate1Kills > currentGame.wingMate2Kills) &&
(currentGame.wingMate1Kills > currentGame.totalKills))
firstPlace = true; firstPlace = true;
faceToUse = FACE_PHOEBE; faceToUse = FACE_PHOEBE;
} }
@ -78,7 +79,8 @@ void getKillMessage(object *ally)
strcpy(otherName, "Phoebe"); strcpy(otherName, "Phoebe");
kills = currentGame.wingMate2Kills; kills = currentGame.wingMate2Kills;
difference = currentGame.wingMate2Kills - currentGame.wingMate1Kills; difference = currentGame.wingMate2Kills - currentGame.wingMate1Kills;
if ((currentGame.wingMate2Kills > currentGame.wingMate1Kills) && (currentGame.wingMate2Kills > currentGame.totalKills)) if ((currentGame.wingMate2Kills > currentGame.wingMate1Kills) &&
(currentGame.wingMate2Kills > currentGame.totalKills))
firstPlace = true; firstPlace = true;
faceToUse = FACE_URSULA; faceToUse = FACE_URSULA;
} }
@ -133,7 +135,8 @@ void getKillMessage(object *ally)
const char *getKlineInsult() const char *getKlineInsult()
{ {
static const char *insult[] = { static const char *insult[] = {
"Pathetic", "How very disappointing...", "Heroic. And stupid", "Fool", "And now you're nothing but a DEAD hero" "Pathetic", "How very disappointing...", "Heroic. And stupid", "Fool",
"And now you're nothing but a DEAD hero"
}; };
if (currentGame.area != 26) if (currentGame.area != 26)
@ -144,13 +147,13 @@ const char *getKlineInsult()
void getPlayerDeathMessage() void getPlayerDeathMessage()
{ {
if (enemy[WC_KLINE].active) if (aliens[WC_KLINE].active)
{ {
setRadioMessage(FACE_KLINE, getKlineInsult(), 1); setRadioMessage(FACE_KLINE, getKlineInsult(), 1);
return; return;
} }
if ((enemy[WC_BOSS].active) && (enemy[WC_BOSS].classDef == CD_KRASS)) if ((aliens[WC_BOSS].active) && (aliens[WC_BOSS].classDef == CD_KRASS))
{ {
setRadioMessage(FACE_KRASS, "That was the easiest $90,000,000 I've ever earned! Bwwah!! Ha!! Ha!! Ha!!", 1); setRadioMessage(FACE_KRASS, "That was the easiest $90,000,000 I've ever earned! Bwwah!! Ha!! Ha!! Ha!!", 1);
return; return;
@ -159,7 +162,9 @@ void getPlayerDeathMessage()
int faceToUse = FACE_PHOEBE; int faceToUse = FACE_PHOEBE;
if ((currentGame.area == 9) || (currentGame.area == 17) || (currentGame.area == 25)) { if ((currentGame.area == 9) || (currentGame.area == 17) ||
(currentGame.area == 25))
{
faceToUse = FACE_SID; faceToUse = FACE_SID;
} }
else if (currentGame.hasWingMate2) else if (currentGame.hasWingMate2)
@ -175,7 +180,7 @@ void getMissFireMessage(object *ally)
{ {
int faceToUse = FACE_PHOEBE; int faceToUse = FACE_PHOEBE;
if (ally == &enemy[FR_PHOEBE]) if (ally == &aliens[FR_PHOEBE])
faceToUse = FACE_PHOEBE; faceToUse = FACE_PHOEBE;
else else
faceToUse = FACE_URSULA; faceToUse = FACE_URSULA;
@ -187,7 +192,7 @@ void getPlayerHitMessage(object *ally)
{ {
int faceToUse = FACE_PHOEBE; int faceToUse = FACE_PHOEBE;
if (ally == &enemy[FR_PHOEBE]) if (ally == &aliens[FR_PHOEBE])
faceToUse = FACE_PHOEBE; faceToUse = FACE_PHOEBE;
else else
faceToUse = FACE_URSULA; faceToUse = FACE_URSULA;

View File

@ -89,11 +89,11 @@ Draw an arrow at the edge of the screen for each enemy ship that is not visible.
*/ */
static void doArrow(int i) static void doArrow(int i)
{ {
if (i < 0 || !enemy[i].active || enemy[i].shield <= 0 || enemy[i].flags & FL_ISCLOAKED) if (i < 0 || !aliens[i].active || aliens[i].shield <= 0 || aliens[i].flags & FL_ISCLOAKED)
return; return;
int x = enemy[i].x + enemy[i].image[0]->w / 2; int x = aliens[i].x + aliens[i].image[0]->w / 2;
int y = enemy[i].y + enemy[i].image[0]->h / 2; int y = aliens[i].y + aliens[i].image[0]->h / 2;
float sx = fabsf((x - (screen->w / 2)) / (screen->w / 2.0)); float sx = fabsf((x - (screen->w / 2)) / (screen->w / 2.0));
float sy = fabsf((y - (screen->h / 2)) / (screen->h / 2.0)); float sy = fabsf((y - (screen->h / 2)) / (screen->h / 2.0));
@ -302,7 +302,7 @@ void doInfo()
// Do the target's remaining shield (if required) // Do the target's remaining shield (if required)
if (currentGame.area != 10) if (currentGame.area != 10)
{ {
if ((engine.targetIndex > -1) && (enemy[engine.targetIndex].shield > 0) && (engine.targetIndex > 9)) if ((engine.targetIndex > -1) && (aliens[engine.targetIndex].shield > 0) && (engine.targetIndex > 9))
{ {
blitText(7); blitText(7);
bar.w = 1; bar.w = 1;
@ -310,7 +310,7 @@ void doInfo()
bar.x = 620; bar.x = 620;
bar.y = 550; bar.y = 550;
for (float i = 0 ; i < (engine.targetShield * enemy[engine.targetIndex].shield) ; i++) for (float i = 0 ; i < (engine.targetShield * aliens[engine.targetIndex].shield) ; i++)
{ {
if (i > 50) if (i > 50)
shieldColor = green; shieldColor = green;

View File

@ -270,8 +270,8 @@ static void mission_killAllEnemies()
{ {
for (int i = 0 ; i < MAX_ALIENS ; i++) for (int i = 0 ; i < MAX_ALIENS ; i++)
{ {
if ((enemy[i].flags & FL_WEAPCO) && (enemy[i].active) && (enemy[i].shield > 0)) if ((aliens[i].flags & FL_WEAPCO) && (aliens[i].active) && (aliens[i].shield > 0))
enemy[i].shield = 0; aliens[i].shield = 0;
} }
} }
@ -424,7 +424,9 @@ void updateMissionRequirements(int type, int id, int value)
{ {
if ((currentMission.completed1[i] == OB_INCOMPLETE) || (currentMission.completed1[i] == OB_CONDITION)) if ((currentMission.completed1[i] == OB_INCOMPLETE) || (currentMission.completed1[i] == OB_CONDITION))
{ {
if ((currentMission.primaryType[i] == type) && ((currentMission.target1[i] == id) || (currentMission.target1[i] == CD_ANY))) if ((currentMission.primaryType[i] == type) &&
((currentMission.target1[i] == id) ||
(currentMission.target1[i] == CD_ANY)))
{ {
matched = 1; matched = 1;
currentMission.targetValue1[i] -= value; currentMission.targetValue1[i] -= value;
@ -441,7 +443,9 @@ void updateMissionRequirements(int type, int id, int value)
{ {
if ((currentMission.completed2[i] == OB_INCOMPLETE) || (currentMission.completed2[i] == OB_CONDITION)) if ((currentMission.completed2[i] == OB_INCOMPLETE) || (currentMission.completed2[i] == OB_CONDITION))
{ {
if ((currentMission.secondaryType[i] == type) && ((currentMission.target2[i] == id) || (currentMission.target2[i] == CD_ANY))) if ((currentMission.secondaryType[i] == type) &&
((currentMission.target2[i] == id) ||
(currentMission.target2[i] == CD_ANY)))
{ {
currentMission.targetValue2[i] -= value; currentMission.targetValue2[i] -= value;
evaluateRequirement(type, id, &currentMission.completed2[i], &currentMission.targetValue2[i], FONT_YELLOW); evaluateRequirement(type, id, &currentMission.completed2[i], &currentMission.targetValue2[i], FONT_YELLOW);
@ -507,10 +511,10 @@ static char revealHiddenObjectives()
{ {
mission_killAllEnemies(); mission_killAllEnemies();
syncScriptEvents(); syncScriptEvents();
enemy[WC_KLINE].active = true; aliens[WC_KLINE].active = true;
enemy[WC_KLINE].x = player.x + 1000; aliens[WC_KLINE].x = player.x + 1000;
enemy[WC_KLINE].y = player.y; aliens[WC_KLINE].y = player.y;
enemy[WC_KLINE].flags |= FL_IMMORTAL | FL_NOFIRE; aliens[WC_KLINE].flags |= FL_IMMORTAL | FL_NOFIRE;
player_setTarget(WC_KLINE); player_setTarget(WC_KLINE);
loadMusic("music/last_cyber_dance.ogg"); loadMusic("music/last_cyber_dance.ogg");
if ((engine.useAudio) && (engine.useMusic)) if ((engine.useAudio) && (engine.useMusic))

View File

@ -68,7 +68,7 @@ void player_setTarget(int index)
{ {
engine.targetIndex = index; engine.targetIndex = index;
engine.targetShield = 85; engine.targetShield = 85;
engine.targetShield /= enemy[index].shield; engine.targetShield /= aliens[index].shield;
} }
void exitPlayer() void exitPlayer()
@ -117,7 +117,8 @@ void doPlayer()
if ((engine.keyState[KEY_ALTFIRE]) && (player.weaponType[1] != W_NONE)) if ((engine.keyState[KEY_ALTFIRE]) && (player.weaponType[1] != W_NONE))
{ {
if ((player.weaponType[1] != W_CHARGER) && (player.weaponType[1] != W_LASER) && (player.ammo[1] > 0)) if ((player.weaponType[1] != W_CHARGER) &&
(player.weaponType[1] != W_LASER) && (player.ammo[1] > 0))
{ {
fireBullet(&player, 1); fireBullet(&player, 1);
} }
@ -231,7 +232,8 @@ void doPlayer()
engine.keyState[KEY_PAUSE] = 0; engine.keyState[KEY_PAUSE] = 0;
} }
if (((currentGame.area == 18) && (enemy[WC_BOSS].shield > 0)) || (currentGame.area == 24)) if (((currentGame.area == 18) && (aliens[WC_BOSS].shield > 0)) ||
(currentGame.area == 24))
{ {
player.face = 0; player.face = 0;
xmoved = true; xmoved = true;
@ -321,14 +323,14 @@ void doPlayer()
player.shield--; player.shield--;
if (player.shield == -1) if (player.shield == -1)
{ {
if ((currentGame.hasWingMate1) || (enemy[WC_KLINE].active)) if ((currentGame.hasWingMate1) || (aliens[WC_KLINE].active))
getPlayerDeathMessage(); getPlayerDeathMessage();
// Make it look like the ships are all still moving... // Make it look like the ships are all still moving...
if (currentGame.area == 18) if (currentGame.area == 18)
{ {
for (int i = 0 ; i < MAX_ALIENS ; i++) for (int i = 0 ; i < MAX_ALIENS ; i++)
enemy[i].flags |= FL_LEAVESECTOR; aliens[i].flags |= FL_LEAVESECTOR;
} }
playSound(SFX_DEATH, player.x); playSound(SFX_DEATH, player.x);
@ -347,7 +349,8 @@ void doPlayer()
limitFloat(&engine.ssy, -cameraMaxSpeed, cameraMaxSpeed); limitFloat(&engine.ssy, -cameraMaxSpeed, cameraMaxSpeed);
// Specific for the mission were you have to chase the Executive Transport // Specific for the mission were you have to chase the Executive Transport
if ((currentGame.area == 18) && (enemy[WC_BOSS].shield > 0) && (player.shield > 0)) if ((currentGame.area == 18) && (aliens[WC_BOSS].shield > 0) &&
(player.shield > 0))
{ {
engine.ssx = -6; engine.ssx = -6;
engine.ssy = 0; engine.ssy = 0;

View File

@ -130,14 +130,14 @@ void loadGameGraphics()
loadBackground(systemBackground[currentGame.system]); loadBackground(systemBackground[currentGame.system]);
for (int i = 0 ; i < MAX_DEFALIENS ; i++) for (int i = 0 ; i < CD_MAX ; i++)
{ {
if (shipShape[defEnemy[i].imageIndex[0]] != NULL) if (shipShape[alien_defs[i].imageIndex[0]] != NULL)
{ {
defEnemy[i].image[0] = shipShape[defEnemy[i].imageIndex[0]]; alien_defs[i].image[0] = shipShape[alien_defs[i].imageIndex[0]];
defEnemy[i].image[1] = shipShape[defEnemy[i].imageIndex[1]]; alien_defs[i].image[1] = shipShape[alien_defs[i].imageIndex[1]];
defEnemy[i].engineX = defEnemy[i].image[0]->w; alien_defs[i].engineX = alien_defs[i].image[0]->w;
defEnemy[i].engineY = (defEnemy[i].image[0]->h / 2); alien_defs[i].engineY = (alien_defs[i].image[0]->h / 2);
} }
} }

View File

@ -48,7 +48,7 @@ void loadScriptEvents()
gameEvent[i].flag = 0; gameEvent[i].flag = 0;
} }
if ((currentGame.area == 27) && (enemy[WC_KLINE].classDef == CD_KLINE)) if ((currentGame.area == 27) && (aliens[WC_KLINE].classDef == CD_KLINE))
setKlineGreeting(); setKlineGreeting();
char filename[255]; char filename[255];
@ -96,13 +96,13 @@ void checkScriptEvents()
{ {
if (gameEvent[i].flag != -FL_ACTIVATE) if (gameEvent[i].flag != -FL_ACTIVATE)
{ {
enemy[gameEvent[i].entity].flags += gameEvent[i].flag; aliens[gameEvent[i].entity].flags += gameEvent[i].flag;
} }
else else
{ {
enemy[gameEvent[i].entity].active = true; aliens[gameEvent[i].entity].active = true;
enemy[gameEvent[i].entity].x = rrand((int)player.x + 400, (int)player.x + 800); aliens[gameEvent[i].entity].x = rrand((int)player.x + 400, (int)player.x + 800);
enemy[gameEvent[i].entity].y = rrand((int)player.y - 400, (int)player.y + 800); aliens[gameEvent[i].entity].y = rrand((int)player.y - 400, (int)player.y + 800);
} }
} }
@ -156,11 +156,11 @@ static void setScene(int scene)
if (shape > -1) if (shape > -1)
{ {
enemy[index].image[0] = shipShape[shape]; aliens[index].image[0] = shipShape[shape];
enemy[index].x = x; aliens[index].x = x;
enemy[index].y = y; aliens[index].y = y;
enemy[index].dx = speed; aliens[index].dx = speed;
enemy[index].active = true; aliens[index].active = true;
} }
} }
@ -201,9 +201,9 @@ void doCutscene(int scene)
for (int i = 0 ; i < 15 ; i++) for (int i = 0 ; i < 15 ; i++)
{ {
enemy[i] = defEnemy[0]; aliens[i] = alien_defs[0];
enemy[i].face = 0; aliens[i].face = 0;
enemy[i].active = false; aliens[i].active = false;
} }
for (int i = 0 ; i < 10 ; i++) for (int i = 0 ; i < 10 ; i++)
@ -220,8 +220,8 @@ void doCutscene(int scene)
*/ */
for (int i = 0 ; i < 15 ; i++) for (int i = 0 ; i < 15 ; i++)
{ {
enemy[i].engineX = enemy[i].image[0]->w; aliens[i].engineX = aliens[i].image[0]->w;
enemy[i].engineY = (enemy[i].image[0]->h / 2); aliens[i].engineY = (aliens[i].image[0]->h / 2);
} }
bool showMessage = false; bool showMessage = false;
@ -244,30 +244,30 @@ void doCutscene(int scene)
for (int i = 0 ; i < 15 ; i++) for (int i = 0 ; i < 15 ; i++)
{ {
if (enemy[i].active) if (aliens[i].active)
{ {
addEngine(&enemy[i]); addEngine(&aliens[i]);
if (scene == 0 && i > 0 && (timer % 15) == i) { if (scene == 0 && i > 0 && (timer % 15) == i) {
enemy[i].dx += (drand48() - 0.5) * 0.1; aliens[i].dx += (drand48() - 0.5) * 0.1;
enemy[i].dy += (drand48() - 0.5) * 0.1; aliens[i].dy += (drand48() - 0.5) * 0.1;
if (enemy[i].x > 500 - timer) if (aliens[i].x > 500 - timer)
enemy[i].dx -= 0.2; aliens[i].dx -= 0.2;
if (enemy[i].x < 0) if (aliens[i].x < 0)
enemy[i].dx += 0.2; aliens[i].dx += 0.2;
} }
enemy[i].x += enemy[i].dx; aliens[i].x += aliens[i].dx;
enemy[i].y += enemy[i].dy; aliens[i].y += aliens[i].dy;
enemy[i].x += engine.ssx + engine.smx; aliens[i].x += engine.ssx + engine.smx;
blit(enemy[i].image[0], (int)enemy[i].x, (int)enemy[i].y); blit(aliens[i].image[0], (int)aliens[i].x, (int)aliens[i].y);
if (enemy[i].x > (screen->w + 50)) if (aliens[i].x > (screen->w + 50))
{ {
enemy[i].x = -50; aliens[i].x = -50;
enemy[i].y = rand() % (screen->h - 40); aliens[i].y = rand() % (screen->h - 40);
} }
if (enemy[i].y < -50) if (aliens[i].y < -50)
enemy[i].y = (screen->h + 50); aliens[i].y = (screen->h + 50);
if (enemy[i].y > (screen->h + 50)) if (aliens[i].y > (screen->h + 50))
enemy[i].y = -50; aliens[i].y = -50;
} }
} }

View File

@ -62,7 +62,8 @@ static void drawSecondaryWeaponSurface()
} }
drawString(description, 10, 22, FONT_WHITE, shopSurface[2]); drawString(description, 10, 22, FONT_WHITE, shopSurface[2]);
if ((player.weaponType[1] != W_LASER) && (player.weaponType[1] != W_CHARGER) && (player.weaponType[1] != W_NONE)) if ((player.weaponType[1] != W_LASER) &&
(player.weaponType[1] != W_CHARGER) && (player.weaponType[1] != W_NONE))
{ {
sprintf(description, "Capacity : %d", currentGame.maxRocketAmmo); sprintf(description, "Capacity : %d", currentGame.maxRocketAmmo);
drawString(description, 10, 37, FONT_WHITE, shopSurface[2]); drawString(description, 10, 37, FONT_WHITE, shopSurface[2]);
@ -71,13 +72,13 @@ static void drawSecondaryWeaponSurface()
static void adjustShopPrices() static void adjustShopPrices()
{ {
shopItems[SHOP_PLASMA_MAX_OUTPUT].price = (500 * currentGame.maxPlasmaOutput); shopItems[SHOP_PLASMA_MAX_OUTPUT].price = (1500 * currentGame.maxPlasmaOutput);
shopItems[SHOP_PLASMA_MAX_DAMAGE].price = (500 * currentGame.maxPlasmaDamage); shopItems[SHOP_PLASMA_MAX_DAMAGE].price = (1500 * currentGame.maxPlasmaDamage);
shopItems[SHOP_PLASMA_MAX_RATE].price = (500 * currentGame.maxPlasmaRate); shopItems[SHOP_PLASMA_MAX_RATE].price = (1500 * currentGame.maxPlasmaRate);
shopItems[SHOP_PLASMA_MIN_OUTPUT].price = (2000 * currentGame.minPlasmaOutput); shopItems[SHOP_PLASMA_MIN_OUTPUT].price = (4000 * currentGame.minPlasmaOutput);
shopItems[SHOP_PLASMA_MIN_DAMAGE].price = (2000 * currentGame.minPlasmaDamage); shopItems[SHOP_PLASMA_MIN_DAMAGE].price = (4000 * currentGame.minPlasmaDamage);
shopItems[SHOP_PLASMA_MIN_RATE].price = (2000 * currentGame.minPlasmaRate); shopItems[SHOP_PLASMA_MIN_RATE].price = (4000 * currentGame.minPlasmaRate);
if (currentGame.maxPlasmaOutput <= currentGame.minPlasmaOutput) if (currentGame.maxPlasmaOutput <= currentGame.minPlasmaOutput)
shopItems[SHOP_PLASMA_MIN_OUTPUT].price += shopItems[SHOP_PLASMA_MAX_OUTPUT].price; shopItems[SHOP_PLASMA_MIN_OUTPUT].price += shopItems[SHOP_PLASMA_MAX_OUTPUT].price;
@ -170,17 +171,22 @@ static void drawShop()
drawString("Primary Weapon", 10, 3, FONT_WHITE, shopSurface[0]); drawString("Primary Weapon", 10, 3, FONT_WHITE, shopSurface[0]);
sprintf(description, "Plasma Cannons : %d", currentGame.minPlasmaOutput); sprintf(description, "Plasma Cannons : %d", currentGame.minPlasmaOutput);
drawString(description, 10, 22, FONT_WHITE, shopSurface[0]); drawString(description, 10, 22, FONT_WHITE, shopSurface[0]);
sprintf(description, "Plasma Power : Stage %d", currentGame.minPlasmaDamage); sprintf(description, "Plasma Power : Stage %d",
currentGame.minPlasmaDamage);
drawString(description, 10, 37, FONT_WHITE, shopSurface[0]); drawString(description, 10, 37, FONT_WHITE, shopSurface[0]);
sprintf(description, "Cooler : Stage %d", currentGame.minPlasmaRate); sprintf(description, "Cooler : Stage %d",
currentGame.minPlasmaRate);
drawString(description, 10, 52, FONT_WHITE, shopSurface[0]); drawString(description, 10, 52, FONT_WHITE, shopSurface[0]);
drawString("Powerup Weapon", 10, 3, FONT_WHITE, shopSurface[1]); drawString("Powerup Weapon", 10, 3, FONT_WHITE, shopSurface[1]);
sprintf(description, "Plasma Output : Stage %d", currentGame.maxPlasmaOutput); sprintf(description, "Plasma Output : Stage %d",
currentGame.maxPlasmaOutput);
drawString(description, 10, 22, FONT_WHITE, shopSurface[1]); drawString(description, 10, 22, FONT_WHITE, shopSurface[1]);
sprintf(description, "Plasma Condensor : Stage %d", currentGame.maxPlasmaDamage); sprintf(description, "Plasma Condensor : Stage %d",
currentGame.maxPlasmaDamage);
drawString(description, 10, 37, FONT_WHITE, shopSurface[1]); drawString(description, 10, 37, FONT_WHITE, shopSurface[1]);
sprintf(description, "Liquid Nitrogen : Stage %d", currentGame.maxPlasmaRate); sprintf(description, "Liquid Nitrogen : Stage %d",
currentGame.maxPlasmaRate);
drawString(description, 10, 52, FONT_WHITE, shopSurface[1]); drawString(description, 10, 52, FONT_WHITE, shopSurface[1]);
sprintf(description, "Plasma Capacity : %d", currentGame.maxPlasmaAmmo); sprintf(description, "Plasma Capacity : %d", currentGame.maxPlasmaAmmo);
drawString(description, 10, 67, FONT_WHITE, shopSurface[1]); drawString(description, 10, 67, FONT_WHITE, shopSurface[1]);
@ -232,40 +238,51 @@ static void drawShop()
case -1: case -1:
break; break;
case -2: case -2:
drawString("You don't have enough money", 20, 30, FONT_WHITE, shopSurface[5]); drawString("You don't have enough money", 20, 30, FONT_WHITE,
shopSurface[5]);
break; break;
case -3: case -3:
drawString("Cannot upgrade ship", 5, 22, FONT_WHITE, shopSurface[5]); drawString("Cannot upgrade ship", 5, 22, FONT_WHITE, shopSurface[5]);
drawString("Hardware capacity has been reached", 20, 38, FONT_CYAN, shopSurface[5]); drawString("Hardware capacity has been reached", 20, 38, FONT_CYAN,
shopSurface[5]);
break; break;
case -4: case -4:
drawString("Ammunition limit reached", 20, 30, FONT_WHITE, shopSurface[5]); drawString("Ammunition limit reached", 20, 30, FONT_WHITE,
shopSurface[5]);
break; break;
case -5: case -5:
drawString("You cannot sell that item", 20, 30, FONT_WHITE, shopSurface[5]); drawString("You cannot sell that item", 20, 30, FONT_WHITE,
shopSurface[5]);
break; break;
case -6: case -6:
drawString("Nothing to sell", 20, 30, FONT_WHITE, shopSurface[5]); drawString("Nothing to sell", 20, 30, FONT_WHITE, shopSurface[5]);
break; break;
case -7: case -7:
drawString("Rockets cannot be bought for Laser or Charger Cannon", 5, 30, FONT_WHITE, shopSurface[5]); drawString("Rockets cannot be bought for Laser or Charger Cannon",
5, 30, FONT_WHITE, shopSurface[5]);
break; break;
case -8: case -8:
drawString("You already have that weapon", 20, 30, FONT_WHITE, shopSurface[5]); drawString("You already have that weapon", 20, 30, FONT_WHITE,
shopSurface[5]);
break; break;
case -9: case -9:
drawString("This weapon's ammo limit has been reached", 20, 30, FONT_WHITE, shopSurface[5]); drawString("This weapon's ammo limit has been reached", 20, 30,
FONT_WHITE, shopSurface[5]);
break; break;
default: default:
if (shopItems[shopSelectedItem].price != 0) if (shopItems[shopSelectedItem].price != 0)
{ {
sprintf(description, "%s ($%d)", shopItems[shopSelectedItem].description, shopItems[shopSelectedItem].price); sprintf(description, "%s ($%d)",
shopItems[shopSelectedItem].description,
shopItems[shopSelectedItem].price);
} }
else else
{ {
sprintf(description, "%s (N/A)", shopItems[shopSelectedItem].description); sprintf(description, "%s (N/A)",
shopItems[shopSelectedItem].description);
} }
drawString(shopItems[shopSelectedItem].name, 5, 22, FONT_WHITE, shopSurface[5]); drawString(shopItems[shopSelectedItem].name, 5, 22, FONT_WHITE,
shopSurface[5]);
drawString(description, 20, 38, FONT_CYAN, shopSurface[5]); drawString(description, 20, 38, FONT_CYAN, shopSurface[5]);
break; break;
} }
@ -275,19 +292,22 @@ void initShop()
{ {
/* ----------- Temporary Items ----------- */ /* ----------- Temporary Items ----------- */
shopItems[SHOP_PLASMA_MAX_OUTPUT].price = 1000; shopItems[SHOP_PLASMA_MAX_OUTPUT].price = 0; // Overwritten later
strcpy(shopItems[SHOP_PLASMA_MAX_OUTPUT].name, "Plasma channel splitter"); strcpy(shopItems[SHOP_PLASMA_MAX_OUTPUT].name, "Plasma channel splitter");
strcpy(shopItems[SHOP_PLASMA_MAX_OUTPUT].description, "Improves poweredup plasma output"); strcpy(shopItems[SHOP_PLASMA_MAX_OUTPUT].description,
"Improves poweredup plasma output");
shopItems[SHOP_PLASMA_MAX_OUTPUT].image = 9; shopItems[SHOP_PLASMA_MAX_OUTPUT].image = 9;
shopItems[SHOP_PLASMA_MAX_DAMAGE].price = 1000; shopItems[SHOP_PLASMA_MAX_DAMAGE].price = 0; // Overwritten later
strcpy(shopItems[SHOP_PLASMA_MAX_DAMAGE].name, "Plasma capacity condensor"); strcpy(shopItems[SHOP_PLASMA_MAX_DAMAGE].name, "Plasma capacity condensor");
strcpy(shopItems[SHOP_PLASMA_MAX_DAMAGE].description, "Increases poweredup plasma damage"); strcpy(shopItems[SHOP_PLASMA_MAX_DAMAGE].description,
"Increases poweredup plasma damage");
shopItems[SHOP_PLASMA_MAX_DAMAGE].image = 10; shopItems[SHOP_PLASMA_MAX_DAMAGE].image = 10;
shopItems[SHOP_PLASMA_MAX_RATE].price = 1000; shopItems[SHOP_PLASMA_MAX_RATE].price = 0; // Overwritten later
strcpy(shopItems[SHOP_PLASMA_MAX_RATE].name, "Liquid nitrogen capsules"); strcpy(shopItems[SHOP_PLASMA_MAX_RATE].name, "Liquid nitrogen capsules");
strcpy(shopItems[SHOP_PLASMA_MAX_RATE].description, "Increases plasma firing rate"); strcpy(shopItems[SHOP_PLASMA_MAX_RATE].description,
"Increases plasma firing rate");
shopItems[SHOP_PLASMA_MAX_RATE].image = 11; shopItems[SHOP_PLASMA_MAX_RATE].image = 11;
shopItems[SHOP_PLASMA_AMMO].price = 50; shopItems[SHOP_PLASMA_AMMO].price = 50;
@ -297,48 +317,56 @@ void initShop()
shopItems[SHOP_ROCKET_AMMO].price = 50; shopItems[SHOP_ROCKET_AMMO].price = 50;
strcpy(shopItems[SHOP_ROCKET_AMMO].name, "Rocket Ammo"); strcpy(shopItems[SHOP_ROCKET_AMMO].name, "Rocket Ammo");
strcpy(shopItems[SHOP_ROCKET_AMMO].description, "High velocity dumb fire rocket"); strcpy(shopItems[SHOP_ROCKET_AMMO].description,
"High velocity dumb fire rocket");
shopItems[SHOP_ROCKET_AMMO].image = 13; shopItems[SHOP_ROCKET_AMMO].image = 13;
/* ----------- Permanent Items ----------- */ /* ----------- Permanent Items ----------- */
shopItems[SHOP_PLASMA_MIN_OUTPUT].price = 2000; shopItems[SHOP_PLASMA_MIN_OUTPUT].price = 0; // Overwritten later
strcpy(shopItems[SHOP_PLASMA_MIN_OUTPUT].name, "Additional Plasma Cannon"); strcpy(shopItems[SHOP_PLASMA_MIN_OUTPUT].name, "Additional Plasma Cannon");
strcpy(shopItems[SHOP_PLASMA_MIN_OUTPUT].description, "Adds an extra plasma cannon to the Firefly"); strcpy(shopItems[SHOP_PLASMA_MIN_OUTPUT].description,
"Adds an extra plasma cannon to the Firefly");
shopItems[SHOP_PLASMA_MIN_OUTPUT].image = 14; shopItems[SHOP_PLASMA_MIN_OUTPUT].image = 14;
shopItems[SHOP_PLASMA_MIN_DAMAGE].price = 2000; shopItems[SHOP_PLASMA_MIN_DAMAGE].price = 0; // Overwritten later
strcpy(shopItems[SHOP_PLASMA_MIN_DAMAGE].name, "Plasma Power Booster"); strcpy(shopItems[SHOP_PLASMA_MIN_DAMAGE].name, "Plasma Power Booster");
strcpy(shopItems[SHOP_PLASMA_MIN_DAMAGE].description, "Increases power of plasma shots"); strcpy(shopItems[SHOP_PLASMA_MIN_DAMAGE].description,
"Increases power of plasma shots");
shopItems[SHOP_PLASMA_MIN_DAMAGE].image = 15; shopItems[SHOP_PLASMA_MIN_DAMAGE].image = 15;
shopItems[SHOP_PLASMA_MIN_RATE].price = 2000; shopItems[SHOP_PLASMA_MIN_RATE].price = 0; // Overwritten later
strcpy(shopItems[SHOP_PLASMA_MIN_RATE].name, "Plasma Cooling Booster"); strcpy(shopItems[SHOP_PLASMA_MIN_RATE].name, "Plasma Cooling Booster");
strcpy(shopItems[SHOP_PLASMA_MIN_RATE].description, "Permanently increases firing rate"); strcpy(shopItems[SHOP_PLASMA_MIN_RATE].description,
"Permanently increases firing rate");
shopItems[SHOP_PLASMA_MIN_RATE].image = 16; shopItems[SHOP_PLASMA_MIN_RATE].image = 16;
/* ----------- Ammo Items -------------- */ /* ----------- Ammo Items -------------- */
shopItems[SHOP_PLASMA_MAX_AMMO].price = 250; shopItems[SHOP_PLASMA_MAX_AMMO].price = 0; // Overwritten later
strcpy(shopItems[SHOP_PLASMA_MAX_AMMO].name, "Plasma compressor"); strcpy(shopItems[SHOP_PLASMA_MAX_AMMO].name, "Plasma compressor");
strcpy(shopItems[SHOP_PLASMA_MAX_AMMO].description, "Increases plasma ammo capacity"); strcpy(shopItems[SHOP_PLASMA_MAX_AMMO].description,
"Increases plasma ammo capacity");
shopItems[SHOP_PLASMA_MAX_AMMO].image = 17; shopItems[SHOP_PLASMA_MAX_AMMO].image = 17;
shopItems[SHOP_ROCKET_MAX_AMMO].price = 250; shopItems[SHOP_ROCKET_MAX_AMMO].price = 0; // Overwritten later
strcpy(shopItems[SHOP_ROCKET_MAX_AMMO].name, "Rocket Pod"); strcpy(shopItems[SHOP_ROCKET_MAX_AMMO].name, "Rocket Pod");
strcpy(shopItems[SHOP_ROCKET_MAX_AMMO].description, "Allows for an additional 5 rockets to be carried"); strcpy(shopItems[SHOP_ROCKET_MAX_AMMO].description,
"Allows for an additional 5 rockets to be carried");
shopItems[SHOP_ROCKET_MAX_AMMO].image = 18; shopItems[SHOP_ROCKET_MAX_AMMO].image = 18;
/* ---------- Weaponary --------------- */ /* ---------- Weaponary --------------- */
shopItems[SHOP_DOUBLE_ROCKETS].price = 2000; shopItems[SHOP_DOUBLE_ROCKETS].price = 2000;
strcpy(shopItems[SHOP_DOUBLE_ROCKETS].name, "Dual Rocket Launcher"); strcpy(shopItems[SHOP_DOUBLE_ROCKETS].name, "Dual Rocket Launcher");
strcpy(shopItems[SHOP_DOUBLE_ROCKETS].description, "Allows for two rockets to be fired at once"); strcpy(shopItems[SHOP_DOUBLE_ROCKETS].description,
"Allows for two rockets to be fired at once");
shopItems[SHOP_DOUBLE_ROCKETS].image = 19; shopItems[SHOP_DOUBLE_ROCKETS].image = 19;
shopItems[SHOP_MICRO_ROCKETS].price = 2500; shopItems[SHOP_MICRO_ROCKETS].price = 2500;
strcpy(shopItems[SHOP_MICRO_ROCKETS].name, "Micro Rocket Launcher"); strcpy(shopItems[SHOP_MICRO_ROCKETS].name, "Micro Rocket Launcher");
strcpy(shopItems[SHOP_MICRO_ROCKETS].description, "Launches several less powerful rockets at once"); strcpy(shopItems[SHOP_MICRO_ROCKETS].description,
"Launches several less powerful rockets at once");
shopItems[SHOP_MICRO_ROCKETS].image = 20; shopItems[SHOP_MICRO_ROCKETS].image = 20;
shopItems[SHOP_LASER].price = 5000; shopItems[SHOP_LASER].price = 5000;
@ -348,8 +376,8 @@ void initShop()
shopItems[SHOP_HOMING_MISSILE].price = 7500; shopItems[SHOP_HOMING_MISSILE].price = 7500;
strcpy(shopItems[SHOP_HOMING_MISSILE].name, "Homing Missile Launcher"); strcpy(shopItems[SHOP_HOMING_MISSILE].name, "Homing Missile Launcher");
sprintf(shopItems[SHOP_HOMING_MISSILE].description, "Fires homing missile (max %i missiles)", sprintf(shopItems[SHOP_HOMING_MISSILE].description,
maxHoming); "Fires homing missile (max %i missiles)", maxHoming);
shopItems[SHOP_HOMING_MISSILE].image = 22; shopItems[SHOP_HOMING_MISSILE].image = 22;
shopItems[SHOP_CHARGER].price = 10000; shopItems[SHOP_CHARGER].price = 10000;
@ -358,13 +386,15 @@ void initShop()
shopItems[SHOP_CHARGER].image = 23; shopItems[SHOP_CHARGER].image = 23;
shopItems[SHOP_DOUBLE_HOMING_MISSILES].price = 10000; shopItems[SHOP_DOUBLE_HOMING_MISSILES].price = 10000;
strcpy(shopItems[SHOP_DOUBLE_HOMING_MISSILES].name, "Dual Homing Missile Launcher"); strcpy(shopItems[SHOP_DOUBLE_HOMING_MISSILES].name,
"Dual Homing Missile Launcher");
sprintf(shopItems[SHOP_DOUBLE_HOMING_MISSILES].description, sprintf(shopItems[SHOP_DOUBLE_HOMING_MISSILES].description,
"Fires two homing missiles (max %i missiles)", maxDoubleHoming); "Fires two homing missiles (max %i missiles)", maxDoubleHoming);
shopItems[SHOP_DOUBLE_HOMING_MISSILES].image = 24; shopItems[SHOP_DOUBLE_HOMING_MISSILES].image = 24;
shopItems[SHOP_MICRO_HOMING_MISSILES].price = 15000; shopItems[SHOP_MICRO_HOMING_MISSILES].price = 15000;
strcpy(shopItems[SHOP_MICRO_HOMING_MISSILES].name, "Homing Micro Missile Launcher"); strcpy(shopItems[SHOP_MICRO_HOMING_MISSILES].name,
"Homing Micro Missile Launcher");
sprintf(shopItems[SHOP_MICRO_HOMING_MISSILES].description, sprintf(shopItems[SHOP_MICRO_HOMING_MISSILES].description,
"Fires several small homing missiles (max %i missiles)", maxMicroHoming); "Fires several small homing missiles (max %i missiles)", maxMicroHoming);
shopItems[SHOP_MICRO_HOMING_MISSILES].image = 25; shopItems[SHOP_MICRO_HOMING_MISSILES].image = 25;

View File

@ -27,7 +27,7 @@ struct object {
signed char AIType; // Type of articifial intelligence signed char AIType; // Type of articifial intelligence
signed char id; // The "job" of the object signed char id; // The "job" of the object
object *target; // index target in enemy array object *target; // index target in aliens array
signed char reload[2]; signed char reload[2];
@ -73,14 +73,14 @@ struct mission {
char primaryObjective[3][50]; // Description char primaryObjective[3][50]; // Description
signed char primaryType[3]; // The type of mission this is signed char primaryType[3]; // The type of mission this is
signed char target1[3]; // index of target in enemy array signed char target1[3]; // index of target in aliens array
int targetValue1[3]; // Number of things to collect (slaves, cash, etc) int targetValue1[3]; // Number of things to collect (slaves, cash, etc)
signed char timeLimit1[3]; // In minutes signed char timeLimit1[3]; // In minutes
int completed1[3]; int completed1[3];
char secondaryObjective[3][50]; // Description char secondaryObjective[3][50]; // Description
signed char secondaryType[3]; // The type of mission this is signed char secondaryType[3]; // The type of mission this is
signed char target2[3]; // index of target in enemy array signed char target2[3]; // index of target in aliens array
int targetValue2[3]; // Number of things to collect (slaves, cash, etc) int targetValue2[3]; // Number of things to collect (slaves, cash, etc)
signed char timeLimit2[3]; // In minutes signed char timeLimit2[3]; // In minutes
int completed2[3]; int completed2[3];

View File

@ -229,15 +229,15 @@ int doTitle()
for (int i = 0 ; i < 15 ; i++) for (int i = 0 ; i < 15 ; i++)
{ {
enemy[i] = defEnemy[rand() % 3]; aliens[i] = alien_defs[rand() % 3];
if ((rand() % 5) == 0) if ((rand() % 5) == 0)
enemy[i] = defEnemy[CD_TRANSPORTSHIP]; aliens[i] = alien_defs[CD_TRANSPORTSHIP];
if ((rand() % 5) == 0) if ((rand() % 5) == 0)
enemy[i] = defEnemy[CD_MINER]; aliens[i] = alien_defs[CD_MINER];
enemy[i].x = rand() % screen->w; aliens[i].x = rand() % screen->w;
enemy[i].y = rand() % (screen->h - 40); aliens[i].y = rand() % (screen->h - 40);
enemy[i].dx = 1 + rand() % 3; aliens[i].dx = 1 + rand() % 3;
enemy[i].face = 0; aliens[i].face = 0;
} }
int redGlow = 255; int redGlow = 255;
@ -281,14 +281,14 @@ int doTitle()
for (int i = 0 ; i < 15 ; i++) for (int i = 0 ; i < 15 ; i++)
{ {
addEngine(&enemy[i]); addEngine(&aliens[i]);
enemy[i].x += enemy[i].dx; aliens[i].x += aliens[i].dx;
blit(enemy[i].image[0], (int)enemy[i].x, (int)enemy[i].y); blit(aliens[i].image[0], (int)aliens[i].x, (int)aliens[i].y);
if (enemy[i].x > 830) if (aliens[i].x > 830)
{ {
enemy[i].x = -40; aliens[i].x = -40;
enemy[i].y = rand() % (screen->h - 20); aliens[i].y = rand() % (screen->h - 20);
enemy[i].dx = 1 + rand() % 3; aliens[i].dx = 1 + rand() % 3;
} }
} }