]> icculus.org git repositories - taylor/freespace2.git/blob - include/emp.h
More changes, took out a lot of the sound/* stuff which will bite later but
[taylor/freespace2.git] / include / emp.h
1 /*
2  * $Logfile: /Freespace2/code/Weapon/Emp.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Header file for managing corkscrew missiles
8  *
9  * $Log$
10  * Revision 1.2  2002/05/04 04:36:56  theoddone33
11  * More changes, took out a lot of the sound/* stuff which will bite later but
12  * I don't care.
13  *
14  * Revision 1.1.1.1  2002/05/03 03:28:12  root
15  * Initial import.
16  *
17  * 
18  * 4     7/02/99 4:31p Dave
19  * Much more sophisticated lightning support.
20  * 
21  * 3     1/08/99 2:08p Dave
22  * Fixed software rendering for pofview. Super early support for AWACS and
23  * beam weapons.
24  * 
25  * 2     10/07/98 10:54a Dave
26  * Initial checkin.
27  * 
28  * 1     10/07/98 10:51a Dave
29  * 
30  * 3     8/28/98 3:29p Dave
31  * EMP effect done. AI effects may need some tweaking as required.
32  * 
33  * 2     8/25/98 1:49p Dave
34  * First rev of EMP effect. Player side stuff basically done. Next comes
35  * AI code.
36  * 
37  * 1     8/24/98 9:29a Dave
38  *
39  * $NoKeywords: $
40  */
41
42 #ifndef __FREESPACE_EMP_MISSILE_HEADER_FILE_
43 #define __FREESPACE_EMP_MISSILE_HEADER_FILE_
44
45 #include "pstypes.h"
46 // ----------------------------------------------------------------------------------------------------
47 // EMP EFFECT DEFINES/VARS
48 //
49
50 // default EMP effect values for weapons which do not specify them
51 // NOTE : anything aboce intensity max or time max will be capped
52 #define EMP_INTENSITY_MAX                                               (500.0f)
53 #define EMP_TIME_MAX                                                            (30.0f)
54 #define EMP_DEFAULT_INTENSITY                                   (300.0f)
55 #define EMP_DEFAULT_TIME                                                (10.0f)
56
57 // for identifying specific text gauges when messing text up
58 #define NUM_TEXT_STAMPS                 36
59 #define EG_NULL                                 -1                              // meaning, always make the string empty
60 #define EG_WEAPON_TITLE                 0                               // title bar of the weapon gauge
61 #define EG_WEAPON_P1                            1                               // first primary weapon slot
62 #define EG_WEAPON_P2                            2                               // second primary weapon slot
63 #define EG_WEAPON_P3                            3                               // third primary weapon slot
64 #define EG_WEAPON_S1                            4                               // first secondary weapon slot
65 #define EG_WEAPON_S2                            5                               // second secondary weapon slot
66 #define EG_ESCORT1                              6                               // first item on escort list
67 #define EG_ESCORT2                              7                               // second item on escort list
68 #define EG_ESCORT3                              8                               // third item on escort list
69 #define EG_OBJ_TITLE                            9                               // titlebar of the directives gauge
70 #define EG_OBJ1                                 10                              // line 1 of the directives display
71 #define EG_OBJ2                                 11                              // line 2
72 #define EG_OBJ3                                 12                              // line 3
73 #define EG_OBJ4                                 13                              // line 4
74 #define EG_OBJ5                                 14                              // line 5
75 #define EG_TBOX_EXTRA1                  15                              // extra target info line 1
76 #define EG_TBOX_EXTRA2                  16                              // extra target info line 2
77 #define EG_TBOX_EXTRA3                  17                              // extra target info line 3
78 #define EG_TBOX_CLASS                   18                              // target class
79 #define EG_TBOX_DIST                            20                              // target dist
80 #define EG_TBOX_SPEED                   21                              // target speed
81 #define EG_TBOX_CARGO                   22                              // target cargo
82 #define EG_TBOX_HULL                            23                              // target hull
83 #define EG_TBOX_NAME                            24                              // target name
84 #define EG_TBOX_INTEG                   25                              // target integrity
85 #define EG_SQ1                                          26                              // squadmsg 1
86 #define EG_SQ2                                          27                              // squadmsg 2
87 #define EG_SQ3                                          28                              // squadmsg 3
88 #define EG_SQ4                                          29                              // squadmsg 4
89 #define EG_SQ5                                          30                              // squadmsg 5
90 #define EG_SQ6                                          31                              // squadmsg 6
91 #define EG_SQ7                                          32                              // squadmsg 7
92 #define EG_SQ8                                          33                              // squadmsg 8
93 #define EG_SQ9                                          34                              // squadmsg 9
94 #define EG_SQ10                                 35                              // squadmsg 10
95
96 struct object;
97 struct ship;
98 struct weapon_info;
99
100
101 // ----------------------------------------------------------------------------------------------------
102 // EMP EFFECT FUNCTIONS
103 //
104
105 // initialize the EMP effect for the mission
106 void emp_level_init();
107
108 // apply the EMP effect to all relevant ships
109 void emp_apply(vector *pos, float inner_radius, float outer_radius, float emp_intensity, float emp_time);
110
111 // start the emp effect for the passed ship (setup lightning arcs, timestamp, etc)
112 // NOTE : if this ship is also me, I should call emp_start_local() as well
113 void emp_start_ship(object *ship_obj, float intensity, float time);
114
115 // process a ship for this frame
116 void emp_process_ship(ship *shipp);
117
118 // start the emp effect for MYSELF (intensity == arbitrary intensity variable, time == time the effect will last)
119 // NOTE : time should be in seconds
120 void emp_start_local(float intensity, float time);
121
122 // stop the emp effect cold
123 void emp_stop_local();
124
125 // if the EMP effect is active
126 int emp_active_local();
127
128 // process some stuff every frame (before frame is rendered)
129 void emp_process_local();
130
131 // randomly say yes or no to a gauge, if emp is not active, always say yes
132 int emp_should_blit_gauge();
133
134 // emp hud string
135 void emp_hud_string(int x, int y, int gauge_id, char *str);
136
137 // emp hud printf
138 void emp_hud_printf(int x, int y, int gauge_id, char *format, ...);
139
140 // throw some jitter into HUD x and y coords
141 void emp_hud_jitter(int *x, int *y);
142
143 // current intensity of the EMP effect (0.0 - 1.0)
144 float emp_current_intensity();
145
146 #endif
147