FS2_Open
Open source remastering of the Freespace 2 engine
emp.h
Go to the documentation of this file.
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 the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef __FREESPACE_EMP_MISSILE_HEADER_FILE_
13 #define __FREESPACE_EMP_MISSILE_HEADER_FILE_
14 
15 // ----------------------------------------------------------------------------------------------------
16 // EMP EFFECT DEFINES/VARS
17 //
18 struct vec3d;
19 
20 // default EMP effect values for weapons which do not specify them
21 // NOTE : anything aboce intensity max or time max will be capped
22 #define EMP_INTENSITY_MAX (500.0f)
23 #define EMP_TIME_MAX (30.0f)
24 #define EMP_DEFAULT_INTENSITY (300.0f)
25 #define EMP_DEFAULT_TIME (10.0f)
26 
27 // for identifying specific text gauges when messing text up
28 #define NUM_TEXT_STAMPS 36
29 #define EG_NULL -1 // meaning, always make the string empty
30 #define EG_WEAPON_TITLE 0 // title bar of the weapon gauge
31 #define EG_WEAPON_P1 1 // first primary weapon slot
32 #define EG_WEAPON_P2 2 // second primary weapon slot
33 #define EG_WEAPON_P3 3 // third primary weapon slot
34 #define EG_WEAPON_S1 4 // first secondary weapon slot
35 #define EG_WEAPON_S2 5 // second secondary weapon slot
36 #define EG_ESCORT1 6 // first item on escort list
37 #define EG_ESCORT2 7 // second item on escort list
38 #define EG_ESCORT3 8 // third item on escort list
39 #define EG_OBJ_TITLE 9 // titlebar of the directives gauge
40 #define EG_OBJ1 10 // line 1 of the directives display
41 #define EG_OBJ2 11 // line 2
42 #define EG_OBJ3 12 // line 3
43 #define EG_OBJ4 13 // line 4
44 #define EG_OBJ5 14 // line 5
45 #define EG_TBOX_EXTRA1 15 // extra target info line 1
46 #define EG_TBOX_EXTRA2 16 // extra target info line 2
47 #define EG_TBOX_EXTRA3 17 // extra target info line 3
48 #define EG_TBOX_CLASS 18 // target class
49 #define EG_TBOX_DIST 20 // target dist
50 #define EG_TBOX_SPEED 21 // target speed
51 #define EG_TBOX_CARGO 22 // target cargo
52 #define EG_TBOX_HULL 23 // target hull
53 #define EG_TBOX_NAME 24 // target name
54 #define EG_TBOX_INTEG 25 // target integrity
55 #define EG_SQ1 26 // squadmsg 1
56 #define EG_SQ2 27 // squadmsg 2
57 #define EG_SQ3 28 // squadmsg 3
58 #define EG_SQ4 29 // squadmsg 4
59 #define EG_SQ5 30 // squadmsg 5
60 #define EG_SQ6 31 // squadmsg 6
61 #define EG_SQ7 32 // squadmsg 7
62 #define EG_SQ8 33 // squadmsg 8
63 #define EG_SQ9 34 // squadmsg 9
64 #define EG_SQ10 35 // squadmsg 10
65 
66 class object;
67 class ship;
68 struct weapon_info;
69 
70 
71 // ----------------------------------------------------------------------------------------------------
72 // EMP EFFECT FUNCTIONS
73 //
74 
75 // initialize the EMP effect for the mission
76 void emp_level_init();
77 
78 // apply the EMP effect to all relevant ships
79 void emp_apply(vec3d *pos, float inner_radius, float outer_radius, float emp_intensity, float emp_time, bool use_emp_time_for_capship_turrets = false);
80 
81 // start the emp effect for the passed ship (setup lightning arcs, timestamp, etc)
82 // NOTE : if this ship is also me, I should call emp_start_local() as well
83 void emp_start_ship(object *ship_obj, float intensity, float time);
84 
85 // process a ship for this frame
87 
88 // start the emp effect for MYSELF (intensity == arbitrary intensity variable, time == time the effect will last)
89 // NOTE : time should be in seconds
90 void emp_start_local(float intensity, float time);
91 
92 // stop the emp effect cold
93 void emp_stop_local();
94 
95 // if the EMP effect is active
96 int emp_active_local();
97 
98 // process some stuff every frame (before frame is rendered)
99 void emp_process_local();
100 
101 // randomly say yes or no to a gauge, if emp is not active, always say yes
103 
104 // emp hud string
105 void emp_hud_string(int x, int y, int gauge_id, const char *str, int resize_mode);
106 
107 // emp hud printf
108 void emp_hud_printf(int x, int y, int gauge_id, const char *format, ...);
109 
110 // throw some jitter into HUD x and y coords
111 void emp_hud_jitter(int *x, int *y);
112 
113 // current intensity of the EMP effect (0.0 - 1.0)
114 float emp_current_intensity();
115 
116 #endif
GLenum GLsizei GLenum format
Definition: Gl.h:1509
int emp_active_local()
Definition: emp.cpp:428
Definition: pstypes.h:88
float emp_current_intensity()
Definition: emp.cpp:634
void emp_hud_string(int x, int y, int gauge_id, const char *str, int resize_mode)
Definition: emp.cpp:468
int emp_should_blit_gauge()
Definition: emp.cpp:456
void emp_hud_jitter(int *x, int *y)
Definition: emp.cpp:621
float emp_intensity
Definition: weapon.h:445
void emp_level_init()
Definition: emp.cpp:88
ship * shipp
Definition: lua.cpp:9162
void emp_hud_printf(int x, int y, int gauge_id, const char *format,...)
Definition: emp.cpp:492
void emp_process_ship(ship *shipp)
Definition: emp.cpp:308
Definition: ship.h:534
GLint GLint GLint GLint GLint x
Definition: Glext.h:5182
Definition: object.h:141
float emp_time
Definition: weapon.h:446
void emp_process_local()
Definition: emp.cpp:434
void emp_start_local(float intensity, float time)
Definition: emp.cpp:375
void emp_apply(vec3d *pos, float inner_radius, float outer_radius, float emp_intensity, float emp_time, bool use_emp_time_for_capship_turrets=false)
Definition: emp.cpp:103
void emp_stop_local()
Definition: emp.cpp:420
hull_check pos
Definition: lua.cpp:5050
void emp_start_ship(object *ship_obj, float intensity, float time)
Definition: emp.cpp:264
GLint y
Definition: Gl.h:1505