2011-08-24 14:14:44 +02:00
|
|
|
/*
|
|
|
|
Copyright (C) 2003 Parallel Realities
|
2015-03-01 21:37:32 +01:00
|
|
|
Copyright (C) 2011, 2012, 2013 Guus Sliepen
|
|
|
|
Copyright (C) 2015 Julian Marchant
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
2015-02-26 17:20:36 +01:00
|
|
|
as published by the Free Software Foundation; either version 3
|
2011-08-24 14:14:44 +02:00
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2015-02-26 17:20:36 +01:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2015-02-26 17:20:36 +01:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2011-08-24 14:14:44 +02:00
|
|
|
*/
|
|
|
|
|
2015-03-04 15:11:04 +01:00
|
|
|
#ifndef STRUCTS_H
|
|
|
|
#define STRUCTS_H
|
|
|
|
|
2011-08-24 14:32:45 +02:00
|
|
|
struct object {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-08-26 16:14:58 +02:00
|
|
|
bool active;
|
2011-08-24 14:14:44 +02:00
|
|
|
signed char classDef; // Used by aliens to determine what they are
|
|
|
|
signed char AIType; // Type of articifial intelligence
|
|
|
|
|
|
|
|
signed char id; // The "job" of the object
|
2015-03-07 15:42:24 +01:00
|
|
|
object *target; // index target in aliens array
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
signed char reload[2];
|
|
|
|
|
|
|
|
int systemPower; // computer systems for craft
|
|
|
|
int shield; // current shield
|
|
|
|
int maxShield; // max shield (for recharging)
|
|
|
|
int deathCounter; // how long to explode for
|
|
|
|
|
|
|
|
signed char speed;
|
2015-03-17 18:03:20 +01:00
|
|
|
int damage; // Contact damage for bullets
|
2015-03-01 02:20:36 +01:00
|
|
|
unsigned char ammo[2]; // Ammo for 2nd weapon.
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-17 18:03:20 +01:00
|
|
|
int face; // Either 0 or 1
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
object *owner; // Who owns this object
|
|
|
|
|
|
|
|
int chance[2]; // Chance of using the weapons (out of 1000)
|
|
|
|
|
|
|
|
SDL_Surface *image[2]; // For facing left and right
|
|
|
|
unsigned char imageIndex[2]; // used for loading
|
|
|
|
signed char hit; // used to make a craft "flash" if it is struck by a shot
|
|
|
|
|
|
|
|
int engineX; // The place for the engine on the other side of the craft
|
|
|
|
int engineY; // The middle of the engine on the craft
|
|
|
|
|
|
|
|
int thinktime; // When the object will next react
|
|
|
|
signed char weaponType[2]; // Weapon types
|
|
|
|
|
|
|
|
signed char collectChance; // Chance of dropping the object
|
|
|
|
signed char collectType; // What the object is carrying
|
Several adjustments for difficulty purposes.
Started out adjusting prices, then ended up doing other things
while testing. Committing this now before I start doing other
random stuff!
But all of the changes are related to balancing difficulty, mostly
with prices, except for a couple bugfixes in the shop. Most notably:
* Ammo now costs $10, not $50. You no longer have to worry about
saving ammo quite as much as a result.
* Plasma upgrades' cost is now calculated differently, and the result
is slightly lower prices than before.
* Easy mode now grants the player more max ammo than other difficulties.
* Increasing max plasma ammo now costs less at the start, and increases
in cost faster.
* You increase max plasma ammo by 25 at a time, not 10. (10 was just too
small of a number.)
* Destroying enemy ships no longer gives you money. I found that, even
in hard mode, I had *way* too much money coming in, and this cuts it
down substantially. It also makes the shield bonus at the end of missions
much more significant. To compensate for the loss of massive bonuses
bosses used to give, these bosses now drop a lot more stuff.
* Kline has decreased health in his first encounter, and increased health
in his last two encounters (the numbers have been reversed).
2015-03-07 18:19:35 +01:00
|
|
|
unsigned int collectValue; // What it is worth
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
int flags; // Various flags for an object
|
|
|
|
|
|
|
|
float x, y, dx, dy;
|
|
|
|
|
|
|
|
object *next;
|
|
|
|
|
2011-08-24 14:32:45 +02:00
|
|
|
};
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-08-24 14:32:45 +02:00
|
|
|
struct mission {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
char primaryObjective[3][50]; // Description
|
|
|
|
signed char primaryType[3]; // The type of mission this is
|
2015-03-07 15:42:24 +01:00
|
|
|
signed char target1[3]; // index of target in aliens array
|
2011-08-24 14:14:44 +02:00
|
|
|
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
|
2015-03-07 15:42:24 +01:00
|
|
|
signed char target2[3]; // index of target in aliens array
|
2011-08-24 14:14:44 +02:00
|
|
|
int targetValue2[3]; // Number of things to collect (slaves, cash, etc)
|
|
|
|
signed char timeLimit2[3]; // In minutes
|
|
|
|
int completed2[3];
|
|
|
|
|
|
|
|
signed char remainingObjectives1;
|
|
|
|
signed char remainingObjectives2;
|
|
|
|
int addAliens; // How often to add new enemies
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2011-08-24 14:32:45 +02:00
|
|
|
struct Star {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
float x, y, dx, dy;
|
|
|
|
signed char speed; // How fast the star moves
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2011-08-24 14:32:45 +02:00
|
|
|
struct collectables {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-08-26 16:14:58 +02:00
|
|
|
bool active;
|
2011-08-24 14:14:44 +02:00
|
|
|
float x, y, dx, dy;
|
|
|
|
SDL_Surface *image;
|
|
|
|
signed char type; // What kind of collectable is it?
|
|
|
|
unsigned char value; // How much is it worth?
|
|
|
|
int life; // How long it will stay around for
|
|
|
|
|
|
|
|
collectables *next;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2011-08-24 14:32:45 +02:00
|
|
|
struct textObject {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
SDL_Surface *image;
|
|
|
|
unsigned char life;
|
|
|
|
float x, y;
|
|
|
|
signed char fontColor;
|
|
|
|
char text[255];
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2011-08-24 14:32:45 +02:00
|
|
|
struct Game {
|
2011-08-24 14:14:44 +02:00
|
|
|
object thePlayer;
|
|
|
|
object playerWeapon;
|
|
|
|
|
|
|
|
unsigned char system;
|
|
|
|
unsigned char area;
|
|
|
|
unsigned char musicVolume;
|
|
|
|
unsigned char sfxVolume;
|
|
|
|
|
2012-12-09 16:11:55 +01:00
|
|
|
signed char saveFormat;
|
|
|
|
signed char difficulty;
|
2011-08-26 22:48:52 +02:00
|
|
|
|
2011-08-24 14:14:44 +02:00
|
|
|
unsigned int cash;
|
|
|
|
unsigned int cashEarned;
|
|
|
|
unsigned int shots;
|
|
|
|
unsigned int hits;
|
|
|
|
unsigned char accuracy;
|
|
|
|
unsigned char hasWingMate1, hasWingMate2;
|
|
|
|
unsigned int totalKills, wingMate1Kills, wingMate2Kills;
|
|
|
|
unsigned char wingMate1Ejects, wingMate2Ejects;
|
|
|
|
unsigned int totalOtherKills;
|
|
|
|
unsigned char secondaryMissions, secondaryMissionsCompleted;
|
|
|
|
unsigned int shieldPickups, rocketPickups, cellPickups, powerups, minesKilled, cargoPickups;
|
|
|
|
|
|
|
|
// slaves for Eyananth
|
|
|
|
unsigned int slavesRescued;
|
|
|
|
|
|
|
|
// remaining shield for experimental fighter
|
|
|
|
unsigned int experimentalShield;
|
|
|
|
|
|
|
|
unsigned int timeTaken; // In seconds
|
|
|
|
unsigned char missionCompleted[10];
|
|
|
|
|
|
|
|
signed char stationedPlanet;
|
|
|
|
signed char destinationPlanet;
|
|
|
|
|
|
|
|
char stationedName[20];
|
|
|
|
char destinationName[20];
|
|
|
|
int distanceCovered;
|
|
|
|
|
2011-09-11 21:57:57 +02:00
|
|
|
unsigned char minPlasmaRate;
|
|
|
|
unsigned char minPlasmaDamage;
|
|
|
|
unsigned char minPlasmaOutput;
|
2011-08-24 14:14:44 +02:00
|
|
|
unsigned char maxPlasmaRate;
|
|
|
|
unsigned char maxPlasmaDamage;
|
|
|
|
unsigned char maxPlasmaOutput;
|
|
|
|
unsigned char maxPlasmaAmmo;
|
|
|
|
unsigned char maxRocketAmmo;
|
|
|
|
|
2015-03-06 18:36:02 +01:00
|
|
|
// Limits on shop upgrades
|
|
|
|
unsigned char minPlasmaRateLimit;
|
|
|
|
unsigned char minPlasmaDamageLimit;
|
|
|
|
unsigned char minPlasmaOutputLimit;
|
|
|
|
unsigned char maxPlasmaRateLimit;
|
|
|
|
unsigned char maxPlasmaDamageLimit;
|
|
|
|
unsigned char maxPlasmaOutputLimit;
|
|
|
|
unsigned char maxPlasmaAmmoLimit;
|
|
|
|
unsigned char maxRocketAmmoLimit;
|
2012-12-09 16:11:55 +01:00
|
|
|
|
2011-08-24 14:14:44 +02:00
|
|
|
};
|
|
|
|
|
2011-08-24 14:32:45 +02:00
|
|
|
struct ShopItem {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
int x, y;
|
|
|
|
unsigned int price;
|
|
|
|
char name[50];
|
|
|
|
char description[255];
|
|
|
|
unsigned char image;
|
|
|
|
};
|
|
|
|
|
2011-08-24 14:32:45 +02:00
|
|
|
struct bRect {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
int x, y, w, h;
|
|
|
|
bRect *next;
|
|
|
|
|
2011-08-24 14:32:45 +02:00
|
|
|
};
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-08-24 14:32:45 +02:00
|
|
|
struct Planet {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
int y;
|
|
|
|
char name[50];
|
|
|
|
SDL_Surface *image;
|
|
|
|
|
|
|
|
signed char missionNumber; // associated mission number
|
|
|
|
signed char missionCompleted; // whether it has been completed
|
|
|
|
|
|
|
|
signed char messageMission;
|
|
|
|
signed char messageSlot;
|
|
|
|
signed char faceImage;
|
|
|
|
char from[50];
|
|
|
|
char subject[100];
|
|
|
|
};
|
|
|
|
|
2013-09-30 16:52:43 +02:00
|
|
|
enum keys {
|
|
|
|
KEY_UP,
|
|
|
|
KEY_DOWN,
|
|
|
|
KEY_LEFT,
|
|
|
|
KEY_RIGHT,
|
|
|
|
KEY_FIRE,
|
|
|
|
KEY_ALTFIRE,
|
|
|
|
KEY_SWITCH,
|
|
|
|
KEY_PAUSE,
|
|
|
|
KEY_ESCAPE,
|
|
|
|
KEY_FULLSCREEN,
|
|
|
|
KEY_DUMMY,
|
|
|
|
KEY_LAST
|
|
|
|
};
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-08-24 14:32:45 +02:00
|
|
|
struct globalEngineVariables {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
SDL_Event event;
|
|
|
|
signed char done;
|
|
|
|
|
|
|
|
SDL_RWops *sdlrw;
|
|
|
|
|
|
|
|
float musicVolume;
|
|
|
|
|
|
|
|
signed char maxAliens;
|
|
|
|
|
|
|
|
float ssx;
|
|
|
|
float ssy;
|
2015-02-27 05:23:08 +01:00
|
|
|
float smx;
|
|
|
|
float smy;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
object *bulletHead;
|
|
|
|
object *bulletTail;
|
|
|
|
object *explosionHead;
|
|
|
|
object *explosionTail;
|
|
|
|
collectables *collectableHead;
|
|
|
|
collectables *collectableTail;
|
|
|
|
object *debrisHead;
|
|
|
|
object *debrisTail;
|
|
|
|
|
|
|
|
int cursor_x, cursor_y;
|
|
|
|
|
|
|
|
signed char commsSection;
|
|
|
|
|
|
|
|
signed char eventTimer;
|
|
|
|
|
|
|
|
signed char lowShield;
|
|
|
|
signed char averageShield;
|
|
|
|
|
|
|
|
float targetShield;
|
|
|
|
signed char targetIndex;
|
|
|
|
|
|
|
|
// Mission completion timer (allows for 4 seconds before leaving sector)
|
|
|
|
unsigned long missionCompleteTimer;
|
|
|
|
|
|
|
|
// Times the mission normally
|
|
|
|
unsigned int counter2;
|
|
|
|
int timeTaken; // In seconds
|
|
|
|
|
|
|
|
// For missions with a time limit
|
|
|
|
signed char timeMission;
|
|
|
|
unsigned int counter;
|
|
|
|
signed char seconds;
|
|
|
|
signed char minutes;
|
|
|
|
|
|
|
|
// Mission Related stuff
|
|
|
|
signed char allAliensDead;
|
|
|
|
int addAliens;
|
|
|
|
|
2011-08-26 16:14:58 +02:00
|
|
|
bool paused;
|
2011-08-24 14:14:44 +02:00
|
|
|
signed char gameSection;
|
|
|
|
|
2011-08-26 16:14:58 +02:00
|
|
|
bool useAudio;
|
2011-08-26 22:48:52 +02:00
|
|
|
bool useSound;
|
|
|
|
bool useMusic;
|
|
|
|
bool fullScreen;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
char userHomeDirectory[1024];
|
|
|
|
|
2013-09-30 16:52:43 +02:00
|
|
|
char keyState[KEY_LAST];
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-08-26 16:14:58 +02:00
|
|
|
bool cheat; // overall cheat
|
|
|
|
bool cheatShield;
|
|
|
|
bool cheatCash;
|
|
|
|
bool cheatAmmo;
|
|
|
|
bool cheatTime;
|
|
|
|
bool cheatCredits;
|
2011-08-24 14:14:44 +02:00
|
|
|
};
|
|
|
|
|
2011-08-24 14:32:45 +02:00
|
|
|
struct event {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
int time;
|
|
|
|
char message[255];
|
|
|
|
signed char face;
|
|
|
|
signed char entity;
|
|
|
|
int flag;
|
|
|
|
};
|
|
|
|
|
2011-08-24 14:32:45 +02:00
|
|
|
struct cutMsg {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
int face;
|
|
|
|
char message[255];
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2011-08-24 14:32:45 +02:00
|
|
|
struct devVariables {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
signed char moveAliens;
|
|
|
|
signed char fireAliens;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2015-03-04 15:11:04 +01:00
|
|
|
#endif
|