mirror of
https://github.com/ENSL/NS.git
synced 2024-11-14 17:01:29 +00:00
4f13237895
Change CRLF to LF in repo.
149 lines
No EOL
3.7 KiB
C++
149 lines
No EOL
3.7 KiB
C++
#ifndef TURRET_H
|
|
#define TURRET_H
|
|
|
|
#include "effects.h"
|
|
#include "turretconst.h"
|
|
|
|
class CBaseTurret : public CBaseMonster
|
|
{
|
|
public:
|
|
void Spawn(void);
|
|
virtual void Precache(void);
|
|
void KeyValue( KeyValueData *pkvd );
|
|
void EXPORT TurretUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
|
|
|
virtual void TraceAttack( entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType);
|
|
virtual int TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType );
|
|
virtual int Classify(void);
|
|
virtual int GetRange() const;
|
|
|
|
virtual char* GetPingSound() const;
|
|
virtual char* GetActiveSound() const;
|
|
virtual char* GetAlertSound() const;
|
|
virtual char* GetDeploySound() const;
|
|
|
|
int BloodColor( void ) { return DONT_BLEED; }
|
|
void GibMonster( void ) {} // UNDONE: Throw turret gibs?
|
|
virtual void StopShooting() {};
|
|
virtual bool NeedsLineOfSight() const;
|
|
|
|
// Think functions
|
|
|
|
void EXPORT ActiveThink(void);
|
|
void EXPORT SearchThink(void);
|
|
void EXPORT AutoSearchThink(void);
|
|
void EXPORT TurretDeath(void);
|
|
|
|
virtual void EXPORT SpinDownCall(void) { m_iSpin = 0; }
|
|
virtual void EXPORT SpinUpCall(void) { m_iSpin = 1; }
|
|
|
|
// void SpinDown(void);
|
|
// float EXPORT SpinDownCall( void ) { return SpinDown(); }
|
|
|
|
// virtual float SpinDown(void) { return 0;}
|
|
// virtual float Retire(void) { return 0;}
|
|
|
|
void EXPORT Deploy(void);
|
|
void EXPORT Retire(void);
|
|
|
|
void EXPORT Initialize(void);
|
|
|
|
virtual void Ping(void);
|
|
virtual void EyeOn(void);
|
|
virtual void EyeOff(void);
|
|
|
|
virtual int Save( CSave &save );
|
|
virtual int Restore( CRestore &restore );
|
|
|
|
static TYPEDESCRIPTION m_SaveData[];
|
|
|
|
// other functions
|
|
void SetTurretAnim(TURRET_ANIM anim);
|
|
int MoveTurret(void);
|
|
virtual void Shoot(Vector &vecSrc, Vector &vecDirToEnemy) { };
|
|
|
|
float m_flMaxSpin; // Max time to spin the barrel w/o a target
|
|
int m_iSpin;
|
|
|
|
CSprite *m_pEyeGlow;
|
|
int m_eyeBrightness;
|
|
|
|
int m_iDeployHeight;
|
|
int m_iRetractHeight;
|
|
int m_iMinPitch;
|
|
|
|
int m_iBaseTurnRate; // angles per second
|
|
float m_fTurnRate; // actual turn rate
|
|
int m_iOrientation; // 0 = floor, 1 = Ceiling
|
|
int m_iOn;
|
|
int m_fBeserk; // Sometimes this bitch will just freak out
|
|
int m_iAutoStart; // true if the turret auto deploys when a target
|
|
// enters its range
|
|
|
|
Vector m_vecLastSight;
|
|
float m_flLastSight; // Last time we saw a target
|
|
float m_flMaxWait; // Max time to seach w/o a target
|
|
int m_iSearchSpeed; // Not Used!
|
|
|
|
// movement
|
|
float m_flStartYaw;
|
|
Vector m_vecCurAngles;
|
|
Vector m_vecGoalAngles;
|
|
|
|
|
|
float m_flPingTime; // Time until the next ping, used when searching
|
|
float m_flSpinUpTime; // Amount of time until the barrel should spin down when searching
|
|
};
|
|
|
|
class CTurret : public CBaseTurret
|
|
{
|
|
public:
|
|
void Spawn(void);
|
|
void Precache(void);
|
|
// Think functions
|
|
void SpinUpCall(void);
|
|
void SpinDownCall(void);
|
|
|
|
virtual int Save( CSave &save );
|
|
virtual int Restore( CRestore &restore );
|
|
|
|
static TYPEDESCRIPTION m_SaveData[];
|
|
|
|
// other functions
|
|
void Shoot(Vector &vecSrc, Vector &vecDirToEnemy);
|
|
|
|
private:
|
|
int m_iStartSpin;
|
|
|
|
};
|
|
|
|
|
|
class CMiniTurret : public CBaseTurret
|
|
{
|
|
public:
|
|
void Spawn( );
|
|
void Precache(void);
|
|
// other functions
|
|
void Shoot(Vector &vecSrc, Vector &vecDirToEnemy);
|
|
};
|
|
|
|
|
|
//=========================================================
|
|
// Sentry gun - smallest turret, placed near grunt entrenchments
|
|
//=========================================================
|
|
class CSentry : public CBaseTurret
|
|
{
|
|
public:
|
|
void Spawn( );
|
|
void Precache(void);
|
|
// other functions
|
|
void Shoot(Vector &vecSrc, Vector &vecDirToEnemy);
|
|
int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
|
|
void EXPORT SentryTouch( CBaseEntity *pOther );
|
|
void EXPORT SentryDeath( void );
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif |