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/Weapon.h $
15 * <insert description of file here>
18 * Revision 1.4 2003/06/11 18:30:32 taylor
21 * Revision 1.3 2003/05/25 02:30:42 taylor
24 * Revision 1.2 2002/06/09 04:41:15 relnev
25 * added copyright header
27 * Revision 1.1.1.1 2002/05/03 03:28:12 root
31 * 34 9/06/99 12:46a Andsager
32 * Add weapon_explosion_ani LOD
34 * 33 8/27/99 1:34a Andsager
35 * Modify damage by shockwaves for BIG|HUGE ships. Modify shockwave damge
36 * when weapon blows up.
38 * 32 8/24/99 10:47a Jefff
39 * tech room weapon anims. added tech anim field to weapons.tbl
41 * 31 8/10/99 5:30p Jefff
42 * Added tech_title string to weapon_info. Changed parser accordingly.
44 * 30 8/02/99 5:16p Dave
45 * Bumped up weapon title string length from 32 to 48
47 * 29 7/15/99 9:20a Andsager
48 * FS2_DEMO initial checkin
50 * 28 6/30/99 5:53p Dave
51 * Put in new anti-camper code.
53 * 27 6/21/99 7:25p Dave
54 * netplayer pain packet. Added type E unmoving beams.
56 * 26 6/14/99 10:45a Dave
57 * Made beam weapons specify accuracy by skill level in the weapons.tbl
59 * 25 6/04/99 2:16p Dave
60 * Put in shrink effect for beam weapons.
62 * 24 6/01/99 8:35p Dave
63 * Finished lockarm weapons. Added proper supercap weapons/damage. Added
64 * awacs-set-radius sexpression.
66 * 23 5/27/99 6:17p Dave
67 * Added in laser glows.
69 * 22 5/20/99 7:00p Dave
70 * Added alternate type names for ships. Changed swarm missile table
73 * 21 4/28/99 11:13p Dave
74 * Temporary checkin of artillery code.
76 * 20 4/28/99 3:11p Andsager
77 * Stagger turret weapon fire times. Make turrets smarter when target is
78 * protected or beam protected. Add weaopn range to weapon info struct.
80 * 19 4/22/99 11:06p Dave
81 * Final pass at beam weapons. Solidified a lot of stuff. All that remains
82 * now is to tweak and fix bugs as they come up. No new beam weapon
85 * 18 4/19/99 11:01p Dave
86 * More sophisticated targeting laser support. Temporary checkin.
88 * 17 4/16/99 5:54p Dave
89 * Support for on/off style "stream" weapons. Real early support for
90 * target-painting lasers.
92 * 16 4/02/99 9:55a Dave
93 * Added a few more options in the weapons.tbl for beam weapons. Attempt
94 * at putting "pain" packets into multiplayer.
96 * 15 3/31/99 8:24p Dave
97 * Beefed up all kinds of stuff, incluging beam weapons, nebula effects
98 * and background nebulae. Added per-ship non-dimming pixel colors.
100 * 14 3/23/99 11:03a Dave
101 * Added a few new fields and fixed parsing code for new weapon stuff.
103 * 13 3/19/99 9:52a Dave
104 * Checkin to repair massive source safe crash. Also added support for
105 * pof-style nebulae, and some new weapons code.
107 * 12 1/29/99 12:47a Dave
108 * Put in sounds for beam weapon. A bunch of interface screens (tech
111 * 11 1/27/99 9:56a Dave
112 * Temporary checkin of beam weapons for Dan to make cool sounds.
114 * 10 1/25/99 5:03a Dave
115 * First run of stealth, AWACS and TAG missile support. New mission type
118 * 9 1/24/99 11:37p Dave
119 * First full rev of beam weapons. Very customizable. Removed some bogus
120 * Int3()'s in low level net code.
122 * 8 1/21/99 10:45a Dave
123 * More beam weapon stuff. Put in warmdown time.
125 * 7 1/08/99 2:08p Dave
126 * Fixed software rendering for pofview. Super early support for AWACS and
129 * 6 11/14/98 5:33p Dave
130 * Lots of nebula work. Put in ship contrails.
132 * 5 10/26/98 9:42a Dave
133 * Early flak gun support.
135 * 4 10/16/98 3:42p Andsager
136 * increase MAX_WEAPONS and MAX_SHIPS and som header files
138 * 3 10/07/98 6:27p Dave
139 * Globalized mission and campaign file extensions. Removed Silent Threat
140 * special code. Moved \cache \players and \multidata into the \data
143 * 2 10/07/98 10:54a Dave
146 * 1 10/07/98 10:51a Dave
148 * 100 9/04/98 3:52p Dave
149 * Put in validated mission updating and application during stats
152 * 99 9/01/98 4:25p Dave
153 * Put in total (I think) backwards compatibility between mission disk
154 * freespace and non mission disk freespace, including pilot files and
155 * campaign savefiles.
157 * 98 8/28/98 3:29p Dave
158 * EMP effect done. AI effects may need some tweaking as required.
160 * 97 8/25/98 1:49p Dave
161 * First rev of EMP effect. Player side stuff basically done. Next comes
164 * 96 8/18/98 10:15a Dave
165 * Touchups on the corkscrew missiles. Added particle spewing weapons.
167 * 95 8/17/98 5:07p Dave
168 * First rev of corkscrewing missiles.
170 * 94 5/18/98 1:58a Mike
171 * Make Phoenix not be fired at fighters (but yes bombers).
172 * Improve positioning of ships in guard mode.
173 * Make turrets on player ship not fire near end of support ship docking.
175 * 93 5/15/98 5:37p Hoffoss
176 * Added new 'tech description' fields to ship and weapon tables, and
177 * added usage of it in tech room.
179 * 92 5/06/98 8:06p Dave
180 * Made standalone reset properly under weird conditions. Tweak
181 * optionsmulti screen. Upped MAX_WEAPONS to 350. Put in new launch
182 * countdown anim. Minro ui fixes/tweaks.
184 * 91 5/05/98 11:15p Lawrance
185 * Optimize weapon flyby sound determination
187 * 90 5/05/98 4:08p Hoffoss
188 * Added WIF_PLAYER_ALLOWED to check what is valid for the weaponry pool
191 * 89 4/23/98 5:50p Hoffoss
192 * Added tracking of techroom database list info in pilot files, added
193 * sexp to add more to list, made mouse usable on ship listing in tech
196 * 88 4/19/98 9:21p Sandeep
198 * 87 4/13/98 5:11p Mike
199 * More improvement to countermeasure code.
201 * 86 4/10/98 11:02p Mike
202 * Make countermeasures less effective against aspect seekers than against
204 * Make AI ships match bank with each other when attacking a faraway
206 * Make ships not do silly loop-de-loop sometimes when attacking a faraway
209 * 85 4/10/98 4:52p Hoffoss
210 * Made several changes related to tooltips.
212 * 84 4/02/98 11:40a Lawrance
213 * check for #ifdef DEMO instead of #ifdef DEMO_RELEASE
215 * 83 4/01/98 5:35p John
216 * Made only the used POFs page in for a level. Reduced some interp
217 * arrays. Made custom detail level work differently.
219 * 82 3/21/98 3:37p Mike
220 * Fix/optimize attacking of big ships.
222 * 81 3/15/98 9:44p Lawrance
223 * Get secondary weapons for turrets working
225 * 79 3/12/98 1:24p Mike
226 * When weapons linked, increase firing delay.
227 * Free up weapon slots for AI ships, if necessary.
228 * Backside render shield effect.
229 * Remove shield hit triangle if offscreen.
231 * 78 3/11/98 4:34p John
232 * Made weapons have glow & thrusters.
234 * 77 3/04/98 8:51a Mike
235 * Working on making ships better about firing Synaptic.
237 * 76 3/03/98 5:12p Dave
238 * 50% done with team vs. team interface issues. Added statskeeping to
239 * secondary weapon blasts. Numerous multiplayer ui bug fixes.
241 * 75 3/02/98 10:00a Sandeep
243 * 74 2/15/98 11:28p Allender
244 * allow increase in MAX_WEAPON_TYPES by chaning all bitfield references
246 * 73 2/11/98 1:52p Sandeep
248 * 72 2/02/98 8:47a Andsager
249 * Ship death area damage applied as instantaneous damage for small ships
250 * and shockwaves for large (>50 radius) ships.
252 * 71 1/29/98 11:48a John
253 * Added new counter measure rendering as model code. Made weapons be
254 * able to have impact explosion.
256 * 70 1/23/98 5:08p John
257 * Took L out of vertex structure used B (blue) instead. Took all small
258 * fireballs out of fireball types and used particles instead. Fixed some
259 * debris explosion things. Restructured fireball code. Restructured
260 * some lighting code. Made dynamic lighting on by default. Made groups
261 * of lasers only cast one light. Made fireballs not cast light.
263 * 69 1/21/98 7:20p Lawrance
264 * removed unused mount_size member
266 * 68 1/19/98 10:01p Lawrance
267 * Implement "Electronics" missiles
269 * 67 1/17/98 10:04p Lawrance
270 * Implementing "must lock to fire" missiles. Fix couple bugs with rearm
273 * 66 1/17/98 4:45p Mike
274 * Better support for AI selection of secondary weapons.
276 * 65 1/16/98 11:43a Mike
277 * Fix countermeasures.
279 * 64 1/15/98 11:13a John
280 * Added code for specifying weapon trail bitmaps in weapons.tbl
282 * 63 1/06/98 6:58p Lawrance
283 * Add wp->turret_subsys, which gets set when a turret fires a weapon.
291 // define moved to before includes so that we can have it available when ship.h is included below
292 #if defined(FS1_DEMO)
293 #define MAX_WEAPON_TYPES 44
294 #elif defined(MAKE_FS1)
295 #define MAX_WEAPON_TYPES 48
297 #define MAX_WEAPON_TYPES 200
300 // define to compile corkscrew missiles in
304 #include "ship.h" /* needed for ship_subsys* */
305 #include "2d.h" // needed for color
306 #include "shockwave.h"
318 // Bitflags controlling weapon behavior
319 #define MAX_WEAPON_FLAGS 18 // Maximum number of different bit flags legal to specify in a single weapons.tbl Flags line
321 #define WIF_HOMING_HEAT (1 << 0) // if set, this weapon homes via seeking heat
322 #define WIF_HOMING_ASPECT (1 << 1) // if set, this weapon homes via chasing aspect
323 #define WIF_ELECTRONICS (1 << 2) // Takes out electronics systems.
324 #define WIF_SPAWN (1 << 3) // Spawns projectiles on detonation.
325 #define WIF_REMOTE (1 << 4) // Can be remotely detonated by parent.
326 #define WIF_PUNCTURE (1 << 5) // Punctures armor, damaging subsystems.
327 #define WIF_SUPERCAP (1 << 6) // This is a weapon which does supercap class damage (meaning, it applies real damage to supercap ships)
328 #define WIF_AREA_EFFECT (1 << 7) // Explosion has an area effect
329 #define WIF_SHOCKWAVE (1 << 8) // Explosion has a shockwave
330 #define WIF_TURNS (1 << 9) // Set this if the weapon ever changes heading. If you
331 // don't set this and the weapon turns, collision detection
332 // won't work, I promise!
333 #define WIF_SWARM (1 << 10) // Missile "swarms".. ie changes heading and twists on way to target
334 #define WIF_TRAIL (1 << 11) // Has a trail
335 #define WIF_BIG_ONLY (1 << 12) // Only big ships (cruiser, capital, etc.) can arm this weapon
336 #define WIF_CHILD (1 << 13) // No ship can have this weapon. It gets created by weapon detonations.
337 #define WIF_BOMB (1 << 14) // Bomb-type missile, can be targeted
338 #define WIF_HUGE (1 << 15) // Huge damage (generally 500+), probably only fired at huge ships.
339 #define WIF_NO_DUMBFIRE (1 << 16) // Missile cannot be fired dumbfire (ie requires aspect lock)
340 #define WIF_THRUSTER (1 << 17) // Has thruster cone and/or glow
341 #define WIF_IN_TECH_DATABASE (1 << 18)
342 #define WIF_PLAYER_ALLOWED (1 << 19) // allowed to be on starting wing ships/in weaponry pool
343 #define WIF_BOMBER_PLUS (1 << 20) // Fire this missile only at a bomber or big ship. But not a fighter.
345 #define WIF_CORKSCREW (1 << 21) // corkscrew style missile
346 #define WIF_PARTICLE_SPEW (1 << 22) // spews particles as it travels
347 #define WIF_EMP (1 << 23) // weapon explodes with a serious EMP effect
348 #define WIF_ENERGY_SUCK (1 << 24) // energy suck primary (impact effect)
349 #define WIF_FLAK (1 << 25) // use for big-ship turrets - flak gun
350 #define WIF_BEAM (1 << 26) // if this is a beam weapon : NOTE - VERY SPECIAL CASE
351 #define WIF_TAG (1 << 27) // this weapon has a tag effect when it hits
352 #define WIF_SHUDDER (1 << 28) // causes the weapon to shudder. shudder is proportional to the mass and damage of the weapon
353 #define WIF_MFLASH (1 << 29) // has muzzle flash
354 #define WIF_LOCKARM (1 << 30) // if the missile was fired without a lock, it does significanlty less damage on impact
355 #define WIF_STREAM (1 << 31) // handled by "trigger down/trigger up" instead of "fire - wait - fire - wait"
357 #define WIF_HOMING (WIF_HOMING_HEAT | WIF_HOMING_ASPECT)
358 #define WIF_HURTS_BIG_SHIPS (WIF_BOMB | WIF_BEAM | WIF_HUGE | WIF_BIG_ONLY)
360 #define WEAPON_EXHAUST_DELTA_TIME 75 // Delay in milliseconds between exhaust blobs
362 #define WF_LOCK_WARNING_PLAYED (1<<0) // set when a lock warning sound is played for the player
363 // (needed since we don't want to play multiple lock sounds)
364 #define WF_ALREADY_APPLIED_STATS (1<<1) // for use in ship_apply_local and ship_apply_global damage functions
365 // so that we don't record multiple hits (stats) for one impact
366 #define WF_PLAYED_FLYBY_SOUND (1<<2) // flyby sound has been played for this weapon
367 #define WF_CONSIDER_FOR_FLYBY_SOUND (1<<3) // consider for flyby
368 #define WF_DEAD_IN_WATER (1<<4) // a missiles engines have died
369 #define WF_LOCKED_WHEN_FIRED (1<<5) // fired with a lock
370 #define WF_DESTROYED_BY_WEAPON (1<<6) // destroyed by damage from other weapon
372 typedef struct weapon {
373 int weapon_info_index; // index into weapon_info array
374 int objnum; // object number for this weapon
375 int team; // The team of the ship that fired this
376 int species; // The species of the ship that fired this
377 float lifeleft; // life left on this weapon
378 int target_num; // Object index of target
379 int target_sig; // So we know if the target is the same one we've been tracking
380 float nearest_dist; // nearest distance yet attained to target
381 fix creation_time; // time at which created, stuffed Missiontime
382 int weapon_flags; // bit flags defining behavior, see WF_xxxx
383 object* homing_object; // object this weapon is homing on.
384 ship_subsys* homing_subsys; // subsystem this weapon is homing on
385 vector homing_pos; // world position missile is homing on
386 short swarm_index; // index into swarm missile info, -1 if not WIF_SWARM
387 int missile_list_index; // index for missiles into Missile_obj_list, -1 weapon not missile
388 int trail_num; // -1 if no trail, else index into Trails array
389 ship_subsys *turret_subsys; // points to turret that fired weapon, otherwise NULL
390 int group_id; // Which group this is in.
392 // Stuff for thruster glows
393 int thruster_bitmap; // What frame the current thruster bitmap is at for this weapon
394 float thruster_frame; // Used to keep track of which frame the animation should be on.
395 int thruster_glow_bitmap; // What frame the current thruster engine glow bitmap is at for this weapon
396 float thruster_glow_frame; // Used to keep track of which frame the engine glow animation should be on.
397 float thruster_glow_noise; // Noise for current frame
399 int pick_big_attack_point_timestamp; // Timestamp at which to pick a new point to attack.
400 vector big_attack_point; // Target-relative location of attack point.
402 int cmeasure_ignore_objnum; // Ignoring this countermeasure. It's failed to attract this weapon.
403 int cmeasure_chase_objnum; // Chasing this countermeasure. Don't maybe ignore in future.
405 // corkscrew info (taken out for now)
406 short cscrew_index; // corkscrew info index
408 // particle spew info
409 int particle_spew_time; // time to spew next bunch of particles
412 short flak_index; // flak info index
416 #if defined(FS2_DEMO) || defined(FS1_DEMO)
417 #define MAX_WEAPONS 100
419 // upped 5/6/98 from 200 - DB
420 #define MAX_WEAPONS 350
423 // info specific to beam weapons
424 #define MAX_BEAM_SECTIONS 5
425 typedef struct beam_weapon_section_info {
426 float width; // width of the section
427 int texture; // texture bitmap
428 ubyte rgba_inner[4]; // for non-textured beams
429 ubyte rgba_outer[4]; // for non-textured beams
430 float flicker; // how much it flickers (0.0 to 1.0)
431 float z_add; // is this necessary?
432 } beam_weapon_section_info;
434 typedef struct beam_weapon_info {
435 int beam_type; // beam type
436 float beam_life; // how long it lasts
437 int beam_warmup; // how long it takes to warmup (in ms)
438 int beam_warmdown; // how long it takes to warmdown (in ms)
439 float beam_muzzle_radius; // muzzle glow radius
440 int beam_particle_count; // beam spew particle count
441 float beam_particle_radius; // radius of beam particles
442 float beam_particle_angle; // angle of beam particle spew cone
443 int beam_particle_ani; // particle ani
444 float beam_miss_factor[NUM_SKILL_LEVELS]; // magic # which makes beams miss more. by skill level
445 int beam_loop_sound; // looping beam sound
446 int beam_warmup_sound; // warmup sound
447 int beam_warmdown_sound; // warmdown sound
448 int beam_num_sections; // the # of visible "sections" on the beam
449 int beam_glow_bitmap; // muzzle glow bitmap
450 int beam_shots; // # of shots the beam takes
451 float beam_shrink_factor; // what percentage of total beam lifetime when the beam starts shrinking
452 float beam_shrink_pct; // what percent/second the beam shrinks at
453 beam_weapon_section_info sections[MAX_BEAM_SECTIONS]; // info on the visible sections of the beam
456 extern weapon Weapons[MAX_WEAPONS];
458 #define WEAPON_TITLE_LEN 48
460 typedef struct weapon_info {
461 char name[NAME_LENGTH]; // name of this weapon
462 char title[WEAPON_TITLE_LEN]; // official title of weapon (used by tooltips)
463 char *desc; // weapon's description (used by tooltips)
464 int subtype; // one of the WP_* macros above
465 int render_type; // rendering method, laser, pof, avi
466 char pofbitmap_name[NAME_LENGTH]; // Name of the pof representing this if POF, or bitmap filename if bitmap
467 int model_num; // modelnum of weapon -- -1 if no model
469 char *tech_desc; // weapon's description (in tech database)
470 char tech_anim_filename[NAME_LENGTH]; // weapon's tech room animation
471 char tech_title[NAME_LENGTH]; // weapon's name (in tech database)
473 int laser_bitmap; // Which bitmap renders for laser, -1 if none
474 int laser_glow_bitmap; // optional bitmap for laser glow
476 color laser_color_1; // for cycling between glow colors
477 color laser_color_2; // for cycling between glow colors
478 float laser_head_radius, laser_tail_radius;
480 float max_speed; // initial speed of the weapon
481 float mass; // mass of the weapon
482 float fire_wait; // fire rate -- amount of time before you can refire the weapon
483 float blast_force; // force this weapon exhibits when hitting an object
484 float damage; // damage of weapon (for missile, damage within inner radius)
485 float inner_radius, outer_radius; // damage radii for missiles (0 means impact only)
486 float shockwave_speed; // speed of shockwave ( 0 means none )
487 float armor_factor, shield_factor, subsystem_factor; // in 0.0..2.0, scale of damage done to type of thing
488 float lifetime; // How long this thing lives.
489 float energy_consumed; // Energy used up when weapon is fired
490 int wi_flags; // bit flags defining behavior, see WIF_xxxx
492 float cargo_size; // cargo space taken up by individual weapon (missiles only)
493 float rearm_rate; // rate per second at which secondary weapons are loaded during rearming
494 float weapon_range; // max range weapon can be effectively fired. (May be less than life * speed)
497 short spawn_type; // Type of weapon to spawn when detonated.
498 short spawn_count; // Number of weapons of spawn_type to spawn.
501 short swarm_count; // how many swarm missiles are fired for this weapon
503 // Specific to ASPECT homing missiles.
504 float min_lock_time; // minimum time (in seconds) to achieve lock
505 int lock_pixels_per_sec; // pixels/sec moved while locking
506 int catchup_pixels_per_sec; // pixels/sec moved while catching-up for a lock
507 int catchup_pixel_penalty; // number of extra pixels to move while locking as a penalty for catching up for a lock
509 // Specific to HEAT homing missiles.
514 int flyby_snd; // whizz-by sound, transmitted through weapon's portable atmosphere.
516 // Specific to weapons with TRAILS:
519 char icon_filename[NAME_LENGTH]; // filename for icon that is displayed in weapon selection
520 char anim_filename[NAME_LENGTH]; // filename for animation that plays in weapon selection
522 int impact_weapon_expl_index; // Index into Weapon_expl_info of which ANI should play when this thing impacts something
523 float impact_explosion_radius; // How big the explosion should be
526 float emp_intensity; // intensity of the EMP effect
527 float emp_time; // time of the EMP effect
529 // Energy suck effect
530 float weapon_reduce; // how much energy removed from weapons systems
531 float afterburner_reduce; // how much energy removed from weapons systems
533 // Beam weapon effect
534 beam_weapon_info b_info; // this must be valid if the weapon is a beam weapon WIF_BEAM or WIF_BEAM_SMALL
537 float tag_time; // how long the tag lasts
538 int tag_level; // tag level (1 - 3)
541 int muzzle_flash; // muzzle flash stuff
544 // Data structure to track the active missiles
545 typedef struct missile_obj {
546 missile_obj *next, *prev;
549 extern missile_obj Missile_obj_list;
551 extern weapon_info Weapon_info[MAX_WEAPON_TYPES];
553 extern int Num_weapon_types; // number of weapons in the game
554 extern int First_secondary_index;
555 extern int Num_weapons;
557 extern int Num_player_weapon_precedence; // Number of weapon types in Player_weapon_precedence
558 extern int Player_weapon_precedence[MAX_WEAPON_TYPES]; // Array of weapon types, precedence list for player weapon selection
559 extern char *Weapon_names[MAX_WEAPON_TYPES];
561 #define WEAPON_INDEX(wp) (wp-Weapons)
562 #define WEAPON_INFO_INDEX(wip) (wip-Weapon_info)
565 int weapon_info_lookup(const char *name);
566 void weapon_init(); // called at game startup
567 void weapon_level_init(); // called before the start of each level
568 void weapon_render(object * obj);
569 void weapon_delete( object * obj );
570 void weapon_process_pre( object *obj, float frame_time);
571 void weapon_process_post( object *obj, float frame_time);
573 // Group_id: If you should quad lasers, they should all have the same group id.
574 // This will be used to optimize lighting, since each group only needs to cast one light.
575 // Call this to get a new group id, then pass it to each weapon_create call for all the
576 // weapons in the group. Number will be between 0 and WEAPON_MAX_GROUP_IDS and will
578 int weapon_create_group_id();
580 // How many unique groups of weapons there can be at one time.
581 #define WEAPON_MAX_GROUP_IDS 256
583 // Passing a group_id of -1 means it isn't in a group. See weapon_create_group_id for more
584 // help on weapon groups.
585 int weapon_create( vector * pos, matrix * orient, int weapon_type, int parent_obj, int secondary_flag, int group_id=-1, int is_locked = 0);
586 void weapon_set_tracking_info(int weapon_objnum, int parent_objnum, int target_objnum, int target_is_locked = 0, ship_subsys *target_subsys = NULL);
588 // for weapons flagged as particle spewers, spew particles. wheee
589 void weapon_maybe_spew_particle(object *obj);
592 void weapon_hit( object * weapon_obj, object * other_obj, vector * hitpos );
593 int weapon_name_lookup(const char *name);
594 void spawn_child_weapons( object *objp );
596 // call to detonate a weapon. essentially calls weapon_hit() with other_obj as NULL, and sends a packet in multiplayer
597 void weapon_detonate(object *objp);
599 void weapon_area_apply_blast(vector *force_apply_pos, object *ship_objp, vector *blast_pos, float blast, int make_shockwave);
600 int weapon_area_calc_damage(object *objp, vector *pos, float inner_rad, float outer_rad, float max_blast, float max_damage,
601 float *blast, float *damage, float limit);
603 void missile_obj_list_rebuild(); // called by save/restore code only
604 missile_obj *missile_obj_return_address(int index);
605 void find_homing_object_cmeasures();
607 // THE FOLLOWING FUNCTION IS IN SHIP.CPP!!!!
608 // JAS - figure out which thruster bitmap will get rendered next
609 // time around. ship_render needs to have shipp->thruster_bitmap set to
610 // a valid bitmap number, or -1 if we shouldn't render thrusters.
611 // This does basically the same thing as ship_do_thruster_frame, except it
612 // operates on a weapon. This is in the ship code because it needs
613 // the same thruster animation info as the ship stuff, and I would
614 // rather extern this one function than all the thruster animation stuff.
615 void ship_do_weapon_thruster_frame( weapon *weaponp, object *objp, float frametime );
617 // call to get the "color" of the laser at the given moment (since glowing lasers can cycle colors)
618 void weapon_get_laser_color(color *c, object *objp);
620 void weapon_hit_do_sound(object *hit_obj, weapon_info *wip, vector *hitpos);
622 // return a scale factor for damage which should be applied for 2 collisions
623 float weapon_get_damage_scale(weapon_info *wip, object *wep, object *target);
625 // return handle to explosion ani
626 int weapon_get_expl_handle(int weapon_expl_index, vector *pos, float size);
628 void weapon_close(); // called in game_shutdown() to free malloc'd memory