////////////////////////////////////////////////////////////////
//
// File:		AVP_Predalien_MeleeCounter_System.h
// Author:		Chris Wallace
// Date:		25-Jan-2008
//
// Copyright (C) 2008 Rebellion, All Rights Reserved.
//
////////////////////////////////////////////////////////////////

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

#ifndef __AVP_PREDPREDALIEN_MELEECOUNTER_SYSTEM_H__
#define __AVP_PREDPREDALIEN_MELEECOUNTER_SYSTEM_H__

///////////////////////////////////////////////
// #includes
///////////////////////////////////////////////

#include "Actor/Vertebrates/AVP_Vertebrate_MeleeCounter_System.h"

///////////////////////////////////////////////

class AVP_ServerEntity_Actor;
class AVP_ServerActor_Predalien;
class AVP_Predalien_Focus;

/////////////////////////////////////////////////////////////////////
//
// Class		:	AVP_Predalien_MeleeCounter_System
//
//////////////////////////////////////////////////////////////////////

enum AVP_PREDPREDALIEN_MELEEATTACK_TYPE
{
	AVP_PREDPREDALIEN_MELEEATTACK_TYPE_CLOSE_STAND_ATTACK = NUM_AVP_MELEEATTACK_TYPES,	// close range stand attack
	AVP_PREDPREDALIEN_MELEEATTACK_TYPE_CLOSE_WALK_ATTACK,								// close range walk attack	
	AVP_PREDPREDALIEN_MELEEATTACK_TYPE_CLOSE_TAIL_ATTACK,
	AVP_PREDPREDALIEN_MELEEATTACK_TYPE_LEAP_ATTACK,
	AVP_PREDPREDALIEN_MELEEATTACK_TYPE_JUMP_DOWN_ATTACK,



	// markers - not used for real attacks
	AVP_PREDPREDALIEN_MELEEATTACK_TYPE_LEAP_ATTACK_DO_GRAPPLE,
	NUM_AVP_PREDPREDALIEN_MELEEATTACK_TYPES,
};

class AVP_Predalien_MeleeCounter_System : public AVP_Vertebrate_MeleeCounter_System
{
public: 
	AVP_Predalien_MeleeCounter_System(AVP_ServerActor_Predalien& xOwner);
	virtual ~AVP_Predalien_MeleeCounter_System() {};

	virtual void InitialiseFromBlueprint(const Asura_Blueprint& xBlueprint);

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

	virtual bool StartMeleeMove(u_int uType);

// 	virtual bool InsidePounceRange() const;
// 	virtual bool InsideTailAttackRange() const;

protected:
	virtual void CheckForAndDealMeleeDamage();
	virtual void ApplyMeleeDamage(Asura_Guid uDamagedGuid);
	// virtual void ApplyGrappleDamage() const;

	//virtual bool GetAttackTypeCanCounter(u_int uType) const; // Returns true if a particular melee request can also be used to counter an incoming attack.

	// Go off and get a move hash relevant to the species and weapon
	virtual Asura_Hash_ID GetMeleeMoveHash(u_int uType) const;	

	virtual bool GetCanBlock() const;

	// Functions for counters by each species, split up to keep the code clearer. Uses the move we're currently doing to pick the correct counter for that species.
	//virtual bool GetCanCounter_AlienCounter(const AVP_ServerEntity_Actor& xEnemy, const u_int uQueuedCounterType, Asura_Hash_ID& uMoveHash, u_int& uNewAttackType, bool& bMakeEnemyIntoPuppet, Asura_Hash_ID& uGrappleSetBlueprintParam) const;
	//virtual bool GetCanCounter_HumanCounter(const AVP_ServerEntity_Actor& xEnemy, const u_int uQueuedCounterType, Asura_Hash_ID& uMoveHash, u_int& uNewAttackType, bool& bMakeEnemyIntoPuppet, Asura_Hash_ID& uGrappleSetBlueprintParam) const;
	virtual bool GetCanCounter_PredatorCounter(const AVP_ServerEntity_Actor& xEnemy, const u_int uQueuedCounterType, Asura_Hash_ID& uMoveHash, u_int& uNewAttackType, bool& bMakeEnemyIntoPuppet, Asura_Hash_ID& uGrappleSetBlueprintParam) const;

	virtual float GetCurrentMaxCounterDistance() const;

	virtual float GetAttackDamage() const;
	virtual Asura_Hash_ID GetAttackDamageType() const;
//	virtual float GetAttackImpulseStrength() const;
// 	virtual void GetAttackDirection(const AVP_ServerEntity_PhysicalObject* pxTarget, Asura_Vector_3& xDirection) const;
// 	virtual int GetAttackBoneHit(Asura_Guid uDamagedGuid) const;
	virtual bool IsAttackUnblockable() const;
	virtual bool GetAttackOnlyHitsCurrentTarget() const;

//	virtual bool GetSendIncomingMeleeMessage(u_int uAttackType) const;

	virtual void SendMeleeAttackHitMessage();

	virtual const Asura_Blueprint* GetExtraMeleeDataBlueprint() const;

	enum CloseMoveType
	{
		CLOSE_MOVE_UKNOWN,
		CLOSE_MOVE_CLAW_LEFT,
		CLOSE_MOVE_CLAW_RIGHT,
		CLOSE_MOVE_TAIL_LEFT,
		CLOSE_MOVE_TAIL_RIGHT
	};

	CloseMoveType GetCurrentCloseMoveType() const;
	bool CalculateLeapTargetPosition(Asura_Vector_3& xDestination);
	bool CalcluateTailDirection(float &fTailLenght, Asura_Vector_3& xTailDirection, Asura_Vector_3& xCurrentTailPosition) const;
	float GetTargetBBHight() const;

	bool m_bDoGrapple;
	bool m_bDoSuperJumpAttack;

	Asura_Vector_3 m_xOwnerStartLeapPosition;
	Asura_Vector_3 m_xTargetStartLeapPosition;
	Asura_Vector_3 m_xTailLastFlatDirection;
	float m_fTailLastLenght;

private:
	typedef AVP_Vertebrate_MeleeCounter_System PARENT;
};

#endif //__AVP_PREDPREDALIEN_MELEECOUNTER_SYSTEM_H__

/// End of file. ///
