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
|
2017-01-22 05:55:54 +01:00
|
|
|
Copyright (C) 2015-2017 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
|
|
|
|
|
2017-01-21 05:26:49 +01:00
|
|
|
#include "SDL.h"
|
|
|
|
|
2016-11-25 18:37:26 +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
|
|
|
|
2016-11-25 18:37:26 +01:00
|
|
|
int id; // The "job" of the Object
|
|
|
|
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-11-25 18:37:26 +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
|
|
|
|
|
2016-11-25 18:37:26 +01:00
|
|
|
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
|
|
|
|
2016-11-25 18:37:26 +01:00
|
|
|
int collectChance; // Chance of dropping the Object
|
|
|
|
int collectType; // What the Object is carrying
|
2015-03-24 23:51:12 +01:00
|
|
|
int collectValue; // What it is worth
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2019-05-21 19:17:07 +02:00
|
|
|
int collectTypeOriginal; // collectType in Classic difficulty
|
|
|
|
int collectValueOriginal; // collectValue in Classic difficulty
|
|
|
|
int score; // Classic difficulty only; money earned by killing
|
|
|
|
|
2016-11-25 18:37:26 +01:00
|
|
|
unsigned long int flags; // Various flags for an Object
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
float x, y, dx, dy;
|
|
|
|
|
2016-11-25 18:37:26 +01:00
|
|
|
struct Object_ *next;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-11-25 18:37:26 +01:00
|
|
|
} Object;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-11-26 00:35:25 +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-11-26 00:35:25 +01:00
|
|
|
} TextObject;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-11-26 00:41:55 +01:00
|
|
|
typedef struct LinkedRect_ {
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
int x, y, w, h;
|
2016-11-26 00:41:55 +01:00
|
|
|
struct LinkedRect_ *next;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2016-11-26 00:41:55 +01:00
|
|
|
} LinkedRect;
|
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
|
|
|
|
2016-11-26 06:36:33 +01:00
|
|
|
int dist;
|
2011-08-24 14:14:44 +02:00
|
|
|
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
|