
///////////////////////////////////////////////////////////////////////////////
//
// File   : AVP_InventoryWeapon_Disc.h
// Author : Chris Wallace
// Date   : 04-Dec-2007
//
// Copyright (C) 2007 Rebellion, All Rights Reserved.
//
///////////////////////////////////////////////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
	#pragma once
#endif   // ifdef ASURA_USE_PRAGMA_ONCE

#ifndef __AVP_INVENTORYWEAPON_DISC_H__
#define __AVP_INVENTORYWEAPON_DISC_H__

////////////////////////////////////////////////////////////////////////////////
// Include files...
////////////////////////////////////////////////////////////////////////////////

#include "Inventory/Items/Weapons/AVP_InventoryWeapon_RangedWeapon.h"
#include "Inventory/Items/Weapons/AVP_RangedWeapon_SubType.h"
#include "Inventory/Groups/AVP_InventoryGroup_Weapons.h"

////////////////////////////////////////////////////////////////////////////////
// Forward class declarations...
////////////////////////////////////////////////////////////////////////////////

class Asura_Physics_Object;
class AVP_ClientActor_Vertebrate;
class AVP_ServerActor_Vertebrate;
class AVP_Predator_Tag;
class AVP_Predator_TagHandler;

////////////////////////////////////////////////////////////////////////////////
// Class declaration...
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_InventoryWeapon_Disc
// Author       : Chris Wallace
// Date         : 13-Nov-2007
//
// Description  : Class to handle either client or server-side updating of the
//				  Disc weapon.
////////////////////////////////////////////////////////////////////////////////

class AVP_InventoryWeapon_Disc : public AVP_InventoryWeapon_RangedWeapon
{
public:
	enum DiscUsageType
	{
		UT_THROW = NUM_RANGED_WEAPON_USAGE_TYPES,	// UT_THROW is not currently used! All discs are now bouncing all the time.
		UT_BOUNCE_THROW,							// only type that is used for current avp game.

		NUM_DISC_USAGE_TYPES
	};

	AVP_InventoryWeapon_Disc( AVP_Inventory_Group& xParentGroup, const Asura_Hash_ID uHash, const Asura_Hash_ID uBlueprintHash );

	virtual int		GetSubTypeIndexFromUsageType( const u_int uUsageType ) const;
	virtual void	ProcessPlayerInput( const AVP_ClientEntity_Actor& xVert );

	// this is needed for server to determine if the disc follows laser,but also it it is important for client to tell, if the visual of laser should be on or off.
	bool			IsInLaserTargetMode() const { return m_bIsInLaserTargetMode; }
	void			SetLaserTargetMode( bool bLaserTargetMode );

protected:
	virtual void	StartUsing(const u_int uUsageType);
	virtual void	StopUsing(const u_int uUsageType);
	virtual void	UpdateClientState( AVP_ClientEntity_Actor& xClient );
	virtual void	UpdateServerState( AVP_ServerEntity_Actor& xServer );

	virtual float	CalculateFireAmount( const AVP_RangedWeapon_SubType* pxSubType, u_int uUsageType ) { return 1.0f; }
	virtual u_int	GetBulletsAvailableToFire( float fAmount, AVP_RangedWeapon_SubType* pxSubType, u_int uUsageType ) { return 1u; }
	virtual void	CalculateFiringDataForSubType( const AVP_ClientEntity_Actor& xVert, Asura_Hash_ID uMuzMP, float fMuzVel, float fMaxRange, Asura_Vector_3& xFirePosition, Asura_Vector_3& xFireDirection, Asura_Matrix_3x3& xMuzzleOri, float& fRange, Asura_Guid* puTargetGuid = NULL );
	virtual void	DoBulletDamage( const AVP_GenericProjectileData* pxProjectileData, Asura_Hash_ID uMuzMP, float fRange, float fMaxRange, const Asura_Vector_3& xShotDirection ) { Asura_Assert( false, "Disc shouldn't be doing bullet damage, is the projectile collision object set?" ); }
	virtual void	SendCreateProjectileMessage( const AVP_GenericProjectileData* pxProjectileData, const AVP_RangedWeapon_SubType* pxSubType, u_int uUsageType, Asura_Hash_ID uMuzMP, float fRange, float fMaxRange, const Asura_Vector_3& xActorVel, const Asura_Vector_3& xFirePosition, const Asura_Vector_3& xShotDirection, const Asura_Matrix_3x3& xShotOrientation, Asura_Guid* puTargetGuid =NULL );

	virtual bool	IsPlayerIsStillFiring( const AVP_ClientEntity_Actor& xVert, int iSubType ) const { return false; }

private:
	typedef AVP_InventoryWeapon_RangedWeapon PARENT;

	void SendRetrieveDiscMessage(void);
	void SendTurnLaserTrackingMessageToPredator( bool bTurnLaserTrackingOn );

	bool m_bIsInLaserTargetMode;

	AVP_InventoryWeapon_Disc(void);
	AVP_InventoryWeapon_Disc(const AVP_InventoryWeapon_Disc& xOther);

	AVP_InventoryWeapon_Disc&	operator=(const AVP_InventoryWeapon_Disc& xOther);
};   // End of class 'AVP_InventoryWeapon_Disc'.


#endif   // ifndef __AVP_INVENTORYWEAPON_DISC_H__


/// End of file. ///
