]> icculus.org git repositories - btb/d2x.git/blob - main/powerup.h
Visual C, PocketPC fixes
[btb/d2x.git] / main / powerup.h
1 /* $Id: powerup.h,v 1.4 2003-10-10 09:36:35 btb Exp $ */
2 /*
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
13 */
14
15 /*
16  *
17  * Powerup header file.
18  *
19  * Old Log:
20  * Revision 1.1  1995/05/16  16:01:35  allender
21  * Initial revision
22  *
23  * Revision 2.0  1995/02/27  11:27:35  john
24  * New version 2.0, which has no anonymous unions, builds with
25  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
26  *
27  * Revision 1.34  1995/02/06  15:52:37  mike
28  * add mini megawow powerup for giving reasonable weapons.
29  *
30  * Revision 1.33  1995/01/30  17:14:11  mike
31  * halve rate of vulcan ammo consumption.
32  *
33  * Revision 1.32  1995/01/15  20:47:56  mike
34  * add lighting field to powerups.
35  *
36  * Revision 1.31  1994/12/12  21:39:58  matt
37  * Changed vulcan ammo: 10K max, 5K w/weapon, 1250 per powerup
38  *
39  * Revision 1.30  1994/12/07  12:55:26  mike
40  * tweak vulcan amounts.
41  *
42  * Revision 1.29  1994/12/02  20:06:46  matt
43  * Made vulcan ammo print at approx 25 times actual
44  *
45  * Revision 1.28  1994/10/26  15:56:27  yuan
46  * Made vulcan cannon give 100 ammo if it has less than that.
47  *
48  * Revision 1.27  1994/10/15  19:07:10  mike
49  * Define constants for amount of vulcan ammo per powerup.
50  *
51  * Revision 1.26  1994/09/26  13:29:38  matt
52  * Added extra life each 100,000 points, and show icons on HUD for num lives
53  *
54  * Revision 1.25  1994/09/22  19:00:25  mike
55  * Kill constants ENERGY_BOOST and SHIELD_BOOST: it's now difficulty level dependent.
56  *
57  * Revision 1.24  1994/09/20  19:46:11  mike
58  * Fix powerup number assignments.
59  *
60  * Revision 1.23  1994/09/02  11:53:34  mike
61  * Add the megawow powerup.  If you don't know about it, that's because it's a secret.
62  *
63  * Revision 1.22  1994/09/01  10:41:35  matt
64  * Sizes for powerups now specified in bitmaps.tbl; blob bitmaps now plot
65  * correctly if width & height of bitmap are different.
66  *
67  * Revision 1.21  1994/08/31  19:26:14  mike
68  * Start adding new pile of powerups.
69  *
70  * Revision 1.20  1994/08/25  17:56:08  matt
71  * Added quad laser powerup
72  *
73  * Revision 1.19  1994/08/18  15:11:50  mike
74  * missile powerups.
75  *
76  * Revision 1.18  1994/08/09  17:54:33  adam
77  * upped no. of powerup types
78  *
79  * Revision 1.17  1994/08/09  17:53:39  adam
80  * *** empty log message ***
81  *
82  * Revision 1.16  1994/07/27  19:44:16  mike
83  * Objects containing objects.
84  *
85  * Revision 1.15  1994/07/26  18:31:32  mike
86  * Move some constants here from eobject.c.
87  *
88  * Revision 1.14  1994/07/20  17:35:03  yuan
89  * Some minor bug fixes and new key gauges...
90  *
91  * Revision 1.13  1994/07/12  15:53:23  john
92  * *** empty log message ***
93  *
94  * Revision 1.12  1994/07/12  15:30:47  mike
95  * Prototype diminish_towards_max.
96  *
97  * Revision 1.11  1994/07/07  14:59:04  john
98  * Made radar powerups.
99  *
100  *
101  * Revision 1.10  1994/07/01  16:35:40  yuan
102  * Added key system
103  *
104  * Revision 1.9  1994/06/29  19:43:33  matt
105  * Made powerup animation not happen in render routine
106  *
107  * Revision 1.8  1994/06/21  18:54:03  matt
108  * Added support for powerups that don't get picked up if not needed, but this
109  * feature is commented out at the end of do_powerup(), since the physics gave
110  * me all sorts of problems, with the player getting stuck on a powerup.
111  *
112  * Revision 1.7  1994/06/08  18:16:32  john
113  * Bunch of new stuff that basically takes constants out of the code
114  * and puts them into bitmaps.tbl.
115  *
116  * Revision 1.6  1994/05/18  13:26:30  yuan
117  * *** empty log message ***
118  *
119  * Revision 1.5  1994/05/17  17:01:48  yuan
120  * Added constant for boosts.
121  *
122  * Revision 1.4  1994/04/06  14:42:50  yuan
123  * Adding new powerups.
124  *
125  * Revision 1.3  1994/04/01  14:36:59  yuan
126  * John's head is an extra life...
127  *
128  * Revision 1.2  1994/04/01  11:15:22  yuan
129  * Added multiple bitmap functionality to all objects...
130  * (hostages, powerups, lasers, etc.)
131  * Hostages and powerups are implemented in the object system,
132  * just need to finish function call to "affect" player.
133  *
134  * Revision 1.1  1994/03/31  17:01:43  yuan
135  * Initial revision
136  *
137  *
138  */
139
140
141 #ifndef _POWERUP_H
142 #define _POWERUP_H
143
144 #include "vclip.h"
145
146 #define POW_EXTRA_LIFE          0
147 #define POW_ENERGY              1
148 #define POW_SHIELD_BOOST        2
149 #define POW_LASER               3
150
151 #define POW_KEY_BLUE            4
152 #define POW_KEY_RED             5
153 #define POW_KEY_GOLD            6
154
155 //#define POW_RADAR_ROBOTS        7
156 //#define POW_RADAR_POWERUPS      8
157
158 #define POW_MISSILE_1           10
159 #define POW_MISSILE_4           11      // 4-pack MUST follow single missile
160
161 #define POW_QUAD_FIRE           12
162
163 #define POW_VULCAN_WEAPON       13
164 #define POW_SPREADFIRE_WEAPON   14
165 #define POW_PLASMA_WEAPON       15
166 #define POW_FUSION_WEAPON       16
167 #define POW_PROXIMITY_WEAPON    17
168 #define POW_SMARTBOMB_WEAPON    20
169 #define POW_MEGA_WEAPON         21
170 #define POW_VULCAN_AMMO         22
171 #define POW_HOMING_AMMO_1       18
172 #define POW_HOMING_AMMO_4       19      // 4-pack MUST follow single missile
173 #define POW_CLOAK               23
174 #define POW_TURBO               24
175 #define POW_INVULNERABILITY     25
176 #define POW_MEGAWOW             27
177
178 #define POW_GAUSS_WEAPON        28
179 #define POW_HELIX_WEAPON        29
180 #define POW_PHOENIX_WEAPON      30
181 #define POW_OMEGA_WEAPON        31
182
183 #define POW_SUPER_LASER         32
184 #define POW_FULL_MAP            33
185 #define POW_CONVERTER           34
186 #define POW_AMMO_RACK           35
187 #define POW_AFTERBURNER         36
188 #define POW_HEADLIGHT           37
189
190 #define POW_SMISSILE1_1         38
191 #define POW_SMISSILE1_4         39      // 4-pack MUST follow single missile
192 #define POW_GUIDED_MISSILE_1    40
193 #define POW_GUIDED_MISSILE_4    41      // 4-pack MUST follow single missile
194 #define POW_SMART_MINE          42
195 #define POW_MERCURY_MISSILE_1   43
196 #define POW_MERCURY_MISSILE_4   44      // 4-pack MUST follow single missile
197 #define POW_EARTHSHAKER_MISSILE 45
198
199 #define POW_FLAG_BLUE           46
200 #define POW_FLAG_RED            47
201
202 #define POW_HOARD_ORB           7       // use unused slot
203
204
205 #define VULCAN_AMMO_MAX             (392*4)
206 #define VULCAN_WEAPON_AMMO_AMOUNT   196
207 #define VULCAN_AMMO_AMOUNT          (49*2)
208
209 #define GAUSS_WEAPON_AMMO_AMOUNT    392
210
211 #define MAX_POWERUP_TYPES   50
212
213 #define POWERUP_NAME_LENGTH 16      // Length of a robot or powerup name.
214 extern char Powerup_names[MAX_POWERUP_TYPES][POWERUP_NAME_LENGTH];
215
216 extern int Headlight_active_default;    // is headlight on when picked up?
217
218 typedef struct powerup_type_info {
219         int vclip_num;
220         int hit_sound;
221         fix size;       // 3d size of longest dimension
222         fix light;      // amount of light cast by this powerup, set in bitmaps.tbl
223 } __pack__ powerup_type_info;
224
225 extern int N_powerup_types;
226 extern powerup_type_info Powerup_info[MAX_POWERUP_TYPES];
227
228 void draw_powerup(object *obj);
229
230 //returns true if powerup consumed
231 int do_powerup(object *obj);
232
233 //process (animate) a powerup for one frame
234 void do_powerup_frame(object *obj);
235
236 // Diminish shields and energy towards max in case they exceeded it.
237 extern void diminish_towards_max(void);
238
239 extern void do_megawow_powerup(int quantity);
240
241 extern void powerup_basic(int redadd, int greenadd, int blueadd, int score, char *format, ...);
242
243 #ifdef FAST_FILE_IO
244 #define powerup_type_info_read_n(pti, n, fp) cfread(pti, sizeof(powerup_type_info), n, fp)
245 #else
246 /*
247  * reads n powerup_type_info structs from a CFILE
248  */
249 extern int powerup_type_info_read_n(powerup_type_info *pti, int n, CFILE *fp);
250 #endif
251
252 #endif /* _POWERUP_H */