2011-08-24 14:14:44 +02:00
|
|
|
/*
|
|
|
|
Copyright (C) 2003 Parallel Realities
|
2015-03-01 21:37:32 +01:00
|
|
|
Copyright (C) 2011 Guus Sliepen
|
2020-03-05 21:01:46 +01:00
|
|
|
Copyright (C) 2015-2019 Layla Marchant <diligentcircle@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 GAME_H
|
|
|
|
#define GAME_H
|
|
|
|
|
2016-11-26 00:35:25 +01:00
|
|
|
#include "SDL.h"
|
|
|
|
|
2016-11-26 00:21:31 +01:00
|
|
|
#include "defs.h"
|
|
|
|
#include "structs.h"
|
|
|
|
|
2016-11-26 00:35:25 +01:00
|
|
|
typedef struct Game_ {
|
|
|
|
Object thePlayer;
|
|
|
|
Object playerWeapon;
|
|
|
|
|
|
|
|
int saveFormat;
|
|
|
|
|
|
|
|
int difficulty;
|
|
|
|
|
|
|
|
int system;
|
|
|
|
int area;
|
|
|
|
int musicVolume;
|
|
|
|
int sfxVolume;
|
|
|
|
|
|
|
|
int cash;
|
|
|
|
int cashEarned;
|
2019-06-07 06:18:24 +02:00
|
|
|
|
2016-11-26 00:35:25 +01:00
|
|
|
int shots;
|
|
|
|
int hits;
|
|
|
|
int accuracy;
|
|
|
|
int hasWingMate1;
|
|
|
|
int hasWingMate2;
|
|
|
|
int totalKills;
|
|
|
|
int wingMate1Kills;
|
|
|
|
int wingMate2Kills;
|
|
|
|
int wingMate1Ejects;
|
|
|
|
int wingMate2Ejects;
|
|
|
|
int totalOtherKills;
|
|
|
|
int secondaryMissions;
|
|
|
|
int secondaryMissionsCompleted;
|
|
|
|
int shieldPickups;
|
|
|
|
int rocketPickups;
|
|
|
|
int cellPickups;
|
|
|
|
int powerups;
|
|
|
|
int minesKilled;
|
|
|
|
int cargoPickups;
|
|
|
|
|
|
|
|
// slaves for Eyananth
|
|
|
|
int slavesRescued;
|
|
|
|
|
|
|
|
// remaining shield for experimental fighter
|
|
|
|
int experimentalShield;
|
|
|
|
|
|
|
|
Uint32 timeTaken; // In seconds
|
2016-11-26 06:36:33 +01:00
|
|
|
int missionCompleted[MAX_PLANETS];
|
2016-11-26 00:35:25 +01:00
|
|
|
|
|
|
|
int stationedPlanet;
|
|
|
|
int destinationPlanet;
|
|
|
|
|
|
|
|
char stationedName[20];
|
|
|
|
char destinationName[20];
|
2016-11-26 07:34:54 +01:00
|
|
|
double distanceCovered;
|
2016-11-26 00:35:25 +01:00
|
|
|
|
|
|
|
int minPlasmaRate;
|
|
|
|
int minPlasmaDamage;
|
|
|
|
int minPlasmaOutput;
|
|
|
|
int maxPlasmaRate;
|
|
|
|
int maxPlasmaDamage;
|
|
|
|
int maxPlasmaOutput;
|
|
|
|
int maxPlasmaAmmo;
|
|
|
|
int maxRocketAmmo;
|
|
|
|
|
|
|
|
// Limits on shop upgrades
|
|
|
|
int minPlasmaRateLimit;
|
|
|
|
int minPlasmaDamageLimit;
|
|
|
|
int minPlasmaOutputLimit;
|
|
|
|
int maxPlasmaRateLimit;
|
|
|
|
int maxPlasmaDamageLimit;
|
|
|
|
int maxPlasmaOutputLimit;
|
|
|
|
int maxPlasmaAmmoLimit;
|
|
|
|
int maxRocketAmmoLimit;
|
|
|
|
|
|
|
|
} Game;
|
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
extern Game game;
|
2019-06-07 06:18:24 +02:00
|
|
|
extern char game_systemNames[SYSTEM_MAX][STRMAX_SHORT];
|
2011-08-26 21:29:04 +02:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
void game_init();
|
2015-06-20 17:58:37 +02:00
|
|
|
void game_doStars();
|
2015-05-01 00:51:26 +02:00
|
|
|
void game_doExplosions();
|
2015-11-07 03:35:07 +01:00
|
|
|
void game_delayFrame();
|
2016-11-19 17:43:50 +01:00
|
|
|
int game_collision(float x0, float y0, int w0, int h0, float x2, float y2, int w1, int h1);
|
2019-06-07 06:18:24 +02:00
|
|
|
void game_getDifficultyText(char *dest, int difficulty);
|
2015-05-21 01:41:43 +02:00
|
|
|
int game_mainLoop();
|
2015-03-04 15:11:04 +01:00
|
|
|
|
|
|
|
#endif
|