]> icculus.org git repositories - btb/d2x.git/blob - main/fireball.h
use portable rand function (fixes #1118)
[btb/d2x.git] / main / fireball.h
1 /* $Id: fireball.h,v 1.2 2003-10-10 09:36:35 btb 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  * Header for fireball.c
18  *
19  * Old Log:
20  * Revision 1.1  1995/05/16  15:56:23  allender
21  * Initial revision
22  *
23  * Revision 2.0  1995/02/27  11:27:03  john
24  * New version 2.0, which has no anonymous unions, builds with
25  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
26  *
27  * Revision 1.13  1995/01/17  12:14:38  john
28  * Made walls, object explosion vclips load at level start.
29  *
30  * Revision 1.12  1995/01/13  15:41:52  rob
31  * Added prototype for maybe_replace_powerup_with_energy
32  *
33  * Revision 1.11  1994/11/17  16:28:36  rob
34  * Changed maybe_drop_cloak_powerup to maybe_drop_net_powerup (more
35  * generic and useful)
36  *
37  * Revision 1.10  1994/10/12  08:03:42  mike
38  * Prototype maybe_drop_cloak_powerup.
39  *
40  * Revision 1.9  1994/10/11  12:24:39  matt
41  * Cleaned up/change badass explosion calls
42  *
43  * Revision 1.8  1994/09/07  16:00:34  mike
44  * Add object pointer to parameter list of object_create_badass_explosion.
45  *
46  * Revision 1.7  1994/09/02  14:00:39  matt
47  * Simplified explode_object() & mutliple-stage explosions
48  *
49  * Revision 1.6  1994/08/17  16:49:58  john
50  * Added damaging fireballs, missiles.
51  *
52  * Revision 1.5  1994/07/14  22:39:19  matt
53  * Added exploding doors
54  *
55  * Revision 1.4  1994/06/08  10:56:36  matt
56  * Improved debris: now get submodel size from new POF files; debris now has
57  * limited life; debris can now be blown up.
58  *
59  * Revision 1.3  1994/04/01  13:35:44  matt
60  * Added multiple-stage explosions
61  *
62  * Revision 1.2  1994/02/17  11:33:32  matt
63  * Changes in object system
64  *
65  * Revision 1.1  1994/02/16  22:41:15  matt
66  * Initial revision
67  *
68  *
69  */
70
71
72 #ifndef _FIREBALL_H
73 #define _FIREBALL_H
74
75 // explosion types
76 #define ET_SPARKS       0   //little sparks, like when laser hits wall
77 #define ET_MULTI_START  1   //first part of multi-part explosion
78 #define ET_MULTI_SECOND 2   //second part of multi-part explosion
79
80 // data for exploding walls (such as hostage door)
81 typedef struct expl_wall {
82         int segnum,sidenum;
83         fix time;
84 } expl_wall;
85
86 #define MAX_EXPLODING_WALLS     10
87
88 extern expl_wall expl_wall_list[MAX_EXPLODING_WALLS];
89
90 object *object_create_explosion(short segnum, vms_vector *position, fix size, int vclip_type);
91 object *object_create_muzzle_flash(short segnum, vms_vector *position, fix size, int vclip_type);
92
93 object *object_create_badass_explosion(object *objp, short segnum,
94                 vms_vector *position, fix size, int vclip_type,
95                 fix maxdamage, fix maxdistance, fix maxforce, int parent);
96
97 // blows up a badass weapon, creating the badass explosion
98 // return the explosion object
99 object *explode_badass_weapon(object *obj,vms_vector *pos);
100
101 // blows up the player with a badass explosion
102 // return the explosion object
103 object *explode_badass_player(object *obj);
104
105 void explode_object(object *obj,fix delay_time);
106 void do_explosion_sequence(object *obj);
107 void do_debris_frame(object *obj);      // deal with debris for this frame
108
109 void draw_fireball(object *obj);
110
111 void explode_wall(int segnum, int sidenum);
112 void do_exploding_wall_frame(void);
113 void init_exploding_walls(void);
114 extern void maybe_drop_net_powerup(int powerup_type);
115 extern void maybe_replace_powerup_with_energy(object *del_obj);
116
117 extern int get_explosion_vclip(object *obj, int stage);
118 extern int drop_powerup(int type, int id, int num, vms_vector *init_vel, vms_vector *pos, int segnum);
119
120 // creates afterburner blobs behind the specified object
121 void drop_afterburner_blobs(object *obj, int count, fix size_scale, fix lifetime);
122
123 #endif /* _FIREBALL_H */