2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/Weapon/Shockwave.h $
15 * Header file for creating and managing shockwaves
18 * Revision 1.2 2002/06/09 04:41:15 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:12 root
25 * 7 8/27/99 1:34a Andsager
26 * Modify damage by shockwaves for BIG|HUGE ships. Modify shockwave damge
27 * when weapon blows up.
29 * 6 7/18/99 12:32p Dave
30 * Randomly oriented shockwaves.
32 * 5 3/23/99 2:29p Andsager
33 * Fix shockwaves for kamikazi and Fred defined. Collect together
34 * shockwave_create_info struct.
36 * 4 2/26/99 4:14p Dave
37 * Put in the ability to have multiple shockwaves for ships.
39 * 3 11/05/98 5:55p Dave
40 * Big pass at reducing #includes
42 * 2 10/07/98 10:54a Dave
45 * 1 10/07/98 10:51a Dave
47 * 11 4/15/98 10:17p Mike
48 * Training mission #5.
49 * Fix application of subsystem damage.
51 * 10 2/26/98 10:08p Hoffoss
52 * Rewrote state saving and restoring to fix bugs and simplify the code.
54 * 9 2/20/98 8:33p Lawrance
55 * Add function to query shockwave max radius
57 * 8 2/14/98 4:43p Lawrance
58 * add shockwave_weapon_index() to interface
60 * 7 2/02/98 8:47a Andsager
61 * Ship death area damage applied as instantaneous damage for small ships
62 * and shockwaves for large (>50 radius) ships.
64 * 6 7/16/97 3:50p Lawrance
65 * render shockwaves first, to fake transparency
67 * 5 7/16/97 2:52p Lawrance
68 * make shockwaves objects
70 * 4 7/15/97 7:26p Lawrance
71 * make shockwave blast persist over time
73 * 3 7/09/97 1:56p Lawrance
74 * add savegame support for shockwaves
76 * 2 7/08/97 6:00p Lawrance
77 * implementing shockwaves
79 * 1 7/08/97 1:30p Lawrance
84 #ifndef __SHOCKWAVE_H__
85 #define __SHOCKWAVE_H__
90 #define SW_USED (1<<0)
91 #define SW_WEAPON (1<<1)
92 #define SW_SHIP_DEATH (1<<2)
93 #define SW_WEAPON_KILL (1<<3) // Shockwave created when weapon destroyed by another
95 #define MAX_SHOCKWAVES 16
96 #define MAX_SHOCKWAVE_TYPES 1
97 #define SW_MAX_OBJS_HIT 64
99 typedef struct shockwave_info
106 typedef struct shockwave {
107 shockwave *next, *prev;
109 int objnum; // index into Objects[] for shockwave
111 int obj_sig_hitlist[SW_MAX_OBJS_HIT];
113 float inner_radius, outer_radius, damage;
114 int weapon_info_index; // -1 if shockwave not caused by weapon
116 float blast; // amount of blast to apply
117 int next_blast; // timestamp for when to apply next blast damage
118 int shockwave_info_index;
120 float time_elapsed; // in seconds
121 float total_time; // total lifetime of animation in seconds
122 int delay_stamp; // for delayed shockwaves
126 typedef struct shockwave_create_info {
133 } shockwave_create_info;
135 extern shockwave Shockwaves[MAX_SHOCKWAVES];
136 extern shockwave_info Shockwave_info[MAX_SHOCKWAVE_TYPES];
138 void shockwave_close();
139 void shockwave_level_init();
140 void shockwave_level_close();
141 void shockwave_delete(object *objp);
142 void shockwave_move_all(float frametime);
143 int shockwave_create(int parent_objnum, vector *pos, shockwave_create_info *sci, int flag, int delay = -1);
144 void shockwave_render(object *objp);
145 int shockwave_weapon_index(int index);
146 float shockwave_max_radius(int index);
148 #endif /* __SHOCKWAVE_H__ */