2013-04-04 14:52:42 +00:00
|
|
|
// Copyright (C) 2001-2002 Raven Software
|
|
|
|
//
|
|
|
|
// bg_weapons.c -- part of bg_pmove functionality
|
|
|
|
|
|
|
|
#include "q_shared.h"
|
|
|
|
#include "bg_public.h"
|
|
|
|
#include "bg_local.h"
|
|
|
|
|
|
|
|
// Muzzle point table...
|
|
|
|
vec3_t WP_MuzzlePoint[WP_NUM_WEAPONS] =
|
|
|
|
{// Fwd, right, up.
|
|
|
|
{0, 0, 0 }, // WP_NONE,
|
|
|
|
{0 , 8, 0 }, // WP_STUN_BATON,
|
|
|
|
{8 , 16, 0 }, // WP_SABER,
|
|
|
|
{12, 6, -6 }, // WP_BRYAR_PISTOL,
|
|
|
|
{12, 6, -6 }, // WP_BLASTER,
|
|
|
|
{12, 6, -6 }, // WP_DISRUPTOR,
|
|
|
|
{12, 2, -6 }, // WP_BOWCASTER,
|
|
|
|
{12, 4.5, -6 }, // WP_REPEATER,
|
|
|
|
{12, 6, -6 }, // WP_DEMP2,
|
|
|
|
{12, 6, -6 }, // WP_FLECHETTE,
|
|
|
|
{12, 8, 0 }, // WP_ROCKET_LAUNCHER,
|
|
|
|
{12, 0, -4 }, // WP_THERMAL,
|
|
|
|
{12, 0, -10 }, // WP_TRIP_MINE,
|
|
|
|
{12, 0, -4 }, // WP_DET_PACK,
|
|
|
|
};
|
|
|
|
|
|
|
|
weaponData_t weaponData[WP_NUM_WEAPONS] =
|
|
|
|
{
|
|
|
|
{ // WP_NONE
|
|
|
|
// "No Weapon", // char classname[32]; // Spawning name
|
|
|
|
AMMO_NONE, // int ammoIndex; // Index to proper ammo slot
|
|
|
|
0, // int ammoLow; // Count when ammo is low
|
|
|
|
0, // int energyPerShot; // Amount of energy used per shot
|
|
|
|
0, // int fireTime; // Amount of time between firings
|
|
|
|
0, // int range; // Range of weapon
|
|
|
|
0, // int altEnergyPerShot; // Amount of energy used for alt-fire
|
|
|
|
0, // int altFireTime; // Amount of time between alt-firings
|
|
|
|
0, // int altRange; // Range of alt-fire
|
|
|
|
0, // int chargeSubTime; // ms interval for subtracting ammo during charge
|
|
|
|
0, // int altChargeSubTime; // above for secondary
|
|
|
|
0, // int chargeSub; // amount to subtract during charge on each interval
|
|
|
|
0, //int altChargeSub; // above for secondary
|
|
|
|
0, // int maxCharge; // stop subtracting once charged for this many ms
|
|
|
|
0 // int altMaxCharge; // above for secondary
|
|
|
|
},
|
|
|
|
{ // WP_STUN_BATON
|
|
|
|
// "Stun Baton", // char classname[32]; // Spawning name
|
|
|
|
AMMO_NONE, // int ammoIndex; // Index to proper ammo slot
|
|
|
|
5, // int ammoLow; // Count when ammo is low
|
|
|
|
0, // int energyPerShot; // Amount of energy used per shot
|
|
|
|
400, // int fireTime; // Amount of time between firings
|
|
|
|
8192, // int range; // Range of weapon
|
|
|
|
0, // int altEnergyPerShot; // Amount of energy used for alt-fire
|
2013-04-04 18:24:26 +00:00
|
|
|
400, // int altFireTime; // Amount of time between alt-firings
|
2013-04-04 14:52:42 +00:00
|
|
|
8192, // int altRange; // Range of alt-fire
|
|
|
|
0, // int chargeSubTime; // ms interval for subtracting ammo during charge
|
|
|
|
0, // int altChargeSubTime; // above for secondary
|
|
|
|
0, // int chargeSub; // amount to subtract during charge on each interval
|
|
|
|
0, //int altChargeSub; // above for secondary
|
|
|
|
0, // int maxCharge; // stop subtracting once charged for this many ms
|
|
|
|
0 // int altMaxCharge; // above for secondary
|
|
|
|
},
|
|
|
|
{ // WP_SABER,
|
|
|
|
// "Lightsaber", // char classname[32]; // Spawning name
|
|
|
|
AMMO_NONE, // int ammoIndex; // Index to proper ammo slot
|
|
|
|
5, // int ammoLow; // Count when ammo is low
|
|
|
|
0, // int energyPerShot; // Amount of energy used per shot
|
|
|
|
100, // int fireTime; // Amount of time between firings
|
|
|
|
8192, // int range; // Range of weapon
|
|
|
|
0, // int altEnergyPerShot; // Amount of energy used for alt-fire
|
|
|
|
100, // int altFireTime; // Amount of time between alt-firings
|
|
|
|
8192, // int altRange; // Range of alt-fire
|
|
|
|
0, // int chargeSubTime; // ms interval for subtracting ammo during charge
|
|
|
|
0, // int altChargeSubTime; // above for secondary
|
|
|
|
0, // int chargeSub; // amount to subtract during charge on each interval
|
|
|
|
0, //int altChargeSub; // above for secondary
|
|
|
|
0, // int maxCharge; // stop subtracting once charged for this many ms
|
|
|
|
0 // int altMaxCharge; // above for secondary
|
|
|
|
},
|
|
|
|
{ // WP_BRYAR_PISTOL,
|
|
|
|
// "Bryar Pistol", // char classname[32]; // Spawning name
|
|
|
|
AMMO_BLASTER, // int ammoIndex; // Index to proper ammo slot
|
|
|
|
15, // int ammoLow; // Count when ammo is low
|
|
|
|
2, // int energyPerShot; // Amount of energy used per shot
|
|
|
|
400, // int fireTime; // Amount of time between firings
|
|
|
|
8192, // int range; // Range of weapon
|
|
|
|
2, // int altEnergyPerShot; // Amount of energy used for alt-fire
|
|
|
|
400, // int altFireTime; // Amount of time between alt-firings
|
|
|
|
8192, // int altRange; // Range of alt-fire
|
|
|
|
0, // int chargeSubTime; // ms interval for subtracting ammo during charge
|
|
|
|
200, // int altChargeSubTime; // above for secondary
|
|
|
|
0, // int chargeSub; // amount to subtract during charge on each interval
|
|
|
|
1, //int altChargeSub; // above for secondary
|
|
|
|
0, // int maxCharge; // stop subtracting once charged for this many ms
|
|
|
|
1500 // int altMaxCharge; // above for secondary
|
|
|
|
},
|
|
|
|
{ // WP_BLASTER
|
|
|
|
// "E11 Blaster Rifle", // char classname[32]; // Spawning name
|
|
|
|
AMMO_BLASTER, // int ammoIndex; // Index to proper ammo slot
|
|
|
|
5, // int ammoLow; // Count when ammo is low
|
|
|
|
2, // int energyPerShot; // Amount of energy used per shot
|
|
|
|
350, // int fireTime; // Amount of time between firings
|
|
|
|
8192, // int range; // Range of weapon
|
|
|
|
3, // int altEnergyPerShot; // Amount of energy used for alt-fire
|
|
|
|
150, // int altFireTime; // Amount of time between alt-firings
|
|
|
|
8192, // int altRange; // Range of alt-fire
|
|
|
|
0, // int chargeSubTime; // ms interval for subtracting ammo during charge
|
|
|
|
0, // int altChargeSubTime; // above for secondary
|
|
|
|
0, // int chargeSub; // amount to subtract during charge on each interval
|
|
|
|
0, //int altChargeSub; // above for secondary
|
|
|
|
0, // int maxCharge; // stop subtracting once charged for this many ms
|
|
|
|
0 // int altMaxCharge; // above for secondary
|
|
|
|
},
|
|
|
|
{ // WP_DISRUPTOR
|
|
|
|
// "Tenloss Disruptor Rifle",// char classname[32]; // Spawning name
|
|
|
|
AMMO_POWERCELL, // int ammoIndex; // Index to proper ammo slot
|
|
|
|
5, // int ammoLow; // Count when ammo is low
|
2013-04-04 18:24:26 +00:00
|
|
|
5, // int energyPerShot; // Amount of energy used per shot
|
2013-04-04 14:52:42 +00:00
|
|
|
600, // int fireTime; // Amount of time between firings
|
|
|
|
8192, // int range; // Range of weapon
|
2013-04-04 18:24:26 +00:00
|
|
|
6, // int altEnergyPerShot; // Amount of energy used for alt-fire
|
2013-04-04 14:52:42 +00:00
|
|
|
1300, // int altFireTime; // Amount of time between alt-firings
|
|
|
|
8192, // int altRange; // Range of alt-fire
|
|
|
|
0, // int chargeSubTime; // ms interval for subtracting ammo during charge
|
2013-04-04 18:24:26 +00:00
|
|
|
200, // int altChargeSubTime; // above for secondary
|
2013-04-04 14:52:42 +00:00
|
|
|
0, // int chargeSub; // amount to subtract during charge on each interval
|
2013-04-04 18:24:26 +00:00
|
|
|
3, //int altChargeSub; // above for secondary
|
2013-04-04 14:52:42 +00:00
|
|
|
0, // int maxCharge; // stop subtracting once charged for this many ms
|
2013-04-04 18:24:26 +00:00
|
|
|
1700 // int altMaxCharge; // above for secondary
|
2013-04-04 14:52:42 +00:00
|
|
|
},
|
|
|
|
{ // WP_BOWCASTER
|
|
|
|
// "Wookiee Bowcaster", // char classname[32]; // Spawning name
|
|
|
|
AMMO_POWERCELL, // int ammoIndex; // Index to proper ammo slot
|
|
|
|
5, // int ammoLow; // Count when ammo is low
|
|
|
|
5, // int energyPerShot; // Amount of energy used per shot
|
|
|
|
1000, // int fireTime; // Amount of time between firings
|
|
|
|
8192, // int range; // Range of weapon
|
|
|
|
5, // int altEnergyPerShot; // Amount of energy used for alt-fire
|
|
|
|
750, // int altFireTime; // Amount of time between alt-firings
|
|
|
|
8192, // int altRange; // Range of alt-fire
|
2013-04-04 18:24:26 +00:00
|
|
|
400, // int chargeSubTime; // ms interval for subtracting ammo during charge
|
2013-04-04 14:52:42 +00:00
|
|
|
0, // int altChargeSubTime; // above for secondary
|
2013-04-04 18:24:26 +00:00
|
|
|
5, // int chargeSub; // amount to subtract during charge on each interval
|
2013-04-04 14:52:42 +00:00
|
|
|
0, //int altChargeSub; // above for secondary
|
2013-04-04 18:24:26 +00:00
|
|
|
1700, // int maxCharge; // stop subtracting once charged for this many ms
|
2013-04-04 14:52:42 +00:00
|
|
|
0 // int altMaxCharge; // above for secondary
|
|
|
|
},
|
|
|
|
{ // WP_REPEATER
|
|
|
|
// "Imperial Heavy Repeater",// char classname[32]; // Spawning name
|
|
|
|
AMMO_METAL_BOLTS, // int ammoIndex; // Index to proper ammo slot
|
|
|
|
5, // int ammoLow; // Count when ammo is low
|
|
|
|
1, // int energyPerShot; // Amount of energy used per shot
|
2013-04-04 18:24:26 +00:00
|
|
|
100, // int fireTime; // Amount of time between firings
|
2013-04-04 14:52:42 +00:00
|
|
|
8192, // int range; // Range of weapon
|
2013-04-04 22:24:29 +00:00
|
|
|
15, // int altEnergyPerShot; // Amount of energy used for alt-fire
|
2013-04-04 14:52:42 +00:00
|
|
|
800, // int altFireTime; // Amount of time between alt-firings
|
|
|
|
8192, // int altRange; // Range of alt-fire
|
|
|
|
0, // int chargeSubTime; // ms interval for subtracting ammo during charge
|
|
|
|
0, // int altChargeSubTime; // above for secondary
|
|
|
|
0, // int chargeSub; // amount to subtract during charge on each interval
|
|
|
|
0, //int altChargeSub; // above for secondary
|
|
|
|
0, // int maxCharge; // stop subtracting once charged for this many ms
|
|
|
|
0 // int altMaxCharge; // above for secondary
|
|
|
|
},
|
|
|
|
{ // WP_DEMP2
|
|
|
|
// "DEMP2", // char classname[32]; // Spawning name
|
|
|
|
AMMO_POWERCELL, // int ammoIndex; // Index to proper ammo slot
|
|
|
|
5, // int ammoLow; // Count when ammo is low
|
2013-04-04 18:24:26 +00:00
|
|
|
8, // int energyPerShot; // Amount of energy used per shot
|
2013-04-04 14:52:42 +00:00
|
|
|
500, // int fireTime; // Amount of time between firings
|
|
|
|
8192, // int range; // Range of weapon
|
2013-04-04 18:24:26 +00:00
|
|
|
6, // int altEnergyPerShot; // Amount of energy used for alt-fire
|
2013-04-04 14:52:42 +00:00
|
|
|
900, // int altFireTime; // Amount of time between alt-firings
|
|
|
|
8192, // int altRange; // Range of alt-fire
|
|
|
|
0, // int chargeSubTime; // ms interval for subtracting ammo during charge
|
2013-04-04 18:24:26 +00:00
|
|
|
250, // int altChargeSubTime; // above for secondary
|
2013-04-04 14:52:42 +00:00
|
|
|
0, // int chargeSub; // amount to subtract during charge on each interval
|
2013-04-04 18:24:26 +00:00
|
|
|
3, // int altChargeSub; // above for secondary
|
2013-04-04 14:52:42 +00:00
|
|
|
0, // int maxCharge; // stop subtracting once charged for this many ms
|
2013-04-04 18:24:26 +00:00
|
|
|
2100 // int altMaxCharge; // above for secondary
|
2013-04-04 14:52:42 +00:00
|
|
|
},
|
|
|
|
{ // WP_FLECHETTE
|
|
|
|
// "Golan Arms Flechette", // char classname[32]; // Spawning name
|
|
|
|
AMMO_METAL_BOLTS, // int ammoIndex; // Index to proper ammo slot
|
|
|
|
5, // int ammoLow; // Count when ammo is low
|
|
|
|
10, // int energyPerShot; // Amount of energy used per shot
|
2013-04-04 18:24:26 +00:00
|
|
|
700, // int fireTime; // Amount of time between firings
|
2013-04-04 14:52:42 +00:00
|
|
|
8192, // int range; // Range of weapon
|
2013-04-04 22:24:29 +00:00
|
|
|
15, // int altEnergyPerShot; // Amount of energy used for alt-fire
|
2013-04-04 14:52:42 +00:00
|
|
|
800, // int altFireTime; // Amount of time between alt-firings
|
|
|
|
8192, // int altRange; // Range of alt-fire
|
|
|
|
0, // int chargeSubTime; // ms interval for subtracting ammo during charge
|
|
|
|
0, // int altChargeSubTime; // above for secondary
|
|
|
|
0, // int chargeSub; // amount to subtract during charge on each interval
|
|
|
|
0, //int altChargeSub; // above for secondary
|
|
|
|
0, // int maxCharge; // stop subtracting once charged for this many ms
|
|
|
|
0 // int altMaxCharge; // above for secondary
|
|
|
|
},
|
|
|
|
{ // WP_ROCKET_LAUNCHER
|
|
|
|
// "Merr-Sonn Missile System", // char classname[32]; // Spawning name
|
|
|
|
AMMO_ROCKETS, // int ammoIndex; // Index to proper ammo slot
|
|
|
|
5, // int ammoLow; // Count when ammo is low
|
2013-04-04 18:24:26 +00:00
|
|
|
1, // int energyPerShot; // Amount of energy used per shot
|
|
|
|
900, // int fireTime; // Amount of time between firings
|
2013-04-04 14:52:42 +00:00
|
|
|
8192, // int range; // Range of weapon
|
2013-04-04 18:24:26 +00:00
|
|
|
2, // int altEnergyPerShot; // Amount of energy used for alt-fire
|
|
|
|
1200, // int altFireTime; // Amount of time between alt-firings
|
2013-04-04 14:52:42 +00:00
|
|
|
8192, // int altRange; // Range of alt-fire
|
|
|
|
0, // int chargeSubTime; // ms interval for subtracting ammo during charge
|
|
|
|
0, // int altChargeSubTime; // above for secondary
|
|
|
|
0, // int chargeSub; // amount to subtract during charge on each interval
|
|
|
|
0, //int altChargeSub; // above for secondary
|
|
|
|
0, // int maxCharge; // stop subtracting once charged for this many ms
|
|
|
|
0 // int altMaxCharge; // above for secondary
|
|
|
|
},
|
|
|
|
{ // WP_THERMAL
|
|
|
|
// "Thermal Detonator", // char classname[32]; // Spawning name
|
|
|
|
AMMO_THERMAL, // int ammoIndex; // Index to proper ammo slot
|
|
|
|
0, // int ammoLow; // Count when ammo is low
|
|
|
|
1, // int energyPerShot; // Amount of energy used per shot
|
|
|
|
800, // int fireTime; // Amount of time between firings
|
|
|
|
8192, // int range; // Range of weapon
|
|
|
|
1, // int altEnergyPerShot; // Amount of energy used for alt-fire
|
|
|
|
400, // int altFireTime; // Amount of time between alt-firings
|
|
|
|
8192, // int altRange; // Range of alt-fire
|
|
|
|
0, // int chargeSubTime; // ms interval for subtracting ammo during charge
|
|
|
|
0, // int altChargeSubTime; // above for secondary
|
|
|
|
0, // int chargeSub; // amount to subtract during charge on each interval
|
|
|
|
0, //int altChargeSub; // above for secondary
|
|
|
|
0, // int maxCharge; // stop subtracting once charged for this many ms
|
|
|
|
0 // int altMaxCharge; // above for secondary
|
|
|
|
},
|
|
|
|
{ // WP_TRIP_MINE
|
|
|
|
// "Trip Mine", // char classname[32]; // Spawning name
|
|
|
|
AMMO_TRIPMINE, // int ammoIndex; // Index to proper ammo slot
|
|
|
|
0, // int ammoLow; // Count when ammo is low
|
|
|
|
1, // int energyPerShot; // Amount of energy used per shot
|
|
|
|
800, // int fireTime; // Amount of time between firings
|
|
|
|
8192, // int range; // Range of weapon
|
|
|
|
1, // int altEnergyPerShot; // Amount of energy used for alt-fire
|
|
|
|
400, // int altFireTime; // Amount of time between alt-firings
|
|
|
|
8192, // int altRange; // Range of alt-fire
|
|
|
|
0, // int chargeSubTime; // ms interval for subtracting ammo during charge
|
|
|
|
0, // int altChargeSubTime; // above for secondary
|
|
|
|
0, // int chargeSub; // amount to subtract during charge on each interval
|
|
|
|
0, //int altChargeSub; // above for secondary
|
|
|
|
0, // int maxCharge; // stop subtracting once charged for this many ms
|
|
|
|
0 // int altMaxCharge; // above for secondary
|
|
|
|
},
|
|
|
|
{ // WP_DET_PACK
|
|
|
|
// "Det Pack", // char classname[32]; // Spawning name
|
|
|
|
AMMO_DETPACK, // int ammoIndex; // Index to proper ammo slot
|
|
|
|
0, // int ammoLow; // Count when ammo is low
|
|
|
|
1, // int energyPerShot; // Amount of energy used per shot
|
|
|
|
800, // int fireTime; // Amount of time between firings
|
|
|
|
8192, // int range; // Range of weapon
|
|
|
|
0, // int altEnergyPerShot; // Amount of energy used for alt-fire
|
|
|
|
400, // int altFireTime; // Amount of time between alt-firings
|
|
|
|
8192, // int altRange; // Range of alt-fire
|
|
|
|
0, // int chargeSubTime; // ms interval for subtracting ammo during charge
|
|
|
|
0, // int altChargeSubTime; // above for secondary
|
|
|
|
0, // int chargeSub; // amount to subtract during charge on each interval
|
|
|
|
0, //int altChargeSub; // above for secondary
|
|
|
|
0, // int maxCharge; // stop subtracting once charged for this many ms
|
|
|
|
0 // int altMaxCharge; // above for secondary
|
|
|
|
},
|
|
|
|
{ // WP_EMPLCACED_GUN
|
|
|
|
// "Emplaced Gun", // char classname[32]; // Spawning name
|
|
|
|
/*AMMO_BLASTER*/0, // int ammoIndex; // Index to proper ammo slot
|
|
|
|
/*5*/0, // int ammoLow; // Count when ammo is low
|
|
|
|
/*2*/0, // int energyPerShot; // Amount of energy used per shot
|
|
|
|
100, // int fireTime; // Amount of time between firings
|
|
|
|
8192, // int range; // Range of weapon
|
|
|
|
/*3*/0, // int altEnergyPerShot; // Amount of energy used for alt-fire
|
|
|
|
100, // int altFireTime; // Amount of time between alt-firings
|
|
|
|
8192, // int altRange; // Range of alt-fire
|
|
|
|
0, // int chargeSubTime; // ms interval for subtracting ammo during charge
|
|
|
|
0, // int altChargeSubTime; // above for secondary
|
|
|
|
0, // int chargeSub; // amount to subtract during charge on each interval
|
|
|
|
0, //int altChargeSub; // above for secondary
|
|
|
|
0, // int maxCharge; // stop subtracting once charged for this many ms
|
|
|
|
0 // int altMaxCharge; // above for secondary
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
ammoData_t ammoData[AMMO_MAX] =
|
|
|
|
{
|
|
|
|
{ // AMMO_NONE
|
|
|
|
// "", // char icon[32]; // Name of ammo icon file
|
|
|
|
0 // int max; // Max amount player can hold of ammo
|
|
|
|
},
|
|
|
|
{ // AMMO_FORCE
|
|
|
|
// "", // char icon[32]; // Name of ammo icon file
|
|
|
|
100 // int max; // Max amount player can hold of ammo
|
|
|
|
},
|
|
|
|
{ // AMMO_BLASTER
|
|
|
|
// "", // char icon[32]; // Name of ammo icon file
|
|
|
|
300 // int max; // Max amount player can hold of ammo
|
|
|
|
},
|
|
|
|
{ // AMMO_POWERCELL
|
|
|
|
// "", // char icon[32]; // Name of ammo icon file
|
|
|
|
300 // int max; // Max amount player can hold of ammo
|
|
|
|
},
|
|
|
|
{ // AMMO_METAL_BOLTS
|
|
|
|
// "", // char icon[32]; // Name of ammo icon file
|
|
|
|
300 // int max; // Max amount player can hold of ammo
|
|
|
|
},
|
|
|
|
{ // AMMO_ROCKETS
|
|
|
|
// "", // char icon[32]; // Name of ammo icon file
|
2013-04-04 18:24:26 +00:00
|
|
|
25 // int max; // Max amount player can hold of ammo
|
2013-04-04 14:52:42 +00:00
|
|
|
},
|
|
|
|
{ // AMMO_EMPLACED
|
|
|
|
// "", // char icon[32]; // Name of ammo icon file
|
|
|
|
800 // int max; // Max amount player can hold of ammo
|
|
|
|
},
|
|
|
|
{ // AMMO_THERMAL
|
|
|
|
// "", // char icon[32]; // Name of ammo icon file
|
|
|
|
10 // int max; // Max amount player can hold of ammo
|
|
|
|
},
|
|
|
|
{ // AMMO_TRIPMINE
|
|
|
|
// "", // char icon[32]; // Name of ammo icon file
|
|
|
|
10 // int max; // Max amount player can hold of ammo
|
|
|
|
},
|
|
|
|
{ // AMMO_DETPACK
|
|
|
|
// "", // char icon[32]; // Name of ammo icon file
|
|
|
|
10 // int max; // Max amount player can hold of ammo
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|