diff --git a/src/Starfighter.cpp b/src/Starfighter.cpp index 52d4777..ba75dcc 100644 --- a/src/Starfighter.cpp +++ b/src/Starfighter.cpp @@ -114,681 +114,681 @@ int main(int argc, char **argv) initVars(); // Dual Plasma Fighter. - defEnemy[CD_DUALFIGHTER].classDef = CD_DUALFIGHTER; - defEnemy[CD_DUALFIGHTER].AIType = AI_NORMAL; - defEnemy[CD_DUALFIGHTER].speed = 4; - defEnemy[CD_DUALFIGHTER].maxShield = 5; - defEnemy[CD_DUALFIGHTER].shield = 5; - defEnemy[CD_DUALFIGHTER].imageIndex[0] = 2; - defEnemy[CD_DUALFIGHTER].imageIndex[1] = 3; - defEnemy[CD_DUALFIGHTER].weaponType[0] = W_DOUBLE_SHOT; - defEnemy[CD_DUALFIGHTER].weaponType[1] = W_ROCKETS; - defEnemy[CD_DUALFIGHTER].chance[0] = 100; - defEnemy[CD_DUALFIGHTER].chance[1] = 1; - defEnemy[CD_DUALFIGHTER].score = 25; - defEnemy[CD_DUALFIGHTER].collectChance = 50; - defEnemy[CD_DUALFIGHTER].collectType = P_ANYTHING; - defEnemy[CD_DUALFIGHTER].collectValue = 50; - defEnemy[CD_DUALFIGHTER].flags = FL_WEAPCO; + alien_defs[CD_DUALFIGHTER].classDef = CD_DUALFIGHTER; + alien_defs[CD_DUALFIGHTER].AIType = AI_NORMAL; + alien_defs[CD_DUALFIGHTER].speed = 4; + alien_defs[CD_DUALFIGHTER].maxShield = 5; + alien_defs[CD_DUALFIGHTER].shield = 5; + alien_defs[CD_DUALFIGHTER].imageIndex[0] = 2; + alien_defs[CD_DUALFIGHTER].imageIndex[1] = 3; + alien_defs[CD_DUALFIGHTER].weaponType[0] = W_DOUBLE_SHOT; + alien_defs[CD_DUALFIGHTER].weaponType[1] = W_ROCKETS; + alien_defs[CD_DUALFIGHTER].chance[0] = 100; + alien_defs[CD_DUALFIGHTER].chance[1] = 1; + alien_defs[CD_DUALFIGHTER].score = 25; + alien_defs[CD_DUALFIGHTER].collectChance = 50; + alien_defs[CD_DUALFIGHTER].collectType = P_ANYTHING; + alien_defs[CD_DUALFIGHTER].collectValue = 50; + alien_defs[CD_DUALFIGHTER].flags = FL_WEAPCO; // Missile Boat - defEnemy[CD_MISSILEBOAT].classDef = CD_MISSILEBOAT; - defEnemy[CD_MISSILEBOAT].AIType = AI_DEFENSIVE; - defEnemy[CD_MISSILEBOAT].speed = 2; - defEnemy[CD_MISSILEBOAT].maxShield = 50; - defEnemy[CD_MISSILEBOAT].shield = 50; - defEnemy[CD_MISSILEBOAT].imageIndex[0] = 4; - defEnemy[CD_MISSILEBOAT].imageIndex[1] = 5; - defEnemy[CD_MISSILEBOAT].weaponType[0] = W_ROCKETS; - defEnemy[CD_MISSILEBOAT].weaponType[1] = W_DOUBLE_ROCKETS; - defEnemy[CD_MISSILEBOAT].chance[0] = 25; - defEnemy[CD_MISSILEBOAT].chance[1] = 4; - defEnemy[CD_MISSILEBOAT].score = 250; - defEnemy[CD_MISSILEBOAT].collectChance = 25; - defEnemy[CD_MISSILEBOAT].collectType = P_ANYTHING; - defEnemy[CD_MISSILEBOAT].collectValue = 75; - defEnemy[CD_MISSILEBOAT].flags = FL_WEAPCO; + alien_defs[CD_MISSILEBOAT].classDef = CD_MISSILEBOAT; + alien_defs[CD_MISSILEBOAT].AIType = AI_DEFENSIVE; + alien_defs[CD_MISSILEBOAT].speed = 2; + alien_defs[CD_MISSILEBOAT].maxShield = 50; + alien_defs[CD_MISSILEBOAT].shield = 50; + alien_defs[CD_MISSILEBOAT].imageIndex[0] = 4; + alien_defs[CD_MISSILEBOAT].imageIndex[1] = 5; + alien_defs[CD_MISSILEBOAT].weaponType[0] = W_ROCKETS; + alien_defs[CD_MISSILEBOAT].weaponType[1] = W_DOUBLE_ROCKETS; + alien_defs[CD_MISSILEBOAT].chance[0] = 25; + alien_defs[CD_MISSILEBOAT].chance[1] = 4; + alien_defs[CD_MISSILEBOAT].score = 250; + alien_defs[CD_MISSILEBOAT].collectChance = 25; + alien_defs[CD_MISSILEBOAT].collectType = P_ANYTHING; + alien_defs[CD_MISSILEBOAT].collectValue = 75; + alien_defs[CD_MISSILEBOAT].flags = FL_WEAPCO; //Prototype fighter - defEnemy[CD_PROTOFIGHTER].classDef = CD_PROTOFIGHTER; - defEnemy[CD_PROTOFIGHTER].AIType = AI_DEFENSIVE; - defEnemy[CD_PROTOFIGHTER].speed = 5; - defEnemy[CD_PROTOFIGHTER].maxShield = 15; - defEnemy[CD_PROTOFIGHTER].shield = 15; - defEnemy[CD_PROTOFIGHTER].imageIndex[0] = 6; - defEnemy[CD_PROTOFIGHTER].imageIndex[1] = 7; - defEnemy[CD_PROTOFIGHTER].weaponType[0] = W_TRIPLE_SHOT; - defEnemy[CD_PROTOFIGHTER].weaponType[1] = P_ANYTHING; - defEnemy[CD_PROTOFIGHTER].chance[0] = 100; - defEnemy[CD_PROTOFIGHTER].chance[1] = 1; - defEnemy[CD_PROTOFIGHTER].score = 50; - defEnemy[CD_PROTOFIGHTER].collectChance = 50; - defEnemy[CD_PROTOFIGHTER].collectType = P_ANYTHING; - defEnemy[CD_PROTOFIGHTER].collectValue = 50; - defEnemy[CD_PROTOFIGHTER].flags = FL_WEAPCO; + alien_defs[CD_PROTOFIGHTER].classDef = CD_PROTOFIGHTER; + alien_defs[CD_PROTOFIGHTER].AIType = AI_DEFENSIVE; + alien_defs[CD_PROTOFIGHTER].speed = 5; + alien_defs[CD_PROTOFIGHTER].maxShield = 15; + alien_defs[CD_PROTOFIGHTER].shield = 15; + alien_defs[CD_PROTOFIGHTER].imageIndex[0] = 6; + alien_defs[CD_PROTOFIGHTER].imageIndex[1] = 7; + alien_defs[CD_PROTOFIGHTER].weaponType[0] = W_TRIPLE_SHOT; + alien_defs[CD_PROTOFIGHTER].weaponType[1] = P_ANYTHING; + alien_defs[CD_PROTOFIGHTER].chance[0] = 100; + alien_defs[CD_PROTOFIGHTER].chance[1] = 1; + alien_defs[CD_PROTOFIGHTER].score = 50; + alien_defs[CD_PROTOFIGHTER].collectChance = 50; + alien_defs[CD_PROTOFIGHTER].collectType = P_ANYTHING; + alien_defs[CD_PROTOFIGHTER].collectValue = 50; + alien_defs[CD_PROTOFIGHTER].flags = FL_WEAPCO; // Phoebe and Ursula - defEnemy[CD_FRIEND].classDef = CD_FRIEND; - defEnemy[CD_FRIEND].AIType = AI_OFFENSIVE; - defEnemy[CD_FRIEND].speed = 3; - defEnemy[CD_FRIEND].maxShield = 50; - defEnemy[CD_FRIEND].shield = 50; - defEnemy[CD_FRIEND].imageIndex[0] = 20; - defEnemy[CD_FRIEND].imageIndex[1] = 21; - defEnemy[CD_FRIEND].weaponType[0] = W_DOUBLE_SHOT; - defEnemy[CD_FRIEND].weaponType[1] = W_HOMING_MISSILE; - defEnemy[CD_FRIEND].chance[0] = 100; - defEnemy[CD_FRIEND].chance[1] = 5; - defEnemy[CD_FRIEND].score = 0; - defEnemy[CD_FRIEND].collectChance = 0; - defEnemy[CD_FRIEND].collectType = P_CASH; - defEnemy[CD_FRIEND].collectValue = 0; - defEnemy[CD_FRIEND].flags = FL_FRIEND; + alien_defs[CD_FRIEND].classDef = CD_FRIEND; + alien_defs[CD_FRIEND].AIType = AI_OFFENSIVE; + alien_defs[CD_FRIEND].speed = 3; + alien_defs[CD_FRIEND].maxShield = 50; + alien_defs[CD_FRIEND].shield = 50; + alien_defs[CD_FRIEND].imageIndex[0] = 20; + alien_defs[CD_FRIEND].imageIndex[1] = 21; + alien_defs[CD_FRIEND].weaponType[0] = W_DOUBLE_SHOT; + alien_defs[CD_FRIEND].weaponType[1] = W_HOMING_MISSILE; + alien_defs[CD_FRIEND].chance[0] = 100; + alien_defs[CD_FRIEND].chance[1] = 5; + alien_defs[CD_FRIEND].score = 0; + alien_defs[CD_FRIEND].collectChance = 0; + alien_defs[CD_FRIEND].collectType = P_CASH; + alien_defs[CD_FRIEND].collectValue = 0; + alien_defs[CD_FRIEND].flags = FL_FRIEND; // Boss 1 - defEnemy[CD_FRIGATE].classDef = CD_BOSS; - defEnemy[CD_FRIGATE].AIType = AI_NORMAL; - defEnemy[CD_FRIGATE].speed = 2; - defEnemy[CD_FRIGATE].maxShield = 550; - defEnemy[CD_FRIGATE].shield = 550; - defEnemy[CD_FRIGATE].imageIndex[0] = 8; - defEnemy[CD_FRIGATE].imageIndex[1] = 9; - defEnemy[CD_FRIGATE].weaponType[0] = W_MICRO_ROCKETS; - defEnemy[CD_FRIGATE].weaponType[1] = W_ENERGYRAY; - defEnemy[CD_FRIGATE].chance[0] = 100; - defEnemy[CD_FRIGATE].chance[1] = 85; - defEnemy[CD_FRIGATE].score = 500; - defEnemy[CD_FRIGATE].collectChance = 100; - defEnemy[CD_FRIGATE].collectType = P_CASH; - defEnemy[CD_FRIGATE].collectValue = 250; - defEnemy[CD_FRIGATE].flags = FL_WEAPCO; + alien_defs[CD_FRIGATE].classDef = CD_BOSS; + alien_defs[CD_FRIGATE].AIType = AI_NORMAL; + alien_defs[CD_FRIGATE].speed = 2; + alien_defs[CD_FRIGATE].maxShield = 550; + alien_defs[CD_FRIGATE].shield = 550; + alien_defs[CD_FRIGATE].imageIndex[0] = 8; + alien_defs[CD_FRIGATE].imageIndex[1] = 9; + alien_defs[CD_FRIGATE].weaponType[0] = W_MICRO_ROCKETS; + alien_defs[CD_FRIGATE].weaponType[1] = W_ENERGYRAY; + alien_defs[CD_FRIGATE].chance[0] = 100; + alien_defs[CD_FRIGATE].chance[1] = 85; + alien_defs[CD_FRIGATE].score = 500; + alien_defs[CD_FRIGATE].collectChance = 100; + alien_defs[CD_FRIGATE].collectType = P_CASH; + alien_defs[CD_FRIGATE].collectValue = 250; + alien_defs[CD_FRIGATE].flags = FL_WEAPCO; - defEnemy[CD_FRIGATE_WING1].classDef = CD_FRIGATE_WING1; - defEnemy[CD_FRIGATE_WING1].AIType = AI_NORMAL; - defEnemy[CD_FRIGATE_WING1].speed = 2; - defEnemy[CD_FRIGATE_WING1].maxShield = 100; - defEnemy[CD_FRIGATE_WING1].shield = 100; - defEnemy[CD_FRIGATE_WING1].imageIndex[0] = 10; - defEnemy[CD_FRIGATE_WING1].imageIndex[1] = 11; - defEnemy[CD_FRIGATE_WING1].weaponType[0] = W_TRIPLE_SHOT; - defEnemy[CD_FRIGATE_WING1].weaponType[1] = W_ROCKETS; - defEnemy[CD_FRIGATE_WING1].chance[0] = 100; - defEnemy[CD_FRIGATE_WING1].chance[1] = 10; - defEnemy[CD_FRIGATE_WING1].score = 500; - defEnemy[CD_FRIGATE_WING1].collectChance = 100; - defEnemy[CD_FRIGATE_WING1].collectType = P_ANYTHING; - defEnemy[CD_FRIGATE_WING1].collectValue = 250; - defEnemy[CD_FRIGATE_WING1].flags = FL_WEAPCO | FL_DAMAGEOWNER; + alien_defs[CD_FRIGATE_WING1].classDef = CD_FRIGATE_WING1; + alien_defs[CD_FRIGATE_WING1].AIType = AI_NORMAL; + alien_defs[CD_FRIGATE_WING1].speed = 2; + alien_defs[CD_FRIGATE_WING1].maxShield = 100; + alien_defs[CD_FRIGATE_WING1].shield = 100; + alien_defs[CD_FRIGATE_WING1].imageIndex[0] = 10; + alien_defs[CD_FRIGATE_WING1].imageIndex[1] = 11; + alien_defs[CD_FRIGATE_WING1].weaponType[0] = W_TRIPLE_SHOT; + alien_defs[CD_FRIGATE_WING1].weaponType[1] = W_ROCKETS; + alien_defs[CD_FRIGATE_WING1].chance[0] = 100; + alien_defs[CD_FRIGATE_WING1].chance[1] = 10; + alien_defs[CD_FRIGATE_WING1].score = 500; + alien_defs[CD_FRIGATE_WING1].collectChance = 100; + alien_defs[CD_FRIGATE_WING1].collectType = P_ANYTHING; + alien_defs[CD_FRIGATE_WING1].collectValue = 250; + alien_defs[CD_FRIGATE_WING1].flags = FL_WEAPCO | FL_DAMAGEOWNER; - defEnemy[CD_FRIGATE_WING2].classDef = CD_FRIGATE_WING2; - defEnemy[CD_FRIGATE_WING2].AIType = AI_NORMAL; - defEnemy[CD_FRIGATE_WING2].speed = 2; - defEnemy[CD_FRIGATE_WING2].maxShield = 100; - defEnemy[CD_FRIGATE_WING2].shield = 100; - defEnemy[CD_FRIGATE_WING2].imageIndex[0] = 12; - defEnemy[CD_FRIGATE_WING2].imageIndex[1] = 13; - defEnemy[CD_FRIGATE_WING2].weaponType[0] = W_TRIPLE_SHOT; - defEnemy[CD_FRIGATE_WING2].weaponType[1] = W_ROCKETS; - defEnemy[CD_FRIGATE_WING2].chance[0] = 100; - defEnemy[CD_FRIGATE_WING2].chance[1] = 10; - defEnemy[CD_FRIGATE_WING2].score = 500; - defEnemy[CD_FRIGATE_WING2].collectChance = 100; - defEnemy[CD_FRIGATE_WING2].collectType = P_ANYTHING; - defEnemy[CD_FRIGATE_WING2].collectValue = 250; - defEnemy[CD_FRIGATE_WING2].flags = FL_WEAPCO | FL_DAMAGEOWNER; + alien_defs[CD_FRIGATE_WING2].classDef = CD_FRIGATE_WING2; + alien_defs[CD_FRIGATE_WING2].AIType = AI_NORMAL; + alien_defs[CD_FRIGATE_WING2].speed = 2; + alien_defs[CD_FRIGATE_WING2].maxShield = 100; + alien_defs[CD_FRIGATE_WING2].shield = 100; + alien_defs[CD_FRIGATE_WING2].imageIndex[0] = 12; + alien_defs[CD_FRIGATE_WING2].imageIndex[1] = 13; + alien_defs[CD_FRIGATE_WING2].weaponType[0] = W_TRIPLE_SHOT; + alien_defs[CD_FRIGATE_WING2].weaponType[1] = W_ROCKETS; + alien_defs[CD_FRIGATE_WING2].chance[0] = 100; + alien_defs[CD_FRIGATE_WING2].chance[1] = 10; + alien_defs[CD_FRIGATE_WING2].score = 500; + alien_defs[CD_FRIGATE_WING2].collectChance = 100; + alien_defs[CD_FRIGATE_WING2].collectType = P_ANYTHING; + alien_defs[CD_FRIGATE_WING2].collectValue = 250; + alien_defs[CD_FRIGATE_WING2].flags = FL_WEAPCO | FL_DAMAGEOWNER; // Transport ship - defEnemy[CD_TRANSPORTSHIP].classDef = CD_TRANSPORTSHIP; - defEnemy[CD_TRANSPORTSHIP].AIType = AI_EVASIVE; - defEnemy[CD_TRANSPORTSHIP].speed = 4; - defEnemy[CD_TRANSPORTSHIP].maxShield = 10; - defEnemy[CD_TRANSPORTSHIP].shield = 10; - defEnemy[CD_TRANSPORTSHIP].imageIndex[0] = 14; - defEnemy[CD_TRANSPORTSHIP].imageIndex[1] = 15; - defEnemy[CD_TRANSPORTSHIP].weaponType[0] = W_DOUBLE_SHOT; - defEnemy[CD_TRANSPORTSHIP].weaponType[1] = W_DOUBLE_SHOT; - defEnemy[CD_TRANSPORTSHIP].chance[0] = 0; - defEnemy[CD_TRANSPORTSHIP].chance[1] = 0; - defEnemy[CD_TRANSPORTSHIP].score = 25; - defEnemy[CD_TRANSPORTSHIP].collectChance = 100; - defEnemy[CD_TRANSPORTSHIP].collectType = P_WEAPONS; - defEnemy[CD_TRANSPORTSHIP].collectValue = 30; - defEnemy[CD_TRANSPORTSHIP].flags = FL_WEAPCO | FL_NOFIRE; + alien_defs[CD_TRANSPORTSHIP].classDef = CD_TRANSPORTSHIP; + alien_defs[CD_TRANSPORTSHIP].AIType = AI_EVASIVE; + alien_defs[CD_TRANSPORTSHIP].speed = 4; + alien_defs[CD_TRANSPORTSHIP].maxShield = 10; + alien_defs[CD_TRANSPORTSHIP].shield = 10; + alien_defs[CD_TRANSPORTSHIP].imageIndex[0] = 14; + alien_defs[CD_TRANSPORTSHIP].imageIndex[1] = 15; + alien_defs[CD_TRANSPORTSHIP].weaponType[0] = W_DOUBLE_SHOT; + alien_defs[CD_TRANSPORTSHIP].weaponType[1] = W_DOUBLE_SHOT; + alien_defs[CD_TRANSPORTSHIP].chance[0] = 0; + alien_defs[CD_TRANSPORTSHIP].chance[1] = 0; + alien_defs[CD_TRANSPORTSHIP].score = 25; + alien_defs[CD_TRANSPORTSHIP].collectChance = 100; + alien_defs[CD_TRANSPORTSHIP].collectType = P_WEAPONS; + alien_defs[CD_TRANSPORTSHIP].collectValue = 30; + alien_defs[CD_TRANSPORTSHIP].flags = FL_WEAPCO | FL_NOFIRE; // Cargo ship - defEnemy[CD_CARGOSHIP].classDef = CD_CARGOSHIP; - defEnemy[CD_CARGOSHIP].AIType = AI_EVASIVE; - defEnemy[CD_CARGOSHIP].speed = 4; - defEnemy[CD_CARGOSHIP].maxShield = 10; - defEnemy[CD_CARGOSHIP].shield = 10; - defEnemy[CD_CARGOSHIP].imageIndex[0] = 22; - defEnemy[CD_CARGOSHIP].imageIndex[1] = 23; - defEnemy[CD_CARGOSHIP].weaponType[0] = W_DOUBLE_SHOT; - defEnemy[CD_CARGOSHIP].weaponType[1] = W_DOUBLE_SHOT; - defEnemy[CD_CARGOSHIP].chance[0] = 0; - defEnemy[CD_CARGOSHIP].chance[1] = 0; - defEnemy[CD_CARGOSHIP].score = 25; - defEnemy[CD_CARGOSHIP].collectChance = 50; - defEnemy[CD_CARGOSHIP].collectType = P_ANYTHING; - defEnemy[CD_CARGOSHIP].collectValue = 100; - defEnemy[CD_CARGOSHIP].flags = FL_WEAPCO | FL_NOFIRE; + alien_defs[CD_CARGOSHIP].classDef = CD_CARGOSHIP; + alien_defs[CD_CARGOSHIP].AIType = AI_EVASIVE; + alien_defs[CD_CARGOSHIP].speed = 4; + alien_defs[CD_CARGOSHIP].maxShield = 10; + alien_defs[CD_CARGOSHIP].shield = 10; + alien_defs[CD_CARGOSHIP].imageIndex[0] = 22; + alien_defs[CD_CARGOSHIP].imageIndex[1] = 23; + alien_defs[CD_CARGOSHIP].weaponType[0] = W_DOUBLE_SHOT; + alien_defs[CD_CARGOSHIP].weaponType[1] = W_DOUBLE_SHOT; + alien_defs[CD_CARGOSHIP].chance[0] = 0; + alien_defs[CD_CARGOSHIP].chance[1] = 0; + alien_defs[CD_CARGOSHIP].score = 25; + alien_defs[CD_CARGOSHIP].collectChance = 50; + alien_defs[CD_CARGOSHIP].collectType = P_ANYTHING; + alien_defs[CD_CARGOSHIP].collectValue = 100; + alien_defs[CD_CARGOSHIP].flags = FL_WEAPCO | FL_NOFIRE; // Weapco Miner - defEnemy[CD_MINER].classDef = CD_MINER; - defEnemy[CD_MINER].AIType = AI_EVASIVE; - defEnemy[CD_MINER].speed = 4; - defEnemy[CD_MINER].maxShield = 25; - defEnemy[CD_MINER].shield = 25; - defEnemy[CD_MINER].imageIndex[0] = 16; - defEnemy[CD_MINER].imageIndex[1] = 17; - defEnemy[CD_MINER].weaponType[0] = W_DOUBLE_SHOT; - defEnemy[CD_MINER].weaponType[1] = W_DOUBLE_SHOT; - defEnemy[CD_MINER].chance[0] = 0; - defEnemy[CD_MINER].chance[1] = 0; - defEnemy[CD_MINER].score = 100; - defEnemy[CD_MINER].collectChance = 100; - defEnemy[CD_MINER].collectType = P_ANYTHING; - defEnemy[CD_MINER].collectValue = 30; - defEnemy[CD_MINER].flags = FL_WEAPCO | FL_NOFIRE | FL_DROPMINES; + alien_defs[CD_MINER].classDef = CD_MINER; + alien_defs[CD_MINER].AIType = AI_EVASIVE; + alien_defs[CD_MINER].speed = 4; + alien_defs[CD_MINER].maxShield = 25; + alien_defs[CD_MINER].shield = 25; + alien_defs[CD_MINER].imageIndex[0] = 16; + alien_defs[CD_MINER].imageIndex[1] = 17; + alien_defs[CD_MINER].weaponType[0] = W_DOUBLE_SHOT; + alien_defs[CD_MINER].weaponType[1] = W_DOUBLE_SHOT; + alien_defs[CD_MINER].chance[0] = 0; + alien_defs[CD_MINER].chance[1] = 0; + alien_defs[CD_MINER].score = 100; + alien_defs[CD_MINER].collectChance = 100; + alien_defs[CD_MINER].collectType = P_ANYTHING; + alien_defs[CD_MINER].collectValue = 30; + alien_defs[CD_MINER].flags = FL_WEAPCO | FL_NOFIRE | FL_DROPMINES; // Kline - defEnemy[CD_KLINE].classDef = CD_KLINE; - defEnemy[CD_KLINE].AIType = AI_OFFENSIVE; - defEnemy[CD_KLINE].speed = 5; - defEnemy[CD_KLINE].maxShield = 750; - defEnemy[CD_KLINE].shield = 750; - defEnemy[CD_KLINE].imageIndex[0] = 18; - defEnemy[CD_KLINE].imageIndex[1] = 19; - defEnemy[CD_KLINE].weaponType[0] = W_TRIPLE_SHOT; - defEnemy[CD_KLINE].weaponType[1] = W_MICRO_ROCKETS; - defEnemy[CD_KLINE].chance[0] = 100; - defEnemy[CD_KLINE].chance[1] = 2; - defEnemy[CD_KLINE].score = 0; - defEnemy[CD_KLINE].collectChance = 0; - defEnemy[CD_KLINE].collectType = P_ANYTHING; - defEnemy[CD_KLINE].collectValue = 0; - defEnemy[CD_KLINE].flags = FL_WEAPCO | FL_CANNOTDIE | FL_ALWAYSFACE | FL_CIRCLES; + alien_defs[CD_KLINE].classDef = CD_KLINE; + alien_defs[CD_KLINE].AIType = AI_OFFENSIVE; + alien_defs[CD_KLINE].speed = 5; + alien_defs[CD_KLINE].maxShield = 750; + alien_defs[CD_KLINE].shield = 750; + alien_defs[CD_KLINE].imageIndex[0] = 18; + alien_defs[CD_KLINE].imageIndex[1] = 19; + alien_defs[CD_KLINE].weaponType[0] = W_TRIPLE_SHOT; + alien_defs[CD_KLINE].weaponType[1] = W_MICRO_ROCKETS; + alien_defs[CD_KLINE].chance[0] = 100; + alien_defs[CD_KLINE].chance[1] = 2; + alien_defs[CD_KLINE].score = 0; + alien_defs[CD_KLINE].collectChance = 0; + alien_defs[CD_KLINE].collectType = P_ANYTHING; + alien_defs[CD_KLINE].collectValue = 0; + alien_defs[CD_KLINE].flags = FL_WEAPCO | FL_CANNOTDIE | FL_ALWAYSFACE | FL_CIRCLES; // Aim Fighter - defEnemy[CD_AIMFIGHTER].classDef = CD_AIMFIGHTER; - defEnemy[CD_AIMFIGHTER].AIType = AI_NORMAL; - defEnemy[CD_AIMFIGHTER].speed = 3; - defEnemy[CD_AIMFIGHTER].maxShield = 15; - defEnemy[CD_AIMFIGHTER].shield = 15; - defEnemy[CD_AIMFIGHTER].imageIndex[0] = 8; - defEnemy[CD_AIMFIGHTER].imageIndex[1] = 9; - defEnemy[CD_AIMFIGHTER].weaponType[0] = W_AIMED_SHOT; - defEnemy[CD_AIMFIGHTER].weaponType[1] = W_AIMED_SHOT; - defEnemy[CD_AIMFIGHTER].chance[0] = 7; - defEnemy[CD_AIMFIGHTER].chance[1] = 1; - defEnemy[CD_AIMFIGHTER].score = 50; - defEnemy[CD_AIMFIGHTER].collectChance = 75; - defEnemy[CD_AIMFIGHTER].collectType = P_ANYTHING; - defEnemy[CD_AIMFIGHTER].collectValue = 100; - defEnemy[CD_AIMFIGHTER].flags = FL_WEAPCO | FL_AIMS; + alien_defs[CD_AIMFIGHTER].classDef = CD_AIMFIGHTER; + alien_defs[CD_AIMFIGHTER].AIType = AI_NORMAL; + alien_defs[CD_AIMFIGHTER].speed = 3; + alien_defs[CD_AIMFIGHTER].maxShield = 15; + alien_defs[CD_AIMFIGHTER].shield = 15; + alien_defs[CD_AIMFIGHTER].imageIndex[0] = 8; + alien_defs[CD_AIMFIGHTER].imageIndex[1] = 9; + alien_defs[CD_AIMFIGHTER].weaponType[0] = W_AIMED_SHOT; + alien_defs[CD_AIMFIGHTER].weaponType[1] = W_AIMED_SHOT; + alien_defs[CD_AIMFIGHTER].chance[0] = 7; + alien_defs[CD_AIMFIGHTER].chance[1] = 1; + alien_defs[CD_AIMFIGHTER].score = 50; + alien_defs[CD_AIMFIGHTER].collectChance = 75; + alien_defs[CD_AIMFIGHTER].collectType = P_ANYTHING; + alien_defs[CD_AIMFIGHTER].collectValue = 100; + alien_defs[CD_AIMFIGHTER].flags = FL_WEAPCO | FL_AIMS; // Slave ship - defEnemy[CD_SLAVETRANSPORT].classDef = CD_SLAVETRANSPORT; - defEnemy[CD_SLAVETRANSPORT].AIType = AI_EVASIVE; - defEnemy[CD_SLAVETRANSPORT].speed = 2; - defEnemy[CD_SLAVETRANSPORT].maxShield = 10; - defEnemy[CD_SLAVETRANSPORT].shield = 20; - defEnemy[CD_SLAVETRANSPORT].imageIndex[0] = 10; - defEnemy[CD_SLAVETRANSPORT].imageIndex[1] = 11; - defEnemy[CD_SLAVETRANSPORT].weaponType[0] = W_DOUBLE_SHOT; - defEnemy[CD_SLAVETRANSPORT].weaponType[1] = W_DOUBLE_SHOT; - defEnemy[CD_SLAVETRANSPORT].chance[0] = 0; - defEnemy[CD_SLAVETRANSPORT].chance[1] = 0; - defEnemy[CD_SLAVETRANSPORT].score = 25; - defEnemy[CD_SLAVETRANSPORT].collectChance = 100; - defEnemy[CD_SLAVETRANSPORT].collectType = P_SLAVES; - defEnemy[CD_SLAVETRANSPORT].collectValue = 25; - defEnemy[CD_SLAVETRANSPORT].flags = FL_WEAPCO | FL_NOFIRE; + alien_defs[CD_SLAVETRANSPORT].classDef = CD_SLAVETRANSPORT; + alien_defs[CD_SLAVETRANSPORT].AIType = AI_EVASIVE; + alien_defs[CD_SLAVETRANSPORT].speed = 2; + alien_defs[CD_SLAVETRANSPORT].maxShield = 10; + alien_defs[CD_SLAVETRANSPORT].shield = 20; + alien_defs[CD_SLAVETRANSPORT].imageIndex[0] = 10; + alien_defs[CD_SLAVETRANSPORT].imageIndex[1] = 11; + alien_defs[CD_SLAVETRANSPORT].weaponType[0] = W_DOUBLE_SHOT; + alien_defs[CD_SLAVETRANSPORT].weaponType[1] = W_DOUBLE_SHOT; + alien_defs[CD_SLAVETRANSPORT].chance[0] = 0; + alien_defs[CD_SLAVETRANSPORT].chance[1] = 0; + alien_defs[CD_SLAVETRANSPORT].score = 25; + alien_defs[CD_SLAVETRANSPORT].collectChance = 100; + alien_defs[CD_SLAVETRANSPORT].collectType = P_SLAVES; + alien_defs[CD_SLAVETRANSPORT].collectValue = 25; + alien_defs[CD_SLAVETRANSPORT].flags = FL_WEAPCO | FL_NOFIRE; // Good Transport - defEnemy[CD_GOODTRANSPORT].classDef = CD_GOODTRANSPORT; - defEnemy[CD_GOODTRANSPORT].AIType = AI_EVASIVE; - defEnemy[CD_GOODTRANSPORT].speed = 3; - defEnemy[CD_GOODTRANSPORT].maxShield = 75; - defEnemy[CD_GOODTRANSPORT].shield = 75; - defEnemy[CD_GOODTRANSPORT].imageIndex[0] = 12; - defEnemy[CD_GOODTRANSPORT].imageIndex[1] = 13; - defEnemy[CD_GOODTRANSPORT].weaponType[0] = W_AIMED_SHOT; - defEnemy[CD_GOODTRANSPORT].weaponType[1] = W_AIMED_SHOT; - defEnemy[CD_GOODTRANSPORT].chance[0] = 100; - defEnemy[CD_GOODTRANSPORT].chance[1] = 100; - defEnemy[CD_GOODTRANSPORT].score = 0; - defEnemy[CD_GOODTRANSPORT].collectChance = 0; - defEnemy[CD_GOODTRANSPORT].collectType = P_ANYTHING; - defEnemy[CD_GOODTRANSPORT].collectValue = 0; - defEnemy[CD_GOODTRANSPORT].flags = FL_FRIEND | FL_NOFIRE | FL_AIMS; + alien_defs[CD_GOODTRANSPORT].classDef = CD_GOODTRANSPORT; + alien_defs[CD_GOODTRANSPORT].AIType = AI_EVASIVE; + alien_defs[CD_GOODTRANSPORT].speed = 3; + alien_defs[CD_GOODTRANSPORT].maxShield = 75; + alien_defs[CD_GOODTRANSPORT].shield = 75; + alien_defs[CD_GOODTRANSPORT].imageIndex[0] = 12; + alien_defs[CD_GOODTRANSPORT].imageIndex[1] = 13; + alien_defs[CD_GOODTRANSPORT].weaponType[0] = W_AIMED_SHOT; + alien_defs[CD_GOODTRANSPORT].weaponType[1] = W_AIMED_SHOT; + alien_defs[CD_GOODTRANSPORT].chance[0] = 100; + alien_defs[CD_GOODTRANSPORT].chance[1] = 100; + alien_defs[CD_GOODTRANSPORT].score = 0; + alien_defs[CD_GOODTRANSPORT].collectChance = 0; + alien_defs[CD_GOODTRANSPORT].collectType = P_ANYTHING; + alien_defs[CD_GOODTRANSPORT].collectValue = 0; + alien_defs[CD_GOODTRANSPORT].flags = FL_FRIEND | FL_NOFIRE | FL_AIMS; // Sid Wilson - defEnemy[CD_SID].classDef = CD_SID; - defEnemy[CD_SID].AIType = AI_NORMAL; - defEnemy[CD_SID].speed = 3; - defEnemy[CD_SID].maxShield = 50; - defEnemy[CD_SID].shield = 50; - defEnemy[CD_SID].imageIndex[0] = 24; - defEnemy[CD_SID].imageIndex[1] = 25; - defEnemy[CD_SID].weaponType[0] = W_IONCANNON; - defEnemy[CD_SID].weaponType[1] = W_IONCANNON; - defEnemy[CD_SID].chance[0] = 100; - defEnemy[CD_SID].chance[1] = 0; - defEnemy[CD_SID].score = 0; - defEnemy[CD_SID].collectChance = 0; - defEnemy[CD_SID].collectType = P_ANYTHING; - defEnemy[CD_SID].collectValue = 0; - defEnemy[CD_SID].flags = FL_FRIEND | FL_AIMS; + alien_defs[CD_SID].classDef = CD_SID; + alien_defs[CD_SID].AIType = AI_NORMAL; + alien_defs[CD_SID].speed = 3; + alien_defs[CD_SID].maxShield = 50; + alien_defs[CD_SID].shield = 50; + alien_defs[CD_SID].imageIndex[0] = 24; + alien_defs[CD_SID].imageIndex[1] = 25; + alien_defs[CD_SID].weaponType[0] = W_IONCANNON; + alien_defs[CD_SID].weaponType[1] = W_IONCANNON; + alien_defs[CD_SID].chance[0] = 100; + alien_defs[CD_SID].chance[1] = 0; + alien_defs[CD_SID].score = 0; + alien_defs[CD_SID].collectChance = 0; + alien_defs[CD_SID].collectType = P_ANYTHING; + alien_defs[CD_SID].collectValue = 0; + alien_defs[CD_SID].flags = FL_FRIEND | FL_AIMS; // Mining Vessel Boss - defEnemy[CD_MINEBOSS].classDef = CD_BOSS; - defEnemy[CD_MINEBOSS].AIType = AI_NORMAL; - defEnemy[CD_MINEBOSS].speed = 3; - defEnemy[CD_MINEBOSS].maxShield = 1000; - defEnemy[CD_MINEBOSS].shield = 1000; - defEnemy[CD_MINEBOSS].imageIndex[0] = 26; - defEnemy[CD_MINEBOSS].imageIndex[1] = 27; - defEnemy[CD_MINEBOSS].weaponType[0] = W_TRIPLE_SHOT; - defEnemy[CD_MINEBOSS].weaponType[1] = W_SPREADSHOT; - defEnemy[CD_MINEBOSS].chance[0] = 0; - defEnemy[CD_MINEBOSS].chance[1] = 0; - defEnemy[CD_MINEBOSS].score = 1000; - defEnemy[CD_MINEBOSS].collectChance = 100; - defEnemy[CD_MINEBOSS].collectType = P_ANYTHING; - defEnemy[CD_MINEBOSS].collectValue = 255; - defEnemy[CD_MINEBOSS].flags = FL_WEAPCO | FL_IMMORTAL; + alien_defs[CD_MINEBOSS].classDef = CD_BOSS; + alien_defs[CD_MINEBOSS].AIType = AI_NORMAL; + alien_defs[CD_MINEBOSS].speed = 3; + alien_defs[CD_MINEBOSS].maxShield = 1000; + alien_defs[CD_MINEBOSS].shield = 1000; + alien_defs[CD_MINEBOSS].imageIndex[0] = 26; + alien_defs[CD_MINEBOSS].imageIndex[1] = 27; + alien_defs[CD_MINEBOSS].weaponType[0] = W_TRIPLE_SHOT; + alien_defs[CD_MINEBOSS].weaponType[1] = W_SPREADSHOT; + alien_defs[CD_MINEBOSS].chance[0] = 0; + alien_defs[CD_MINEBOSS].chance[1] = 0; + alien_defs[CD_MINEBOSS].score = 1000; + alien_defs[CD_MINEBOSS].collectChance = 100; + alien_defs[CD_MINEBOSS].collectType = P_ANYTHING; + alien_defs[CD_MINEBOSS].collectValue = 255; + alien_defs[CD_MINEBOSS].flags = FL_WEAPCO | FL_IMMORTAL; - defEnemy[CD_BOSS2_WING1].classDef = CD_BOSS2_WING1; - defEnemy[CD_BOSS2_WING1].AIType = AI_NORMAL; - defEnemy[CD_BOSS2_WING1].speed = 1; - defEnemy[CD_BOSS2_WING1].maxShield = 250; - defEnemy[CD_BOSS2_WING1].shield = 250; - defEnemy[CD_BOSS2_WING1].imageIndex[0] = 28; - defEnemy[CD_BOSS2_WING1].imageIndex[1] = 29; - defEnemy[CD_BOSS2_WING1].weaponType[0] = W_TRIPLE_SHOT; - defEnemy[CD_BOSS2_WING1].weaponType[1] = W_SPREADSHOT; - defEnemy[CD_BOSS2_WING1].chance[0] = 0; - defEnemy[CD_BOSS2_WING1].chance[1] = 0; - defEnemy[CD_BOSS2_WING1].score = 1000; - defEnemy[CD_BOSS2_WING1].collectChance = 100; - defEnemy[CD_BOSS2_WING1].collectType = P_ANYTHING; - defEnemy[CD_BOSS2_WING1].collectValue = 255; - defEnemy[CD_BOSS2_WING1].flags = FL_WEAPCO | FL_DAMAGEOWNER; + alien_defs[CD_BOSS2_WING1].classDef = CD_BOSS2_WING1; + alien_defs[CD_BOSS2_WING1].AIType = AI_NORMAL; + alien_defs[CD_BOSS2_WING1].speed = 1; + alien_defs[CD_BOSS2_WING1].maxShield = 250; + alien_defs[CD_BOSS2_WING1].shield = 250; + alien_defs[CD_BOSS2_WING1].imageIndex[0] = 28; + alien_defs[CD_BOSS2_WING1].imageIndex[1] = 29; + alien_defs[CD_BOSS2_WING1].weaponType[0] = W_TRIPLE_SHOT; + alien_defs[CD_BOSS2_WING1].weaponType[1] = W_SPREADSHOT; + alien_defs[CD_BOSS2_WING1].chance[0] = 0; + alien_defs[CD_BOSS2_WING1].chance[1] = 0; + alien_defs[CD_BOSS2_WING1].score = 1000; + alien_defs[CD_BOSS2_WING1].collectChance = 100; + alien_defs[CD_BOSS2_WING1].collectType = P_ANYTHING; + alien_defs[CD_BOSS2_WING1].collectValue = 255; + alien_defs[CD_BOSS2_WING1].flags = FL_WEAPCO | FL_DAMAGEOWNER; - defEnemy[CD_BOSS2_WING2].classDef = CD_BOSS2_WING2; - defEnemy[CD_BOSS2_WING2].AIType = AI_NORMAL; - defEnemy[CD_BOSS2_WING2].speed = 1; - defEnemy[CD_BOSS2_WING2].maxShield = 500; - defEnemy[CD_BOSS2_WING2].shield = 500; - defEnemy[CD_BOSS2_WING2].imageIndex[0] = 30; - defEnemy[CD_BOSS2_WING2].imageIndex[1] = 31; - defEnemy[CD_BOSS2_WING2].weaponType[0] = W_TRIPLE_SHOT; - defEnemy[CD_BOSS2_WING2].weaponType[1] = W_SPREADSHOT; - defEnemy[CD_BOSS2_WING2].chance[0] = 0; - defEnemy[CD_BOSS2_WING2].chance[1] = 0; - defEnemy[CD_BOSS2_WING2].score = 1000; - defEnemy[CD_BOSS2_WING2].collectChance = 100; - defEnemy[CD_BOSS2_WING2].collectType = P_ANYTHING; - defEnemy[CD_BOSS2_WING2].collectValue = 255; - defEnemy[CD_BOSS2_WING2].flags = FL_WEAPCO | FL_DEPLOYDRONES | FL_DAMAGEOWNER; + alien_defs[CD_BOSS2_WING2].classDef = CD_BOSS2_WING2; + alien_defs[CD_BOSS2_WING2].AIType = AI_NORMAL; + alien_defs[CD_BOSS2_WING2].speed = 1; + alien_defs[CD_BOSS2_WING2].maxShield = 500; + alien_defs[CD_BOSS2_WING2].shield = 500; + alien_defs[CD_BOSS2_WING2].imageIndex[0] = 30; + alien_defs[CD_BOSS2_WING2].imageIndex[1] = 31; + alien_defs[CD_BOSS2_WING2].weaponType[0] = W_TRIPLE_SHOT; + alien_defs[CD_BOSS2_WING2].weaponType[1] = W_SPREADSHOT; + alien_defs[CD_BOSS2_WING2].chance[0] = 0; + alien_defs[CD_BOSS2_WING2].chance[1] = 0; + alien_defs[CD_BOSS2_WING2].score = 1000; + alien_defs[CD_BOSS2_WING2].collectChance = 100; + alien_defs[CD_BOSS2_WING2].collectType = P_ANYTHING; + alien_defs[CD_BOSS2_WING2].collectValue = 255; + alien_defs[CD_BOSS2_WING2].flags = FL_WEAPCO | FL_DEPLOYDRONES | FL_DAMAGEOWNER; - defEnemy[CD_BOSS2_WING3].classDef = CD_BOSS2_WING3; - defEnemy[CD_BOSS2_WING3].AIType = AI_NORMAL; - defEnemy[CD_BOSS2_WING3].speed = 1; - defEnemy[CD_BOSS2_WING3].maxShield = 500; - defEnemy[CD_BOSS2_WING3].shield = 500; - defEnemy[CD_BOSS2_WING3].imageIndex[0] = 32; - defEnemy[CD_BOSS2_WING3].imageIndex[1] = 33; - defEnemy[CD_BOSS2_WING3].weaponType[0] = W_TRIPLE_SHOT; - defEnemy[CD_BOSS2_WING3].weaponType[1] = W_SPREADSHOT; - defEnemy[CD_BOSS2_WING3].chance[0] = 0; - defEnemy[CD_BOSS2_WING3].chance[1] = 0; - defEnemy[CD_BOSS2_WING3].score = 1000; - defEnemy[CD_BOSS2_WING3].collectChance = 100; - defEnemy[CD_BOSS2_WING3].collectType = P_ANYTHING; - defEnemy[CD_BOSS2_WING3].collectValue = 255; - defEnemy[CD_BOSS2_WING3].flags = FL_WEAPCO | FL_DEPLOYDRONES | FL_DAMAGEOWNER; + alien_defs[CD_BOSS2_WING3].classDef = CD_BOSS2_WING3; + alien_defs[CD_BOSS2_WING3].AIType = AI_NORMAL; + alien_defs[CD_BOSS2_WING3].speed = 1; + alien_defs[CD_BOSS2_WING3].maxShield = 500; + alien_defs[CD_BOSS2_WING3].shield = 500; + alien_defs[CD_BOSS2_WING3].imageIndex[0] = 32; + alien_defs[CD_BOSS2_WING3].imageIndex[1] = 33; + alien_defs[CD_BOSS2_WING3].weaponType[0] = W_TRIPLE_SHOT; + alien_defs[CD_BOSS2_WING3].weaponType[1] = W_SPREADSHOT; + alien_defs[CD_BOSS2_WING3].chance[0] = 0; + alien_defs[CD_BOSS2_WING3].chance[1] = 0; + alien_defs[CD_BOSS2_WING3].score = 1000; + alien_defs[CD_BOSS2_WING3].collectChance = 100; + alien_defs[CD_BOSS2_WING3].collectType = P_ANYTHING; + alien_defs[CD_BOSS2_WING3].collectValue = 255; + alien_defs[CD_BOSS2_WING3].flags = FL_WEAPCO | FL_DEPLOYDRONES | FL_DAMAGEOWNER; - defEnemy[CD_BOSS2_WING4].classDef = CD_BOSS2_WING4; - defEnemy[CD_BOSS2_WING4].AIType = AI_NORMAL; - defEnemy[CD_BOSS2_WING4].speed = 1; - defEnemy[CD_BOSS2_WING4].maxShield = 250; - defEnemy[CD_BOSS2_WING4].shield = 250; - defEnemy[CD_BOSS2_WING4].imageIndex[0] = 34; - defEnemy[CD_BOSS2_WING4].imageIndex[1] = 35; - defEnemy[CD_BOSS2_WING4].weaponType[0] = W_TRIPLE_SHOT; - defEnemy[CD_BOSS2_WING4].weaponType[1] = W_SPREADSHOT; - defEnemy[CD_BOSS2_WING4].chance[0] = 0; - defEnemy[CD_BOSS2_WING4].chance[1] = 0; - defEnemy[CD_BOSS2_WING4].score = 1000; - defEnemy[CD_BOSS2_WING4].collectChance = 100; - defEnemy[CD_BOSS2_WING4].collectType = P_ANYTHING; - defEnemy[CD_BOSS2_WING4].collectValue = 255; - defEnemy[CD_BOSS2_WING4].flags = FL_WEAPCO | FL_DAMAGEOWNER; + alien_defs[CD_BOSS2_WING4].classDef = CD_BOSS2_WING4; + alien_defs[CD_BOSS2_WING4].AIType = AI_NORMAL; + alien_defs[CD_BOSS2_WING4].speed = 1; + alien_defs[CD_BOSS2_WING4].maxShield = 250; + alien_defs[CD_BOSS2_WING4].shield = 250; + alien_defs[CD_BOSS2_WING4].imageIndex[0] = 34; + alien_defs[CD_BOSS2_WING4].imageIndex[1] = 35; + alien_defs[CD_BOSS2_WING4].weaponType[0] = W_TRIPLE_SHOT; + alien_defs[CD_BOSS2_WING4].weaponType[1] = W_SPREADSHOT; + alien_defs[CD_BOSS2_WING4].chance[0] = 0; + alien_defs[CD_BOSS2_WING4].chance[1] = 0; + alien_defs[CD_BOSS2_WING4].score = 1000; + alien_defs[CD_BOSS2_WING4].collectChance = 100; + alien_defs[CD_BOSS2_WING4].collectType = P_ANYTHING; + alien_defs[CD_BOSS2_WING4].collectValue = 255; + alien_defs[CD_BOSS2_WING4].flags = FL_WEAPCO | FL_DAMAGEOWNER; // Drone - defEnemy[CD_DRONE].classDef = CD_DRONE; - defEnemy[CD_DRONE].AIType = AI_OFFENSIVE; - defEnemy[CD_DRONE].speed = 8; - defEnemy[CD_DRONE].maxShield = 5; - defEnemy[CD_DRONE].shield = 5; - defEnemy[CD_DRONE].imageIndex[0] = 36; - defEnemy[CD_DRONE].imageIndex[1] = 37; - defEnemy[CD_DRONE].weaponType[0] = W_DOUBLE_SHOT; - defEnemy[CD_DRONE].weaponType[1] = W_LASER; - defEnemy[CD_DRONE].chance[0] = 100; - defEnemy[CD_DRONE].chance[1] = 0; - defEnemy[CD_DRONE].score = 0; - defEnemy[CD_DRONE].collectChance = 10; - defEnemy[CD_DRONE].collectType = P_SHIELD; - defEnemy[CD_DRONE].collectValue = 1; - defEnemy[CD_DRONE].flags = FL_WEAPCO; + alien_defs[CD_DRONE].classDef = CD_DRONE; + alien_defs[CD_DRONE].AIType = AI_OFFENSIVE; + alien_defs[CD_DRONE].speed = 8; + alien_defs[CD_DRONE].maxShield = 5; + alien_defs[CD_DRONE].shield = 5; + alien_defs[CD_DRONE].imageIndex[0] = 36; + alien_defs[CD_DRONE].imageIndex[1] = 37; + alien_defs[CD_DRONE].weaponType[0] = W_DOUBLE_SHOT; + alien_defs[CD_DRONE].weaponType[1] = W_LASER; + alien_defs[CD_DRONE].chance[0] = 100; + alien_defs[CD_DRONE].chance[1] = 0; + alien_defs[CD_DRONE].score = 0; + alien_defs[CD_DRONE].collectChance = 10; + alien_defs[CD_DRONE].collectType = P_SHIELD; + alien_defs[CD_DRONE].collectValue = 1; + alien_defs[CD_DRONE].flags = FL_WEAPCO; // Experimental Fighter - defEnemy[CD_CLOAKFIGHTER].classDef = CD_CLOAKFIGHTER; - defEnemy[CD_CLOAKFIGHTER].AIType = AI_OFFENSIVE; - defEnemy[CD_CLOAKFIGHTER].speed = 6; - defEnemy[CD_CLOAKFIGHTER].maxShield = 1000; - defEnemy[CD_CLOAKFIGHTER].shield = 1000; - defEnemy[CD_CLOAKFIGHTER].imageIndex[0] = 10; - defEnemy[CD_CLOAKFIGHTER].imageIndex[1] = 11; - defEnemy[CD_CLOAKFIGHTER].weaponType[0] = W_SPREADSHOT; - defEnemy[CD_CLOAKFIGHTER].weaponType[1] = W_DOUBLE_ROCKETS; - defEnemy[CD_CLOAKFIGHTER].chance[0] = 100; - defEnemy[CD_CLOAKFIGHTER].chance[1] = 5; - defEnemy[CD_CLOAKFIGHTER].score = 550; - defEnemy[CD_CLOAKFIGHTER].collectChance = 100; - defEnemy[CD_CLOAKFIGHTER].collectType = P_CASH; - defEnemy[CD_CLOAKFIGHTER].collectValue = 255; - defEnemy[CD_CLOAKFIGHTER].flags = FL_WEAPCO | FL_CANCLOAK | FL_RUNSAWAY; + alien_defs[CD_CLOAKFIGHTER].classDef = CD_CLOAKFIGHTER; + alien_defs[CD_CLOAKFIGHTER].AIType = AI_OFFENSIVE; + alien_defs[CD_CLOAKFIGHTER].speed = 6; + alien_defs[CD_CLOAKFIGHTER].maxShield = 1000; + alien_defs[CD_CLOAKFIGHTER].shield = 1000; + alien_defs[CD_CLOAKFIGHTER].imageIndex[0] = 10; + alien_defs[CD_CLOAKFIGHTER].imageIndex[1] = 11; + alien_defs[CD_CLOAKFIGHTER].weaponType[0] = W_SPREADSHOT; + alien_defs[CD_CLOAKFIGHTER].weaponType[1] = W_DOUBLE_ROCKETS; + alien_defs[CD_CLOAKFIGHTER].chance[0] = 100; + alien_defs[CD_CLOAKFIGHTER].chance[1] = 5; + alien_defs[CD_CLOAKFIGHTER].score = 550; + alien_defs[CD_CLOAKFIGHTER].collectChance = 100; + alien_defs[CD_CLOAKFIGHTER].collectType = P_CASH; + alien_defs[CD_CLOAKFIGHTER].collectValue = 255; + alien_defs[CD_CLOAKFIGHTER].flags = FL_WEAPCO | FL_CANCLOAK | FL_RUNSAWAY; // Evil Ursula - defEnemy[CD_EVILURSULA].classDef = CD_EVILURSULA; - defEnemy[CD_EVILURSULA].AIType = AI_OFFENSIVE; - defEnemy[CD_EVILURSULA].speed = 5; - defEnemy[CD_EVILURSULA].maxShield = 500; - defEnemy[CD_EVILURSULA].shield = 500; - defEnemy[CD_EVILURSULA].imageIndex[0] = 12; - defEnemy[CD_EVILURSULA].imageIndex[1] = 13; - defEnemy[CD_EVILURSULA].weaponType[0] = W_TRIPLE_SHOT; - defEnemy[CD_EVILURSULA].weaponType[1] = W_HOMING_MISSILE; - defEnemy[CD_EVILURSULA].chance[0] = 100; - defEnemy[CD_EVILURSULA].chance[1] = 100; - defEnemy[CD_EVILURSULA].score = 500; - defEnemy[CD_EVILURSULA].collectChance = 100; - defEnemy[CD_EVILURSULA].collectType = P_ESCAPEPOD; - defEnemy[CD_EVILURSULA].collectValue = 1; - defEnemy[CD_EVILURSULA].flags = FL_WEAPCO; + alien_defs[CD_EVILURSULA].classDef = CD_EVILURSULA; + alien_defs[CD_EVILURSULA].AIType = AI_OFFENSIVE; + alien_defs[CD_EVILURSULA].speed = 5; + alien_defs[CD_EVILURSULA].maxShield = 500; + alien_defs[CD_EVILURSULA].shield = 500; + alien_defs[CD_EVILURSULA].imageIndex[0] = 12; + alien_defs[CD_EVILURSULA].imageIndex[1] = 13; + alien_defs[CD_EVILURSULA].weaponType[0] = W_TRIPLE_SHOT; + alien_defs[CD_EVILURSULA].weaponType[1] = W_HOMING_MISSILE; + alien_defs[CD_EVILURSULA].chance[0] = 100; + alien_defs[CD_EVILURSULA].chance[1] = 100; + alien_defs[CD_EVILURSULA].score = 500; + alien_defs[CD_EVILURSULA].collectChance = 100; + alien_defs[CD_EVILURSULA].collectType = P_ESCAPEPOD; + alien_defs[CD_EVILURSULA].collectValue = 1; + alien_defs[CD_EVILURSULA].flags = FL_WEAPCO; // Mercenary - defEnemy[CD_KRASS].classDef = CD_KRASS; - defEnemy[CD_KRASS].AIType = AI_OFFENSIVE; - defEnemy[CD_KRASS].speed = 5; - defEnemy[CD_KRASS].maxShield = 1000; - defEnemy[CD_KRASS].shield = 1000; - defEnemy[CD_KRASS].imageIndex[0] = 26; - defEnemy[CD_KRASS].imageIndex[1] = 27; - defEnemy[CD_KRASS].weaponType[0] = W_SPREADSHOT; - defEnemy[CD_KRASS].weaponType[1] = W_CHARGER; - defEnemy[CD_KRASS].chance[0] = 100; - defEnemy[CD_KRASS].chance[1] = 0; - defEnemy[CD_KRASS].score = 2000; - defEnemy[CD_KRASS].collectChance = 100; - defEnemy[CD_KRASS].collectType = P_ANYTHING; - defEnemy[CD_KRASS].collectValue = 255; - defEnemy[CD_KRASS].flags = FL_FRIEND | FL_IMMORTAL; + alien_defs[CD_KRASS].classDef = CD_KRASS; + alien_defs[CD_KRASS].AIType = AI_OFFENSIVE; + alien_defs[CD_KRASS].speed = 5; + alien_defs[CD_KRASS].maxShield = 1000; + alien_defs[CD_KRASS].shield = 1000; + alien_defs[CD_KRASS].imageIndex[0] = 26; + alien_defs[CD_KRASS].imageIndex[1] = 27; + alien_defs[CD_KRASS].weaponType[0] = W_SPREADSHOT; + alien_defs[CD_KRASS].weaponType[1] = W_CHARGER; + alien_defs[CD_KRASS].chance[0] = 100; + alien_defs[CD_KRASS].chance[1] = 0; + alien_defs[CD_KRASS].score = 2000; + alien_defs[CD_KRASS].collectChance = 100; + alien_defs[CD_KRASS].collectType = P_ANYTHING; + alien_defs[CD_KRASS].collectValue = 255; + alien_defs[CD_KRASS].flags = FL_FRIEND | FL_IMMORTAL; // Executive Transport - defEnemy[CD_EXEC].classDef = CD_BOSS; - defEnemy[CD_EXEC].AIType = AI_NORMAL; - defEnemy[CD_EXEC].speed = 5; - defEnemy[CD_EXEC].maxShield = 1000; - defEnemy[CD_EXEC].shield = 1000; - defEnemy[CD_EXEC].imageIndex[0] = 28; - defEnemy[CD_EXEC].imageIndex[1] = 28; - defEnemy[CD_EXEC].weaponType[0] = W_SPREADSHOT; - defEnemy[CD_EXEC].weaponType[1] = W_HOMING_MISSILE; - defEnemy[CD_EXEC].chance[0] = 0; - defEnemy[CD_EXEC].chance[1] = 0; - defEnemy[CD_EXEC].score = 2000; - defEnemy[CD_EXEC].collectChance = 0; - defEnemy[CD_EXEC].collectType = P_ANYTHING; - defEnemy[CD_EXEC].collectValue = 0; - defEnemy[CD_EXEC].flags = FL_WEAPCO | FL_NOFIRE; + alien_defs[CD_EXEC].classDef = CD_BOSS; + alien_defs[CD_EXEC].AIType = AI_NORMAL; + alien_defs[CD_EXEC].speed = 5; + alien_defs[CD_EXEC].maxShield = 1000; + alien_defs[CD_EXEC].shield = 1000; + alien_defs[CD_EXEC].imageIndex[0] = 28; + alien_defs[CD_EXEC].imageIndex[1] = 28; + alien_defs[CD_EXEC].weaponType[0] = W_SPREADSHOT; + alien_defs[CD_EXEC].weaponType[1] = W_HOMING_MISSILE; + alien_defs[CD_EXEC].chance[0] = 0; + alien_defs[CD_EXEC].chance[1] = 0; + alien_defs[CD_EXEC].score = 2000; + alien_defs[CD_EXEC].collectChance = 0; + alien_defs[CD_EXEC].collectType = P_ANYTHING; + alien_defs[CD_EXEC].collectValue = 0; + alien_defs[CD_EXEC].flags = FL_WEAPCO | FL_NOFIRE; // Asteroid - defEnemy[CD_ASTEROID].classDef = CD_ASTEROID; - defEnemy[CD_ASTEROID].AIType = AI_WANDER; - defEnemy[CD_ASTEROID].speed = 1; - defEnemy[CD_ASTEROID].maxShield = 50; - defEnemy[CD_ASTEROID].shield = 50; - defEnemy[CD_ASTEROID].imageIndex[0] = 38; - defEnemy[CD_ASTEROID].imageIndex[1] = 38; - defEnemy[CD_ASTEROID].weaponType[0] = W_SPREADSHOT; - defEnemy[CD_ASTEROID].weaponType[1] = W_HOMING_MISSILE; - defEnemy[CD_ASTEROID].chance[0] = 0; - defEnemy[CD_ASTEROID].chance[1] = 0; - defEnemy[CD_ASTEROID].score = 0; - defEnemy[CD_ASTEROID].collectChance = 25; - defEnemy[CD_ASTEROID].collectType = P_ORE; - defEnemy[CD_ASTEROID].collectValue = 1; - defEnemy[CD_ASTEROID].flags = FL_WEAPCO; + alien_defs[CD_ASTEROID].classDef = CD_ASTEROID; + alien_defs[CD_ASTEROID].AIType = AI_WANDER; + alien_defs[CD_ASTEROID].speed = 1; + alien_defs[CD_ASTEROID].maxShield = 50; + alien_defs[CD_ASTEROID].shield = 50; + alien_defs[CD_ASTEROID].imageIndex[0] = 38; + alien_defs[CD_ASTEROID].imageIndex[1] = 38; + alien_defs[CD_ASTEROID].weaponType[0] = W_SPREADSHOT; + alien_defs[CD_ASTEROID].weaponType[1] = W_HOMING_MISSILE; + alien_defs[CD_ASTEROID].chance[0] = 0; + alien_defs[CD_ASTEROID].chance[1] = 0; + alien_defs[CD_ASTEROID].score = 0; + alien_defs[CD_ASTEROID].collectChance = 25; + alien_defs[CD_ASTEROID].collectType = P_ORE; + alien_defs[CD_ASTEROID].collectValue = 1; + alien_defs[CD_ASTEROID].flags = FL_WEAPCO; - defEnemy[CD_ASTEROID2].classDef = CD_ASTEROID2; - defEnemy[CD_ASTEROID2].AIType = AI_WANDER; - defEnemy[CD_ASTEROID2].speed = 1; - defEnemy[CD_ASTEROID2].maxShield = 10; - defEnemy[CD_ASTEROID2].shield = 10; - defEnemy[CD_ASTEROID2].imageIndex[0] = 39; - defEnemy[CD_ASTEROID2].imageIndex[1] = 40; - defEnemy[CD_ASTEROID2].weaponType[0] = W_SPREADSHOT; - defEnemy[CD_ASTEROID2].weaponType[1] = W_HOMING_MISSILE; - defEnemy[CD_ASTEROID2].chance[0] = 0; - defEnemy[CD_ASTEROID2].chance[1] = 0; - defEnemy[CD_ASTEROID2].score = 0; - defEnemy[CD_ASTEROID2].collectChance = 25; - defEnemy[CD_ASTEROID2].collectType = P_ORE; - defEnemy[CD_ASTEROID2].collectValue = 1; - defEnemy[CD_ASTEROID2].flags = FL_WEAPCO; + alien_defs[CD_ASTEROID2].classDef = CD_ASTEROID2; + alien_defs[CD_ASTEROID2].AIType = AI_WANDER; + alien_defs[CD_ASTEROID2].speed = 1; + alien_defs[CD_ASTEROID2].maxShield = 10; + alien_defs[CD_ASTEROID2].shield = 10; + alien_defs[CD_ASTEROID2].imageIndex[0] = 39; + alien_defs[CD_ASTEROID2].imageIndex[1] = 40; + alien_defs[CD_ASTEROID2].weaponType[0] = W_SPREADSHOT; + alien_defs[CD_ASTEROID2].weaponType[1] = W_HOMING_MISSILE; + alien_defs[CD_ASTEROID2].chance[0] = 0; + alien_defs[CD_ASTEROID2].chance[1] = 0; + alien_defs[CD_ASTEROID2].score = 0; + alien_defs[CD_ASTEROID2].collectChance = 25; + alien_defs[CD_ASTEROID2].collectType = P_ORE; + alien_defs[CD_ASTEROID2].collectValue = 1; + alien_defs[CD_ASTEROID2].flags = FL_WEAPCO; // Escort - defEnemy[CD_ESCORT].classDef = CD_ESCORT; - defEnemy[CD_ESCORT].AIType = AI_NORMAL; - defEnemy[CD_ESCORT].speed = 3; - defEnemy[CD_ESCORT].maxShield = 200; - defEnemy[CD_ESCORT].shield = 200; - defEnemy[CD_ESCORT].imageIndex[0] = 30; - defEnemy[CD_ESCORT].imageIndex[1] = 31; - defEnemy[CD_ESCORT].weaponType[0] = W_LASER; - defEnemy[CD_ESCORT].weaponType[1] = W_LASER; - defEnemy[CD_ESCORT].chance[0] = 25; - defEnemy[CD_ESCORT].chance[1] = 25; - defEnemy[CD_ESCORT].score = 450; - defEnemy[CD_ESCORT].collectChance = 100; - defEnemy[CD_ESCORT].collectType = P_ANYTHING; - defEnemy[CD_ESCORT].collectValue = 100; - defEnemy[CD_ESCORT].flags = FL_WEAPCO; + alien_defs[CD_ESCORT].classDef = CD_ESCORT; + alien_defs[CD_ESCORT].AIType = AI_NORMAL; + alien_defs[CD_ESCORT].speed = 3; + alien_defs[CD_ESCORT].maxShield = 200; + alien_defs[CD_ESCORT].shield = 200; + alien_defs[CD_ESCORT].imageIndex[0] = 30; + alien_defs[CD_ESCORT].imageIndex[1] = 31; + alien_defs[CD_ESCORT].weaponType[0] = W_LASER; + alien_defs[CD_ESCORT].weaponType[1] = W_LASER; + alien_defs[CD_ESCORT].chance[0] = 25; + alien_defs[CD_ESCORT].chance[1] = 25; + alien_defs[CD_ESCORT].score = 450; + alien_defs[CD_ESCORT].collectChance = 100; + alien_defs[CD_ESCORT].collectType = P_ANYTHING; + alien_defs[CD_ESCORT].collectValue = 100; + alien_defs[CD_ESCORT].flags = FL_WEAPCO; // Mobile Ray Cannon - defEnemy[CD_MOBILE_RAY].classDef = CD_MOBILE_RAY; - defEnemy[CD_MOBILE_RAY].AIType = AI_OFFENSIVE; - defEnemy[CD_MOBILE_RAY].speed = 5; - defEnemy[CD_MOBILE_RAY].maxShield = 250; - defEnemy[CD_MOBILE_RAY].shield = 250; - defEnemy[CD_MOBILE_RAY].imageIndex[0] = 10; - defEnemy[CD_MOBILE_RAY].imageIndex[1] = 11; - defEnemy[CD_MOBILE_RAY].weaponType[0] = W_ENERGYRAY; - defEnemy[CD_MOBILE_RAY].weaponType[1] = W_ENERGYRAY; - defEnemy[CD_MOBILE_RAY].chance[0] = 50; - defEnemy[CD_MOBILE_RAY].chance[1] = 50; - defEnemy[CD_MOBILE_RAY].score = 1000; - defEnemy[CD_MOBILE_RAY].collectChance = 75; - defEnemy[CD_MOBILE_RAY].collectType = P_SHIELD; - defEnemy[CD_MOBILE_RAY].collectValue = 2; - defEnemy[CD_MOBILE_RAY].flags = FL_WEAPCO; + alien_defs[CD_MOBILE_RAY].classDef = CD_MOBILE_RAY; + alien_defs[CD_MOBILE_RAY].AIType = AI_OFFENSIVE; + alien_defs[CD_MOBILE_RAY].speed = 5; + alien_defs[CD_MOBILE_RAY].maxShield = 250; + alien_defs[CD_MOBILE_RAY].shield = 250; + alien_defs[CD_MOBILE_RAY].imageIndex[0] = 10; + alien_defs[CD_MOBILE_RAY].imageIndex[1] = 11; + alien_defs[CD_MOBILE_RAY].weaponType[0] = W_ENERGYRAY; + alien_defs[CD_MOBILE_RAY].weaponType[1] = W_ENERGYRAY; + alien_defs[CD_MOBILE_RAY].chance[0] = 50; + alien_defs[CD_MOBILE_RAY].chance[1] = 50; + alien_defs[CD_MOBILE_RAY].score = 1000; + alien_defs[CD_MOBILE_RAY].collectChance = 75; + alien_defs[CD_MOBILE_RAY].collectType = P_SHIELD; + alien_defs[CD_MOBILE_RAY].collectValue = 2; + alien_defs[CD_MOBILE_RAY].flags = FL_WEAPCO; // Rebel Carrier - defEnemy[CD_REBELCARRIER].classDef = CD_REBELCARRIER; - defEnemy[CD_REBELCARRIER].AIType = AI_OFFENSIVE; - defEnemy[CD_REBELCARRIER].speed = 2; - defEnemy[CD_REBELCARRIER].maxShield = 100; - defEnemy[CD_REBELCARRIER].shield = 100; - defEnemy[CD_REBELCARRIER].imageIndex[0] = 32; - defEnemy[CD_REBELCARRIER].imageIndex[1] = 33; - defEnemy[CD_REBELCARRIER].weaponType[0] = W_DOUBLE_ROCKETS; - defEnemy[CD_REBELCARRIER].weaponType[1] = W_MICRO_ROCKETS; - defEnemy[CD_REBELCARRIER].chance[0] = 50; - defEnemy[CD_REBELCARRIER].chance[1] = 2; - defEnemy[CD_REBELCARRIER].score = 0; - defEnemy[CD_REBELCARRIER].collectChance = 0; - defEnemy[CD_REBELCARRIER].collectType = P_SHIELD; - defEnemy[CD_REBELCARRIER].collectValue = 0; - defEnemy[CD_REBELCARRIER].flags = FL_FRIEND; + alien_defs[CD_REBELCARRIER].classDef = CD_REBELCARRIER; + alien_defs[CD_REBELCARRIER].AIType = AI_OFFENSIVE; + alien_defs[CD_REBELCARRIER].speed = 2; + alien_defs[CD_REBELCARRIER].maxShield = 100; + alien_defs[CD_REBELCARRIER].shield = 100; + alien_defs[CD_REBELCARRIER].imageIndex[0] = 32; + alien_defs[CD_REBELCARRIER].imageIndex[1] = 33; + alien_defs[CD_REBELCARRIER].weaponType[0] = W_DOUBLE_ROCKETS; + alien_defs[CD_REBELCARRIER].weaponType[1] = W_MICRO_ROCKETS; + alien_defs[CD_REBELCARRIER].chance[0] = 50; + alien_defs[CD_REBELCARRIER].chance[1] = 2; + alien_defs[CD_REBELCARRIER].score = 0; + alien_defs[CD_REBELCARRIER].collectChance = 0; + alien_defs[CD_REBELCARRIER].collectType = P_SHIELD; + alien_defs[CD_REBELCARRIER].collectValue = 0; + alien_defs[CD_REBELCARRIER].flags = FL_FRIEND; // Pluto Boss - defEnemy[CD_PLUTOBOSS].classDef = CD_PLUTOBOSS; - defEnemy[CD_PLUTOBOSS].AIType = AI_OFFENSIVE; - defEnemy[CD_PLUTOBOSS].speed = 4; - defEnemy[CD_PLUTOBOSS].maxShield = 500; - defEnemy[CD_PLUTOBOSS].shield = 500; - defEnemy[CD_PLUTOBOSS].imageIndex[0] = 12; - defEnemy[CD_PLUTOBOSS].imageIndex[1] = 13; - defEnemy[CD_PLUTOBOSS].weaponType[0] = W_DOUBLE_ROCKETS; - defEnemy[CD_PLUTOBOSS].weaponType[1] = W_MICRO_ROCKETS; - defEnemy[CD_PLUTOBOSS].chance[0] = 50; - defEnemy[CD_PLUTOBOSS].chance[1] = 2; - defEnemy[CD_PLUTOBOSS].score = 1000; - defEnemy[CD_PLUTOBOSS].collectChance = 0; - defEnemy[CD_PLUTOBOSS].collectType = P_SHIELD; - defEnemy[CD_PLUTOBOSS].collectValue = 0; - defEnemy[CD_PLUTOBOSS].flags = FL_WEAPCO; + alien_defs[CD_PLUTOBOSS].classDef = CD_PLUTOBOSS; + alien_defs[CD_PLUTOBOSS].AIType = AI_OFFENSIVE; + alien_defs[CD_PLUTOBOSS].speed = 4; + alien_defs[CD_PLUTOBOSS].maxShield = 500; + alien_defs[CD_PLUTOBOSS].shield = 500; + alien_defs[CD_PLUTOBOSS].imageIndex[0] = 12; + alien_defs[CD_PLUTOBOSS].imageIndex[1] = 13; + alien_defs[CD_PLUTOBOSS].weaponType[0] = W_DOUBLE_ROCKETS; + alien_defs[CD_PLUTOBOSS].weaponType[1] = W_MICRO_ROCKETS; + alien_defs[CD_PLUTOBOSS].chance[0] = 50; + alien_defs[CD_PLUTOBOSS].chance[1] = 2; + alien_defs[CD_PLUTOBOSS].score = 1000; + alien_defs[CD_PLUTOBOSS].collectChance = 0; + alien_defs[CD_PLUTOBOSS].collectType = P_SHIELD; + alien_defs[CD_PLUTOBOSS].collectValue = 0; + alien_defs[CD_PLUTOBOSS].flags = FL_WEAPCO; // Pluto Boss Barrier - defEnemy[CD_BARRIER].classDef = CD_BARRIER; - defEnemy[CD_BARRIER].AIType = AI_OFFENSIVE; - defEnemy[CD_BARRIER].speed = 1; - defEnemy[CD_BARRIER].maxShield = 250; - defEnemy[CD_BARRIER].shield = 250; - defEnemy[CD_BARRIER].imageIndex[0] = 32; - defEnemy[CD_BARRIER].imageIndex[1] = 33; - defEnemy[CD_BARRIER].weaponType[0] = W_DOUBLE_SHOT; - defEnemy[CD_BARRIER].weaponType[1] = W_MICRO_ROCKETS; - defEnemy[CD_BARRIER].chance[0] = 0; - defEnemy[CD_BARRIER].chance[1] = 0; - defEnemy[CD_BARRIER].score = 1000; - defEnemy[CD_BARRIER].collectChance = 100; - defEnemy[CD_BARRIER].collectType = P_ANYTHING; - defEnemy[CD_BARRIER].collectValue = 25; - defEnemy[CD_BARRIER].flags = FL_WEAPCO | FL_NOFIRE; + alien_defs[CD_BARRIER].classDef = CD_BARRIER; + alien_defs[CD_BARRIER].AIType = AI_OFFENSIVE; + alien_defs[CD_BARRIER].speed = 1; + alien_defs[CD_BARRIER].maxShield = 250; + alien_defs[CD_BARRIER].shield = 250; + alien_defs[CD_BARRIER].imageIndex[0] = 32; + alien_defs[CD_BARRIER].imageIndex[1] = 33; + alien_defs[CD_BARRIER].weaponType[0] = W_DOUBLE_SHOT; + alien_defs[CD_BARRIER].weaponType[1] = W_MICRO_ROCKETS; + alien_defs[CD_BARRIER].chance[0] = 0; + alien_defs[CD_BARRIER].chance[1] = 0; + alien_defs[CD_BARRIER].score = 1000; + alien_defs[CD_BARRIER].collectChance = 100; + alien_defs[CD_BARRIER].collectType = P_ANYTHING; + alien_defs[CD_BARRIER].collectValue = 25; + alien_defs[CD_BARRIER].flags = FL_WEAPCO | FL_NOFIRE; // Neptune Boss - defEnemy[CD_NEPTUNEBOSS].classDef = CD_NEPTUNEBOSS; - defEnemy[CD_NEPTUNEBOSS].AIType = AI_OFFENSIVE; - defEnemy[CD_NEPTUNEBOSS].speed = 4; - defEnemy[CD_NEPTUNEBOSS].maxShield = 800; - defEnemy[CD_NEPTUNEBOSS].shield = 800; - defEnemy[CD_NEPTUNEBOSS].imageIndex[0] = 12; - defEnemy[CD_NEPTUNEBOSS].imageIndex[1] = 13; - defEnemy[CD_NEPTUNEBOSS].weaponType[0] = W_DOUBLE_SHOT; - defEnemy[CD_NEPTUNEBOSS].weaponType[1] = W_MICRO_ROCKETS; - defEnemy[CD_NEPTUNEBOSS].chance[0] = 100; - defEnemy[CD_NEPTUNEBOSS].chance[1] = 0; - defEnemy[CD_NEPTUNEBOSS].score = 1000; - defEnemy[CD_NEPTUNEBOSS].collectChance = 100; - defEnemy[CD_NEPTUNEBOSS].collectType = P_ANYTHING; - defEnemy[CD_NEPTUNEBOSS].collectValue = 25; - defEnemy[CD_NEPTUNEBOSS].flags = FL_WEAPCO; + alien_defs[CD_NEPTUNEBOSS].classDef = CD_NEPTUNEBOSS; + alien_defs[CD_NEPTUNEBOSS].AIType = AI_OFFENSIVE; + alien_defs[CD_NEPTUNEBOSS].speed = 4; + alien_defs[CD_NEPTUNEBOSS].maxShield = 800; + alien_defs[CD_NEPTUNEBOSS].shield = 800; + alien_defs[CD_NEPTUNEBOSS].imageIndex[0] = 12; + alien_defs[CD_NEPTUNEBOSS].imageIndex[1] = 13; + alien_defs[CD_NEPTUNEBOSS].weaponType[0] = W_DOUBLE_SHOT; + alien_defs[CD_NEPTUNEBOSS].weaponType[1] = W_MICRO_ROCKETS; + alien_defs[CD_NEPTUNEBOSS].chance[0] = 100; + alien_defs[CD_NEPTUNEBOSS].chance[1] = 0; + alien_defs[CD_NEPTUNEBOSS].score = 1000; + alien_defs[CD_NEPTUNEBOSS].collectChance = 100; + alien_defs[CD_NEPTUNEBOSS].collectType = P_ANYTHING; + alien_defs[CD_NEPTUNEBOSS].collectValue = 25; + alien_defs[CD_NEPTUNEBOSS].flags = FL_WEAPCO; // Mobile Shield - defEnemy[CD_MOBILESHIELD].classDef = CD_MOBILESHIELD; - defEnemy[CD_MOBILESHIELD].AIType = AI_EVASIVE; - defEnemy[CD_MOBILESHIELD].speed = 6; - defEnemy[CD_MOBILESHIELD].maxShield = 150; - defEnemy[CD_MOBILESHIELD].shield = 150; - defEnemy[CD_MOBILESHIELD].imageIndex[0] = 34; - defEnemy[CD_MOBILESHIELD].imageIndex[1] = 35; - defEnemy[CD_MOBILESHIELD].weaponType[0] = W_DOUBLE_SHOT; - defEnemy[CD_MOBILESHIELD].weaponType[1] = W_MICRO_ROCKETS; - defEnemy[CD_MOBILESHIELD].chance[0] = 0; - defEnemy[CD_MOBILESHIELD].chance[1] = 0; - defEnemy[CD_MOBILESHIELD].score = 250; - defEnemy[CD_MOBILESHIELD].collectChance = 100; - defEnemy[CD_MOBILESHIELD].collectType = P_ANYTHING; - defEnemy[CD_MOBILESHIELD].collectValue = 25; - defEnemy[CD_MOBILESHIELD].flags = FL_WEAPCO | FL_NOFIRE; + alien_defs[CD_MOBILESHIELD].classDef = CD_MOBILESHIELD; + alien_defs[CD_MOBILESHIELD].AIType = AI_EVASIVE; + alien_defs[CD_MOBILESHIELD].speed = 6; + alien_defs[CD_MOBILESHIELD].maxShield = 150; + alien_defs[CD_MOBILESHIELD].shield = 150; + alien_defs[CD_MOBILESHIELD].imageIndex[0] = 34; + alien_defs[CD_MOBILESHIELD].imageIndex[1] = 35; + alien_defs[CD_MOBILESHIELD].weaponType[0] = W_DOUBLE_SHOT; + alien_defs[CD_MOBILESHIELD].weaponType[1] = W_MICRO_ROCKETS; + alien_defs[CD_MOBILESHIELD].chance[0] = 0; + alien_defs[CD_MOBILESHIELD].chance[1] = 0; + alien_defs[CD_MOBILESHIELD].score = 250; + alien_defs[CD_MOBILESHIELD].collectChance = 100; + alien_defs[CD_MOBILESHIELD].collectType = P_ANYTHING; + alien_defs[CD_MOBILESHIELD].collectValue = 25; + alien_defs[CD_MOBILESHIELD].flags = FL_WEAPCO | FL_NOFIRE; // Firefly - defEnemy[CD_FIREFLY].classDef = CD_FIREFLY; - defEnemy[CD_FIREFLY].AIType = AI_OFFENSIVE; - defEnemy[CD_FIREFLY].speed = 5; - defEnemy[CD_FIREFLY].maxShield = 250; - defEnemy[CD_FIREFLY].shield = 250; - defEnemy[CD_FIREFLY].imageIndex[0] = 0; - defEnemy[CD_FIREFLY].imageIndex[1] = 1; - defEnemy[CD_FIREFLY].weaponType[0] = W_TRIPLE_SHOT; - defEnemy[CD_FIREFLY].weaponType[1] = W_DOUBLE_ROCKETS; - defEnemy[CD_FIREFLY].chance[0] = 100; - defEnemy[CD_FIREFLY].chance[1] = 5; - defEnemy[CD_FIREFLY].score = 500; - defEnemy[CD_FIREFLY].collectChance = 100; - defEnemy[CD_FIREFLY].collectType = P_ANYTHING; - defEnemy[CD_FIREFLY].collectValue = 250; - defEnemy[CD_FIREFLY].flags = FL_WEAPCO; + alien_defs[CD_FIREFLY].classDef = CD_FIREFLY; + alien_defs[CD_FIREFLY].AIType = AI_OFFENSIVE; + alien_defs[CD_FIREFLY].speed = 5; + alien_defs[CD_FIREFLY].maxShield = 250; + alien_defs[CD_FIREFLY].shield = 250; + alien_defs[CD_FIREFLY].imageIndex[0] = 0; + alien_defs[CD_FIREFLY].imageIndex[1] = 1; + alien_defs[CD_FIREFLY].weaponType[0] = W_TRIPLE_SHOT; + alien_defs[CD_FIREFLY].weaponType[1] = W_DOUBLE_ROCKETS; + alien_defs[CD_FIREFLY].chance[0] = 100; + alien_defs[CD_FIREFLY].chance[1] = 5; + alien_defs[CD_FIREFLY].score = 500; + alien_defs[CD_FIREFLY].collectChance = 100; + alien_defs[CD_FIREFLY].collectType = P_ANYTHING; + alien_defs[CD_FIREFLY].collectValue = 250; + alien_defs[CD_FIREFLY].flags = FL_WEAPCO; // Uranus Boss - defEnemy[CD_URANUSBOSS].classDef = CD_URANUSBOSS; - defEnemy[CD_URANUSBOSS].AIType = AI_OFFENSIVE; - defEnemy[CD_URANUSBOSS].speed = 4; - defEnemy[CD_URANUSBOSS].maxShield = 750; - defEnemy[CD_URANUSBOSS].shield = 750; - defEnemy[CD_URANUSBOSS].imageIndex[0] = 41; - defEnemy[CD_URANUSBOSS].imageIndex[1] = 42; - defEnemy[CD_URANUSBOSS].weaponType[0] = W_SPREADSHOT; - defEnemy[CD_URANUSBOSS].weaponType[1] = W_DOUBLE_ROCKETS; - defEnemy[CD_URANUSBOSS].chance[0] = 100; - defEnemy[CD_URANUSBOSS].chance[1] = 5; - defEnemy[CD_URANUSBOSS].score = 500; - defEnemy[CD_URANUSBOSS].collectChance = 100; - defEnemy[CD_URANUSBOSS].collectType = P_ANYTHING; - defEnemy[CD_URANUSBOSS].collectValue = 250; - defEnemy[CD_URANUSBOSS].flags = FL_WEAPCO; + alien_defs[CD_URANUSBOSS].classDef = CD_URANUSBOSS; + alien_defs[CD_URANUSBOSS].AIType = AI_OFFENSIVE; + alien_defs[CD_URANUSBOSS].speed = 4; + alien_defs[CD_URANUSBOSS].maxShield = 750; + alien_defs[CD_URANUSBOSS].shield = 750; + alien_defs[CD_URANUSBOSS].imageIndex[0] = 41; + alien_defs[CD_URANUSBOSS].imageIndex[1] = 42; + alien_defs[CD_URANUSBOSS].weaponType[0] = W_SPREADSHOT; + alien_defs[CD_URANUSBOSS].weaponType[1] = W_DOUBLE_ROCKETS; + alien_defs[CD_URANUSBOSS].chance[0] = 100; + alien_defs[CD_URANUSBOSS].chance[1] = 5; + alien_defs[CD_URANUSBOSS].score = 500; + alien_defs[CD_URANUSBOSS].collectChance = 100; + alien_defs[CD_URANUSBOSS].collectType = P_ANYTHING; + alien_defs[CD_URANUSBOSS].collectValue = 250; + alien_defs[CD_URANUSBOSS].flags = FL_WEAPCO; // Uranus Boss Wing 1 - defEnemy[CD_URANUSBOSSWING1].classDef = CD_URANUSBOSSWING1; - defEnemy[CD_URANUSBOSSWING1].AIType = AI_OFFENSIVE; - defEnemy[CD_URANUSBOSSWING1].speed = 4; - defEnemy[CD_URANUSBOSSWING1].maxShield = 250; - defEnemy[CD_URANUSBOSSWING1].shield = 250; - defEnemy[CD_URANUSBOSSWING1].imageIndex[0] = 43; - defEnemy[CD_URANUSBOSSWING1].imageIndex[1] = 44; - defEnemy[CD_URANUSBOSSWING1].weaponType[0] = W_DOUBLE_ROCKETS; - defEnemy[CD_URANUSBOSSWING1].weaponType[1] = W_DOUBLE_ROCKETS; - defEnemy[CD_URANUSBOSSWING1].chance[0] = 5; - defEnemy[CD_URANUSBOSSWING1].chance[1] = 0; - defEnemy[CD_URANUSBOSSWING1].score = 500; - defEnemy[CD_URANUSBOSSWING1].collectChance = 100; - defEnemy[CD_URANUSBOSSWING1].collectType = P_ANYTHING; - defEnemy[CD_URANUSBOSSWING1].collectValue = 250; - defEnemy[CD_URANUSBOSSWING1].flags = FL_WEAPCO | FL_IMMORTAL; + alien_defs[CD_URANUSBOSSWING1].classDef = CD_URANUSBOSSWING1; + alien_defs[CD_URANUSBOSSWING1].AIType = AI_OFFENSIVE; + alien_defs[CD_URANUSBOSSWING1].speed = 4; + alien_defs[CD_URANUSBOSSWING1].maxShield = 250; + alien_defs[CD_URANUSBOSSWING1].shield = 250; + alien_defs[CD_URANUSBOSSWING1].imageIndex[0] = 43; + alien_defs[CD_URANUSBOSSWING1].imageIndex[1] = 44; + alien_defs[CD_URANUSBOSSWING1].weaponType[0] = W_DOUBLE_ROCKETS; + alien_defs[CD_URANUSBOSSWING1].weaponType[1] = W_DOUBLE_ROCKETS; + alien_defs[CD_URANUSBOSSWING1].chance[0] = 5; + alien_defs[CD_URANUSBOSSWING1].chance[1] = 0; + alien_defs[CD_URANUSBOSSWING1].score = 500; + alien_defs[CD_URANUSBOSSWING1].collectChance = 100; + alien_defs[CD_URANUSBOSSWING1].collectType = P_ANYTHING; + alien_defs[CD_URANUSBOSSWING1].collectValue = 250; + alien_defs[CD_URANUSBOSSWING1].flags = FL_WEAPCO | FL_IMMORTAL; // Uranus Boss Wing 2 - defEnemy[CD_URANUSBOSSWING2].classDef = CD_URANUSBOSSWING2; - defEnemy[CD_URANUSBOSSWING2].AIType = AI_OFFENSIVE; - defEnemy[CD_URANUSBOSSWING2].speed = 4; - defEnemy[CD_URANUSBOSSWING2].maxShield = 250; - defEnemy[CD_URANUSBOSSWING2].shield = 250; - defEnemy[CD_URANUSBOSSWING2].imageIndex[0] = 45; - defEnemy[CD_URANUSBOSSWING2].imageIndex[1] = 46; - defEnemy[CD_URANUSBOSSWING2].weaponType[0] = W_DOUBLE_ROCKETS; - defEnemy[CD_URANUSBOSSWING2].weaponType[1] = W_DOUBLE_ROCKETS; - defEnemy[CD_URANUSBOSSWING2].chance[0] = 5; - defEnemy[CD_URANUSBOSSWING2].chance[1] = 0; - defEnemy[CD_URANUSBOSSWING2].score = 500; - defEnemy[CD_URANUSBOSSWING2].collectChance = 100; - defEnemy[CD_URANUSBOSSWING2].collectType = P_ANYTHING; - defEnemy[CD_URANUSBOSSWING2].collectValue = 250; - defEnemy[CD_URANUSBOSSWING2].flags = FL_WEAPCO | FL_IMMORTAL; + alien_defs[CD_URANUSBOSSWING2].classDef = CD_URANUSBOSSWING2; + alien_defs[CD_URANUSBOSSWING2].AIType = AI_OFFENSIVE; + alien_defs[CD_URANUSBOSSWING2].speed = 4; + alien_defs[CD_URANUSBOSSWING2].maxShield = 250; + alien_defs[CD_URANUSBOSSWING2].shield = 250; + alien_defs[CD_URANUSBOSSWING2].imageIndex[0] = 45; + alien_defs[CD_URANUSBOSSWING2].imageIndex[1] = 46; + alien_defs[CD_URANUSBOSSWING2].weaponType[0] = W_DOUBLE_ROCKETS; + alien_defs[CD_URANUSBOSSWING2].weaponType[1] = W_DOUBLE_ROCKETS; + alien_defs[CD_URANUSBOSSWING2].chance[0] = 5; + alien_defs[CD_URANUSBOSSWING2].chance[1] = 0; + alien_defs[CD_URANUSBOSSWING2].score = 500; + alien_defs[CD_URANUSBOSSWING2].collectChance = 100; + alien_defs[CD_URANUSBOSSWING2].collectType = P_ANYTHING; + alien_defs[CD_URANUSBOSSWING2].collectValue = 250; + alien_defs[CD_URANUSBOSSWING2].flags = FL_WEAPCO | FL_IMMORTAL; setColorIndexes(); diff --git a/src/aliens.cpp b/src/aliens.cpp index 749bea7..05412aa 100644 --- a/src/aliens.cpp +++ b/src/aliens.cpp @@ -19,8 +19,8 @@ along with this program. If not, see . #include "Starfighter.h" -object defEnemy[MAX_DEFALIENS]; -object enemy[MAX_ALIENS]; +object alien_defs[CD_MAX]; +object aliens[MAX_ALIENS]; /* 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++) { - if (!enemy[i].active) + if (!aliens[i].active) { return i; } @@ -164,44 +164,44 @@ bool alien_add() delete[] alienArray; - enemy[index] = defEnemy[randEnemy]; - enemy[index].active = true; - enemy[index].face = rand() % 2; - enemy[index].owner = &enemy[index]; // Most enemies will own themselves - enemy[index].target = &enemy[index]; - enemy[index].thinktime = (50 + rand() % 50); - enemy[index].systemPower = enemy[index].maxShield; - enemy[index].deathCounter = 0 - (enemy[index].maxShield * 3); - enemy[index].hit = 0; + aliens[index] = alien_defs[randEnemy]; + aliens[index].active = true; + aliens[index].face = rand() % 2; + aliens[index].owner = &aliens[index]; // Most enemies will own themselves + aliens[index].target = &aliens[index]; + aliens[index].thinktime = (50 + rand() % 50); + aliens[index].systemPower = aliens[index].maxShield; + aliens[index].deathCounter = 0 - (aliens[index].maxShield * 3); + 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. for (int i = 0 ; i < 100 ; i++) { - if (alien_place(&enemy[index])) + if (alien_place(&aliens[index])) break; - enemy[index].active = false; + aliens[index].active = false; return false; } - if (enemy[index].classDef == CD_CARGOSHIP) - addCargo(&enemy[index], P_CARGO); + if (aliens[index].classDef == CD_CARGOSHIP) + addCargo(&aliens[index], P_CARGO); - if (enemy[index].classDef == CD_MOBILE_RAY) - enemy[index].shield = 25; + if (aliens[index].classDef == CD_MOBILE_RAY) + aliens[index].shield = 25; - if (enemy[index].classDef == CD_ESCORT) - enemy[index].shield = 50; + if (aliens[index].classDef == CD_ESCORT) + aliens[index].shield = 50; - enemy[index].dx = rrand(-2, 2); - enemy[index].dy = rrand(-2, 2); + aliens[index].dx = rrand(-2, 2); + aliens[index].dy = rrand(-2, 2); - enemy[index].ammo[0] = 0; + aliens[index].ammo[0] = 0; if (currentGame.area == 18) - enemy[index].flags |= FL_HASMINIMUMSPEED; + aliens[index].flags |= FL_HASMINIMUMSPEED; return true; } @@ -213,18 +213,18 @@ void alien_addDrone(object *hostAlien) if (index == -1) return; - enemy[index] = defEnemy[CD_DRONE]; - enemy[index].active = true; - enemy[index].face = rand() % 2; - enemy[index].owner = &enemy[index]; // Most enemies will own themselves - enemy[index].target = &enemy[index]; - enemy[index].thinktime = (50 + rand() % 50); - enemy[index].systemPower = enemy[index].maxShield; - enemy[index].deathCounter = 0 - (enemy[index].maxShield * 3); - enemy[index].hit = 0; + aliens[index] = alien_defs[CD_DRONE]; + aliens[index].active = true; + aliens[index].face = rand() % 2; + aliens[index].owner = &aliens[index]; // Most enemies will own themselves + aliens[index].target = &aliens[index]; + aliens[index].thinktime = (50 + rand() % 50); + aliens[index].systemPower = aliens[index].maxShield; + aliens[index].deathCounter = 0 - (aliens[index].maxShield * 3); + aliens[index].hit = 0; - enemy[index].x = hostAlien->x + rand() % 50; - enemy[index].y = hostAlien->y + rand() % 50; + aliens[index].x = hostAlien->x + rand() % 50; + aliens[index].y = hostAlien->y + rand() % 50; } void alien_addSmallAsteroid(object *hostAlien) @@ -239,7 +239,7 @@ void alien_addSmallAsteroid(object *hostAlien) addBullet(&weapon[W_ROCKETS], hostAlien, 0, 0); for (int i = 10 ; i < 20 ; i++) - if (!enemy[i].active) + if (!aliens[i].active) index = i; if (index == -1) @@ -247,58 +247,58 @@ void alien_addSmallAsteroid(object *hostAlien) if ((rand() % 10) > 3) { - enemy[index] = defEnemy[CD_ASTEROID2]; - enemy[index].imageIndex[0] = enemy[index].imageIndex[1] = 39 + rand() % 2; - enemy[index].image[0] = shipShape[enemy[index].imageIndex[0]]; - enemy[index].image[1] = shipShape[enemy[index].imageIndex[1]]; + aliens[index] = alien_defs[CD_ASTEROID2]; + aliens[index].imageIndex[0] = aliens[index].imageIndex[1] = 39 + rand() % 2; + aliens[index].image[0] = shipShape[aliens[index].imageIndex[0]]; + aliens[index].image[1] = shipShape[aliens[index].imageIndex[1]]; } else { - enemy[index] = defEnemy[CD_DRONE]; + aliens[index] = alien_defs[CD_DRONE]; } - enemy[index].owner = &enemy[index]; // Most enemies will own themselves - enemy[index].target = &enemy[index]; - enemy[index].thinktime = 1; - enemy[index].systemPower = enemy[index].maxShield; - enemy[index].deathCounter = 0 - (enemy[index].maxShield * 3); - enemy[index].hit = 0; + aliens[index].owner = &aliens[index]; // Most enemies will own themselves + aliens[index].target = &aliens[index]; + aliens[index].thinktime = 1; + aliens[index].systemPower = aliens[index].maxShield; + aliens[index].deathCounter = 0 - (aliens[index].maxShield * 3); + aliens[index].hit = 0; - enemy[index].x = hostAlien->x; - enemy[index].y = hostAlien->y; - enemy[index].active = true; + aliens[index].x = hostAlien->x; + aliens[index].y = hostAlien->y; + aliens[index].active = true; } void alien_addFriendly(int type) { if (type != FR_SID) - enemy[type] = defEnemy[CD_FRIEND]; + aliens[type] = alien_defs[CD_FRIEND]; else - enemy[type] = defEnemy[CD_SID]; + aliens[type] = alien_defs[CD_SID]; - enemy[type].owner = &enemy[type]; - enemy[type].target = &enemy[type]; - enemy[type].active = true; + aliens[type].owner = &aliens[type]; + aliens[type].target = &aliens[type]; + aliens[type].active = true; 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 - 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) - 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 - 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) - enemy[type].classDef = CD_PHOEBE; + aliens[type].classDef = CD_PHOEBE; if (type == FR_URSULA) - enemy[type].classDef = CD_URSULA; + aliens[type].classDef = CD_URSULA; // For the sake of it being the final battle :) if (currentGame.area == 25) - enemy[type].flags |= FL_IMMORTAL; + aliens[type].flags |= FL_IMMORTAL; } bool alien_place(object *alien) @@ -321,9 +321,11 @@ bool alien_place(object *alien) 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; } } @@ -334,7 +336,7 @@ bool alien_place(object *alien) void alien_setAI(object *alien) { // 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) { @@ -476,10 +478,13 @@ void alien_setKlineAI(object *alien) switch(rand() % 10) { 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->dx = ((alien->x - alien->target->x) / ((300 / alien->speed) + rand() % 100)); - alien->dy = ((alien->y - alien->target->y) / ((300 / alien->speed) + rand() % 100)); + alien->dx = ((alien->x - alien->target->x) / + ((300 / alien->speed) + rand() % 100)); + alien->dy = ((alien->y - alien->target->y) / + ((300 / alien->speed) + rand() % 100)); break; case 1: case 2: @@ -518,7 +523,7 @@ void alien_searchForTarget(object *alien) i = rand() % MAX_ALIENS; - object *targetEnemy = &enemy[i]; + object *targetEnemy = &aliens[i]; // 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) @@ -537,7 +542,8 @@ void alien_searchForTarget(object *alien) if (targetEnemy->classDef == CD_BOSS) return; - if ((targetEnemy->flags & FL_DISABLED) || (targetEnemy->flags & FL_NOFIRE)) + if ((targetEnemy->flags & FL_DISABLED) || + (targetEnemy->flags & FL_NOFIRE)) return; } } @@ -593,7 +599,8 @@ int alien_checkTarget(object *alien) return 1; // 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 1; @@ -605,13 +612,15 @@ any enemy craft that enter their line of sight. */ int alien_enemiesInFront(object *alien) { - object *anEnemy = enemy; + object *anEnemy = aliens; 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)) return 1; @@ -660,13 +669,18 @@ void alien_move(object *alien) } } - object *anEnemy = enemy; + object *anEnemy = aliens; if (checkCollisions) { 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++; continue; @@ -674,7 +688,8 @@ void alien_move(object *alien) if (collision(alien, anEnemy)) { - if ((anEnemy->classDef == CD_BARRIER) && (anEnemy->owner != alien)) + if ((anEnemy->classDef == CD_BARRIER) && + (anEnemy->owner != alien)) { alien->shield--; alien->hit = 3; diff --git a/src/aliens.h b/src/aliens.h index 8d20b5e..3856749 100644 --- a/src/aliens.h +++ b/src/aliens.h @@ -20,8 +20,8 @@ along with this program. If not, see . #ifndef ALIEN_H #define ALIEN_H -extern object defEnemy[MAX_DEFALIENS]; -extern object enemy[MAX_ALIENS]; +extern object alien_defs[CD_MAX]; +extern object aliens[MAX_ALIENS]; bool alien_add(); void alien_addDrone(object *hostAlien); diff --git a/src/bullets.cpp b/src/bullets.cpp index f06027c..c2ad17e 100644 --- a/src/bullets.cpp +++ b/src/bullets.cpp @@ -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 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; if ((engine.cheatAmmo) || (theWeapon->id == WT_LASER)) @@ -248,22 +248,22 @@ static object *getRandomEnemy(object *bullet) i = rand() % MAX_ALIENS; - if ((enemy[i].shield < 1) || (!enemy[i].active)) + if ((aliens[i].shield < 1) || (!aliens[i].active)) 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; - if ((bullet->owner->flags & FL_FRIEND) && (enemy[i].flags & FL_FRIEND)) + if ((bullet->owner->flags & FL_FRIEND) && (aliens[i].flags & FL_FRIEND)) 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; - 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 &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++) { @@ -567,7 +567,7 @@ void doBullets() for (int i = 0 ; i < MAX_ALIENS ; i++) { - alien = &enemy[i]; + alien = &aliens[i]; if ((alien->shield < 1) || (!alien->active)) continue; diff --git a/src/cargo.cpp b/src/cargo.cpp index dbcc886..c90a4a3 100644 --- a/src/cargo.cpp +++ b/src/cargo.cpp @@ -73,9 +73,9 @@ static void becomeCollectable(int i) } else { - enemy[FR_PHOEBE].active = true; - enemy[FR_PHOEBE].x = cargo[i].x; - enemy[FR_PHOEBE].y = cargo[i].y; + aliens[FR_PHOEBE].active = true; + aliens[FR_PHOEBE].x = cargo[i].x; + aliens[FR_PHOEBE].y = cargo[i].y; setRadioMessage(FACE_PHOEBE, "Thanks!! Watch out, WEAPCO! Phoebe's loose and she's ANGRY!!!", 1); } diff --git a/src/defs.h b/src/defs.h index 79d4c00..c4b0fc8 100644 --- a/src/defs.h +++ b/src/defs.h @@ -91,7 +91,6 @@ along with this program. If not, see . #define MAX_TEXTSHAPES 150 #define MAX_FONTSHAPES 6 #define MAX_SHOPSHAPES 6 -#define MAX_DEFALIENS 40 #define MAX_MISSIONS 28 #define MAX_CARGO 20 @@ -240,6 +239,7 @@ enum { CD_URANUSBOSS, CD_URANUSBOSSWING1, CD_URANUSBOSSWING2, + CD_MAX, // Some special ones CD_ANY = 100, diff --git a/src/game.cpp b/src/game.cpp index 4c1e4bf..e5ea71a 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -143,9 +143,9 @@ int mainGameLoop() // Init aliens for (int i = 0 ; i < MAX_ALIENS ; i++) { - enemy[i].active = false; - enemy[i].shield = -1; - enemy[i].flags = 0; + aliens[i].active = false; + aliens[i].shield = -1; + aliens[i].flags = 0; } engine.targetIndex = -1; @@ -162,11 +162,11 @@ int mainGameLoop() { placeAttempt = 0; - enemy[index] = defEnemy[alienType]; - enemy[index].owner = &enemy[index]; - enemy[index].target = &enemy[index]; - enemy[index].face = rand() % 2; - enemy[index].active = true; + aliens[index] = alien_defs[alienType]; + aliens[index].owner = &aliens[index]; + aliens[index].target = &aliens[index]; + aliens[index].face = rand() % 2; + aliens[index].active = true; /* we make 1000 attempts to place this enemy since it is required. If after @@ -178,7 +178,7 @@ int mainGameLoop() { placeAttempt++; - if (alien_place(&enemy[index])) + if (alien_place(&aliens[index])) break; if (placeAttempt > 1000) @@ -186,56 +186,56 @@ int mainGameLoop() } if (currentGame.area == 2) - addCargo(&enemy[index], P_CARGO); + addCargo(&aliens[index], P_CARGO); else if (currentGame.area == 7) - addCargo(&enemy[index], P_PHOEBE); + addCargo(&aliens[index], P_PHOEBE); if (index == WC_KLINE) { - enemy[WC_KLINE].target = &player; + aliens[WC_KLINE].target = &player; 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; - enemy[index].maxShield = enemy[index].shield = 400; - enemy[index].flags &= ~FL_RUNSAWAY; - enemy[index].speed = 3; + aliens[index].active = false; + aliens[index].maxShield = aliens[index].shield = 400; + aliens[index].flags &= ~FL_RUNSAWAY; + 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]; - enemy[index].speed = barrierSpeed; + aliens[index].owner = &aliens[WC_BOSS]; + aliens[index].speed = 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; - enemy[index].flags |= FL_IMMORTAL; + aliens[index].imageIndex[1] = 29; + aliens[index].flags |= FL_IMMORTAL; } if (currentGame.area == 18) - enemy[index].flags |= FL_HASMINIMUMSPEED; + aliens[index].flags |= FL_HASMINIMUMSPEED; if (currentGame.area == 23) { - enemy[index].flags = FL_WEAPCO; + aliens[index].flags = FL_WEAPCO; if (index == WC_BOSS) - enemy[index].chance[1] = 5; + aliens[index].chance[1] = 5; } } @@ -243,71 +243,71 @@ int mainGameLoop() if (currentGame.area == 5) { - enemy[WC_BOSS].target = &player; - enemy[WC_BOSS].x = -screen->w / 2; - enemy[WC_BOSS].y = screen->h / 2; + aliens[WC_BOSS].target = &player; + aliens[WC_BOSS].x = -screen->w / 2; + aliens[WC_BOSS].y = screen->h / 2; - enemy[13].owner = &enemy[WC_BOSS]; - enemy[13].target = &player; - enemy[13].dx = -25; - enemy[13].dy = -21; + aliens[13].owner = &aliens[WC_BOSS]; + aliens[13].target = &player; + aliens[13].dx = -25; + aliens[13].dy = -21; - enemy[12].owner = &enemy[WC_BOSS]; - enemy[12].target = &player; - enemy[12].dx = -20; - enemy[12].dy = 37; + aliens[12].owner = &aliens[WC_BOSS]; + aliens[12].target = &player; + aliens[12].dx = -20; + aliens[12].dy = 37; } else if ((currentGame.area == 11) || (currentGame.area == 14)) { - enemy[WC_BOSS].target = &player; - enemy[WC_BOSS].x = -screen->w / 2; - enemy[WC_BOSS].y = screen->h / 2; + aliens[WC_BOSS].target = &player; + aliens[WC_BOSS].x = -screen->w / 2; + aliens[WC_BOSS].y = screen->h / 2; - enemy[13].owner = &enemy[WC_BOSS]; - enemy[13].target = &player; - enemy[13].dx = 15; - enemy[13].dy = -22; + aliens[13].owner = &aliens[WC_BOSS]; + aliens[13].target = &player; + aliens[13].dx = 15; + aliens[13].dy = -22; - enemy[12].owner = &enemy[WC_BOSS]; - enemy[12].target = &player; - enemy[12].dx = 15; - enemy[12].dy = 22; + aliens[12].owner = &aliens[WC_BOSS]; + aliens[12].target = &player; + aliens[12].dx = 15; + aliens[12].dy = 22; - enemy[11].owner = &enemy[13]; - enemy[11].target = &player; - enemy[11].dx = -35; - enemy[11].dy = -12; + aliens[11].owner = &aliens[13]; + aliens[11].target = &player; + aliens[11].dx = -35; + aliens[11].dy = -12; - enemy[10].owner = &enemy[12]; - enemy[10].target = &player; - enemy[10].dx = -35; - enemy[10].dy = 20; + aliens[10].owner = &aliens[12]; + aliens[10].target = &player; + aliens[10].dx = -35; + aliens[10].dy = 20; if (currentGame.area == 14) { - enemy[WC_BOSS].AIType = AI_EVASIVE; + aliens[WC_BOSS].AIType = AI_EVASIVE; for (int i = 10 ; i < 15 ; i++) { - enemy[i].imageIndex[0] += 15; - enemy[i].imageIndex[1] += 15; + aliens[i].imageIndex[0] += 15; + aliens[i].imageIndex[1] += 15; - enemy[i].image[0] = shipShape[enemy[i].imageIndex[0]]; - enemy[i].image[1] = shipShape[enemy[i].imageIndex[1]]; + aliens[i].image[0] = shipShape[aliens[i].imageIndex[0]]; + aliens[i].image[1] = shipShape[aliens[i].imageIndex[1]]; } } } else if (currentGame.area == 21) { - enemy[WC_BOSS].target = &player; - enemy[WC_BOSS].x = -screen->w / 2; - enemy[WC_BOSS].y = screen->h / 2; + aliens[WC_BOSS].target = &player; + aliens[WC_BOSS].x = -screen->w / 2; + aliens[WC_BOSS].y = screen->h / 2; - enemy[13].owner = &enemy[WC_BOSS]; - enemy[13].dy = 20; + aliens[13].owner = &aliens[WC_BOSS]; + aliens[13].dy = 20; - enemy[12].owner = &enemy[WC_BOSS]; - enemy[12].dy = -16; + aliens[12].owner = &aliens[WC_BOSS]; + aliens[12].dy = -16; } } @@ -316,7 +316,7 @@ int mainGameLoop() currentGame.hasWingMate1 = 1; if (currentGame.area == 11) - enemy[WC_KLINE].active = false; + aliens[WC_KLINE].active = false; for (int i = 0 ; i < engine.maxAliens ; i++) alien_add(); @@ -342,15 +342,15 @@ int mainGameLoop() case 18: case 24: case 26: - enemy[FR_PHOEBE].active = false; - enemy[FR_URSULA].active = false; + aliens[FR_PHOEBE].active = false; + aliens[FR_URSULA].active = false; break; } if (currentGame.area == 10) { - enemy[0].collectChance = 100; - enemy[0].collectType = P_ESCAPEPOD; + aliens[0].collectChance = 100; + aliens[0].collectType = P_ESCAPEPOD; } // Some specifics for interception missions @@ -358,13 +358,13 @@ int mainGameLoop() { if ((currentGame.system > 1) && ((rand() % 5) == 0)) { - enemy[WC_KLINE] = defEnemy[CD_KLINE]; - enemy[WC_KLINE].owner = &enemy[WC_KLINE]; - enemy[WC_KLINE].target = &player; - enemy[WC_KLINE].shield = 100; - enemy[WC_KLINE].active = true; - enemy[WC_KLINE].x = player.x + 1000; - enemy[WC_KLINE].y = player.y; + aliens[WC_KLINE] = alien_defs[CD_KLINE]; + aliens[WC_KLINE].owner = &aliens[WC_KLINE]; + aliens[WC_KLINE].target = &player; + aliens[WC_KLINE].shield = 100; + aliens[WC_KLINE].active = true; + aliens[WC_KLINE].x = player.x + 1000; + aliens[WC_KLINE].y = player.y; player_setTarget(WC_KLINE); } @@ -372,36 +372,36 @@ int mainGameLoop() { if ((rand() % 2) == 0) { - enemy[10] = defEnemy[CD_CLOAKFIGHTER]; - enemy[10].owner = &enemy[10]; - enemy[10].target = &enemy[10]; - enemy[10].shield = 1000; - enemy[10].active = true; - enemy[10].x = player.x - 1000; - enemy[10].y = player.y; + aliens[10] = alien_defs[CD_CLOAKFIGHTER]; + aliens[10].owner = &aliens[10]; + aliens[10].target = &aliens[10]; + aliens[10].shield = 1000; + aliens[10].active = true; + aliens[10].x = player.x - 1000; + aliens[10].y = player.y; player_setTarget(10); - enemy[10].shield = currentGame.experimentalShield; + aliens[10].shield = currentGame.experimentalShield; } } } 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; - enemy[WC_KLINE].y = screen->h * 2 / 3; + aliens[WC_KLINE].x = screen->w * 2 / 3; + aliens[WC_KLINE].y = screen->h * 2 / 3; - enemy[WC_KLINE].deathCounter = -250; - enemy[WC_KLINE].maxShield = 1500; - enemy[WC_KLINE].shield = 500; + aliens[WC_KLINE].deathCounter = -250; + aliens[WC_KLINE].maxShield = 1500; + aliens[WC_KLINE].shield = 500; } for (int i = 0 ; i < MAX_ALIENS ; i++) { - enemy[i].systemPower = enemy[i].maxShield; - enemy[i].deathCounter = 0 - (enemy[i].maxShield * 3); - limitInt(&enemy[i].deathCounter, -350, 0); + aliens[i].systemPower = aliens[i].maxShield; + aliens[i].deathCounter = 0 - (aliens[i].maxShield * 3); + limitInt(&aliens[i].deathCounter, -350, 0); } // Set target energy meter @@ -461,7 +461,8 @@ int mainGameLoop() 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]; if (currentMission.primaryType[i] == M_DESTROY_ALL_TARGETS) @@ -470,7 +471,7 @@ int mainGameLoop() 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--; } @@ -513,25 +514,25 @@ int mainGameLoop() leaveSector(); 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; - enemy[FR_PHOEBE].y = player.y - 35; - enemy[FR_PHOEBE].face = 0; + aliens[FR_PHOEBE].x = player.x - 40; + aliens[FR_PHOEBE].y = player.y - 35; + 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; - enemy[FR_URSULA].y = player.y + 45; - enemy[FR_URSULA].face = 0; + aliens[FR_URSULA].x = player.x - 40; + aliens[FR_URSULA].y = player.y + 45; + aliens[FR_URSULA].face = 0; } if ((currentGame.area == 9) || (currentGame.area == 17)) { - enemy[FR_SID].x = player.x - 100; - enemy[FR_SID].y = player.y; - enemy[FR_SID].face = 0; + aliens[FR_SID].x = player.x - 100; + aliens[FR_SID].y = player.y; + aliens[FR_SID].face = 0; } } } @@ -575,7 +576,7 @@ int mainGameLoop() // A global variable for checking if all the aliens are dead engine.allAliensDead = 1; - object *alien = enemy; + object *alien = aliens; for (int i = 0 ; i < MAX_ALIENS ; i++) { @@ -729,7 +730,7 @@ int mainGameLoop() 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); @@ -805,7 +806,7 @@ int mainGameLoop() 600 + rand() % 2400); // Kline drops mines a lot more often - if ((alien == &enemy[WC_KLINE])) + if ((alien == &aliens[WC_KLINE])) { if ((rand() % 10) == 0) addCollectable(alien->x, alien->y, P_MINE, 25, @@ -855,7 +856,7 @@ int mainGameLoop() { alien->active = false; if ((alien->classDef == CD_BOSS) || - (alien->owner == &enemy[WC_BOSS]) || + (alien->owner == &aliens[WC_BOSS]) || (alien->flags & FL_FRIEND) || (alien->classDef == CD_ASTEROID) || (alien->classDef == CD_KLINE)) @@ -927,16 +928,16 @@ int mainGameLoop() engine.missionCompleteTimer = SDL_GetTicks() + 7000; // 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); updateScreen(); for (int i = 0 ; i < 300 ; i++) { SDL_Delay(10); if ((rand() % 25) == 0) - playSound(SFX_EXPLOSION, enemy[WC_BOSS].x); + playSound(SFX_EXPLOSION, aliens[WC_BOSS].x); } SDL_Delay(1000); break; diff --git a/src/messages.cpp b/src/messages.cpp index 250ed26..c788af4 100644 --- a/src/messages.cpp +++ b/src/messages.cpp @@ -64,12 +64,13 @@ void getKillMessage(object *ally) bool firstPlace = false; int faceToUse = FACE_PHOEBE; - if (ally == &enemy[FR_PHOEBE]) + if (ally == &aliens[FR_PHOEBE]) { strcpy(otherName, "Ursula"); kills = currentGame.wingMate1Kills; 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; faceToUse = FACE_PHOEBE; } @@ -78,7 +79,8 @@ void getKillMessage(object *ally) strcpy(otherName, "Phoebe"); kills = currentGame.wingMate2Kills; 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; faceToUse = FACE_URSULA; } @@ -133,7 +135,8 @@ void getKillMessage(object *ally) const char *getKlineInsult() { 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) @@ -144,13 +147,13 @@ const char *getKlineInsult() void getPlayerDeathMessage() { - if (enemy[WC_KLINE].active) + if (aliens[WC_KLINE].active) { setRadioMessage(FACE_KLINE, getKlineInsult(), 1); 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); return; @@ -159,7 +162,9 @@ void getPlayerDeathMessage() 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; } else if (currentGame.hasWingMate2) @@ -175,7 +180,7 @@ void getMissFireMessage(object *ally) { int faceToUse = FACE_PHOEBE; - if (ally == &enemy[FR_PHOEBE]) + if (ally == &aliens[FR_PHOEBE]) faceToUse = FACE_PHOEBE; else faceToUse = FACE_URSULA; @@ -187,7 +192,7 @@ void getPlayerHitMessage(object *ally) { int faceToUse = FACE_PHOEBE; - if (ally == &enemy[FR_PHOEBE]) + if (ally == &aliens[FR_PHOEBE]) faceToUse = FACE_PHOEBE; else faceToUse = FACE_URSULA; diff --git a/src/misc.cpp b/src/misc.cpp index dabf265..795eb8a 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -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) { - 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; - int x = enemy[i].x + enemy[i].image[0]->w / 2; - int y = enemy[i].y + enemy[i].image[0]->h / 2; + int x = aliens[i].x + aliens[i].image[0]->w / 2; + int y = aliens[i].y + aliens[i].image[0]->h / 2; float sx = fabsf((x - (screen->w / 2)) / (screen->w / 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) 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); bar.w = 1; @@ -310,7 +310,7 @@ void doInfo() bar.x = 620; 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) shieldColor = green; diff --git a/src/missions.cpp b/src/missions.cpp index 1d3a017..668e0fa 100644 --- a/src/missions.cpp +++ b/src/missions.cpp @@ -270,8 +270,8 @@ static void mission_killAllEnemies() { for (int i = 0 ; i < MAX_ALIENS ; i++) { - if ((enemy[i].flags & FL_WEAPCO) && (enemy[i].active) && (enemy[i].shield > 0)) - enemy[i].shield = 0; + if ((aliens[i].flags & FL_WEAPCO) && (aliens[i].active) && (aliens[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.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; 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.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; evaluateRequirement(type, id, ¤tMission.completed2[i], ¤tMission.targetValue2[i], FONT_YELLOW); @@ -507,10 +511,10 @@ static char revealHiddenObjectives() { mission_killAllEnemies(); syncScriptEvents(); - enemy[WC_KLINE].active = true; - enemy[WC_KLINE].x = player.x + 1000; - enemy[WC_KLINE].y = player.y; - enemy[WC_KLINE].flags |= FL_IMMORTAL | FL_NOFIRE; + aliens[WC_KLINE].active = true; + aliens[WC_KLINE].x = player.x + 1000; + aliens[WC_KLINE].y = player.y; + aliens[WC_KLINE].flags |= FL_IMMORTAL | FL_NOFIRE; player_setTarget(WC_KLINE); loadMusic("music/last_cyber_dance.ogg"); if ((engine.useAudio) && (engine.useMusic)) diff --git a/src/player.cpp b/src/player.cpp index 2e8a7ba..cebdcbe 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -68,7 +68,7 @@ void player_setTarget(int index) { engine.targetIndex = index; engine.targetShield = 85; - engine.targetShield /= enemy[index].shield; + engine.targetShield /= aliens[index].shield; } void exitPlayer() @@ -117,7 +117,8 @@ void doPlayer() 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); } @@ -231,7 +232,8 @@ void doPlayer() 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; xmoved = true; @@ -321,14 +323,14 @@ void doPlayer() player.shield--; if (player.shield == -1) { - if ((currentGame.hasWingMate1) || (enemy[WC_KLINE].active)) + if ((currentGame.hasWingMate1) || (aliens[WC_KLINE].active)) getPlayerDeathMessage(); // Make it look like the ships are all still moving... if (currentGame.area == 18) { for (int i = 0 ; i < MAX_ALIENS ; i++) - enemy[i].flags |= FL_LEAVESECTOR; + aliens[i].flags |= FL_LEAVESECTOR; } playSound(SFX_DEATH, player.x); @@ -347,7 +349,8 @@ void doPlayer() limitFloat(&engine.ssy, -cameraMaxSpeed, cameraMaxSpeed); // 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.ssy = 0; diff --git a/src/resources.cpp b/src/resources.cpp index e2bda6e..ac36e19 100644 --- a/src/resources.cpp +++ b/src/resources.cpp @@ -130,14 +130,14 @@ void loadGameGraphics() 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]]; - defEnemy[i].image[1] = shipShape[defEnemy[i].imageIndex[1]]; - defEnemy[i].engineX = defEnemy[i].image[0]->w; - defEnemy[i].engineY = (defEnemy[i].image[0]->h / 2); + alien_defs[i].image[0] = shipShape[alien_defs[i].imageIndex[0]]; + alien_defs[i].image[1] = shipShape[alien_defs[i].imageIndex[1]]; + alien_defs[i].engineX = alien_defs[i].image[0]->w; + alien_defs[i].engineY = (alien_defs[i].image[0]->h / 2); } } diff --git a/src/script.cpp b/src/script.cpp index a49d8b5..c51cca6 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -48,7 +48,7 @@ void loadScriptEvents() 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(); char filename[255]; @@ -96,13 +96,13 @@ void checkScriptEvents() { if (gameEvent[i].flag != -FL_ACTIVATE) { - enemy[gameEvent[i].entity].flags += gameEvent[i].flag; + aliens[gameEvent[i].entity].flags += gameEvent[i].flag; } else { - enemy[gameEvent[i].entity].active = true; - enemy[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].active = true; + aliens[gameEvent[i].entity].x = rrand((int)player.x + 400, (int)player.x + 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) { - enemy[index].image[0] = shipShape[shape]; - enemy[index].x = x; - enemy[index].y = y; - enemy[index].dx = speed; - enemy[index].active = true; + aliens[index].image[0] = shipShape[shape]; + aliens[index].x = x; + aliens[index].y = y; + aliens[index].dx = speed; + aliens[index].active = true; } } @@ -201,9 +201,9 @@ void doCutscene(int scene) for (int i = 0 ; i < 15 ; i++) { - enemy[i] = defEnemy[0]; - enemy[i].face = 0; - enemy[i].active = false; + aliens[i] = alien_defs[0]; + aliens[i].face = 0; + aliens[i].active = false; } for (int i = 0 ; i < 10 ; i++) @@ -220,8 +220,8 @@ void doCutscene(int scene) */ for (int i = 0 ; i < 15 ; i++) { - enemy[i].engineX = enemy[i].image[0]->w; - enemy[i].engineY = (enemy[i].image[0]->h / 2); + aliens[i].engineX = aliens[i].image[0]->w; + aliens[i].engineY = (aliens[i].image[0]->h / 2); } bool showMessage = false; @@ -244,30 +244,30 @@ void doCutscene(int scene) 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) { - enemy[i].dx += (drand48() - 0.5) * 0.1; - enemy[i].dy += (drand48() - 0.5) * 0.1; - if (enemy[i].x > 500 - timer) - enemy[i].dx -= 0.2; - if (enemy[i].x < 0) - enemy[i].dx += 0.2; + aliens[i].dx += (drand48() - 0.5) * 0.1; + aliens[i].dy += (drand48() - 0.5) * 0.1; + if (aliens[i].x > 500 - timer) + aliens[i].dx -= 0.2; + if (aliens[i].x < 0) + aliens[i].dx += 0.2; } - enemy[i].x += enemy[i].dx; - enemy[i].y += enemy[i].dy; - enemy[i].x += engine.ssx + engine.smx; - blit(enemy[i].image[0], (int)enemy[i].x, (int)enemy[i].y); - if (enemy[i].x > (screen->w + 50)) + aliens[i].x += aliens[i].dx; + aliens[i].y += aliens[i].dy; + aliens[i].x += engine.ssx + engine.smx; + blit(aliens[i].image[0], (int)aliens[i].x, (int)aliens[i].y); + if (aliens[i].x > (screen->w + 50)) { - enemy[i].x = -50; - enemy[i].y = rand() % (screen->h - 40); + aliens[i].x = -50; + aliens[i].y = rand() % (screen->h - 40); } - if (enemy[i].y < -50) - enemy[i].y = (screen->h + 50); - if (enemy[i].y > (screen->h + 50)) - enemy[i].y = -50; + if (aliens[i].y < -50) + aliens[i].y = (screen->h + 50); + if (aliens[i].y > (screen->h + 50)) + aliens[i].y = -50; } } diff --git a/src/shop.cpp b/src/shop.cpp index ddb5521..28db9fa 100644 --- a/src/shop.cpp +++ b/src/shop.cpp @@ -62,7 +62,8 @@ static void drawSecondaryWeaponSurface() } 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); drawString(description, 10, 37, FONT_WHITE, shopSurface[2]); @@ -71,13 +72,13 @@ static void drawSecondaryWeaponSurface() static void adjustShopPrices() { - shopItems[SHOP_PLASMA_MAX_OUTPUT].price = (500 * currentGame.maxPlasmaOutput); - shopItems[SHOP_PLASMA_MAX_DAMAGE].price = (500 * currentGame.maxPlasmaDamage); - shopItems[SHOP_PLASMA_MAX_RATE].price = (500 * currentGame.maxPlasmaRate); + shopItems[SHOP_PLASMA_MAX_OUTPUT].price = (1500 * currentGame.maxPlasmaOutput); + shopItems[SHOP_PLASMA_MAX_DAMAGE].price = (1500 * currentGame.maxPlasmaDamage); + shopItems[SHOP_PLASMA_MAX_RATE].price = (1500 * currentGame.maxPlasmaRate); - shopItems[SHOP_PLASMA_MIN_OUTPUT].price = (2000 * currentGame.minPlasmaOutput); - shopItems[SHOP_PLASMA_MIN_DAMAGE].price = (2000 * currentGame.minPlasmaDamage); - shopItems[SHOP_PLASMA_MIN_RATE].price = (2000 * currentGame.minPlasmaRate); + shopItems[SHOP_PLASMA_MIN_OUTPUT].price = (4000 * currentGame.minPlasmaOutput); + shopItems[SHOP_PLASMA_MIN_DAMAGE].price = (4000 * currentGame.minPlasmaDamage); + shopItems[SHOP_PLASMA_MIN_RATE].price = (4000 * currentGame.minPlasmaRate); if (currentGame.maxPlasmaOutput <= currentGame.minPlasmaOutput) 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]); sprintf(description, "Plasma Cannons : %d", currentGame.minPlasmaOutput); 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]); - sprintf(description, "Cooler : Stage %d", currentGame.minPlasmaRate); + sprintf(description, "Cooler : Stage %d", + currentGame.minPlasmaRate); drawString(description, 10, 52, FONT_WHITE, shopSurface[0]); 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]); - sprintf(description, "Plasma Condensor : Stage %d", currentGame.maxPlasmaDamage); + sprintf(description, "Plasma Condensor : Stage %d", + currentGame.maxPlasmaDamage); 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]); sprintf(description, "Plasma Capacity : %d", currentGame.maxPlasmaAmmo); drawString(description, 10, 67, FONT_WHITE, shopSurface[1]); @@ -232,40 +238,51 @@ static void drawShop() case -1: break; 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; case -3: 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; case -4: - drawString("Ammunition limit reached", 20, 30, FONT_WHITE, shopSurface[5]); + drawString("Ammunition limit reached", 20, 30, FONT_WHITE, + shopSurface[5]); break; 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; case -6: drawString("Nothing to sell", 20, 30, FONT_WHITE, shopSurface[5]); break; 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; 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; 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; default: 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 { - 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]); break; } @@ -275,19 +292,22 @@ void initShop() { /* ----------- 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].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_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].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_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].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_AMMO].price = 50; @@ -297,48 +317,56 @@ void initShop() shopItems[SHOP_ROCKET_AMMO].price = 50; 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; /* ----------- 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].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_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].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_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].description, "Permanently increases firing rate"); + strcpy(shopItems[SHOP_PLASMA_MIN_RATE].description, + "Permanently increases firing rate"); shopItems[SHOP_PLASMA_MIN_RATE].image = 16; /* ----------- 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].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_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].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; /* ---------- Weaponary --------------- */ shopItems[SHOP_DOUBLE_ROCKETS].price = 2000; 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_MICRO_ROCKETS].price = 2500; 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_LASER].price = 5000; @@ -348,8 +376,8 @@ void initShop() shopItems[SHOP_HOMING_MISSILE].price = 7500; strcpy(shopItems[SHOP_HOMING_MISSILE].name, "Homing Missile Launcher"); - sprintf(shopItems[SHOP_HOMING_MISSILE].description, "Fires homing missile (max %i missiles)", - maxHoming); + sprintf(shopItems[SHOP_HOMING_MISSILE].description, + "Fires homing missile (max %i missiles)", maxHoming); shopItems[SHOP_HOMING_MISSILE].image = 22; shopItems[SHOP_CHARGER].price = 10000; @@ -358,13 +386,15 @@ void initShop() shopItems[SHOP_CHARGER].image = 23; 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, "Fires two homing missiles (max %i missiles)", maxDoubleHoming); shopItems[SHOP_DOUBLE_HOMING_MISSILES].image = 24; 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, "Fires several small homing missiles (max %i missiles)", maxMicroHoming); shopItems[SHOP_MICRO_HOMING_MISSILES].image = 25; diff --git a/src/structs.h b/src/structs.h index 8fc8d18..b6296f1 100644 --- a/src/structs.h +++ b/src/structs.h @@ -27,7 +27,7 @@ struct object { signed char AIType; // Type of articifial intelligence 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]; @@ -73,14 +73,14 @@ struct mission { char primaryObjective[3][50]; // Description 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) signed char timeLimit1[3]; // In minutes int completed1[3]; char secondaryObjective[3][50]; // Description 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) signed char timeLimit2[3]; // In minutes int completed2[3]; diff --git a/src/title.cpp b/src/title.cpp index 645f9a6..9ac9429 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -229,15 +229,15 @@ int doTitle() for (int i = 0 ; i < 15 ; i++) { - enemy[i] = defEnemy[rand() % 3]; + aliens[i] = alien_defs[rand() % 3]; if ((rand() % 5) == 0) - enemy[i] = defEnemy[CD_TRANSPORTSHIP]; + aliens[i] = alien_defs[CD_TRANSPORTSHIP]; if ((rand() % 5) == 0) - enemy[i] = defEnemy[CD_MINER]; - enemy[i].x = rand() % screen->w; - enemy[i].y = rand() % (screen->h - 40); - enemy[i].dx = 1 + rand() % 3; - enemy[i].face = 0; + aliens[i] = alien_defs[CD_MINER]; + aliens[i].x = rand() % screen->w; + aliens[i].y = rand() % (screen->h - 40); + aliens[i].dx = 1 + rand() % 3; + aliens[i].face = 0; } int redGlow = 255; @@ -281,14 +281,14 @@ int doTitle() for (int i = 0 ; i < 15 ; i++) { - addEngine(&enemy[i]); - enemy[i].x += enemy[i].dx; - blit(enemy[i].image[0], (int)enemy[i].x, (int)enemy[i].y); - if (enemy[i].x > 830) + addEngine(&aliens[i]); + aliens[i].x += aliens[i].dx; + blit(aliens[i].image[0], (int)aliens[i].x, (int)aliens[i].y); + if (aliens[i].x > 830) { - enemy[i].x = -40; - enemy[i].y = rand() % (screen->h - 20); - enemy[i].dx = 1 + rand() % 3; + aliens[i].x = -40; + aliens[i].y = rand() % (screen->h - 20); + aliens[i].dx = 1 + rand() % 3; } }