]> icculus.org git repositories - taylor/freespace2.git/blob - include/shockwave.h
embed standalone web in executable
[taylor/freespace2.git] / include / shockwave.h
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
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
6  * the source.
7  */
8
9 /*
10  * $Logfile: /Freespace2/code/Weapon/Shockwave.h $
11  * $Revision$
12  * $Date$
13  * $Author$
14  *
15  * Header file for creating and managing shockwaves
16  *
17  * $Log$
18  * Revision 1.2  2002/06/09 04:41:15  relnev
19  * added copyright header
20  *
21  * Revision 1.1.1.1  2002/05/03 03:28:12  root
22  * Initial import.
23  *
24  * 
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.
28  * 
29  * 6     7/18/99 12:32p Dave
30  * Randomly oriented shockwaves.
31  * 
32  * 5     3/23/99 2:29p Andsager
33  * Fix shockwaves for kamikazi and Fred defined.  Collect together
34  * shockwave_create_info struct.
35  * 
36  * 4     2/26/99 4:14p Dave
37  * Put in the ability to have multiple shockwaves for ships.
38  * 
39  * 3     11/05/98 5:55p Dave
40  * Big pass at reducing #includes
41  * 
42  * 2     10/07/98 10:54a Dave
43  * Initial checkin.
44  * 
45  * 1     10/07/98 10:51a Dave
46  * 
47  * 11    4/15/98 10:17p Mike
48  * Training mission #5.
49  * Fix application of subsystem damage.
50  * 
51  * 10    2/26/98 10:08p Hoffoss
52  * Rewrote state saving and restoring to fix bugs and simplify the code.
53  * 
54  * 9     2/20/98 8:33p Lawrance
55  * Add function to query shockwave max radius
56  * 
57  * 8     2/14/98 4:43p Lawrance
58  * add shockwave_weapon_index() to interface
59  * 
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.
63  * 
64  * 6     7/16/97 3:50p Lawrance
65  * render shockwaves first, to fake transparency
66  * 
67  * 5     7/16/97 2:52p Lawrance
68  * make shockwaves objects
69  * 
70  * 4     7/15/97 7:26p Lawrance
71  * make shockwave blast persist over time
72  * 
73  * 3     7/09/97 1:56p Lawrance
74  * add savegame support for shockwaves
75  * 
76  * 2     7/08/97 6:00p Lawrance
77  * implementing shockwaves
78  * 
79  * 1     7/08/97 1:30p Lawrance
80  *
81  * $NoKeywords: $
82  */
83
84 #ifndef __SHOCKWAVE_H__
85 #define __SHOCKWAVE_H__
86
87 #include "cfile.h"
88 #include "object.h"
89
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
94
95 #define MAX_SHOCKWAVES                  16
96 #define MAX_SHOCKWAVE_TYPES     1
97 #define SW_MAX_OBJS_HIT 64
98
99 typedef struct shockwave_info
100 {
101         int     bitmap_id;
102         int     num_frames;
103         int     fps;
104 } shockwave_info;
105
106 typedef struct shockwave {
107         shockwave       *next, *prev;
108         int                     flags;
109         int                     objnum;                                 // index into Objects[] for shockwave
110         int                     num_objs_hit;
111         int                     obj_sig_hitlist[SW_MAX_OBJS_HIT];
112         float                   speed, radius;
113         float                   inner_radius, outer_radius, damage;
114         int                     weapon_info_index;      // -1 if shockwave not caused by weapon 
115         vector          pos;
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;
119         int                     current_bitmap;
120         float                   time_elapsed;                   // in seconds
121         float                   total_time;                             // total lifetime of animation in seconds
122         int                     delay_stamp;                    // for delayed shockwaves
123         float                   rot_angle;
124 } shockwave;
125
126 typedef struct shockwave_create_info {
127         float inner_rad;
128         float outer_rad;
129         float damage;
130         float blast;
131         float speed;
132         float rot_angle;
133 } shockwave_create_info;
134
135 extern shockwave                        Shockwaves[MAX_SHOCKWAVES];
136 extern shockwave_info   Shockwave_info[MAX_SHOCKWAVE_TYPES];
137
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);
147
148 #endif /* __SHOCKWAVE_H__ */
149