]> icculus.org git repositories - taylor/freespace2.git/blob - include/shockwave.h
Initial revision
[taylor/freespace2.git] / include / shockwave.h
1 /*
2  * $Logfile: /Freespace2/code/Weapon/Shockwave.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Header file for creating and managing shockwaves
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:12  root
11  * Initial revision
12  *
13  * 
14  * 7     8/27/99 1:34a Andsager
15  * Modify damage by shockwaves for BIG|HUGE ships.  Modify shockwave damge
16  * when weapon blows up.
17  * 
18  * 6     7/18/99 12:32p Dave
19  * Randomly oriented shockwaves.
20  * 
21  * 5     3/23/99 2:29p Andsager
22  * Fix shockwaves for kamikazi and Fred defined.  Collect together
23  * shockwave_create_info struct.
24  * 
25  * 4     2/26/99 4:14p Dave
26  * Put in the ability to have multiple shockwaves for ships.
27  * 
28  * 3     11/05/98 5:55p Dave
29  * Big pass at reducing #includes
30  * 
31  * 2     10/07/98 10:54a Dave
32  * Initial checkin.
33  * 
34  * 1     10/07/98 10:51a Dave
35  * 
36  * 11    4/15/98 10:17p Mike
37  * Training mission #5.
38  * Fix application of subsystem damage.
39  * 
40  * 10    2/26/98 10:08p Hoffoss
41  * Rewrote state saving and restoring to fix bugs and simplify the code.
42  * 
43  * 9     2/20/98 8:33p Lawrance
44  * Add function to query shockwave max radius
45  * 
46  * 8     2/14/98 4:43p Lawrance
47  * add shockwave_weapon_index() to interface
48  * 
49  * 7     2/02/98 8:47a Andsager
50  * Ship death area damage applied as instantaneous damage for small ships
51  * and shockwaves for large (>50 radius) ships.
52  * 
53  * 6     7/16/97 3:50p Lawrance
54  * render shockwaves first, to fake transparency
55  * 
56  * 5     7/16/97 2:52p Lawrance
57  * make shockwaves objects
58  * 
59  * 4     7/15/97 7:26p Lawrance
60  * make shockwave blast persist over time
61  * 
62  * 3     7/09/97 1:56p Lawrance
63  * add savegame support for shockwaves
64  * 
65  * 2     7/08/97 6:00p Lawrance
66  * implementing shockwaves
67  * 
68  * 1     7/08/97 1:30p Lawrance
69  *
70  * $NoKeywords: $
71  */
72
73 #ifndef __SHOCKWAVE_H__
74 #define __SHOCKWAVE_H__
75
76 #include "cfile.h"
77 #include "object.h"
78
79 #define SW_USED                         (1<<0)
80 #define SW_WEAPON                       (1<<1)
81 #define SW_SHIP_DEATH           (1<<2)
82 #define SW_WEAPON_KILL          (1<<3)  // Shockwave created when weapon destroyed by another
83
84 #define MAX_SHOCKWAVES                  16
85 #define MAX_SHOCKWAVE_TYPES     1
86 #define SW_MAX_OBJS_HIT 64
87
88 typedef struct shockwave_info
89 {
90         int     bitmap_id;
91         int     num_frames;
92         int     fps;
93 } shockwave_info;
94
95 typedef struct shockwave {
96         shockwave       *next, *prev;
97         int                     flags;
98         int                     objnum;                                 // index into Objects[] for shockwave
99         int                     num_objs_hit;
100         int                     obj_sig_hitlist[SW_MAX_OBJS_HIT];
101         float                   speed, radius;
102         float                   inner_radius, outer_radius, damage;
103         int                     weapon_info_index;      // -1 if shockwave not caused by weapon 
104         vector          pos;
105         float                   blast;                                  // amount of blast to apply
106         int                     next_blast;                             // timestamp for when to apply next blast damage
107         int                     shockwave_info_index;
108         int                     current_bitmap;
109         float                   time_elapsed;                   // in seconds
110         float                   total_time;                             // total lifetime of animation in seconds
111         int                     delay_stamp;                    // for delayed shockwaves
112         float                   rot_angle;
113 } shockwave;
114
115 typedef struct shockwave_create_info {
116         float inner_rad;
117         float outer_rad;
118         float damage;
119         float blast;
120         float speed;
121         float rot_angle;
122 } shockwave_create_info;
123
124 extern shockwave                        Shockwaves[MAX_SHOCKWAVES];
125 extern shockwave_info   Shockwave_info[MAX_SHOCKWAVE_TYPES];
126
127 void shockwave_close();
128 void shockwave_level_init();
129 void shockwave_level_close();
130 void shockwave_delete(object *objp);
131 void shockwave_move_all(float frametime);
132 int shockwave_create(int parent_objnum, vector *pos, shockwave_create_info *sci, int flag, int delay = -1);
133 void shockwave_render(object *objp);
134 int shockwave_weapon_index(int index);
135 float shockwave_max_radius(int index);
136
137 #endif /* __SHOCKWAVE_H__ */
138