FS2_Open
Open source remastering of the Freespace 2 engine
weapon.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 _WEAPON_H
13 #define _WEAPON_H
14 
15 #include "globalincs/globals.h"
16 #include "globalincs/systemvars.h"
17 #include "graphics/2d.h"
18 #include "graphics/generic.h"
19 #include "model/model.h"
20 #include "weapon/shockwave.h"
21 #include "weapon/trails.h"
22 
23 class object;
24 class ship_subsys;
25 
26 #define WP_UNUSED -1
27 #define WP_LASER 0 // PLEASE NOTE that this flag specifies ballistic primaries as well - Goober5000
28 #define WP_MISSILE 1
29 #define WP_BEAM 2
30 extern char *Weapon_subtype_names[];
31 extern int Num_weapon_subtypes;
32 
33 #define WRT_NONE -1
34 #define WRT_LASER 1
35 #define WRT_POF 2
36 
37 // Bitflags controlling weapon behavior
38 #define MAX_WEAPON_FLAGS 18 // Maximum number of different bit flags legal to specify in a single weapons.tbl Flags line
39 
40 #define WIF_DEFAULT_VALUE 0
41 #define WIF2_DEFAULT_VALUE 0
42 #define WIF3_DEFAULT_VALUE 0
43 
44 #define WIF_HOMING_HEAT (1 << 0) // if set, this weapon homes via seeking heat
45 #define WIF_HOMING_ASPECT (1 << 1) // if set, this weapon homes via chasing aspect
46 #define WIF_ELECTRONICS (1 << 2) // Takes out electronics systems.
47 #define WIF_SPAWN (1 << 3) // Spawns projectiles on detonation.
48 #define WIF_REMOTE (1 << 4) // Can be remotely detonated by parent.
49 #define WIF_PUNCTURE (1 << 5) // Punctures armor, damaging subsystems.
50 #define WIF_SUPERCAP (1 << 6) // This is a weapon which does supercap class damage (meaning, it applies real damage to supercap ships)
51 #define WIF_CMEASURE (1 << 7) // Weapon acts as a countermeasure
52 //#define WIF_AREA_EFFECT (1 << 7) // Explosion has an area effect
53 //#define WIF_SHOCKWAVE (1 << 8) // Explosion has a shockwave
54 //WMC - These are no longer needed so these spots are free
55 #define WIF_HOMING_JAVELIN (1 << 8) // WC Saga Javelin HS style heatseeker, locks only on target's engines
56 #define WIF_TURNS (1 << 9) // Set this if the weapon ever changes heading. If you
57  // don't set this and the weapon turns, collision detection
58  // won't work, I promise!
59 #define WIF_SWARM (1 << 10) // Missile "swarms".. ie changes heading and twists on way to target
60 #define WIF_TRAIL (1 << 11) // Has a trail
61 #define WIF_BIG_ONLY (1 << 12) // Only big ships (cruiser, capital, etc.) can arm this weapon
62 #define WIF_CHILD (1 << 13) // No ship can have this weapon. It gets created by weapon detonations.
63 #define WIF_BOMB (1 << 14) // Bomb-type missile, can be targeted
64 #define WIF_HUGE (1 << 15) // Huge damage (generally 500+), probably only fired at huge ships.
65 #define WIF_NO_DUMBFIRE (1 << 16) // Missile cannot be fired dumbfire (ie requires aspect lock)
66 #define WIF_THRUSTER (1 << 17) // Has thruster cone and/or glow
67 #define WIF_IN_TECH_DATABASE (1 << 18)
68 #define WIF_PLAYER_ALLOWED (1 << 19) // allowed to be on starting wing ships/in weaponry pool
69 #define WIF_BOMBER_PLUS (1 << 20) // Fire this missile only at a bomber or big ship. But not a fighter.
70 
71 #define WIF_CORKSCREW (1 << 21) // corkscrew style missile
72 #define WIF_PARTICLE_SPEW (1 << 22) // spews particles as it travels
73 #define WIF_EMP (1 << 23) // weapon explodes with a serious EMP effect
74 #define WIF_ENERGY_SUCK (1 << 24) // energy suck primary (impact effect)
75 #define WIF_FLAK (1 << 25) // use for big-ship turrets - flak gun
76 #define WIF_BEAM (1 << 26) // if this is a beam weapon : NOTE - VERY SPECIAL CASE
77 #define WIF_TAG (1 << 27) // this weapon has a tag effect when it hits
78 #define WIF_SHUDDER (1 << 28) // causes the weapon to shudder. shudder is proportional to the mass and damage of the weapon
79 #define WIF_LOCKARM (1 << 29) // if the missile was fired without a lock, it does significanlty less damage on impact
80 #define WIF_STREAM (1 << 30) // handled by "trigger down/trigger up" instead of "fire - wait - fire - wait"
81 // NOTE: the remaining WIF is reserved for a flag that truly needs to be in the WIF_ flag field,
82 // as opposed to any typical new flag that can be added to WIF3
83 
84 #define WIF2_BALLISTIC (1 << 0) // ballistic primaries - Goober5000
85 #define WIF2_PIERCE_SHIELDS (1 << 1) // shield pierceing -Bobboau
86 #define WIF2_DEFAULT_IN_TECH_DATABASE (1 << 2) // default in tech database - Goober5000
87 #define WIF2_LOCAL_SSM (1 << 3) // localized ssm. ship that fires ssm is in mission. ssms also warp back in during mission
88 #define WIF2_TAGGED_ONLY (1 << 4) // can only fire if target is tagged
89 #define WIF2_CYCLE (1 << 5) // will only fire from (shots (defalts to 1)) points at a time
90 #define WIF2_SMALL_ONLY (1 << 6) // can only be used against small ships like fighters or bombers
91 #define WIF2_SAME_TURRET_COOLDOWN (1 << 7) // the weapon has the same cooldown time on turrets
92 #define WIF2_MR_NO_LIGHTING (1 << 8) // don't render with lighting, regardless of user options
93 #define WIF2_TRANSPARENT (1 << 9) // render as transparent
94 #define WIF2_TRAINING (1 << 10) // Weapon does shield/hull damage, but doesn't hurt subsystems, whack you, or put marks on your ship.
95 #define WIF2_SMART_SPAWN (1 << 11) // Spawn weapon that is fired via turrets like normal weapons
96 #define WIF2_INHERIT_PARENT_TARGET (1 << 12) // child weapons home in on the target their parent is homing on.
97 #define WIF2_NO_EMP_KILL (1 << 13) // though weapon has hitpoints it can not be disabled by EMP
98 #define WIF2_VARIABLE_LEAD_HOMING (1 << 14) // allows user defined scaler to be added to lead (to enable, lead, pure or lag pursuit for missiles)
99 #define WIF2_UNTARGETED_HEAT_SEEKER (1 << 15) // forces heat seeker to lose target immeadiately (and acquire a random new one)
100 #define WIF2_HARD_TARGET_BOMB (1 << 16) // removes the radius doubling effect bombs have for collisions
101 #define WIF2_NON_SUBSYS_HOMING (1 << 17) // spreads fired missiles around the target ships hull
102 #define WIF2_NO_LIFE_LOST_IF_MISSED (1 << 18) // prevents game from shortening the lifeleft of the missed but still homing missiles
103 #define WIF2_CUSTOM_SEEKER_STR (1 << 19) // sets the game to use custom seeker strengths instead of default values
104 #define WIF2_CAN_BE_TARGETED (1 << 20) // allows non-bomb weapons to be targeted
105 #define WIF2_SHOWN_ON_RADAR (1 << 21) // allows non-bombs be visible on radar
106 #define WIF2_SHOW_FRIENDLY (1 << 22) // allows friendly weapon radar dots be drawn
107 #define WIF2_CAPITAL_PLUS (1 << 23) // AI will not use this weapon on fighters or bombers
108 #define WIF2_EXTERNAL_WEAPON_FP (1 << 24) // will try to use external models FPs if possible
109 #define WIF2_EXTERNAL_WEAPON_LNCH (1 << 25) // render external secondary as a launcher
110 #define WIF2_TAKES_BLAST_DAMAGE (1 << 26) // This weapon can take blast damage
111 #define WIF2_TAKES_SHOCKWAVE_DAMAGE (1 << 27) // This weapon can take shockwave damage
112 #define WIF2_DONT_SHOW_ON_RADAR (1 << 28) // Force a weapon to not show on radar
113 #define WIF2_RENDER_FLAK (1 << 29) // Even though this is a flak weapon, render the shell
114 #define WIF2_CIWS (1 << 30) // This weapons' burst and shockwave damage can damage bombs (Basically, a reverse for TAKES_BLAST/SHOCKWAVE_DAMAGE
115 #define WIF2_ANTISUBSYSBEAM (1 << 31) // This beam can target subsystems as per normal
116 
117 #define WIF3_NOLINK (1 << 0) // This weapon can not be linked with others
118 #define WIF3_USE_EMP_TIME_FOR_CAPSHIP_TURRETS (1 << 1) // override MAX_TURRET_DISRUPT_TIME in emp.cpp - Goober5000
119 #define WIF3_NO_LINKED_PENALTY (1 << 2) // This weapon does not count into linked firing penalty
120 #define WIF3_NO_HOMING_SPEED_RAMP (1 << 3) // Disables the 1s long speed ramping when firing locked-on secondaries
121 #define WIF3_CMEASURE_ASPECT_HOME_ON (1 << 4) // This countermeasure flag makes aspect seekers home on the countermeasure instead of going into dumbfire mode
122 #define WIF3_TURRET_INTERCEPTABLE (1 << 5) // These two flags mark a weapon as being interceptable by the AI
123 #define WIF3_FIGHTER_INTERCEPTABLE (1 << 6) // (like WIF_BOMB), without forcing it to be tagetable -MageKing17
124 #define WIF3_AOE_ELECTRONICS (1 << 7) // Apply electronics effect across the weapon's entire area of effect instead of just on the impacted ship -MageKing17
125 #define WIF3_APPLY_RECOIL (1 << 8) // Apply recoil using weapon and ship info
126 #define WIF3_DONT_SPAWN_IF_SHOT (1 << 9) // Prevent shot down parent weapons from spawning children (DahBlount)
127 #define WIF3_DIE_ON_LOST_LOCK (1 << 10) // WIF_LOCKED_HOMING missiles will die if they lose their lock
128 
129 #define WIF_HOMING (WIF_HOMING_HEAT | WIF_HOMING_ASPECT | WIF_HOMING_JAVELIN)
130 #define WIF_LOCKED_HOMING (WIF_HOMING_ASPECT | WIF_HOMING_JAVELIN)
131 #define WIF_HURTS_BIG_SHIPS (WIF_BOMB | WIF_BEAM | WIF_HUGE | WIF_BIG_ONLY)
132 
133 #define WEAPON_EXHAUST_DELTA_TIME 75 // Delay in milliseconds between exhaust blobs
134 
135 #define WF_LOCK_WARNING_PLAYED (1<<0) // set when a lock warning sound is played for the player
136  // (needed since we don't want to play multiple lock sounds)
137 #define WF_ALREADY_APPLIED_STATS (1<<1) // for use in ship_apply_local and ship_apply_global damage functions
138  // so that we don't record multiple hits (stats) for one impact
139 #define WF_PLAYED_FLYBY_SOUND (1<<2) // flyby sound has been played for this weapon
140 #define WF_CONSIDER_FOR_FLYBY_SOUND (1<<3) // consider for flyby
141 #define WF_DEAD_IN_WATER (1<<4) // a missiles engines have died
142 #define WF_LOCKED_WHEN_FIRED (1<<5) // fired with a lock
143 #define WF_DESTROYED_BY_WEAPON (1<<6) // destroyed by damage from other weapon
144 #define WF_SPAWNED (1<<7) //Spawned from a spawning type weapon
145 #define WF_HOMING_UPDATE_NEEDED (1<<8) // this is a newly spawned homing weapon which needs to update client machines
146 #define WF_NO_HOMING (1<<9) // this weapon should ignore any homing behavior it'd usually have
147 
148 // flags for setting burst fire
149 #define WBF_FAST_FIRING (1<<0) // burst is to use only the firewait to determine firing delays
150 #define WBF_RANDOM_LENGTH (1<<1) // burst is to fire random length bursts
151 
152 //particle names go here -nuke
153 #define PSPEW_NONE -1 //used to disable a spew, useful for xmts
154 #define PSPEW_DEFAULT 0 //std fs2 pspew
155 #define PSPEW_HELIX 1 //q2 style railgun trail
156 #define PSPEW_SPARKLER 2 //random particles in every direction, can be sperical or ovoid
157 #define PSPEW_RING 3 //outward expanding ring
158 #define PSPEW_PLUME 4 //spewers arrayed within a radius for thruster style effects, may converge or scatter
159 
160 #define MAX_PARTICLE_SPEWERS 4 //i figure 4 spewers should be enough for now -nuke
161 #define MAX_WEP_DAMAGE_SLOTS 32 //Maximum number of ships which can be counted as killer or assits on destroying this weapon
162 
163 typedef struct weapon {
164  int weapon_info_index; // index into weapon_info array
165  int objnum; // object number for this weapon
166  int model_instance_num; // model instance number, if we have any intrinsic-rotating submodels
167  int team; // The team of the ship that fired this
168  int species; // The species of the ship that fired thisz
169  float lifeleft; // life left on this weapon
171 
172  int target_num; // Object index of target
173  int target_sig; // So we know if the target is the same one we've been tracking
174  float nearest_dist; // nearest distance yet attained to target
175  fix creation_time; // time at which created, stuffed Missiontime
176  int weapon_flags; // bit flags defining behavior, see WF_xxxx
177  object* homing_object; // object this weapon is homing on.
178  ship_subsys* homing_subsys; // subsystem this weapon is homing on
179  vec3d homing_pos; // world position missile is homing on
180  short swarm_index; // index into swarm missile info, -1 if not WIF_SWARM
181  int missile_list_index; // index for missiles into Missile_obj_list, -1 weapon not missile
182  trail *trail_ptr; // NULL if no trail, otherwise a pointer to its trail
183  ship_subsys *turret_subsys; // points to turret that fired weapon, otherwise NULL
184  int group_id; // Which group this is in.
185  float det_range; //How far from start_pos it blows up
186 
187  // Stuff for thruster glows
188  int thruster_bitmap; // What frame the current thruster bitmap is at for this weapon
189  float thruster_frame; // Used to keep track of which frame the animation should be on.
190  int thruster_glow_bitmap; // What frame the current thruster engine glow bitmap is at for this weapon
191  float thruster_glow_frame; // Used to keep track of which frame the engine glow animation should be on.
192  float thruster_glow_noise; // Noise for current frame
193 
194  // laser stuff
195  float laser_bitmap_frame; // used to keep track of which frame the animation should be on
196  float laser_glow_bitmap_frame; // used to keep track of which frame the glow animation should be on
197 
198  int pick_big_attack_point_timestamp; // Timestamp at which to pick a new point to attack.
199  vec3d big_attack_point; // Target-relative location of attack point.
200 
202 
203  // corkscrew info (taken out for now)
204  short cscrew_index; // corkscrew info index
205 
206  // particle spew info
207  int particle_spew_time[MAX_PARTICLE_SPEWERS]; // time to spew next bunch of particles
208  float particle_spew_rand; // per weapon randomness value used by some particle spew types -nuke
209 
210  // flak info
211  short flak_index; // flak info index
212 
213  //local ssm stuff
214  fix lssm_warpout_time; //time at which the missile warps out
215  fix lssm_warpin_time; //time at which the missile warps back in
216  int lssm_stage; //what stage its in 1=just launched, 2=warping out. 3=warped out, 4=warping back in, 5=terminal dive
217  int lssm_warp_idx; //warphole index
218  float lssm_warp_time; //length of time warphole stays open
219  float lssm_warp_pct; //how much of the warphole's life should be dedicated to stage 2
221 
222  // weapon transparency info
223  ubyte alpha_backward; // 1 = move in reverse (ascending in value)
224  float alpha_current; // the current alpha value
225 
226  float weapon_max_vel; // might just as well store the data here
227  float launch_speed; // the initial forward speed (can vary due to additive velocity or acceleration)
228  // currently only gets set when weapon_info->acceleration_time is used
229 
231  mc_info collisionInfo; // The last collision of this weapon or NULL if it had none
232  //Scoring stuff
233  float total_damage_received; // total damage received (for scoring purposes)
234  float damage_ship[MAX_WEP_DAMAGE_SLOTS]; // damage applied from each player
235  int damage_ship_id[MAX_WEP_DAMAGE_SLOTS]; // signature of the damager (corresponds to each entry in damage_ship)
236 
237  int hud_in_flight_snd_sig; // Signature of the sound played while the weapon is in flight
238 } weapon;
239 
240 
241 // info specific to beam weapons
242 typedef struct beam_weapon_section_info {
243  float width; // width of the section
244  float flicker; // how much it flickers (0.0 to 1.0)
245  float z_add; // is this necessary?
246  float tile_factor; // texture tile factor -Bobboau
247  int tile_type; // is this beam tiled by it's length, or not
248  float translation; // makes the beam texture move -Bobboau
249  generic_anim texture; // texture anim/bitmap
251 
252 typedef struct beam_weapon_info {
253  int beam_type; // beam type
254  float beam_life; // how long it lasts
255  int beam_warmup; // how long it takes to warmup (in ms)
256  int beam_warmdown; // how long it takes to warmdown (in ms)
257  float beam_muzzle_radius; // muzzle glow radius
258  int beam_particle_count; // beam spew particle count
259  float beam_particle_radius; // radius of beam particles
260  float beam_particle_angle; // angle of beam particle spew cone
262  float beam_iff_miss_factor[MAX_IFFS][NUM_SKILL_LEVELS]; // magic # which makes beams miss more. by parent iff and player skill level
263  int beam_loop_sound; // looping beam sound
264  int beam_warmup_sound; // warmup sound
265  int beam_warmdown_sound; // warmdown sound
266  int beam_num_sections; // the # of visible "sections" on the beam
267  generic_anim beam_glow; // muzzle glow bitmap
268  float glow_length; // (DahBlount) determines the length the muzzle glow when using a directional glow
269  bool directional_glow; // (DahBlount) makes the muzzle glow render to a poly that is oriented along the direction of fire
270  int beam_shots; // # of shots the beam takes
271  float beam_shrink_factor; // what percentage of total beam lifetime when the beam starts shrinking
272  float beam_shrink_pct; // what percent/second the beam shrinks at
273  beam_weapon_section_info sections[MAX_BEAM_SECTIONS]; // info on the visible sections of the beam
274  float range; // how far it will shoot-Bobboau
275  float damage_threshold; // point at wich damage will start being atenuated from 0.0 to 1.0
276  float beam_width; // width of the beam (for certain collision checks)
278 
279 typedef struct particle_spew_info { //this will be used for multi spews
280  // particle spew stuff
281  int particle_spew_type; //added pspew type field -nuke
288  float particle_spew_z_scale; //length value for some effects -nuke
289  float particle_spew_rotation_rate; //rotation rate for some particle effects -nuke
290  vec3d particle_spew_offset; //offsets and normals, yay!
294 
295 typedef struct spawn_weapon_info
296 {
297  short spawn_type; // Type of weapon to spawn when detonated.
298  short spawn_count; // Number of weapons of spawn_type to spawn.
299  float spawn_angle; // Angle to spawn the child weapons in. default is 180
301 
302 #define MAX_SPAWN_TYPES_PER_WEAPON 5
303 
304 // use this to extend a beam to "infinity"
305 #define BEAM_FAR_LENGTH 30000.0f
306 
307 
308 extern weapon Weapons[MAX_WEAPONS];
309 
310 #define WEAPON_TITLE_LEN 48
311 
313 {
317 };
318 
319 #define MAX_SUBSTITUTION_PATTERNS 10
320 
321 typedef struct weapon_info {
322  char name[NAME_LENGTH]; // name of this weapon
323  char alt_name[NAME_LENGTH]; // alt name of this weapon
324  char title[WEAPON_TITLE_LEN]; // official title of weapon (used by tooltips)
325  char *desc; // weapon's description (used by tooltips)
326  int subtype; // one of the WP_* macros above
327  int render_type; // rendering method, laser, pof, avi
328  char pofbitmap_name[MAX_FILENAME_LEN]; // Name of the pof representing this if POF, or bitmap filename if bitmap
329  int model_num; // modelnum of weapon -- -1 if no model
330  char external_model_name[MAX_FILENAME_LEN]; //the model rendered on the weapon points of a ship
331  int external_model_num; //the model rendered on the weapon points of a ship
332  int hud_target_lod; // LOD to use when rendering weapon model to the hud targetbox
333  int num_detail_levels; // number of LODs defined in table (optional)
334  int detail_distance[MAX_MODEL_DETAIL_LEVELS]; // LOD distances define in table (optional)
335  char *tech_desc; // weapon's description (in tech database)
336  char tech_anim_filename[MAX_FILENAME_LEN]; // weapon's tech room animation
337  char tech_title[NAME_LENGTH]; // weapon's name (in tech database)
338  char tech_model[MAX_FILENAME_LEN]; //Image to display in the techroom (TODO) or the weapon selection screen if the ANI isn't specified/missing
339 
340  vec3d closeup_pos; // position for camera to set an offset for viewing the weapon model
341  float closeup_zoom; // zoom when using weapon model in closeup view in loadout selection
342 
343  char hud_filename[MAX_FILENAME_LEN]; //Name of image to display on HUD in place of text
344  int hud_image_index; //teh index of the image
345 
346  generic_anim laser_bitmap; // bitmap for a laser
347  generic_anim laser_glow_bitmap; // optional laser glow bitmap
348 
350  color laser_color_1; // for cycling between glow colors
351  color laser_color_2; // for cycling between glow colors
353 
354  float max_speed; // max speed of the weapon
355  float acceleration_time; // how many seconds to reach max speed (secondaries only)
356  float vel_inherit_amount; // how much of the parent ship's velocity is inherited (0.0..1.0)
358  float mass; // mass of the weapon
359  float fire_wait; // fire rate -- amount of time before you can refire the weapon
360  float max_delay; // max time to delay a shot (DahBlount)
361  float min_delay; // min time to delay a shot (DahBlount)
362 
363  float damage; // damage of weapon (for missile, damage within inner radius)
364  float damage_time; // point in the lifetime of the weapon at which damage starts to attenuate. This applies to non-beam primaries. (DahBlount)
365  float atten_damage; // The damage to attenuate to. (DahBlount)
366 
370  float arm_dist;
371  float arm_radius;
372  float det_range;
373  float det_radius; //How far from target or target subsystem it blows up
374  float flak_detonation_accuracy; //How far away from a target a flak shell will blow up. Standard is 65.0f
375  float flak_targeting_accuracy; //Determines the amount of jitter applied to flak targeting. USE WITH CAUTION!
376  float untargeted_flak_range_penalty; //Untargeted flak shells detonate after travelling max range - this parameter. Default 20.0f
377 
378  float armor_factor, shield_factor, subsystem_factor; // in 0.0..2.0, scale of damage done to type of thing
379  float life_min;
380  float life_max;
381  float max_lifetime ; // How long this weapon will actually live for
382  float lifetime; // How long the AI thinks this thing lives (used for distance calculations etc)
383  float energy_consumed; // Energy used up when weapon is fired
384  int wi_flags; // bit flags defining behavior, see WIF_xxxx
385  int wi_flags2; // stupid int wi_flags, only 32 bits... argh - Goober5000
386  int wi_flags3; // stupid int wi_flags2, only 32 bits... argh - The E
387  float turn_time;
388  float cargo_size; // cargo space taken up by individual weapon (missiles only)
389  float rearm_rate; // rate per second at which secondary weapons are loaded during rearming
390  float weapon_range; // max range weapon can be effectively fired. (May be less than life * speed)
391 
392  // spawn weapons
396 
397  // swarm count
398  short swarm_count; // how many swarm missiles are fired for this weapon
399 
400  // Specific to ASPECT homing missiles.
401  float min_lock_time; // minimum time (in seconds) to achieve lock
402  int lock_pixels_per_sec; // pixels/sec moved while locking
403  int catchup_pixels_per_sec; // pixels/sec moved while catching-up for a lock
404  int catchup_pixel_penalty; // number of extra pixels to move while locking as a penalty for catching up for a lock
405 
406  // Specific to HEAT homing missiles.
407  float fov;
408 
409  // Seeker strength - for countermeasures overhaul.
411 
413  int pre_launch_snd_min_interval; //Minimum interval in ms between the last time the pre-launch sound was played and the next time it can play, as a limiter in case the player is pumping the trigger
417  int flyby_snd; // whizz-by sound, transmitted through weapon's portable atmosphere.
418 
419  // Specific to weapons with TRAILS:
421 
422  char icon_filename[MAX_FILENAME_LEN]; // filename for icon that is displayed in weapon selection
423  char anim_filename[MAX_FILENAME_LEN]; // filename for animation that plays in weapon selection
425 
426  int impact_weapon_expl_index; // Index into Weapon_expl_info of which ANI should play when this thing impacts something
427  float impact_explosion_radius; // How big the explosion should be
428  float shield_impact_explosion_radius; // How big the shield hit explosion should be
429 
432 
435 
443 
444  // EMP effect
445  float emp_intensity; // intensity of the EMP effect
446  float emp_time; // time of the EMP effect
447 
448  // Recoil effect
450 
451  // Energy suck effect
452  float weapon_reduce; // how much energy removed from weapons systems
453  float afterburner_reduce; // how much energy removed from weapons systems
454 
455  // Beam weapon effect
456  beam_weapon_info b_info; // this must be valid if the weapon is a beam weapon WIF_BEAM or WIF_BEAM_SMALL
457 
458  // tag stuff
459  float tag_time; // how long the tag lasts
460  int tag_level; // tag level (1 - 3)
461 
462  // muzzle flash
463  int muzzle_flash; // muzzle flash stuff
464 
465  // SSM
466  int SSM_index; // wich entry in the SSM,tbl it uses -Bobboau
467 
468  // now using new particle spew struct -nuke
470 
471  // Corkscrew info - phreak 11/9/02
473  float cs_radius;
474  float cs_twist;
476  int cs_delay;
477 
478  //electronics info - phreak 5/3/03
479  int elec_time; //how long it lasts, in milliseconds
480  float elec_eng_mult; //multiplier on engine subsystem
481  float elec_weap_mult; //multiplier on weapon subsystem and turrets
482  float elec_beam_mult; //used instead of elec_weap_mult if turret is a beam turret
483  float elec_sensors_mult; //multiplier on sensors and awacs
484  int elec_randomness; //disruption time lasts + or - this value from whats calculated. time in milliseconds
485  int elec_use_new_style; //use new style electronics parameters
486 
487  //local ssm info
488  int lssm_warpout_delay; //delay between launch and warpout (ms)
489  int lssm_warpin_delay; //delay between warpout and warpin (ms)
490  float lssm_stage5_vel; //velocity during final stage
493 
494  float field_of_fire; //cone the weapon will fire in, 0 is strait all the time-Bobboau
495  float fof_spread_rate; //How quickly the FOF will spread for each shot (primary weapons only, this doesn't really make sense for turrets)
496  float fof_reset_rate; //How quickly the FOF spread will reset over time (primary weapons only, this doesn't really make sense for turrets)
497  float max_fof_spread; //The maximum fof increase that the shots can spread to
498  int shots; //the number of shots that will be fired at a time,
499  //only realy usefull when used with FOF to make a shot gun effect
500  //now also used for weapon point cycleing
501 
502  // Countermeasure information
507  bool cm_kill_single; // should the countermeasure kill just the single decoyed missile within CMEASURE_DETONATE_DISTANCE?
508 
509  // *
510 
511  int SwarmWait; // *Swarm firewait, default is 150 -Et1
512 
513  float WeaponMinRange; // *Minimum weapon range, default is 0 -Et1
514 
515 
518 
520  int damage_type_idx_sav; // stored value from table used to reset damage_type_idx
521 
522  int armor_type_idx; // Weapon armor type
523 
524 
525  // transparency/alpha info
526  float alpha_max; // maximum alpha value to use
527  float alpha_min; // minimum alpha value to use
528  float alpha_cycle; // cycle between max and min by this much each frame
529 
531 
533  float burst_delay;
535 
536  // Thruster effects
540 
544 
545  // the optional pattern of weapons that this weapon will fire
548  char weapon_substitution_pattern_names[MAX_SUBSTITUTION_PATTERNS][NAME_LENGTH]; // weapon names so that we can generate the indexs after sort
549 
550  int score; //Optional score for destroying the weapon
551 
552  int hud_tracking_snd; // Sound played when this weapon tracks a target
553  int hud_locked_snd; // Sound played when this weapon locked onto a target
554  int hud_in_flight_snd; // Sound played while the weapon is in flight
555  InFlightSoundType in_flight_play_type; // The status when the sound should be played
556 } weapon_info;
557 
558 // Data structure to track the active missiles
559 typedef struct missile_obj {
561  int flags, objnum;
562 } missile_obj;
564 
565 // WEAPON EXPLOSION INFO
566 #define MAX_WEAPON_EXPL_LOD 4
567 
568 typedef struct weapon_expl_lod {
572  int fps;
573 
575  : bitmap_id( -1 ), num_frames( 0 ), fps( 0 )
576  {
577  filename[ 0 ] = 0;
578  }
580 
581 typedef struct weapon_expl_info {
582  int lod_count;
585 
587 {
588 private:
589  SCP_vector<weapon_expl_info> ExplosionInfo;
590  int GetIndex(char *filename);
591 
592 public:
594 
595  int Load(char *filename = NULL, int specified_lods = MAX_WEAPON_EXPL_LOD);
596  int GetAnim(int weapon_expl_index, vec3d *pos, float size);
597  void PageIn(int idx);
598 };
599 
601 
603 
604 extern int Num_weapon_types; // number of weapons in the game
605 extern int Num_weapons;
606 extern int First_secondary_index;
607 extern int Default_cmeasure_index;
608 
609 extern int Num_player_weapon_precedence; // Number of weapon types in Player_weapon_precedence
610 extern int Player_weapon_precedence[MAX_WEAPON_TYPES]; // Array of weapon types, precedence list for player weapon selection
611 
612 #define WEAPON_INDEX(wp) (wp-Weapons)
613 #define WEAPON_INFO_INDEX(wip) (wip-Weapon_info)
614 
615 
616 int weapon_info_lookup(const char *name = NULL);
617 void weapon_init(); // called at game startup
618 void weapon_close(); // called at game shutdown
619 void weapon_level_init(); // called before the start of each level
620 void weapon_render_DEPRECATED(object * obj);
621 void weapon_render(object* obj, draw_list *scene);
622 void weapon_delete( object * obj );
623 void weapon_process_pre( object *obj, float frame_time);
624 void weapon_process_post( object *obj, float frame_time);
625 
626 //Call before weapons_page_in to mark a weapon as used
627 void weapon_mark_as_used(int weapon_id);
628 
629 // Group_id: If you should quad lasers, they should all have the same group id.
630 // This will be used to optimize lighting, since each group only needs to cast one light.
631 // Call this to get a new group id, then pass it to each weapon_create call for all the
632 // weapons in the group. Number will be between 0 and WEAPON_MAX_GROUP_IDS and will
633 // get reused.
635 
636 // How many unique groups of weapons there can be at one time.
637 #define WEAPON_MAX_GROUP_IDS 256
638 
639 // Passing a group_id of -1 means it isn't in a group. See weapon_create_group_id for more
640 // help on weapon groups.
641 int weapon_create( vec3d * pos, matrix * orient, int weapon_type, int parent_obj, int group_id=-1, int is_locked = 0, int is_spawned = 0, float fof_cooldown = 0.0f, ship_subsys * src_turret = NULL);
642 void weapon_set_tracking_info(int weapon_objnum, int parent_objnum, int target_objnum, int target_is_locked = 0, ship_subsys *target_subsys = NULL);
643 
644 // for weapons flagged as particle spewers, spew particles. wheee
645 void weapon_maybe_spew_particle(object *obj);
646 
647 bool weapon_armed(weapon *wp, bool hit_target);
648 void weapon_hit( object * weapon_obj, object * other_obj, vec3d * hitpos, int quadrant = -1 );
649 int cmeasure_name_lookup(char *name);
650 void spawn_child_weapons( object *objp );
651 
652 // call to detonate a weapon. essentially calls weapon_hit() with other_obj as NULL, and sends a packet in multiplayer
653 void weapon_detonate(object *objp);
654 
655 void weapon_area_apply_blast(vec3d *force_apply_pos, object *ship_objp, vec3d *blast_pos, float blast, int make_shockwave);
656 int weapon_area_calc_damage(object *objp, vec3d *pos, float inner_rad, float outer_rad, float max_blast, float max_damage,
657  float *blast, float *damage, float limit);
658 
659 void missile_obj_list_rebuild(); // called by save/restore code only
662 
663 // THE FOLLOWING FUNCTION IS IN SHIP.CPP!!!!
664 // JAS - figure out which thruster bitmap will get rendered next
665 // time around. ship_render needs to have shipp->thruster_bitmap set to
666 // a valid bitmap number, or -1 if we shouldn't render thrusters.
667 // This does basically the same thing as ship_do_thruster_frame, except it
668 // operates on a weapon. This is in the ship code because it needs
669 // the same thruster animation info as the ship stuff, and I would
670 // rather extern this one function than all the thruster animation stuff.
671 void ship_do_weapon_thruster_frame( weapon *weaponp, object *objp, float frametime );
672 
673 // call to get the "color" of the laser at the given moment (since glowing lasers can cycle colors)
674 void weapon_get_laser_color(color *c, object *objp);
675 
676 void weapon_hit_do_sound(object *hit_obj, weapon_info *wip, vec3d *hitpos, bool is_armed);
677 
678 void weapon_do_electronics_effect(object *ship_objp, vec3d *blast_pos, int wi_index);
679 
680 // return a scale factor for damage which should be applied for 2 collisions
681 float weapon_get_damage_scale(weapon_info *wip, object *wep, object *target);
682 
683 // Pauses all running weapon sounds
684 void weapon_pause_sounds();
685 
686 // Unpauses all running weapon sounds
687 void weapon_unpause_sounds();
688 
689 // Called by hudartillery.cpp after SSMs have been parsed to make sure that $SSM: entries defined in weapons are valid.
690 void validate_SSM_entries();
691 
692 void shield_impact_explosion(vec3d *hitpos, object *objp, float radius, int idx);
693 
694 #endif
int target_num
Definition: weapon.h:172
short cscrew_index
Definition: weapon.h:204
#define MAX_FILENAME_LEN
Definition: pstypes.h:324
int muzzle_flash
Definition: weapon.h:463
int particle_spew_type
Definition: weapon.h:281
missile_obj * prev
Definition: weapon.h:560
int launch_snd
Definition: weapon.h:414
fix creation_time
Definition: weapon.h:175
char tech_model[MAX_FILENAME_LEN]
Definition: weapon.h:338
float nearest_dist
Definition: weapon.h:174
int lock_pixels_per_sec
Definition: weapon.h:402
char * tech_desc
Definition: weapon.h:335
weapon Weapons[MAX_WEAPONS]
Definition: weapons.cpp:78
float cm_aspect_effectiveness
Definition: weapon.h:503
int elec_time
Definition: weapon.h:479
float fof_spread_rate
Definition: weapon.h:495
float min_lock_time
Definition: weapon.h:401
int group_id
Definition: weapon.h:184
void missile_obj_list_rebuild()
Definition: weapons.cpp:441
float particle_spew_scale
Definition: weapon.h:287
void weapon_process_pre(object *obj, float frame_time)
Definition: weapons.cpp:4667
object * homing_object
Definition: weapon.h:177
int SwarmWait
Definition: weapon.h:511
int flyby_snd
Definition: weapon.h:417
float arm_radius
Definition: weapon.h:371
size_t num_substitution_patterns
Definition: weapon.h:546
float laser_glow_bitmap_frame
Definition: weapon.h:196
int weapon_area_calc_damage(object *objp, vec3d *pos, float inner_rad, float outer_rad, float max_blast, float max_damage, float *blast, float *damage, float limit)
Definition: weapons.cpp:6025
int total_children_spawned
Definition: weapon.h:394
int external_model_num
Definition: weapon.h:331
weapon_info Weapon_info[MAX_WEAPON_TYPES]
Definition: weapons.cpp:79
float thruster_glow_noise
Definition: weapon.h:192
float fire_wait
Definition: weapon.h:359
int species
Definition: weapon.h:168
Definition: trails.h:34
generic_anim laser_bitmap
Definition: weapon.h:346
vec3d closeup_pos
Definition: weapon.h:340
int First_secondary_index
Definition: weapons.cpp:116
int beam_loop_sound
Definition: weapon.h:263
fix arm_time
Definition: weapon.h:369
GLuint index
Definition: Glext.h:5608
Definition: weapon.h:163
int weapon_create(vec3d *pos, matrix *orient, int weapon_type, int parent_obj, int group_id=-1, int is_locked=0, int is_spawned=0, float fof_cooldown=0.0f, ship_subsys *src_turret=NULL)
Definition: weapons.cpp:5246
generic_anim beam_glow
Definition: weapon.h:267
char weapon_substitution_pattern_names[MAX_SUBSTITUTION_PATTERNS][NAME_LENGTH]
Definition: weapon.h:548
int pick_big_attack_point_timestamp
Definition: weapon.h:198
float elec_eng_mult
Definition: weapon.h:480
int missile_list_index
Definition: weapon.h:181
int weapon_info_lookup(const char *name=NULL)
Definition: weapons.cpp:467
float glow_length
Definition: weapon.h:268
int pre_launch_snd
Definition: weapon.h:412
float piercing_impact_particle_life
Definition: weapon.h:439
float alpha_cycle
Definition: weapon.h:528
float weapon_reduce
Definition: weapon.h:452
float det_range
Definition: weapon.h:185
Definition: pstypes.h:88
InFlightSoundType in_flight_play_type
Definition: weapon.h:555
int Player_weapon_precedence[MAX_WEAPON_TYPES]
Definition: weapons.cpp:125
#define NUM_SKILL_LEVELS
Definition: systemvars.h:150
float weapon_max_vel
Definition: weapon.h:226
short spawn_type
Definition: weapon.h:297
Definition: 2d.h:95
char anim_filename[MAX_FILENAME_LEN]
Definition: weapon.h:423
float laser_head_radius
Definition: weapon.h:352
float untargeted_flak_range_penalty
Definition: weapon.h:376
float piercing_impact_particle_variance
Definition: weapon.h:442
float max_fof_spread
Definition: weapon.h:497
int Num_weapon_subtypes
Definition: weapons.cpp:92
short swarm_count
Definition: weapon.h:398
char external_model_name[MAX_FILENAME_LEN]
Definition: weapon.h:330
int shots
Definition: weapon.h:498
float particle_spew_rand
Definition: weapon.h:208
GLclampf f
Definition: Glext.h:7097
void weapon_unpause_sounds()
Definition: weapons.cpp:7257
void weapon_render(object *obj, draw_list *scene)
Definition: weapons.cpp:7268
int GetAnim(int weapon_expl_index, vec3d *pos, float size)
Definition: weapons.cpp:253
float fof_reset_rate
Definition: weapon.h:496
float thruster_glow_factor
Definition: weapon.h:539
struct weapon_expl_lod weapon_expl_lod
void weapon_mark_as_used(int weapon_id)
Definition: weapons.cpp:6497
int cs_crotate
Definition: weapon.h:475
struct weapon weapon
float max_speed
Definition: weapon.h:354
ship_subsys * homing_subsys
Definition: weapon.h:178
#define MAX_WEP_DAMAGE_SLOTS
Definition: weapon.h:161
int burst_flags
Definition: weapon.h:534
float emp_intensity
Definition: weapon.h:445
float beam_life
Definition: weapon.h:254
vec3d big_attack_point
Definition: weapon.h:199
float weapon_range
Definition: weapon.h:390
hull_check orient
Definition: lua.cpp:5049
float piercing_impact_particle_back_velocity
Definition: weapon.h:441
object * objp
Definition: lua.cpp:3105
int hud_in_flight_snd
Definition: weapon.h:554
float lifeleft
Definition: weapon.h:169
int cs_delay
Definition: weapon.h:476
int beam_particle_count
Definition: weapon.h:258
GLsizeiptr size
Definition: Glext.h:5496
int disarmed_impact_snd
Definition: weapon.h:416
int subtype
Definition: weapon.h:326
int num_spawn_weapons_defined
Definition: weapon.h:393
int beam_warmdown
Definition: weapon.h:256
void find_homing_object_cmeasures()
Definition: weapons.cpp:4170
float weapon_get_damage_scale(weapon_info *wip, object *wep, object *target)
Definition: weapons.cpp:7137
float subsystem_factor
Definition: weapon.h:378
int damage_type_idx_sav
Definition: weapon.h:520
int render_type
Definition: weapon.h:327
struct spawn_weapon_info spawn_weapon_info
float particle_spew_z_scale
Definition: weapon.h:288
int piercing_impact_weapon_expl_index
Definition: weapon.h:436
float beam_iff_miss_factor[MAX_IFFS][NUM_SKILL_LEVELS]
Definition: weapon.h:262
float laser_length
Definition: weapon.h:349
int Load(char *filename=NULL, int specified_lods=MAX_WEAPON_EXPL_LOD)
Definition: weapons.cpp:179
float laser_tail_radius
Definition: weapon.h:352
short spawn_count
Definition: weapon.h:298
int weapon_info_index
Definition: weapon.h:164
int weapon_substitution_pattern[MAX_SUBSTITUTION_PATTERNS]
Definition: weapon.h:547
float lifetime
Definition: weapon.h:382
float damage_threshold
Definition: weapon.h:275
float launch_speed
Definition: weapon.h:227
int cs_num_fired
Definition: weapon.h:472
void weapon_maybe_spew_particle(object *obj)
Definition: weapons.cpp:6767
int damage_ship_id[MAX_WEP_DAMAGE_SLOTS]
Definition: weapon.h:235
bool directional_glow
Definition: weapon.h:269
int elec_randomness
Definition: weapon.h:484
int objnum
Definition: weapon.h:561
float beam_particle_radius
Definition: weapon.h:259
vec3d homing_pos
Definition: weapon.h:179
int flash_impact_weapon_expl_index
Definition: weapon.h:433
#define MAX_WEAPON_EXPL_LOD
Definition: weapon.h:566
beam_weapon_info b_info
Definition: weapon.h:456
int elec_use_new_style
Definition: weapon.h:485
void weapon_delete(object *obj)
Definition: weapons.cpp:3822
int weapon_hitpoints
Definition: weapon.h:530
int thruster_glow_bitmap
Definition: weapon.h:190
int lssm_warpout_delay
Definition: weapon.h:488
void weapon_set_tracking_info(int weapon_objnum, int parent_objnum, int target_objnum, int target_is_locked=0, ship_subsys *target_subsys=NULL)
Definition: weapons.cpp:5093
vec3d start_pos
Definition: weapon.h:170
mc_info collisionInfo
Definition: weapon.h:231
char * desc
Definition: weapon.h:325
int weapon_flags
Definition: weapon.h:176
ship_subsys * turret_subsys
Definition: weapon.h:183
int num_detail_levels
Definition: weapon.h:333
SCP_vector< int > * cmeasure_ignore_list
Definition: weapon.h:201
int Num_weapons
Definition: weapons.cpp:107
float mass
Definition: weapon.h:358
int armor_type_idx
Definition: weapon.h:522
float beam_particle_angle
Definition: weapon.h:260
struct beam_weapon_info beam_weapon_info
float life_min
Definition: weapon.h:379
float cargo_size
Definition: weapon.h:388
int team
Definition: weapon.h:167
char hud_filename[MAX_FILENAME_LEN]
Definition: weapon.h:343
missile_obj * missile_obj_return_address(int index)
Definition: weapons.cpp:458
char filename[MAX_FILENAME_LEN]
Definition: weapon.h:569
float beam_shrink_pct
Definition: weapon.h:272
trail * trail_ptr
Definition: weapon.h:182
particle_spew_info particle_spewers[MAX_PARTICLE_SPEWERS]
Definition: weapon.h:469
int pre_launch_snd_min_interval
Definition: weapon.h:413
int objnum
Definition: weapon.h:165
float flash_impact_explosion_radius
Definition: weapon.h:434
char * filename
ubyte alpha_backward
Definition: weapon.h:223
generic_anim beam_particle_ani
Definition: weapon.h:261
int hud_target_lod
Definition: weapon.h:332
float lssm_stage5_vel
Definition: weapon.h:490
float lssm_warp_time
Definition: weapon.h:218
float free_flight_time
Definition: weapon.h:357
int damage_type_idx
Definition: weapon.h:519
int SSM_index
Definition: weapon.h:466
float target_lead_scaler
Definition: weapon.h:541
generic_anim thruster_glow
Definition: weapon.h:538
#define MAX_WEAPON_TYPES
Definition: globals.h:73
void weapon_hit(object *weapon_obj, object *other_obj, vec3d *hitpos, int quadrant=-1)
Definition: weapons.cpp:6253
float WeaponMinRange
Definition: weapon.h:513
int dinky_impact_weapon_expl_index
Definition: weapon.h:430
#define MAX_SPAWN_TYPES_PER_WEAPON
Definition: weapon.h:302
float shield_impact_explosion_radius
Definition: weapon.h:428
int tag_level
Definition: weapon.h:460
char tech_anim_filename[MAX_FILENAME_LEN]
Definition: weapon.h:336
beam_weapon_section_info sections[MAX_BEAM_SECTIONS]
Definition: weapon.h:273
float weapon_submodel_rotate_accell
Definition: weapon.h:516
#define MAX_BEAM_SECTIONS
Definition: globals.h:89
float cs_twist
Definition: weapon.h:474
bool collisionOccured
Definition: weapon.h:230
struct beam_weapon_section_info beam_weapon_section_info
void weapon_process_post(object *obj, float frame_time)
Definition: weapons.cpp:4775
int lssm_warpin_delay
Definition: weapon.h:489
int detail_distance[MAX_MODEL_DETAIL_LEVELS]
Definition: weapon.h:334
int lssm_stage
Definition: weapon.h:216
void PageIn(int idx)
Definition: weapons.cpp:237
float life_max
Definition: weapon.h:380
float fov
Definition: weapon.h:407
char tech_title[NAME_LENGTH]
Definition: weapon.h:337
int wi_flags3
Definition: weapon.h:386
fix lssm_warpout_time
Definition: weapon.h:214
#define MAX_SUBSTITUTION_PATTERNS
Definition: weapon.h:319
vec3d particle_spew_offset
Definition: weapon.h:290
float det_radius
Definition: weapon.h:373
float piercing_impact_explosion_radius
Definition: weapon.h:437
int idx
Definition: multiui.cpp:761
char * Weapon_subtype_names[]
Definition: weapons.cpp:87
float alpha_current
Definition: weapon.h:224
float elec_weap_mult
Definition: weapon.h:481
generic_anim laser_glow_bitmap
Definition: weapon.h:347
void ship_do_weapon_thruster_frame(weapon *weaponp, object *objp, float frametime)
Definition: ship.cpp:8680
float piercing_impact_particle_velocity
Definition: weapon.h:440
float cm_effective_rad
Definition: weapon.h:505
float lssm_warp_pct
Definition: weapon.h:219
InFlightSoundType
Definition: weapon.h:312
int num_targeting_priorities
Definition: weapon.h:543
float alpha_max
Definition: weapon.h:526
long fix
Definition: pstypes.h:54
int model_instance_num
Definition: weapon.h:166
unsigned char ubyte
Definition: pstypes.h:62
missile_obj * next
Definition: weapon.h:560
struct missile_obj missile_obj
Definition: object.h:141
int wi_flags
Definition: weapon.h:384
float emp_time
Definition: weapon.h:446
float laser_bitmap_frame
Definition: weapon.h:195
void weapon_init()
Definition: weapons.cpp:3516
int wi_flags2
Definition: weapon.h:385
int catchup_pixels_per_sec
Definition: weapon.h:403
short flak_index
Definition: weapon.h:211
char icon_filename[MAX_FILENAME_LEN]
Definition: weapon.h:422
int particle_spew_count
Definition: weapon.h:282
float total_damage_received
Definition: weapon.h:233
int piercing_impact_particle_count
Definition: weapon.h:438
Definition: weapon.h:316
int target_sig
Definition: weapon.h:173
void weapon_get_laser_color(color *c, object *objp)
Definition: weapons.cpp:6707
int catchup_pixel_penalty
Definition: weapon.h:404
color laser_color_1
Definition: weapon.h:350
GLuint const GLchar * name
Definition: Glext.h:5608
struct weapon_info weapon_info
bool weapon_armed(weapon *wp, bool hit_target)
Definition: weapons.cpp:6208
int score
Definition: weapon.h:550
float particle_spew_vel
Definition: weapon.h:284
vec3d particle_spew_velocity
Definition: weapon.h:291
shockwave_create_info dinky_shockwave
Definition: weapon.h:368
float particle_spew_rotation_rate
Definition: weapon.h:289
int selection_effect
Definition: weapon.h:424
int hud_in_flight_snd_sig
Definition: weapon.h:237
void weapon_do_electronics_effect(object *ship_objp, vec3d *blast_pos, int wi_index)
Definition: weapons.cpp:5934
float cs_radius
Definition: weapon.h:473
int flags
Definition: weapon.h:561
float frame_time
Definition: multi.cpp:1426
int hud_tracking_snd
Definition: weapon.h:552
float cm_detonation_rad
Definition: weapon.h:506
void weapon_hit_do_sound(object *hit_obj, weapon_info *wip, vec3d *hitpos, bool is_armed)
Definition: weapons.cpp:5834
void weapon_close()
Definition: weapons.cpp:3545
#define NAME_LENGTH
Definition: globals.h:15
int lssm_warp_idx
Definition: weapon.h:217
float particle_spew_radius
Definition: weapon.h:285
float lssm_lock_range
Definition: weapon.h:492
fix lssm_warpin_time
Definition: weapon.h:215
GLenum target
Definition: Glext.h:6872
float flak_detonation_accuracy
Definition: weapon.h:374
float beam_shrink_factor
Definition: weapon.h:271
float lssm_warpin_radius
Definition: weapon.h:491
void weapon_level_init()
Definition: weapons.cpp:3582
void validate_SSM_entries()
Definition: weapons.cpp:7461
float cm_heat_effectiveness
Definition: weapon.h:504
float thruster_glow_frame
Definition: weapon.h:191
spawn_weapon_info spawn_info[MAX_SPAWN_TYPES_PER_WEAPON]
Definition: weapon.h:395
int hud_locked_snd
Definition: weapon.h:553
float thruster_frame
Definition: weapon.h:189
float elec_beam_mult
Definition: weapon.h:482
int impact_snd
Definition: weapon.h:415
int thruster_bitmap
Definition: weapon.h:188
float shield_factor
Definition: weapon.h:378
float burst_delay
Definition: weapon.h:533
float spawn_angle
Definition: weapon.h:299
#define MAX_MODEL_DETAIL_LEVELS
Definition: model.h:27
int beam_warmdown_sound
Definition: weapon.h:265
#define MAX_WEAPONS
Definition: globals.h:71
void shield_impact_explosion(vec3d *hitpos, object *objp, float radius, int idx)
Definition: weapons.cpp:7263
hull_check pos
Definition: lua.cpp:5050
float alpha_min
Definition: weapon.h:527
GLsizei GLsizei GLuint * obj
Definition: Glext.h:5619
void weapon_render_DEPRECATED(object *obj)
Definition: weapons.cpp:3625
float damage_time
Definition: weapon.h:364
int particle_spew_time[MAX_PARTICLE_SPEWERS]
Definition: weapon.h:207
bool cm_kill_single
Definition: weapon.h:507
int model_num
Definition: weapon.h:329
int cmeasure_name_lookup(char *name)
float rearm_rate
Definition: weapon.h:389
void spawn_child_weapons(object *objp)
Definition: weapons.cpp:5676
float energy_consumed
Definition: weapon.h:383
float acceleration_time
Definition: weapon.h:355
float impact_explosion_radius
Definition: weapon.h:427
float seeker_strength
Definition: weapon.h:410
char pofbitmap_name[MAX_FILENAME_LEN]
Definition: weapon.h:328
void weapon_area_apply_blast(vec3d *force_apply_pos, object *ship_objp, vec3d *blast_pos, float blast, int make_shockwave)
Definition: weapons.cpp:6080
weapon_explosions Weapon_explosions
Definition: weapons.cpp:101
float elec_sensors_mult
Definition: weapon.h:483
#define MAX_IFFS
Definition: globals.h:34
float recoil_modifier
Definition: weapon.h:449
int beam_warmup_sound
Definition: weapon.h:264
int particle_spew_time
Definition: weapon.h:283
trail_info tr_info
Definition: weapon.h:420
float max_delay
Definition: weapon.h:360
float dinky_impact_explosion_radius
Definition: weapon.h:431
float particle_spew_lifetime
Definition: weapon.h:286
float det_range
Definition: weapon.h:372
float afterburner_reduce
Definition: weapon.h:453
float vel_inherit_amount
Definition: weapon.h:356
int num_frames
Definition: weapon.h:571
char alt_name[NAME_LENGTH]
Definition: weapon.h:323
#define MAX_PARTICLE_SPEWERS
Definition: weapon.h:160
float min_delay
Definition: weapon.h:361
missile_obj Missile_obj_list
Definition: weapons.cpp:84
int beam_num_sections
Definition: weapon.h:266
#define WEAPON_TITLE_LEN
Definition: weapon.h:310
GLint lod
Definition: Glext.h:7352
float closeup_zoom
Definition: weapon.h:341
generic_anim texture
Definition: weapon.h:249
GLint limit
Definition: Glext.h:9797
shockwave_create_info shockwave
Definition: weapon.h:367
float damage
Definition: weapon.h:363
color laser_color_2
Definition: weapon.h:351
struct particle_spew_info particle_spew_info
short swarm_index
Definition: weapon.h:180
#define wp(p)
Definition: modelsinc.h:69
float flak_targeting_accuracy
Definition: weapon.h:375
float armor_factor
Definition: weapon.h:378
float damage_ship[MAX_WEP_DAMAGE_SLOTS]
Definition: weapon.h:234
int targeting_priorities[32]
Definition: weapon.h:542
void weapon_pause_sounds()
Definition: weapons.cpp:7248
int weapon_create_group_id()
Definition: weapons.cpp:6481
int impact_weapon_expl_index
Definition: weapon.h:426
char title[WEAPON_TITLE_LEN]
Definition: weapon.h:324
void weapon_detonate(object *objp)
Definition: weapons.cpp:6450
float turn_time
Definition: weapon.h:387
float weapon_submodel_rotate_vel
Definition: weapon.h:517
struct weapon_expl_info weapon_expl_info
float atten_damage
Definition: weapon.h:365
generic_anim thruster_flame
Definition: weapon.h:537
int Num_player_weapon_precedence
Definition: weapons.cpp:124
float arm_dist
Definition: weapon.h:370
const GLubyte * c
Definition: Glext.h:8376
float beam_muzzle_radius
Definition: weapon.h:257
float beam_width
Definition: weapon.h:276
generic_anim particle_spew_anim
Definition: weapon.h:292
int Default_cmeasure_index
Definition: weapons.cpp:117
int burst_shots
Definition: weapon.h:532
int Num_weapon_types
Definition: weapons.cpp:105
float tag_time
Definition: weapon.h:459
vec3d lssm_target_pos
Definition: weapon.h:220
float max_lifetime
Definition: weapon.h:381
int hud_image_index
Definition: weapon.h:344
float field_of_fire
Definition: weapon.h:494