2 * $Logfile: /Freespace2/code/Weapon/Shockwave.h $
7 * Header file for creating and managing shockwaves
10 * Revision 1.1 2002/05/03 03:28:12 root
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.
18 * 6 7/18/99 12:32p Dave
19 * Randomly oriented shockwaves.
21 * 5 3/23/99 2:29p Andsager
22 * Fix shockwaves for kamikazi and Fred defined. Collect together
23 * shockwave_create_info struct.
25 * 4 2/26/99 4:14p Dave
26 * Put in the ability to have multiple shockwaves for ships.
28 * 3 11/05/98 5:55p Dave
29 * Big pass at reducing #includes
31 * 2 10/07/98 10:54a Dave
34 * 1 10/07/98 10:51a Dave
36 * 11 4/15/98 10:17p Mike
37 * Training mission #5.
38 * Fix application of subsystem damage.
40 * 10 2/26/98 10:08p Hoffoss
41 * Rewrote state saving and restoring to fix bugs and simplify the code.
43 * 9 2/20/98 8:33p Lawrance
44 * Add function to query shockwave max radius
46 * 8 2/14/98 4:43p Lawrance
47 * add shockwave_weapon_index() to interface
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.
53 * 6 7/16/97 3:50p Lawrance
54 * render shockwaves first, to fake transparency
56 * 5 7/16/97 2:52p Lawrance
57 * make shockwaves objects
59 * 4 7/15/97 7:26p Lawrance
60 * make shockwave blast persist over time
62 * 3 7/09/97 1:56p Lawrance
63 * add savegame support for shockwaves
65 * 2 7/08/97 6:00p Lawrance
66 * implementing shockwaves
68 * 1 7/08/97 1:30p Lawrance
73 #ifndef __SHOCKWAVE_H__
74 #define __SHOCKWAVE_H__
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
84 #define MAX_SHOCKWAVES 16
85 #define MAX_SHOCKWAVE_TYPES 1
86 #define SW_MAX_OBJS_HIT 64
88 typedef struct shockwave_info
95 typedef struct shockwave {
96 shockwave *next, *prev;
98 int objnum; // index into Objects[] for shockwave
100 int obj_sig_hitlist[SW_MAX_OBJS_HIT];
102 float inner_radius, outer_radius, damage;
103 int weapon_info_index; // -1 if shockwave not caused by weapon
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;
109 float time_elapsed; // in seconds
110 float total_time; // total lifetime of animation in seconds
111 int delay_stamp; // for delayed shockwaves
115 typedef struct shockwave_create_info {
122 } shockwave_create_info;
124 extern shockwave Shockwaves[MAX_SHOCKWAVES];
125 extern shockwave_info Shockwave_info[MAX_SHOCKWAVE_TYPES];
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);
137 #endif /* __SHOCKWAVE_H__ */