diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /sp/src/game/server/hl2/weapon_brickbat.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'sp/src/game/server/hl2/weapon_brickbat.h')
| -rw-r--r-- | sp/src/game/server/hl2/weapon_brickbat.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/sp/src/game/server/hl2/weapon_brickbat.h b/sp/src/game/server/hl2/weapon_brickbat.h new file mode 100644 index 00000000..0a793803 --- /dev/null +++ b/sp/src/game/server/hl2/weapon_brickbat.h @@ -0,0 +1,82 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Weapon that throws things from the hand
+//
+// $Workfile: $
+// $Date: $
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef WEAPON_BRICKBAT_H
+#define WEAPON_BRICKBAT_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+#include "basehlcombatweapon.h"
+
+enum BrickbatAmmo_t
+{
+ BRICKBAT_ROCK = 0,
+ BRICKBAT_BOTTLE,
+
+ NUM_BRICKBAT_AMMO_TYPES
+};
+
+class CGrenade_Brickbat;
+
+class CWeaponBrickbat : public CBaseHLCombatWeapon
+{
+public:
+ DECLARE_CLASS( CWeaponBrickbat, CBaseHLCombatWeapon );
+
+ DECLARE_SERVERCLASS();
+
+public:
+ int m_iCurrentAmmoType;
+
+ void Precache( void );
+ void Spawn( void );
+ bool Deploy( void );
+
+ virtual const char *GetViewModel( int viewmodelindex =0 );
+ virtual const char *GetWorldModel( void );
+
+ void DrawAmmo( void );
+
+ virtual int WeaponRangeAttack1Condition( float flDot, float flDist );
+ virtual bool WeaponLOSCondition(const Vector &ownerPos, const Vector &targetPos, bool bSetConditions);
+
+ void SetPickupTouch( void );
+ void BrickbatTouch( CBaseEntity *pOther ); // default weapon touch
+ void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr );
+ int CapabilitiesGet( void ) { return bits_CAP_WEAPON_RANGE_ATTACK1; }
+
+ bool ObjectInWay( void );
+
+ void ThrowBrickbat( Vector vecSrc, Vector vecVelocity, float damage);
+ void ItemPostFrame( void );
+ void PrimaryAttack( void );
+ void SecondaryAttack( void );
+ void Throw( void );
+
+ void Operator_HandleAnimEvent( animevent_t *pEvent, CBaseCombatCharacter *pOperator );
+
+ DECLARE_DATADESC();
+ DECLARE_ACTTABLE();
+
+ CWeaponBrickbat(void);
+
+private:
+ bool m_bNeedDraw;
+ bool m_bNeedThrow;
+ int m_iThrowBits; // Save the current throw bits state
+ float m_fNextThrowCheck; // When to check throw ability next
+ Vector m_vecTossVelocity;
+
+ int m_nAmmoCount[NUM_BRICKBAT_AMMO_TYPES]; // How much ammo of each type do I own?
+};
+
+#endif //WEAPON_BRICKBAT_H
|