starfighter/src/game.h

113 lines
2.4 KiB
C
Raw Normal View History

/*
Copyright (C) 2003 Parallel Realities
Copyright (C) 2011 Guus Sliepen
2019-05-22 00:47:32 +02:00
Copyright (C) 2015-2019 Julie Marchant <onpon4@riseup.net>
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
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.
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/>.
*/
#ifndef GAME_H
#define GAME_H
#include "SDL.h"
2016-11-26 00:21:31 +01:00
#include "defs.h"
#include "structs.h"
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
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
int missionCompleted[MAX_PLANETS];
int stationedPlanet;
int destinationPlanet;
char stationedName[20];
char destinationName[20];
2016-11-26 07:34:54 +01:00
double distanceCovered;
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;
extern Game game;
2019-06-07 06:18:24 +02:00
extern char game_systemNames[SYSTEM_MAX][STRMAX_SHORT];
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();
void game_delayFrame();
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);
int game_mainLoop();
#endif