]> icculus.org git repositories - btb/d2x.git/blob - main/powerup.h
build dumpmine.c for editor
[btb/d2x.git] / main / powerup.h
1 /* $Id: powerup.h,v 1.5 2004-08-28 23:17:45 schaffner 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  */
20
21
22 #ifndef _POWERUP_H
23 #define _POWERUP_H
24
25 #include "vclip.h"
26
27 #define POW_EXTRA_LIFE          0
28 #define POW_ENERGY              1
29 #define POW_SHIELD_BOOST        2
30 #define POW_LASER               3
31
32 #define POW_KEY_BLUE            4
33 #define POW_KEY_RED             5
34 #define POW_KEY_GOLD            6
35
36 //#define POW_RADAR_ROBOTS        7
37 //#define POW_RADAR_POWERUPS      8
38
39 #define POW_MISSILE_1           10
40 #define POW_MISSILE_4           11      // 4-pack MUST follow single missile
41
42 #define POW_QUAD_FIRE           12
43
44 #define POW_VULCAN_WEAPON       13
45 #define POW_SPREADFIRE_WEAPON   14
46 #define POW_PLASMA_WEAPON       15
47 #define POW_FUSION_WEAPON       16
48 #define POW_PROXIMITY_WEAPON    17
49 #define POW_SMARTBOMB_WEAPON    20
50 #define POW_MEGA_WEAPON         21
51 #define POW_VULCAN_AMMO         22
52 #define POW_HOMING_AMMO_1       18
53 #define POW_HOMING_AMMO_4       19      // 4-pack MUST follow single missile
54 #define POW_CLOAK               23
55 #define POW_TURBO               24
56 #define POW_INVULNERABILITY     25
57 #define POW_MEGAWOW             27
58
59 #define POW_GAUSS_WEAPON        28
60 #define POW_HELIX_WEAPON        29
61 #define POW_PHOENIX_WEAPON      30
62 #define POW_OMEGA_WEAPON        31
63
64 #define POW_SUPER_LASER         32
65 #define POW_FULL_MAP            33
66 #define POW_CONVERTER           34
67 #define POW_AMMO_RACK           35
68 #define POW_AFTERBURNER         36
69 #define POW_HEADLIGHT           37
70
71 #define POW_SMISSILE1_1         38
72 #define POW_SMISSILE1_4         39      // 4-pack MUST follow single missile
73 #define POW_GUIDED_MISSILE_1    40
74 #define POW_GUIDED_MISSILE_4    41      // 4-pack MUST follow single missile
75 #define POW_SMART_MINE          42
76 #define POW_MERCURY_MISSILE_1   43
77 #define POW_MERCURY_MISSILE_4   44      // 4-pack MUST follow single missile
78 #define POW_EARTHSHAKER_MISSILE 45
79
80 #define POW_FLAG_BLUE           46
81 #define POW_FLAG_RED            47
82
83 #define POW_HOARD_ORB           7       // use unused slot
84
85
86 #define VULCAN_AMMO_MAX             (392*4)
87 #define VULCAN_WEAPON_AMMO_AMOUNT   196
88 #define VULCAN_AMMO_AMOUNT          (49*2)
89
90 #define GAUSS_WEAPON_AMMO_AMOUNT    392
91
92 #define MAX_POWERUP_TYPES   50
93
94 #define POWERUP_NAME_LENGTH 16      // Length of a robot or powerup name.
95 extern char Powerup_names[MAX_POWERUP_TYPES][POWERUP_NAME_LENGTH];
96
97 extern int Headlight_active_default;    // is headlight on when picked up?
98
99 typedef struct powerup_type_info {
100         int vclip_num;
101         int hit_sound;
102         fix size;       // 3d size of longest dimension
103         fix light;      // amount of light cast by this powerup, set in bitmaps.tbl
104 } __pack__ powerup_type_info;
105
106 extern int N_powerup_types;
107 extern powerup_type_info Powerup_info[MAX_POWERUP_TYPES];
108
109 void draw_powerup(object *obj);
110
111 //returns true if powerup consumed
112 int do_powerup(object *obj);
113
114 //process (animate) a powerup for one frame
115 void do_powerup_frame(object *obj);
116
117 // Diminish shields and energy towards max in case they exceeded it.
118 extern void diminish_towards_max(void);
119
120 extern void do_megawow_powerup(int quantity);
121
122 extern void powerup_basic(int redadd, int greenadd, int blueadd, int score, char *format, ...);
123
124 #ifdef FAST_FILE_IO
125 #define powerup_type_info_read_n(pti, n, fp) cfread(pti, sizeof(powerup_type_info), n, fp)
126 #else
127 /*
128  * reads n powerup_type_info structs from a CFILE
129  */
130 extern int powerup_type_info_read_n(powerup_type_info *pti, int n, CFILE *fp);
131 #endif
132
133 #endif /* _POWERUP_H */