
///////////////////////////////////////////////////////////////////////////////
//
// File   : AVP_ClientActor_Alien.h
// Author : Andy Tate
// Modified to Alien : Chris Wallace
// Date   : 3-Oct-2006
//
// Copyright (C) 2006 Rebellion, All Rights Reserved.
//
///////////////////////////////////////////////////////////////////////////////

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

#ifndef __AVP_CLIENTACTOR_ALIEN_H__
#define __AVP_CLIENTACTOR_ALIEN_H__

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

#include "Actor/Vertebrates/Alien/AVP_Alien_Description.h"
#include "Blueprint/AVP_Blueprint_HashIDs.h"
#include "Entity/PhysicalObject/Actor/Vertebrates/AVP_ClientActor_Vertebrate.h"

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

class AVP_Message_ActorClientPickup;
class AVP_Message_AlienClientUpdate;

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

////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_ClientActor_Alien
// Author       : Andy Tate
// Date         : 3-Oct-2006
//
// Description  : This class handles the operation of the Alien actor, the
//				  Predator can be either player controlled or AI controlled.
////////////////////////////////////////////////////////////////////////////////

class AVP_ClientActor_Alien : public AVP_ClientActor_Vertebrate
{
public:
	// Public functions...
	static	AVP_ClientActor_Alien*	Create	(const Asura_Message* pxMessage);

	// Overridden functions...
	virtual	void	Update(void);
	virtual	bool	HandleMessage(const Asura_Message* pxMessage);

//	virtual	void	UpdateInput(void);
	virtual	void	RenderHUD(void) const;
//	virtual	void	SetCamera(void);
	virtual void	OnDeath( const AVP_EntityDamage_ApplyToEntity& xDamage );

	// Accessor functions...

	void			SetStanding( const bool bSet, const bool bCheckIfPossible );
	bool			IsStanding		(void) const { return m_bStanding; }

	// Static list accessors...
	static	AVP_ClientActor_Alien*							FindEntity	(const Asura_Guid uGuid)	{ return(s_xList.FindEntity(uGuid)); }
	static	const Asura_Hashed_List<AVP_ClientActor_Alien>*	GetList		(void)						{ return(&s_xList); }

	void PlayFootSound(const bool bLeftFoot, const float fMoveSpeedParametric);

	virtual void MakePlayer(Asura_Guid uPlayerGuid);
	virtual void MakeAI(void);

	virtual void PostCreateInitialise(void);

	bool		GetComboPressed(void) const				{ return(m_bComboPressed); }
	void		SetComboPressed(const bool bPressed)	{ m_bComboPressed = bPressed; }

	// stealth indicator stuff
	bool			IsAlienInShadow() const				{ return m_bIsInShadow; }
	bool			GetHasBeenHeard(void) const			{ return m_bHasBeenHeard; }
	u_int			GetSpottedState(void) const			{ return m_uSpottedState; }
	void			SetHasBeenHeard(bool bVal)			{ m_bHasBeenHeard = bVal; }
	void			SetSpottedState(u_int uState)		{ m_uSpottedState = uState; }
	bool			IsFaceHuggerSummonable() const		{ return m_bIsFaceHuggerSummonable; }
	u_int			GetFaceHuggerPetStatus() const		{ return m_uFaceHuggerPetStatus; }

	void			SetLookSmoothingTransitionAngle( const float fAngle ) { m_fLookSmoothingTransitionAngle = fAngle; }

	virtual void	GetCurrentMeleeBlueprintIDs(Asura_Hash_ID& uFirstPersonID, Asura_Hash_ID& uThirdPersonID) const;

	virtual void	GetFootPosition( u_int uFootItr, Asura_Vector_3& xFootPos );

protected:
	// Protected enumerated types...
// 	enum Weapon
// 	{
// 		CLAW,
// 		TAIL,
// 		BITE,
// 		
// 		MAX_WEAPONS
// 	};

	// Protected functions...
	AVP_ClientActor_Alien          (void);
	virtual ~AVP_ClientActor_Alien ();

	// Overridden functions...

	// Overridden initialisation functions...
	virtual	bool	InitialiseMoves(void);
	virtual bool	InitialiseSoundEvents(void);
	virtual void	CreateAnimationHandler();

	// Added static function GetElementFromBoneID to actor description class, but left this here as a wrapper (AN 07/11/07)
	virtual u_int	GetElementFromBoneID(int iBoneID) const { return AVP_Alien_Description::GetElementFromBoneID(iBoneID); }
	virtual int		GetAnyBoneIDFromElement(u_int uElement) const { return AVP_Alien_Description::GetAnyBoneIDFromElement(uElement); } // Since bones->elements is a many->one mapping, this function will return one of the bones associated with the given element, but not necessarily the only one.

	virtual void	GetCurrentBlockBlueprintHashes(Asura_Hash_ID& uBlueprintTypeHash, Asura_Hash_ID& uFirstPersonBlueprintHash, Asura_Hash_ID& uThirdPersonBlueprintHash) const;

	virtual bool	IsBoneInTorso( const int iBoneID );

	void			ProcessClientUpdate	(const AVP_Message_AlienClientUpdate* pxData, const float fServerTime, const bool bProcessPosAndOri = true);

	virtual void GetDesiredForwardMovementDirection(Asura_AVector3& xDirection, const Asura_AMatrix3x3& xOri) const;

	virtual void OnDecapitation();

private:
	// Private typedefs...
	typedef AVP_ClientActor_Vertebrate PARENT;

	virtual const AVP_Actor_AnimStateData* GetStateDataFromMesssageData( const u_int uState, const AVP_Message_Actor_ClientUpdate* pxActorData );
	virtual const AVP_Actor_AnimStateData* GetStateData( const u_int uState, const u_int uGroundType, const u_int uLimbDamage, const bool bIsAiming, const u_int uCoverType );


	// Private variables...
	bool						m_bIsInShadow;

	bool						m_bComboPressed;

	u_int						m_uDroolPFXEffect;		// The effect ID of the Alien drool PFX (used in grapple-mode).
	const Asura_Sound_Event*	m_pxGibSoundEvent;

	bool						m_bHasBeenHeard;
	u_int						m_uSpottedState;

	float						m_fTimeStanding;
	float						m_fLookSmoothingTransitionAngle;

	bool						m_bIsFaceHuggerSummonable;
	u_int						m_uFaceHuggerPetStatus;


	union
	{
		u_int	m_uAlienFlags;			// Single access point for the flags.

		struct
		{
			u_int	m_bStanding		: 1,	// Flag to say that we're standing.
									: 0;	// 31 spare-bits.		
		};
	};


#if defined(ASURA_SUPPORT_COMMAND_CONSOLE)
	static u_int s_uConsoleVarReferenceCount;
#endif

	static	Asura_Hashed_List<AVP_ClientActor_Alien>	s_xList;

	// Private functions...
	AVP_ClientActor_Alien (const AVP_ClientActor_Alien& xOther);

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


#endif   // ifndef __AVP_CLIENTACTOR_ALIEN_H__


/// End of file. ///
