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
|
2016-11-17 01:43:03 +01:00
|
|
|
Copyright (C) 2015, 2016 Julie Marchant <onpon4@riseup.net>
|
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
|
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
typedef struct object_ {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-11-19 17:43:50 +01:00
|
|
|
int active;
|
2015-03-24 23:51:12 +01:00
|
|
|
int classDef; // Used by aliens to determine what they are
|
|
|
|
int AIType; // Type of articifial intelligence
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-24 23:51:12 +01:00
|
|
|
int id; // The "job" of the object
|
2016-01-02 23:15:50 +01:00
|
|
|
struct object_ *target; // index target in aliens array
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-24 23:51:12 +01:00
|
|
|
int reload[2];
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
int systemPower; // computer systems for craft
|
|
|
|
int shield; // current shield
|
|
|
|
int maxShield; // max shield (for recharging)
|
|
|
|
int deathCounter; // how long to explode for
|
|
|
|
|
2015-03-24 23:51:12 +01:00
|
|
|
int speed;
|
2015-03-17 18:03:20 +01:00
|
|
|
int damage; // Contact damage for bullets
|
2015-03-24 23:51:12 +01:00
|
|
|
int 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
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
struct object_ *owner; // Who owns this object
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
int chance[2]; // Chance of using the weapons (out of 1000)
|
|
|
|
|
|
|
|
SDL_Surface *image[2]; // For facing left and right
|
2015-03-24 23:51:12 +01:00
|
|
|
int imageIndex[2]; // used for loading
|
|
|
|
int hit; // used to make a craft "flash" if it is struck by a shot
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
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
|
2015-03-24 23:51:12 +01:00
|
|
|
int weaponType[2]; // Weapon types
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-24 23:51:12 +01:00
|
|
|
int collectChance; // Chance of dropping the object
|
|
|
|
int collectType; // What the object is carrying
|
|
|
|
int collectValue; // What it is worth
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-31 19:02:09 +02:00
|
|
|
unsigned long int flags; // Various flags for an object
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
float x, y, dx, dy;
|
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
struct object_ *next;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
} object;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
typedef struct mission_ {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
char primaryObjective[3][50]; // Description
|
2015-03-24 23:51:12 +01:00
|
|
|
int primaryType[3]; // The type of mission this is
|
|
|
|
int 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)
|
2015-03-24 23:51:12 +01:00
|
|
|
int timeLimit1[3]; // In minutes
|
2011-08-24 14:14:44 +02:00
|
|
|
int completed1[3];
|
|
|
|
|
|
|
|
char secondaryObjective[3][50]; // Description
|
2015-03-24 23:51:12 +01:00
|
|
|
int secondaryType[3]; // The type of mission this is
|
|
|
|
int 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)
|
2015-03-24 23:51:12 +01:00
|
|
|
int timeLimit2[3]; // In minutes
|
2011-08-24 14:14:44 +02:00
|
|
|
int completed2[3];
|
|
|
|
|
2015-03-24 23:51:12 +01:00
|
|
|
int remainingObjectives1;
|
|
|
|
int remainingObjectives2;
|
2011-08-24 14:14:44 +02:00
|
|
|
int addAliens; // How often to add new enemies
|
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
} mission;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
typedef struct Star_ {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
float x, y, dx, dy;
|
2015-03-24 23:51:12 +01:00
|
|
|
int speed; // How fast the star moves
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
} Star;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
typedef struct collectables_ {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-11-19 17:43:50 +01:00
|
|
|
int active;
|
2011-08-24 14:14:44 +02:00
|
|
|
float x, y, dx, dy;
|
|
|
|
SDL_Surface *image;
|
2015-03-24 23:51:12 +01:00
|
|
|
int type; // What kind of collectable is it?
|
|
|
|
int value; // How much is it worth?
|
2011-08-24 14:14:44 +02:00
|
|
|
int life; // How long it will stay around for
|
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
struct collectables_ *next;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
} collectables;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
typedef struct textObject_ {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
SDL_Surface *image;
|
2015-03-24 23:51:12 +01:00
|
|
|
int life;
|
2011-08-24 14:14:44 +02:00
|
|
|
float x, y;
|
2015-03-24 23:51:12 +01:00
|
|
|
int fontColor;
|
2011-08-24 14:14:44 +02:00
|
|
|
char text[255];
|
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
} textObject;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
typedef struct Game_ {
|
2011-08-24 14:14:44 +02:00
|
|
|
object thePlayer;
|
|
|
|
object playerWeapon;
|
|
|
|
|
2015-03-31 21:23:17 +02:00
|
|
|
int saveFormat;
|
|
|
|
|
|
|
|
int difficulty;
|
|
|
|
|
2015-03-24 23:51:12 +01:00
|
|
|
int system;
|
|
|
|
int area;
|
|
|
|
int musicVolume;
|
|
|
|
int sfxVolume;
|
|
|
|
|
|
|
|
int cash;
|
|
|
|
int cashEarned;
|
|
|
|
|
|
|
|
int shots;
|
|
|
|
int hits;
|
|
|
|
int accuracy;
|
2015-03-31 21:23:17 +02:00
|
|
|
int hasWingMate1;
|
|
|
|
int hasWingMate2;
|
|
|
|
int totalKills;
|
|
|
|
int wingMate1Kills;
|
|
|
|
int wingMate2Kills;
|
|
|
|
int wingMate1Ejects;
|
|
|
|
int wingMate2Ejects;
|
2015-03-24 23:51:12 +01:00
|
|
|
int totalOtherKills;
|
2015-03-31 21:23:17 +02:00
|
|
|
int secondaryMissions;
|
|
|
|
int secondaryMissionsCompleted;
|
|
|
|
int shieldPickups;
|
|
|
|
int rocketPickups;
|
|
|
|
int cellPickups;
|
|
|
|
int powerups;
|
|
|
|
int minesKilled;
|
|
|
|
int cargoPickups;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
// slaves for Eyananth
|
2015-03-24 23:51:12 +01:00
|
|
|
int slavesRescued;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
// remaining shield for experimental fighter
|
2015-03-24 23:51:12 +01:00
|
|
|
int experimentalShield;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-01-12 20:52:24 +01:00
|
|
|
Uint32 timeTaken; // In seconds
|
2015-03-24 23:51:12 +01:00
|
|
|
int missionCompleted[10];
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-24 23:51:12 +01:00
|
|
|
int stationedPlanet;
|
|
|
|
int destinationPlanet;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
char stationedName[20];
|
|
|
|
char destinationName[20];
|
|
|
|
int distanceCovered;
|
|
|
|
|
2015-03-24 23:51:12 +01:00
|
|
|
int minPlasmaRate;
|
|
|
|
int minPlasmaDamage;
|
|
|
|
int minPlasmaOutput;
|
|
|
|
int maxPlasmaRate;
|
|
|
|
int maxPlasmaDamage;
|
|
|
|
int maxPlasmaOutput;
|
|
|
|
int maxPlasmaAmmo;
|
|
|
|
int maxRocketAmmo;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-06 18:36:02 +01:00
|
|
|
// Limits on shop upgrades
|
2015-03-24 23:51:12 +01:00
|
|
|
int minPlasmaRateLimit;
|
|
|
|
int minPlasmaDamageLimit;
|
|
|
|
int minPlasmaOutputLimit;
|
|
|
|
int maxPlasmaRateLimit;
|
|
|
|
int maxPlasmaDamageLimit;
|
|
|
|
int maxPlasmaOutputLimit;
|
|
|
|
int maxPlasmaAmmoLimit;
|
|
|
|
int maxRocketAmmoLimit;
|
2012-12-09 16:11:55 +01:00
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
} Game;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
typedef struct ShopItem_ {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
int x, y;
|
2015-03-24 23:51:12 +01:00
|
|
|
int price;
|
2011-08-24 14:14:44 +02:00
|
|
|
char name[50];
|
|
|
|
char description[255];
|
2015-03-24 23:51:12 +01:00
|
|
|
int image;
|
2016-01-02 23:37:19 +01:00
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
} ShopItem;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
typedef struct bRect_ {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
int x, y, w, h;
|
2016-01-02 23:15:50 +01:00
|
|
|
struct bRect_ *next;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
} bRect;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-01-02 23:15:50 +01:00
|
|
|
typedef struct Planet_ {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
int y;
|
|
|
|
char name[50];
|
|
|
|
SDL_Surface *image;
|
|
|
|
|
2015-03-24 23:51:12 +01:00
|
|
|
int missionNumber; // associated mission number
|
|
|
|
int missionCompleted; // whether it has been completed
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-24 23:51:12 +01:00
|
|
|
int messageMission;
|
|
|
|
int messageSlot;
|
|
|
|
int faceImage;
|
2011-08-24 14:14:44 +02:00
|
|
|
char from[50];
|
|
|
|
char subject[100];
|
|
|
|
|
2016-01-02 23:37:19 +01:00
|
|
|
} Planet;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-04 15:11:04 +01:00
|
|
|
#endif
|