private:
float xPos, yPos,
zPos;
float pitch, yaw;
float dragFactor;
int fireCount,bursts;
int initialRounds;
float fractionalRoundsRemaining; // Could
make numRoundsRemaining a float, but this changed less code...
DrawableTracer**
tracers;
Drawable2D**
bullets;
DrawableTrail*
smokeTrail;
TracerCollisionMode tracerMode;
// these variables are used to do the series of muzzle tracers
DrawableTracer
**firstTracer;
Tpoint *muzzleLoc;
Tpoint *muzzleEnd;
float *muzzleAlpha;
float *muzzleWidth;
int* trailState;
int muzzleStart;
float qTimer;
void UpdateTracers(
int firing );
public:
void InitTracers(void);
void CleanupTracers(void);
GunClass(int type);
virtual ~GunClass(void);
enum GunStatus {Ready, Sim, Safe};
float initBulletVelocity;
GunStatus status;
GunTracerType
*bullet;
float roundsPerSecond;
int numRoundsRemaining;
int numTracers;
int numFirstTracers;
int unlimitedAmmo;
int numFlying;
void Init (float muzzleVel, int numRounds);
void SetPosition (float xOffset, float
yOffset, float zOffset, float pitch, float yaw);
int Exec (int* fire, TransformMatrix
dmx, ObjectGeometry *geomData, SimObjectType* objList, BOOL isOwnship );
void NewBurst
(void) { bursts++; };
int GetCurrentBurst
(void) { return bursts; };
void SetTracerCollisionMode( TracerCollisionMode
mode )
{
tracerMode = mode;
};
// new stuff for to support shells
// typpedefs and enums
enum GunType
{
GUN_SHELL,
GUN_TRACER,
GUN_TRACER_BALL
};
virtual int IsGun (void) { return TRUE; };
// member functions
BOOL
IsShell( void );
BOOL
IsTracer( void );
BOOL
ReadyToFire( void );
float
GetDamageAssessment( SimBaseClass *target, float range );
void
FireShell( SimObjectType *target );
void
UpdateShell( void );
WeaponDomain GetSMSDomain( void );
// member variables
WeaponDomain
gunDomain;
// air, land, both
SimObjectType
*shellTargetPtr;
// set when shell flying
GunType
typeOfGun;
// tracer or shell
VU_TIME
shellDetonateTime;
// when it goes cablooey
float
minShellRange;
// minimum for shell
float
maxShellRange;
// max for shell
WeaponClassDataType
*wcPtr;
// pointer to weapon class data