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