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 #define MAX_WEAPON_TYPES 200
294 // define to compile corkscrew missiles in
298 #include "ship.h" /* needed for ship_subsys* */
299 #include "2d.h" // needed for color
300 #include "shockwave.h"
312 // Bitflags controlling weapon behavior
313 #define MAX_WEAPON_FLAGS 18 // Maximum number of different bit flags legal to specify in a single weapons.tbl Flags line
315 #define WIF_HOMING_HEAT (1 << 0) // if set, this weapon homes via seeking heat
316 #define WIF_HOMING_ASPECT (1 << 1) // if set, this weapon homes via chasing aspect
317 #define WIF_ELECTRONICS (1 << 2) // Takes out electronics systems.
318 #define WIF_SPAWN (1 << 3) // Spawns projectiles on detonation.
319 #define WIF_REMOTE (1 << 4) // Can be remotely detonated by parent.
320 #define WIF_PUNCTURE (1 << 5) // Punctures armor, damaging subsystems.
321 #define WIF_SUPERCAP (1 << 6) // This is a weapon which does supercap class damage (meaning, it applies real damage to supercap ships)
322 #define WIF_AREA_EFFECT (1 << 7) // Explosion has an area effect
323 #define WIF_SHOCKWAVE (1 << 8) // Explosion has a shockwave
324 #define WIF_TURNS (1 << 9) // Set this if the weapon ever changes heading. If you
325 // don't set this and the weapon turns, collision detection
326 // won't work, I promise!
327 #define WIF_SWARM (1 << 10) // Missile "swarms".. ie changes heading and twists on way to target
328 #define WIF_TRAIL (1 << 11) // Has a trail
329 #define WIF_BIG_ONLY (1 << 12) // Only big ships (cruiser, capital, etc.) can arm this weapon
330 #define WIF_CHILD (1 << 13) // No ship can have this weapon. It gets created by weapon detonations.
331 #define WIF_BOMB (1 << 14) // Bomb-type missile, can be targeted
332 #define WIF_HUGE (1 << 15) // Huge damage (generally 500+), probably only fired at huge ships.
333 #define WIF_NO_DUMBFIRE (1 << 16) // Missile cannot be fired dumbfire (ie requires aspect lock)
334 #define WIF_THRUSTER (1 << 17) // Has thruster cone and/or glow
335 #define WIF_IN_TECH_DATABASE (1 << 18)
336 #define WIF_PLAYER_ALLOWED (1 << 19) // allowed to be on starting wing ships/in weaponry pool
337 #define WIF_BOMBER_PLUS (1 << 20) // Fire this missile only at a bomber or big ship. But not a fighter.
339 #define WIF_CORKSCREW (1 << 21) // corkscrew style missile
340 #define WIF_PARTICLE_SPEW (1 << 22) // spews particles as it travels
341 #define WIF_EMP (1 << 23) // weapon explodes with a serious EMP effect
342 #define WIF_ENERGY_SUCK (1 << 24) // energy suck primary (impact effect)
343 #define WIF_FLAK (1 << 25) // use for big-ship turrets - flak gun
344 #define WIF_BEAM (1 << 26) // if this is a beam weapon : NOTE - VERY SPECIAL CASE
345 #define WIF_TAG (1 << 27) // this weapon has a tag effect when it hits
346 #define WIF_SHUDDER (1 << 28) // causes the weapon to shudder. shudder is proportional to the mass and damage of the weapon
347 #define WIF_MFLASH (1 << 29) // has muzzle flash
348 #define WIF_LOCKARM (1 << 30) // if the missile was fired without a lock, it does significanlty less damage on impact
349 #define WIF_STREAM (1 << 31) // handled by "trigger down/trigger up" instead of "fire - wait - fire - wait"
351 #define WIF_HOMING (WIF_HOMING_HEAT | WIF_HOMING_ASPECT)
352 #define WIF_HURTS_BIG_SHIPS (WIF_BOMB | WIF_BEAM | WIF_HUGE | WIF_BIG_ONLY)
354 #define WEAPON_EXHAUST_DELTA_TIME 75 // Delay in milliseconds between exhaust blobs
356 #define WF_LOCK_WARNING_PLAYED (1<<0) // set when a lock warning sound is played for the player
357 // (needed since we don't want to play multiple lock sounds)
358 #define WF_ALREADY_APPLIED_STATS (1<<1) // for use in ship_apply_local and ship_apply_global damage functions
359 // so that we don't record multiple hits (stats) for one impact
360 #define WF_PLAYED_FLYBY_SOUND (1<<2) // flyby sound has been played for this weapon
361 #define WF_CONSIDER_FOR_FLYBY_SOUND (1<<3) // consider for flyby
362 #define WF_DEAD_IN_WATER (1<<4) // a missiles engines have died
363 #define WF_LOCKED_WHEN_FIRED (1<<5) // fired with a lock
364 #define WF_DESTROYED_BY_WEAPON (1<<6) // destroyed by damage from other weapon
366 typedef struct weapon {
367 int weapon_info_index; // index into weapon_info array
368 int objnum; // object number for this weapon
369 int team; // The team of the ship that fired this
370 int species; // The species of the ship that fired this
371 float lifeleft; // life left on this weapon
372 int target_num; // Object index of target
373 int target_sig; // So we know if the target is the same one we've been tracking
374 float nearest_dist; // nearest distance yet attained to target
375 fix creation_time; // time at which created, stuffed Missiontime
376 int weapon_flags; // bit flags defining behavior, see WF_xxxx
377 object* homing_object; // object this weapon is homing on.
378 ship_subsys* homing_subsys; // subsystem this weapon is homing on
379 vector homing_pos; // world position missile is homing on
380 short swarm_index; // index into swarm missile info, -1 if not WIF_SWARM
381 int missile_list_index; // index for missiles into Missile_obj_list, -1 weapon not missile
382 int trail_num; // -1 if no trail, else index into Trails array
383 ship_subsys *turret_subsys; // points to turret that fired weapon, otherwise NULL
384 int group_id; // Which group this is in.
386 // Stuff for thruster glows
387 int thruster_bitmap; // What frame the current thruster bitmap is at for this weapon
388 float thruster_frame; // Used to keep track of which frame the animation should be on.
389 int thruster_glow_bitmap; // What frame the current thruster engine glow bitmap is at for this weapon
390 float thruster_glow_frame; // Used to keep track of which frame the engine glow animation should be on.
391 float thruster_glow_noise; // Noise for current frame
393 int pick_big_attack_point_timestamp; // Timestamp at which to pick a new point to attack.
394 vector big_attack_point; // Target-relative location of attack point.
396 int cmeasure_ignore_objnum; // Ignoring this countermeasure. It's failed to attract this weapon.
397 int cmeasure_chase_objnum; // Chasing this countermeasure. Don't maybe ignore in future.
399 // corkscrew info (taken out for now)
400 short cscrew_index; // corkscrew info index
402 // particle spew info
403 int particle_spew_time; // time to spew next bunch of particles
406 short flak_index; // flak info index
410 #if defined(FS2_DEMO) || defined(FS1_DEMO)
411 #define MAX_WEAPONS 100
413 // upped 5/6/98 from 200 - DB
414 #define MAX_WEAPONS 350
417 // info specific to beam weapons
418 #define MAX_BEAM_SECTIONS 5
419 typedef struct beam_weapon_section_info {
420 float width; // width of the section
421 int texture; // texture bitmap
422 ubyte rgba_inner[4]; // for non-textured beams
423 ubyte rgba_outer[4]; // for non-textured beams
424 float flicker; // how much it flickers (0.0 to 1.0)
425 float z_add; // is this necessary?
426 } beam_weapon_section_info;
428 typedef struct beam_weapon_info {
429 int beam_type; // beam type
430 float beam_life; // how long it lasts
431 int beam_warmup; // how long it takes to warmup (in ms)
432 int beam_warmdown; // how long it takes to warmdown (in ms)
433 float beam_muzzle_radius; // muzzle glow radius
434 int beam_particle_count; // beam spew particle count
435 float beam_particle_radius; // radius of beam particles
436 float beam_particle_angle; // angle of beam particle spew cone
437 int beam_particle_ani; // particle ani
438 float beam_miss_factor[NUM_SKILL_LEVELS]; // magic # which makes beams miss more. by skill level
439 int beam_loop_sound; // looping beam sound
440 int beam_warmup_sound; // warmup sound
441 int beam_warmdown_sound; // warmdown sound
442 int beam_num_sections; // the # of visible "sections" on the beam
443 int beam_glow_bitmap; // muzzle glow bitmap
444 int beam_shots; // # of shots the beam takes
445 float beam_shrink_factor; // what percentage of total beam lifetime when the beam starts shrinking
446 float beam_shrink_pct; // what percent/second the beam shrinks at
447 beam_weapon_section_info sections[MAX_BEAM_SECTIONS]; // info on the visible sections of the beam
450 extern weapon Weapons[MAX_WEAPONS];
452 #define WEAPON_TITLE_LEN 48
454 typedef struct weapon_info {
455 char name[NAME_LENGTH]; // name of this weapon
456 char title[WEAPON_TITLE_LEN]; // official title of weapon (used by tooltips)
457 char *desc; // weapon's description (used by tooltips)
458 int subtype; // one of the WP_* macros above
459 int render_type; // rendering method, laser, pof, avi
460 char pofbitmap_name[NAME_LENGTH]; // Name of the pof representing this if POF, or bitmap filename if bitmap
461 int model_num; // modelnum of weapon -- -1 if no model
463 char *tech_desc; // weapon's description (in tech database)
464 char tech_anim_filename[NAME_LENGTH]; // weapon's tech room animation
465 char tech_title[NAME_LENGTH]; // weapon's name (in tech database)
467 int laser_bitmap; // Which bitmap renders for laser, -1 if none
468 int laser_glow_bitmap; // optional bitmap for laser glow
470 color laser_color_1; // for cycling between glow colors
471 color laser_color_2; // for cycling between glow colors
472 float laser_head_radius, laser_tail_radius;
474 float max_speed; // initial speed of the weapon
475 float mass; // mass of the weapon
476 float fire_wait; // fire rate -- amount of time before you can refire the weapon
477 float blast_force; // force this weapon exhibits when hitting an object
478 float damage; // damage of weapon (for missile, damage within inner radius)
479 float inner_radius, outer_radius; // damage radii for missiles (0 means impact only)
480 float shockwave_speed; // speed of shockwave ( 0 means none )
481 float armor_factor, shield_factor, subsystem_factor; // in 0.0..2.0, scale of damage done to type of thing
482 float lifetime; // How long this thing lives.
483 float energy_consumed; // Energy used up when weapon is fired
484 int wi_flags; // bit flags defining behavior, see WIF_xxxx
486 float cargo_size; // cargo space taken up by individual weapon (missiles only)
487 float rearm_rate; // rate per second at which secondary weapons are loaded during rearming
488 float weapon_range; // max range weapon can be effectively fired. (May be less than life * speed)
491 short spawn_type; // Type of weapon to spawn when detonated.
492 short spawn_count; // Number of weapons of spawn_type to spawn.
495 short swarm_count; // how many swarm missiles are fired for this weapon
497 // Specific to ASPECT homing missiles.
498 float min_lock_time; // minimum time (in seconds) to achieve lock
499 int lock_pixels_per_sec; // pixels/sec moved while locking
500 int catchup_pixels_per_sec; // pixels/sec moved while catching-up for a lock
501 int catchup_pixel_penalty; // number of extra pixels to move while locking as a penalty for catching up for a lock
503 // Specific to HEAT homing missiles.
508 int flyby_snd; // whizz-by sound, transmitted through weapon's portable atmosphere.
510 // Specific to weapons with TRAILS:
513 char icon_filename[NAME_LENGTH]; // filename for icon that is displayed in weapon selection
514 char anim_filename[NAME_LENGTH]; // filename for animation that plays in weapon selection
516 int impact_weapon_expl_index; // Index into Weapon_expl_info of which ANI should play when this thing impacts something
517 float impact_explosion_radius; // How big the explosion should be
520 float emp_intensity; // intensity of the EMP effect
521 float emp_time; // time of the EMP effect
523 // Energy suck effect
524 float weapon_reduce; // how much energy removed from weapons systems
525 float afterburner_reduce; // how much energy removed from weapons systems
527 // Beam weapon effect
528 beam_weapon_info b_info; // this must be valid if the weapon is a beam weapon WIF_BEAM or WIF_BEAM_SMALL
531 float tag_time; // how long the tag lasts
532 int tag_level; // tag level (1 - 3)
535 int muzzle_flash; // muzzle flash stuff
538 // Data structure to track the active missiles
539 typedef struct missile_obj {
540 missile_obj *next, *prev;
543 extern missile_obj Missile_obj_list;
545 extern weapon_info Weapon_info[MAX_WEAPON_TYPES];
547 extern int Num_weapon_types; // number of weapons in the game
548 extern int First_secondary_index;
549 extern int Num_weapons;
551 extern int Num_player_weapon_precedence; // Number of weapon types in Player_weapon_precedence
552 extern int Player_weapon_precedence[MAX_WEAPON_TYPES]; // Array of weapon types, precedence list for player weapon selection
553 extern char *Weapon_names[MAX_WEAPON_TYPES];
555 #define WEAPON_INDEX(wp) (wp-Weapons)
556 #define WEAPON_INFO_INDEX(wip) (wip-Weapon_info)
559 int weapon_info_lookup(const char *name);
560 void weapon_init(); // called at game startup
561 void weapon_level_init(); // called before the start of each level
562 void weapon_render(object * obj);
563 void weapon_delete( object * obj );
564 void weapon_process_pre( object *obj, float frame_time);
565 void weapon_process_post( object *obj, float frame_time);
567 // Group_id: If you should quad lasers, they should all have the same group id.
568 // This will be used to optimize lighting, since each group only needs to cast one light.
569 // Call this to get a new group id, then pass it to each weapon_create call for all the
570 // weapons in the group. Number will be between 0 and WEAPON_MAX_GROUP_IDS and will
572 int weapon_create_group_id();
574 // How many unique groups of weapons there can be at one time.
575 #define WEAPON_MAX_GROUP_IDS 256
577 // Passing a group_id of -1 means it isn't in a group. See weapon_create_group_id for more
578 // help on weapon groups.
579 int weapon_create( vector * pos, matrix * orient, int weapon_type, int parent_obj, int secondary_flag, int group_id=-1, int is_locked = 0);
580 void weapon_set_tracking_info(int weapon_objnum, int parent_objnum, int target_objnum, int target_is_locked = 0, ship_subsys *target_subsys = NULL);
582 // for weapons flagged as particle spewers, spew particles. wheee
583 void weapon_maybe_spew_particle(object *obj);
586 void weapon_hit( object * weapon_obj, object * other_obj, vector * hitpos );
587 int weapon_name_lookup(const char *name);
588 void spawn_child_weapons( object *objp );
590 // call to detonate a weapon. essentially calls weapon_hit() with other_obj as NULL, and sends a packet in multiplayer
591 void weapon_detonate(object *objp);
593 void weapon_area_apply_blast(vector *force_apply_pos, object *ship_objp, vector *blast_pos, float blast, int make_shockwave);
594 int weapon_area_calc_damage(object *objp, vector *pos, float inner_rad, float outer_rad, float max_blast, float max_damage,
595 float *blast, float *damage, float limit);
597 void missile_obj_list_rebuild(); // called by save/restore code only
598 missile_obj *missile_obj_return_address(int index);
599 void find_homing_object_cmeasures();
601 // THE FOLLOWING FUNCTION IS IN SHIP.CPP!!!!
602 // JAS - figure out which thruster bitmap will get rendered next
603 // time around. ship_render needs to have shipp->thruster_bitmap set to
604 // a valid bitmap number, or -1 if we shouldn't render thrusters.
605 // This does basically the same thing as ship_do_thruster_frame, except it
606 // operates on a weapon. This is in the ship code because it needs
607 // the same thruster animation info as the ship stuff, and I would
608 // rather extern this one function than all the thruster animation stuff.
609 void ship_do_weapon_thruster_frame( weapon *weaponp, object *objp, float frametime );
611 // call to get the "color" of the laser at the given moment (since glowing lasers can cycle colors)
612 void weapon_get_laser_color(color *c, object *objp);
614 void weapon_hit_do_sound(object *hit_obj, weapon_info *wip, vector *hitpos);
616 // return a scale factor for damage which should be applied for 2 collisions
617 float weapon_get_damage_scale(weapon_info *wip, object *wep, object *target);
619 // return handle to explosion ani
620 int weapon_get_expl_handle(int weapon_expl_index, vector *pos, float size);
622 void weapon_close(); // called in game_shutdown() to free malloc'd memory