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