/*** * * 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. * ****/ #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. }; // constant items #define ITEM_HEALTHKIT 1 #define ITEM_ANTIDOTE 2 #define ITEM_SECURITY 3 #define ITEM_BATTERY 4 #define WEAPON_NONE 0 #define WEAPON_HEATERPIPE 2 #define WEAPON_BRADNAILER 3 #define WEAPON_NAILGUN 4 #define WEAPON_SHOTGUN 5 #define WEAPON_CMLWBR 6 #define WEAPON_XS 7 #define WEAPON_PIPEBOMB 8 #define WEAPON_PAR21 9 #define WEAPON_CROWBAR 10 #define WEAPON_SATCHEL 11 #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 CHeaterPipe : public CCrowbar { public: void Spawn( void ); void Precache( void ); void EXPORT SwingAgain( void ); void EXPORT Smack( void ); int GetItemInfo( ItemInfo *p ); void PrimaryAttack( void ); int Swing( int fFirst ); BOOL Deploy( void ); void Holster( int skiplocal = 0 ); void WeaponIdle( void ); private: unsigned short m_usHeaterPipe; }; class CBradnailer : public CBasePlayerWeapon { public: void Spawn( void ); void Precache( void ); int iItemSlot( void ){ return 2; } int GetItemInfo( ItemInfo *p ); void PrimaryAttack( void ); void SecondaryAttack( void ); BOOL Deploy( void ); BOOL CanHolster( void ); void Holster( int skiplocal = 0 ); void Reload( void ); BOOL ShouldWeaponIdle( void ); void WeaponIdle( void ); virtual BOOL UseDecrement( void ) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } void Fire( float flSpread, float flCycleTime, BOOL fUseAutoAim, BOOL fFastShoot ); private: int m_iShell; unsigned short m_usReload; unsigned short m_usFireBradnailer; }; class CNailgun : public CBasePlayerWeapon { public: void Spawn( void ); void Precache( void ); int iItemSlot( void ){ return 2; } int GetItemInfo( ItemInfo *p ); int AddToPlayer( CBasePlayer *pPlayer ); void PrimaryAttack( void ); BOOL Deploy( void ); void Reload( void ); void WeaponIdle( void ); int m_iShell; virtual BOOL UseDecrement( void ) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } private: unsigned short m_usReload; unsigned short m_usNailgun; }; class CCmlwbr : 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(){ return 3; } int GetItemInfo( ItemInfo *p ); void FireBolt( void ); void PrimaryAttack( void ); void SecondaryAttack( void ); int AddToPlayer( CBasePlayer *pPlayer ); BOOL Deploy(); void Holster( int skiplocal = 0 ); void Reload( void ); void WeaponIdle( void ); BOOL ShouldWeaponIdle( void ); int m_fInZoom; // don't save this virtual BOOL UseDecrement( void ) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } BOOL IsDrawn( void ); void SetDrawn( BOOL bDrawn ); void ToggleZoom( void ); void ZoomIn( int iFOV ); void ZoomOut( void ); void DoReload(); void DrawBack( void ); void Undraw(); private: unsigned short m_usReload; unsigned short m_usCmlwbr; }; class CXenSquasher : 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 4; } int GetItemInfo( ItemInfo *p ); int AddToPlayer( CBasePlayer *pPlayer ); BOOL Deploy( void ); void Holster( int skiplocal = 0 ); void Reload( void ); void PrimaryAttack( void ); void SecondaryAttack( void ); void WeaponIdle( void ); void StartFire( void ); void Fire( Vector vecOrigSrc, Vector vecDirShooting, float flDamage ); float GetFullChargeTime( void ); int m_iBalls; int m_iGlow; int m_iBeam; int m_iSoundState; // don't save this // was this weapon just fired primary or secondary? // we need to know so we can pick the right set of effects. BOOL m_fPrimaryFire; virtual BOOL UseDecrement( void ) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } private: unsigned short m_usReload; unsigned short m_usXSFire; unsigned short m_usXSSpin; }; class CPipeBomb : public CSatchel { 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 AddToPlayer( CBasePlayer *pPlayer ); void PrimaryAttack( void ); void SecondaryAttack( void ); BOOL Deploy( void ); void Holster( int skiplocal = 0 ); void WeaponIdle( void ); void Throw( void ); void Redraw( void ); BOOL ShouldWeaponIdle( void ); private: unsigned short m_usReload; }; #endif // WEAPONS_H