1 /*
2 Copyright (C) 2003 Parallel Realities
3 Copyright (C) 2011 Guus Sliepen
4 Copyright (C) 2015-2020 The Diligent Circle <diligentcircle@riseup.net>
5 
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 3
9 of the License, or (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef GAME_H
21 #define GAME_H
22 
23 #include "SDL.h"
24 
25 #include "defs.h"
26 #include "structs.h"
27 
28 typedef struct Game_ {
29 	int saveFormat;
30 
31 	int difficulty;
32 
33 	int system;
34 	int area;
35 	int musicVolume;
36 	int sfxVolume;
37 
38 	int cash;
39 	int cashEarned;
40 
41 	int shots;
42 	int hits;
43 	int accuracy;
44 	int hasWingMate1;
45 	int hasWingMate2;
46 	int totalKills;
47 	int wingMate1Kills;
48 	int wingMate2Kills;
49 	int wingMate1Ejects;
50 	int wingMate2Ejects;
51 	int totalOtherKills;
52 	int secondaryMissions;
53 	int secondaryMissionsCompleted;
54 	int shieldPickups;
55 	int rocketPickups;
56 	int cellPickups;
57 	int powerups;
58 	int minesKilled;
59 	int cargoPickups;
60 
61 	// slaves for Eyananth
62 	int slavesRescued;
63 
64 	// remaining shield for experimental fighter
65 	int experimentalShield;
66 
67 	Uint32 timeTaken; // In seconds
68 	int missionCompleted[MAX_PLANETS];
69 
70 	int stationedPlanet;
71 	int destinationPlanet;
72 
73 	char stationedName[STRMAX_SHORT];
74 	char destinationName[STRMAX_SHORT];
75 	double distanceCovered;
76 
77 	int minPlasmaRate;
78 	int minPlasmaDamage;
79 	int minPlasmaOutput;
80 	int maxPlasmaRate;
81 	int maxPlasmaDamage;
82 	int maxPlasmaOutput;
83 	int maxPlasmaAmmo;
84 	int maxRocketAmmo;
85 
86 	// Limits on shop upgrades
87 	int minPlasmaRateLimit;
88 	int minPlasmaDamageLimit;
89 	int minPlasmaOutputLimit;
90 	int maxPlasmaRateLimit;
91 	int maxPlasmaDamageLimit;
92 	int maxPlasmaOutputLimit;
93 	int maxPlasmaAmmoLimit;
94 	int maxRocketAmmoLimit;
95 
96 } Game;
97 
98 extern Game game;
99 extern char game_systemNames[SYSTEM_MAX][STRMAX_SHORT];
100 
101 void game_init();
102 void game_setStars();
103 void game_doStars();
104 void game_doExplosions();
105 void game_delayFrame();
106 int game_collision(float x0, float y0, int w0, int h0, float x2, float y2, int w1, int h1);
107 void game_getDifficultyText(char *dest, int difficulty);
108 int game_mainLoop();
109 
110 #endif
111