/*
MECHWPNS.C
MW2 weapons & explosion / sfx tables
ep 9/12
*/
#include <stdlib.h>
#include "mw2.h"
#include "3dstruct.h"
#include "mechdefs.h"
#include "viewdefs.h"
#include "audiopan.h"
#include "audio_id.h"
// Constants - added on an ad-hoc basis
#define HEAT 32768L // scale factor for one heat unit
// (heat is <16.16>)
#define MHEAT 0x20000L // scale for missile heat
#define LLASER_SPEED 280 // LLaser initial velocity, cm/tick
#define MLASER_SPEED 280 // MLaser initial velocity, cm/tick
#define SLASER_SPEED 280 // SLaser initial velocity, cm/tick
#define LRM_DMG 2 // damage per missile for LRMs
#define SRM_DMG 3 // for SRMs
#define AC_BUMP 1.5 // multiplier for AC damage
#define LRM_TIME 5.5 * ASECOND // flight time for LRMs
#define SRM_TIME 3.9 * ASECOND // flight time for SRMS
// This is the weapon class table. A weapon instance (an individual
// example of a weapon) will reference a member of this array.
// Ranges in this table are for decision making only & don't do
// anything to the behavior of the shot, which is entirely determined
// by the simulation.
// Data are:
// weapon basic type missile / bullet / laser / ppc / flamer / whatever
// xplosion type same as above, or -1 for no explosion
// automatic / oneshot nonzero for automatic
// modeled / faked nonzero if there's a geometry model
// smart / dumb nonzero if it's guided
// salvo number of projectiles in one shot
// firing audio id project file cache id of firing audio
// ddy how much gravity accelerates the model, 16.16
// velocity initial velocity, in cm/tick
// damage basic damage done by 1 shot
// heat heat buildup from firing this weapon
// min range in cm (for display & selection only)
// max range in cm (ditto)
// recycle time time for weapon to recharge/reload
// shot time time for salvo to finish
// air time time until projectile times out
// text[ 8 ] in-cockpit text, for user's instance only
MECH_WEAPON mech_weapons[] = {
// --- LRM20 ----
{
SMISSILE_TYPE, // Weapon type
MISSILE_TYPE, // Explosion type
MISSILE_FLASH1, // Muzzle flash type 1
MISSILE_FLASH2, // Muzzle flash type 2
0, // 0 = one-shot, 1 = auto
1, // 0 = fake, 1 = geometry
1, // 0 = dumb, 1 = guided
20, // Shots per salvo
6, // Default number of salvos
MECBBAAT, // Audio ID
0, // ddy (effect of gravity)
100, // Vo (initial velocity)
LRM_DMG, // Damage per shot
0.3 * MHEAT, // Heat from firing
0, // Heat from impacting
7500, // Minimum range
100100, // Maximum range
14 * ASECOND, // Recycle time
TEENTHSECOND, // Duration of salvo firing
LRM_TIME, // Life of shot
"LRM20"
},
// --- LRM15 ----
{
SMISSILE_TYPE, // Weapon type
MISSILE_TYPE, // Explosion type
MISSILE_FLASH1, // Muzzle flash type 1
MISSILE_FLASH2, // Muzzle flash type 2
0, // 0 = one-shot, 1 = auto
1, // 0 = fake, 1 = geometry
1, // 0 = dumb, 1 = guided
15, // Shots per salvo
8, // Default number of salvos
MECBBAAT, // Audio ID
0, // ddy (effect of gravity)
100, // Vo (initial velocity)
LRM_DMG, // Damage per shot
0.3 * MHEAT, // Heat from firing
0, // Heat from impacting
7500, // Minimum range
100100, // Maximum range
12 * ASECOND, // Recycle time
TENTHSECOND, // Duration of salvo firing
LRM_TIME, // Life of shot
"LRM15"
},
// --- LRM10 ----
{
SMISSILE_TYPE, // Weapon type
MISSILE_TYPE, // Explosion type
MISSILE_FLASH1, // Muzzle flash type 1
MISSILE_FLASH2, // Muzzle flash type 2
0, // 0 = one-shot, 1 = auto
1, // 0 = fake, 1 = geometry
1, // 0 = dumb, 1 = guided
10, // Shots per salvo
12, // Default number of salvos
MECBBAAT, // Audio ID
0, // ddy (effect of gravity)
100, // Vo (initial velocity)
LRM_DMG, // Damage per shot
0.4 * MHEAT, // Heat from firing
0, // Heat from impacting
7500, // Minimum range
100100, // Maximum range
10 * ASECOND, // Recycle time
QUARTERSECOND, // Duration of salvo firing
LRM_TIME, // Life of shot
"LRM10"
},
// --- LRM5 ----
{
SMISSILE_TYPE, // Weapon type
MISSILE_TYPE, // Explosion type
MISSILE_FLASH1, // Muzzle flash type 1
MISSILE_FLASH2, // Muzzle flash type 2
0, // 0 = one-shot, 1 = auto
1, // 0 = fake, 1 = geometry
1, // 0 = dumb, 1 = guided
5, // Shots per salvo
12, // Default number of salvos
MECBBAAT, // Audio ID
0, // ddy (effect of gravity)
100, // Vo (initial velocity)
LRM_DMG, // Damage per shot
0.4 * MHEAT, // Heat from firing
0, // Heat from impacting
7500, // Minimum range
100100, // Maximum range
8 * ASECOND, // Recycle time
QUARTERSECOND, // Duration of salvo firing
LRM_TIME, // Life of shot
"LRM5"
},
// --- SRM6 ----
{
MISSILE_TYPE, // Weapon type
MISSILE_TYPE, // Explosion type
MISSILE_FLASH1, // Muzzle flash type 1
MISSILE_FLASH2, // Muzzle flash type 2
0, // 0 = one-shot, 1 = auto
1, // 0 = fake, 1 = geometry
0, // 0 = dumb, 1 = guided
6, // Shots per salvo
15, // Default number of salvos
MLAUNCH1, // Audio ID
0, // ddy (effect of gravity)
70, // Vo (initial velocity)
SRM_DMG, // Damage per shot
0.67 * MHEAT , // Heat from firing
0, // Heat from impacting
0, // Minimum range
49686, // Maximum range
8 * ASECOND, // Recycle time
THIRDSECOND, // Duration of salvo firing
SRM_TIME, // Life of shot
"SRM6"
},
// --- SRM4 ----
{
MISSILE_TYPE, // Weapon type
MISSILE_TYPE, // Explosion type
MISSILE_FLASH1, // Muzzle flash type 1
MISSILE_FLASH2, // Muzzle flash type 2
0, // 0 = one-shot, 1 = auto
1, // 0 = fake, 1 = geometry
0, // 0 = dumb, 1 = guided
4, // Shots per salvo
25, // Default number of salvos
MLAUNCH1, // Audio ID
0, // ddy (effect of gravity)
70, // Vo (initial velocity)
SRM_DMG, // Damage per shot
0.75 * MHEAT, // Heat from firing
0, // Heat from impacting
0, // Minimum range
49686, // Maximum range
7 * ASECOND, // Recycle time
QUARTERSECOND, // Duration of salvo firing
SRM_TIME, // Life of shot
"SRM4"
},
// --- SRM2 ----
{
MISSILE_TYPE, // Weapon type
MISSILE_TYPE, // Explosion type
MISSILE_FLASH1, // Muzzle flash type 1
MISSILE_FLASH2, // Muzzle flash type 2
0, // 0 = one-shot, 1 = auto
1, // 0 = fake, 1 = geometry
0, // 0 = dumb, 1 = guided
2, // Shots per salvo
50, // Default number of salvos
MLAUNCH1, // Audio ID
0, // ddy (effect of gravity)
100, // Vo (initial velocity)
SRM_DMG, // Damage per shot
MHEAT, // Heat from firing
0, // Heat from impacting
0, // Minimum range
49686, // Maximum range
6 * ASECOND, // Recycle time
QUARTERSECOND, // Duration of salvo firing
SRM_TIME, // Life of shot
"SRM2"
},