1 /*
2 Copyright (C) 1994-1995 Apogee Software, Ltd.
3 
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 
13 See the GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18 
19 */
20 #ifndef _rt_game_public
21 #define _rt_game_public
22 
23 //***************************************************************************
24 //
25 // Public header for RT_GAME.C
26 //
27 //***************************************************************************
28 
29 #include "rt_actor.h"
30 #include "lumpy.h"
31 #include "rt_cfg.h"
32 #include "rt_playr.h"
33 
34 //***************************************************************************
35 //
36 // DEFINES
37 //
38 //***************************************************************************
39 
40 #define  MaxHighName 57
41 #define  MaxScores   7
42 
43 
44 //***************************************************************************
45 //
46 // TYPEDEFS
47 //
48 //***************************************************************************
49 
50 typedef struct
51 {
52    char  message[30];
53    byte  episode;
54    byte  area;
55    byte  version;
56    byte  picture[16000];
57    word  mapcrc;
58    AlternateInformation info;
59 } gamestorage_t;
60 
61 typedef  struct
62 {
63 	char  name[MaxHighName + 1];
64 	long  score;
65 	word  completed,episode;
66 } HighScore;
67 
68 
69 //***************************************************************************
70 //
71 // GLOBALS
72 //
73 //***************************************************************************
74 
75 extern int PlayerSnds[5];
76 
77 extern int SHAKETICS;
78 extern int damagecount;
79 
80 extern HighScore   Scores[MaxScores];
81 extern int SaveTime;
82 
83 //***************************************************************************
84 //
85 // PROTOTYPES
86 //
87 //***************************************************************************
88 
89 void SetupPlayScreen (void);
90 void SD_PreCache (void);
91 void GameMemToScreen( pic_t *source, int x, int y, int bufferofsonly );
92 void DrawPlayScreen (boolean bufferofsonly);
93 
94 void DrawKills (boolean bufferofsonly);
95 void DrawPlayers ( void );
96 void DrawGameString (int x, int y, char * str, boolean bufferofsonly);
97 void DrawNumber (int x, int y, int width, int which, boolean bufferofsonly);
98 void TakeDamage (int points, objtype *attacker);
99 void HealPlayer (int points, objtype * ob);
100 void DrawLives (boolean bufferofsonly);
101 void GiveExtraMan (void);
102 void DrawScore (boolean bufferofsonly);
103 void GivePoints (long points);
104 void DrawKeys (boolean bufferofsonly);
105 void GiveKey (int key);
106 void GiveWeapon (objtype * ob, int weapon);
107 void GiveMissileWeapon(objtype * ob, int which);
108 void GiveLives (int newlives);
109 
110 void UpdateScore (unsigned int num);
111 void UpdateLives (int num);
112 
113 void DrawTimeXY( int x, int y, int sec, boolean bufferofsonly );
114 void DrawTime (boolean bufferofsonly);
115 
116 boolean SaveTheGame (int num, gamestorage_t * game);
117 boolean LoadTheGame (int num, gamestorage_t * game);
118 void GetSavedMessage (int num, char * message);
119 void GetSavedHeader (int num, gamestorage_t * game);
120 
121 void DrawHighScores (void);
122 void CheckHighScore (long score, word other, boolean INMENU);
123 void LevelCompleted ( exit_t playstate );
124 void BattleLevelCompleted ( int localplayer );
125 void Died (void);
126 void ScreenShake (void);
127 void UpdateTriads (objtype * ob, int num);
128 void DrawTriads (boolean bufferofsonly);
129 void DrawStats (void);
130 void DrawBarHealth (boolean bufferonly);
131 void DrawBarAmmo (boolean bufferonly);
132 void GM_DrawBonus (int which);
133 
134 void DrawEpisodeLevel ( int x, int y );
135 void DoBorderShifts (void);
136 void GM_UpdateBonus (int time, int powerup);
137 void DoLoadGameAction (void);
138 int GetLevel (int episode, int mapon);
139 void DrawPause (void);
140 void DrawPauseXY (int x, int y);
141 
142 void DrawColoredMPPic (int xpos, int ypos, int width, int height, int heightmod, byte *src, boolean bufferofsonly, int color);
143 void StatusDrawColoredPic (unsigned x, unsigned y, pic_t *nums, boolean bufferofsonly, int color);
144 
145 void ClearTriads (playertype * pstate);
146 #endif
147