AvHBasePlayerWeapon.h

 ifndef AVHBASEPLAYERWEAPON_H
define AVHBASEPLAYERWEAPON_H
include "../dlls/weapons.h"
include "../dlls/extdll.h"
include "../dlls/util.h"
include "../dlls/cbase.h"
include "../dlls/monsters.h"
include "../dlls/weapons.h"
include "../dlls/nodes.h"
include "../dlls/player.h"
include "../dlls/soundent.h"
include "../dlls/gamerules.h"
include "../util/CString.h"
include "AvHBasePlayerWeaponConstants.h"
include "AvHConstants.h"
include "AvHSpecials.h"
const int kIdleAnimationOne = 0;
const int kIdleAnimationTwo = 1;
const int kReloadAnimation = 2;
const int kShootAnimation = 3;
const int kShootEmptyAnimation = 4;
const int kDeployAnimation = 5;
Vector UTIL_GetRandomSpreadDir(unsigned int inSeed, int inShotNumber, const Vector& inBaseDirection, const Vector& inRight, const Vector& inUp, const Vector& inSpread);
Vector UTIL_GetRandomSpreadDirFrom(unsigned int inSeed, int inShotNumber, const Vector& inBaseDirection, const Vector& inRight, const Vector& inUp, const Vector& inSpread, const Vector& inFromSpread);
class AvHBasePlayerWeapon : public CBasePlayerWeapon
{
public:
AvHBasePlayerWeapon();
virtual void PrintWeaponToClient(CBaseEntity *theAvHPlayer);
virtual int AddToPlayer( CBasePlayer *pPlayer );
virtual float ComputeAttackInterval() const; virtual void DeductCostForShot(void); virtual BOOL DefaultDeploy(char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, int skiplocal = 0, int body = 0); virtual int DefaultReload(int iClipSize, int iAnim, float fDelay, int body = 0); virtual BOOL Deploy(); virtual char* GetActiveViewModel() const; virtual char* GetAnimationExtension() const; virtual int GetBarrelLength() const = 0; virtual bool GetCanBeResupplied() const; virtual int GetClipSize() const; virtual bool GetIsGunPositionValid() const; virtual int GetPrimaryAmmoAmount() const; virtual int GetDamageType() const; virtual int GetDeployAnimation() const; virtual int GetEmptyShootAnimation() const; virtual char* GetDeploySound() const; virtual float GetDeploySoundVolume() const; virtual bool GetEnabledState() const; virtual void GetEventOrigin(Vector& outOrigin) const; virtual void GetEventAngles(Vector& outAngles) const; virtual bool GetIsFiring() const; virtual bool GetMustPressTriggerForEachShot() const { return false; } virtual bool GetHasMuzzleFlash() const; virtual bool GetIsCapableOfFiring() const; virtual bool GetIsPlayerMoving() const; virtual bool GetFiresUnderwater() const; virtual int GetIdleAnimation() const; virtual Vector GetProjectileSpread() const; virtual float GetRateOfFire() const; virtual char* GetPlayerModel() const; virtual char* GetPrimeSound() const; virtual float GetPrimeSoundVolume() const; virtual int GetShootAnimation() const; virtual char* GetViewModel() const; virtual char* GetWorldModel() const; virtual bool GetIsDroppable() const; virtual int GetMaxClipsCouldReceive(); // Priming functions virtual float GetWeaponPrimeTime() const; virtual void PrimeWeapon(); virtual BOOL GetIsWeaponPrimed() const; virtual BOOL GetIsWeaponPriming() const; virtual int GetPrimeAnimation() const; virtual float GetRange() const; virtual int GetReloadAnimation() const; virtual vec3_t GetWorldBarrelPoint() const; virtual void Holster( int skiplocal = 0 ); virtual void ItemPostFrame( void ); // called each frame by the player PostThink virtual void Precache(); virtual void PrimaryAttack(); virtual void Reload(); virtual bool Resupply(); virtual void SendWeaponAnim(int inAnimation, int skiplocal = 1, int body = 0); // Only to be used on server #ifdef AVH_SERVER virtual int GetGroundLifetime() const; virtual void SetGroundLifetime(int inGroundLifetime); virtual int GetResourceCost() const; virtual void SetOverwatchState(bool inState); virtual void UpdateInventoryEnabledState(int inNumActiveHives); // Methods for placing in the map void EXPORT VirtualDestroyItem(void); virtual int GetLifetime() const; virtual bool GetIsPersistent() const; virtual void SetPersistent(); virtual void KeyValue(KeyValueData* pkvd); virtual void ResetEntity(); virtual void VirtualMaterialize(void); #endif virtual void SecondaryAttack(); virtual void Spawn(); virtual bool UsesAmmo(void) const; virtual BOOL UseDecrement(void); virtual void WeaponIdle();
protected:
//BOOL Deploy(char *szViewModel, char *szWeaponModel, int iAnim, char *szAnimExt, float inNextAttackTime, int skiplocal = 0);
virtual bool GetAllowedForUser3(AvHUser3 inUser3) = 0; virtual int GetShotsInClip() const; virtual AvHWeaponID GetPreviousWeaponID() const; virtual bool ProcessValidAttack(void); virtual float GetReloadTime(void) const; virtual float GetTimePassedThisTick() const; virtual void PlaybackEvent(unsigned short inEvent, int inIparam2 = 0, int inFlags = FEV_NOTHOST) const; virtual void SetAnimationAndSound(void); virtual void FireProjectiles(void); virtual void SetNextAttack(void); virtual void SetNextIdle(void); unsigned short mEvent; unsigned short mWeaponAnimationEvent; unsigned short mStartEvent; unsigned short mEndEvent; float mRange; float mDamage; bool mAttackButtonDownLastFrame; float mTimeOfLastResupply; float mTimeOfLastPrime; bool mWeaponPrimeStarted; #ifdef AVH_SERVER bool mInOverwatch; bool mIsPersistent; int mLifetime; #endif // sounds CStringList mFireSounds;
};
endif