/*** * * Copyright (c) 1996-2002, Valve LLC. All rights reserved. * * This product contains software technology licensed from Id * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. * All Rights Reserved. * * Use, distribution, and modification of this source code and/or resulting * object code is restricted to non-commercial enhancements to products from * Valve LLC. All other use, distribution, or modification is prohibited * without written permission from Valve LLC. * ****/ #pragma once #ifndef WEAPONS_H #define WEAPONS_H #include "effects.h" class CBasePlayer; extern int gmsgWeapPickup; void DeactivateSatchels( CBasePlayer *pOwner ); // Contact Grenade / Timed grenade / Satchel Charge class CGrenade : public CBaseMonster { public: void Spawn( void ); typedef enum { SATCHEL_DETONATE = 0, SATCHEL_RELEASE } SATCHELCODE; static CGrenade *ShootTimed( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time ); static CGrenade *ShootContact( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity ); static CGrenade *ShootSatchelCharge( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity ); static void UseSatchelCharges( entvars_t *pevOwner, SATCHELCODE code ); void Explode( Vector vecSrc, Vector vecAim ); void Explode( TraceResult *pTrace, int bitsDamageType ); void EXPORT Smoke( void ); void EXPORT BounceTouch( CBaseEntity *pOther ); void EXPORT SlideTouch( CBaseEntity *pOther ); void EXPORT ExplodeTouch( CBaseEntity *pOther ); void EXPORT DangerSoundThink( void ); void EXPORT PreDetonate( void ); void EXPORT Detonate( void ); void EXPORT DetonateUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ); void EXPORT TumbleThink( void ); virtual void BounceSound( void ); virtual int BloodColor( void ) { return DONT_BLEED; } virtual void Killed( entvars_t *pevAttacker, int iGib ); BOOL m_fRegisteredSound;// whether or not this grenade has issued its DANGER sound to the world sound list yet. }; // Timed Tnt class CTnt : public CGrenade { public: void Spawn( void ); static CGrenade *ShootTimed( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time ); }; // constant items #define ITEM_HEALTHKIT 1 #define ITEM_ANTIDOTE 2 #define ITEM_SECURITY 3 #define ITEM_BATTERY 4 #define WEAPON_NONE 0 #define WEAPON_CROWBAR 1 #define WEAPON_GLOCK 2 #define WEAPON_PYTHON 3 #define WEAPON_MP5 4 #define WEAPON_CHAINGUN 5 #define WEAPON_CROSSBOW 6 #define WEAPON_SHOTGUN 7 #define WEAPON_RPG 8 #define WEAPON_GAUSS 9 #define WEAPON_EGON 10 #define WEAPON_HORNETGUN 11 #define WEAPON_HANDGRENADE 12 #define WEAPON_TRIPMINE 13 #define WEAPON_SATCHEL 14 #define WEAPON_SNARK 15 #define WEAPON_SHOVEL 16 #define WEAPON_SPANNER 17 #define WEAPON_AP9 18 #define WEAPON_TAURUS 19 #define WEAPON_EINAR1 20 #define WEAPON_HKG36 21 #define WEAPON_MEDKIT 22 #define WEAPON_ALLWEAPONS (~(1<absmin = pev->origin + Vector(-16, -16, -5); pev->absmax = pev->origin + Vector(16, 16, 28); } void PrimaryAttack( void ); BOOL Deploy( void ); void Holster( int skiplocal = 0 ); void WeaponIdle( void ); virtual BOOL UseDecrement( void ) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } private: unsigned short m_usTripFire; }; class CSqueak : public CBasePlayerWeapon { public: void Spawn( void ); void Precache( void ); int iItemSlot( void ) { return 5; } int GetItemInfo(ItemInfo *p); void PrimaryAttack( void ); void SecondaryAttack( void ); BOOL Deploy( void ); void Holster( int skiplocal = 0 ); void WeaponIdle( void ); int m_fJustThrown; virtual BOOL UseDecrement( void ) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } private: unsigned short m_usSnarkFire; }; class CShovel : public CCrowbar { public: void Spawn( void ); void Precache( void ); int GetItemInfo(ItemInfo *p); void PrimaryAttack( void ); int Swing( int fFirst ); BOOL Deploy( void ); void Holster( int skiplocal = 0 ); private: unsigned short m_usShovel; }; class CSpanner : public CCrowbar { public: void Spawn(void); void Precache(void); int GetItemInfo(ItemInfo *p); void PrimaryAttack(void); int Swing(int fFirst); BOOL Deploy(void); void Holster(int skiplocal = 0); private: unsigned short m_usSpanner; }; class CAP9 : public CBasePlayerWeapon { public: #ifndef CLIENT_DLL int Save(CSave &save); int Restore(CRestore &restore); static TYPEDESCRIPTION m_SaveData[]; #endif void Spawn(void); void Precache(void); int iItemSlot(void) { return 2; } int GetItemInfo(ItemInfo *p); int AddToPlayer(CBasePlayer *pPlayer); void PrimaryAttack(void); void SecondaryAttack(void); void AP9Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim, BOOL fBurstShot); BOOL Deploy(void); void Reload(void); void WeaponIdle(void); BOOL ShouldWeaponIdle(void) { return TRUE; } int m_iShell; virtual BOOL UseDecrement(void) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } int m_iBurstShots; private: unsigned short m_usFireAP9; }; class CTaurus : public CGlock { public: void Spawn( void ); void Precache( void ); int GetItemInfo(ItemInfo *p); void PrimaryAttack( void ); void SecondaryAttack( void ) {} BOOL Deploy( void ); void Reload( void ); void WeaponIdle( void ); private: int m_iShell; unsigned short m_usFireTaurus; }; class CSniper : public CBasePlayerWeapon { public: #ifndef CLIENT_DLL int Save(CSave &save); int Restore(CRestore &restore); static TYPEDESCRIPTION m_SaveData[]; #endif virtual int GetPrimaryAttackActivity(void) = 0; virtual int GetZoomedAttackActivity(void) = 0; int iItemSlot(void) { return 3; } int AddToPlayer(CBasePlayer *pPlayer); void PrimaryAttack(void); void SecondaryAttack(void); void SniperFire(float flSpread, float flCycleTime, BOOL fUseAutoAim, int iActivity); void Holster(int skiplocal = 0); void Reload(void); void WeaponIdle(void); virtual BOOL UseDecrement(void) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } void SetZoomState(BOOL bState); void ToggleZoom(void); BOOL m_fInZoom; protected: unsigned short m_usFireSniper; }; class CHKG36 : public CSniper { public: void Spawn(void); void Precache(void); int GetItemInfo(ItemInfo *p); BOOL Deploy(void); void Reload(void); void WeaponIdle(void); int GetPrimaryAttackActivity(void); int GetZoomedAttackActivity(void); }; #if 0 class CEinar1 : public CSniper { public: void Spawn(void); void Precache(void); int GetItemInfo(ItemInfo *p); void PrimaryAttack(void); void SecondaryAttack(void); BOOL Deploy(void); void Holster(int skiplocal = 0); void Reload(void); void WeaponIdle(void); BOOL ShouldWeaponIdle(void); int GetPrimaryAttackActivity(void); int GetZoomedAttackActivity(void); private: unsigned short m_usFireSniper2; }; #endif #if 0 class CEinar1 : public CBasePlayerWeapon { public: #ifndef CLIENT_DLL int Save(CSave &save); int Restore(CRestore &restore); static TYPEDESCRIPTION m_SaveData[]; #endif void Spawn(void); void Precache(void); int GetItemInfo(ItemInfo *p); int iItemSlot(void) { return 3; } int AddToPlayer(CBasePlayer *pPlayer); void PrimaryAttack(void); void SecondaryAttack(void); BOOL Deploy(void); void Holster(int skiplocal = 0); void Reload(void); void WeaponIdle(void); BOOL ShouldWeaponIdle(void); virtual BOOL UseDecrement(void) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } void SetZoomState(BOOL bState); void ToggleZoom(void); BOOL m_fInZoom; private: unsigned short m_usFireSniper; unsigned short m_usFireSniper2; }; #endif #if 1 class CEinar1 : public CSniper { public: void Spawn(void); void Precache(void); int GetItemInfo(ItemInfo *p); void PrimaryAttack(void); void SecondaryAttack(void); BOOL Deploy(void); void Holster(int skiplocal = 0); void Reload(void); void WeaponIdle(void); BOOL ShouldWeaponIdle(void); int GetPrimaryAttackActivity(void); int GetZoomedAttackActivity(void); }; #endif class CChaingun : public CBasePlayerWeapon { public: void Spawn(void); void Precache(void); int iItemSlot(void) { return 4; } int GetItemInfo(ItemInfo *p); void PrimaryAttack(void); void SecondaryAttack(void); BOOL Deploy(void); void Holster(int skiplocal = 0); void Reload(void); void WeaponIdle(void); BOOL ShouldWeaponIdle(void); virtual BOOL UseDecrement(void) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } void SpinUp(void); void SpinDown(void); void Spin(void); void Fire(float flSpread, float flCycleTime, BOOL fUseAutoAim); void StopSounds(void); private: int m_iShell; unsigned short m_usFireChaingun1; unsigned short m_usFireChaingun2; }; class CMedkit : public CBasePlayerWeapon { public: void Spawn(void); void Precache(void); int iItemSlot(void) { return 5; } int GetItemInfo(ItemInfo *p); void PrimaryAttack(void); BOOL Deploy(void); void Holster(int skiplocal = 0); void WeaponIdle(void); BOOL PlayEmptySound(void); BOOL ShouldWeaponIdle(void) { return TRUE; } virtual BOOL UseDecrement(void) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } float m_flSoundDelay; private: unsigned short m_usMedkit; }; #endif // WEAPONS_H