/*** * * 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 ); void DoshSpawn( void ); typedef enum { SATCHEL_DETONATE = 0, SATCHEL_RELEASE } SATCHELCODE; static CGrenade *ShootTimed( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time ); static CGrenade *ShootJihad( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time ); static CGrenade *ShootContact( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity ); static CGrenade *ShootContact2( 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 Explode2( 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 ExplodeTouch2( CBaseEntity *pPlayer ); void EXPORT ExplodeTouch3( CBaseEntity *pPlayer ); //void EXPORT DoshTouch( CBasePlayer *pOther ); //BOOL EXPORT DoshTouch( CBasePlayer *pPlayer ); void EXPORT DangerSoundThink( void ); void EXPORT PreDetonate( void ); void EXPORT Detonate( void ); void EXPORT Detonate2( void ); void EXPORT Detonate3( void ); void EXPORT DetonateUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ); void EXPORT TumbleThink( void ); void EXPORT TumbleThink2( 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_CROWBAR 1 #define WEAPON_GLOCK 2 #define WEAPON_GOLDENGUN 3 #define WEAPON_MP5 4 #define WEAPON_CHAINGUN 5 #define WEAPON_ZAPPER 6 #define WEAPON_SHOTGUN 7 #define WEAPON_RPG 8 #define WEAPON_BOOMBOX 9 #define WEAPON_SCIENTIST 10 #define WEAPON_SODA 11 #define WEAPON_HANDGRENADE 12 #define WEAPON_TRIPMINE 13 #define WEAPON_SATCHEL 14 #define WEAPON_SNARK 15 #define WEAPON_DOSH 16 #define WEAPON_JASON 17 #define WEAPON_BEAMKATANA 18 #define WEAPON_AK47 19 #define WEAPON_BOW 20 #define WEAPON_JIHAD 21 #define WEAPON_NSTAR 22 #define WEAPON_MW2 23 #define WEAPON_FOTN 24 #define WEAPON_JACKAL 25 #define WEAPON_MODMAN 26 #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 3; } 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 CLIENT_WEAPONS return TRUE; #else return FALSE; #endif } private: unsigned short m_usSnarkFire; }; class CDosh : public CBasePlayerWeapon { public: #if !CLIENT_DLL //int Save( CSave &save ); //int Restore( CRestore &restore ); static TYPEDESCRIPTION m_SaveData[]; #endif void Spawn( void ); void Precache( void ); void Reload( void ); int iItemSlot( void ) { return 3; } int GetItemInfo(ItemInfo *p); int AddToPlayer( CBasePlayer *pPlayer ); BOOL Deploy( void ); BOOL CanHolster( void ); void Holster( int skiplocal = 0 ); void PrimaryAttack( void ); //void SecondaryAttack( void ); void WeaponIdle( void ); //void UpdateSpot( void ); BOOL ShouldWeaponIdle( void ) { return TRUE; }; CLaserSpot *m_pSpot; int m_fSpotActive; int m_cActiveRockets;// how many missiles in flight from this launcher right now? virtual BOOL UseDecrement( void ) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } private: unsigned short m_usDosh; unsigned short m_usDosh2; }; class CDoshRocket : public CGrenade { public: //int Save( CSave &save ); //int Restore( CRestore &restore ); static TYPEDESCRIPTION m_SaveData[]; void Spawn( void ); void Precache( void ); void EXPORT FollowThink( void ); void EXPORT IgniteThink( void ); void DoshTouch( CBaseEntity *pPlayer ); void EXPORT RocketTouch( CBaseEntity *pOther ); static CDoshRocket *CreateDoshRocket( Vector vecOrigin, Vector vecAngles, CBaseEntity *pOwner, CDosh *pLauncher ); int m_iTrail; float m_flIgniteTime; CDosh *m_pLauncher;// pointer back to the launcher that fired me. }; class CJason : public CBasePlayerWeapon { public: void Spawn( void ); void Precache( void ); int iItemSlot( void ) { return 1; } void EXPORT SwingAgain( void ); void EXPORT Smack( void ); int GetItemInfo(ItemInfo *p); BOOL Deploy( void ); void Holster( int skiplocal = 0 ); void PrimaryAttack( void ); void SecondaryAttack( void ); virtual BOOL UseDecrement( void ) { #if CLIENT_WEAPONS return TRUE; #else return FALSE; #endif } private: unsigned short m_usJason; }; class CBeamKatana : public CBasePlayerWeapon { public: void Spawn( void ); void Precache( void ); int iItemSlot( void ) { return 2; } void EXPORT SwingAgain( void ); void EXPORT Smack( void ); int GetItemInfo(ItemInfo *p); //void FindHullIntersection( const Vector &vecSrc, TraceResult &tr, float *mins, float *maxs, edict_t *pEntity ); void PrimaryAttack( void ); void SecondaryAttack( void ); void Fuckhead( void ); int Swing( int fFirst ); BOOL Deploy( void ); void Holster( int skiplocal = 0 ); int m_iSwing; TraceResult m_trHit; virtual BOOL UseDecrement( void ) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } private: unsigned short m_usBeamKatana; }; class CAK47 : public CBasePlayerWeapon { public: void Spawn( void ); void Precache( void ); int iItemSlot( void ) { return 3; } int GetItemInfo(ItemInfo *p); int AddToPlayer( CBasePlayer *pPlayer ); void PrimaryAttack( void ); //void SecondaryAttack( void ); //int SecondaryAmmoIndex( void ); BOOL Deploy( void ); void Reload( void ); void WeaponIdle( void ); float m_flNextAnimTime; int m_iShell; BOOL UseDecrement( void ) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } private: unsigned short m_usAK47; //unsigned short m_usMP52; }; class CBow : public CBasePlayerWeapon { public: void Spawn( void ); void Precache( void ); int iItemSlot( ) { return 3; } int GetItemInfo(ItemInfo *p); void FireBolt( void ); //void FireSniperBolt( void ); void PrimaryAttack( void ); //void SecondaryAttack( void ); int AddToPlayer( CBasePlayer *pPlayer ); BOOL Deploy( ); void Holster( int skiplocal = 0 ); //void Reload( void ); void WeaponIdle( void ); //int m_fInZoom; // don't save this virtual BOOL UseDecrement( void ) { #if CLIENT_WEAPONS return TRUE; #else return FALSE; #endif } private: unsigned short m_usBow; //unsigned short m_usCrossbow2; }; class CSciPG : public CBasePlayerWeapon { public: void Spawn( void ); void Precache( void ); int iItemSlot( ) { return 4; } int GetItemInfo(ItemInfo *p); void FireBolt( void ); //void FireSniperBolt( void ); void PrimaryAttack( void ); //void SecondaryAttack( void ); int AddToPlayer( CBasePlayer *pPlayer ); BOOL Deploy( ); void Holster( int skiplocal = 0 ); //void Reload( void ); void WeaponIdle( void ); //int m_fInZoom; // don't save this virtual BOOL UseDecrement( void ) { #if CLIENT_WEAPONS return TRUE; #else return FALSE; #endif } private: unsigned short m_usScientist; }; class CGOLDENGUN : public CBasePlayerWeapon { public: void Spawn( void ); void Precache( void ); int iItemSlot( void ) { return 2; } int GetItemInfo(ItemInfo *p); void PrimaryAttack( void ); void SecondaryAttack( void ); void GOLDENGUNFire( float flSpread, float flCycleTime, BOOL fUseAutoAim ); BOOL Deploy( void ); void Reload( void ); void WeaponIdle( void ); virtual BOOL UseDecrement( void ) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } private: int m_iShell; unsigned short m_usFireGOLDENGUN; }; class CJackal : public CBasePlayerWeapon { public: void Spawn( void ); void Precache( void ); int iItemSlot( void ) { return 2; } int GetItemInfo(ItemInfo *p); void PrimaryAttack( void ); void SecondaryAttack( void ); void JackalFire( float flSpread, float flCycleTime, BOOL fUseAutoAim ); BOOL Deploy( void ); void Reload( void ); void WeaponIdle( void ); virtual BOOL UseDecrement( void ) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } private: int m_iShell; unsigned short m_usFireJackal; }; class CModman : public CBasePlayerWeapon { public: void Spawn( void ); void Precache( void ); int iItemSlot( ) { return 2; } int GetItemInfo(ItemInfo *p); void FireHorn( void ); void FireSniperHorn( void ); void PrimaryAttack( void ); int AddToPlayer( CBasePlayer *pPlayer ); BOOL Deploy( ); void Holster( int skiplocal = 0 ); void Reload( void ); void WeaponIdle( void ); virtual BOOL UseDecrement( void ) { #if CLIENT_WEAPONS return TRUE; #else return FALSE; #endif } private: unsigned short m_usModman; unsigned short m_usModman2; }; class CJihad : 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 ); BOOL CanHolster( void ); void Holster( int skiplocal = 0 ); void WeaponIdle( void ); void EXPORT ExplodeThink( void ); virtual BOOL UseDecrement( void ) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } private: unsigned short m_usJihad; }; class CNStar : public CBasePlayerWeapon { public: void Spawn( void ); void Precache( void ); int iItemSlot( ) { return 4; } int GetItemInfo(ItemInfo *p); void FireStar( void ); //void FireSniperBolt( void ); void PrimaryAttack( void ); //void SecondaryAttack( void ); int AddToPlayer( CBasePlayer *pPlayer ); BOOL Deploy( ); void Holster( int skiplocal = 0 ); //void Reload( void ); void WeaponIdle( void ); //int m_fInZoom; // don't save this virtual BOOL UseDecrement( void ) { #if CLIENT_WEAPONS return TRUE; #else return FALSE; #endif } private: unsigned short m_usNStar; //unsigned short m_usCrossbow2; }; class CMW2 : public CBasePlayerWeapon { public: void Spawn( void ); void Precache( void ); int iItemSlot( void ) { return 3; } int GetItemInfo(ItemInfo *p); int AddToPlayer( CBasePlayer *pPlayer ); void PrimaryAttack( void ); //void SecondaryAttack( void ); //int SecondaryAmmoIndex( void ); BOOL Deploy( void ); void Reload( void ); void WeaponIdle( void ); float m_flNextAnimTime; int m_iShell; virtual BOOL UseDecrement( void ) { #if defined( CLIENT_WEAPONS ) return TRUE; #else return FALSE; #endif } private: unsigned short m_usMW2; //unsigned short m_usMP52; }; class CZAPPER : public CBasePlayerWeapon { public: void Spawn( void ); void Precache( void ); int iItemSlot( void ) { return 2; } int GetItemInfo(ItemInfo *p); void PrimaryAttack( void ); void SecondaryAttack( void ); void ZAPPERFire( float flSpread, float flCycleTime, BOOL fUseAutoAim ); BOOL Deploy( void ); void Reload( void ); void WeaponIdle( void ); virtual BOOL UseDecrement( void ) { #if CLIENT_WEAPONS return TRUE; #else return FALSE; #endif } private: int m_iShell; unsigned short m_usFireZAPPER; }; #endif // WEAPONS_H