//-----------------------------------------------------------------------------
//
// Mortician header file by Boon, created 11-11-98
//
// DESCRIPTION:
// Mortician
// 

#ifndef __MORTICIAN_H__
#define __MORTICIAN_H__

#include "g_local.h"
#include "actor.h"

class Mortician : public Actor {
public:
	CLASS_PROTOTYPE( Mortician );
	
	Mortician();
	virtual void JumpToEvent(Event *ev);
	virtual void FlashEvent(Event *ev);
	float JumpTo(const Vector &targ ); //Subtle alteration of regular jumpto
};
	
class MJump : public Behavior {
private:
	float endtime;
	str anim;		//Temp variable for assembling animation names in
	str jumpdir;	//Used for the direction part of the animation name to be played
	int state;
	qboolean animdone;
	Vector goal;
	Vector temp_vel;	//Used for destructive testing of velocity
	qboolean accurate;	//Do we need to land exactly there, or only near there?
	EntityPtr target;	//Used to tell him where to face if he's jumping around the player
	Vector FindCloseSightNodeTo( Actor &self,const Vector &pos, float maxjumpdistance );
	float heightwanted;	// Height of ceiling which allows unrestricted jumping
	float heightneeded;	// Minimum height of ceiling for reasonable jumping
	qboolean jumpok;		// Set to false if there is not enough ceiling height
	float oldworldheight;	//Since self.velocity doesn't work real reliably due to animation vectors, I'm making my own
	float upspeed;		// Keep a flag on vertical velocity
	qboolean jumpbegun;		//Flag to note that we have taken off
	
public:
	CLASS_PROTOTYPE( MJump );
	
	MJump();
	void SetArgs( Event *ev );
	void ShowInfo( Actor &self );
	void Begin( Actor &self );
	qboolean Evaluate( Actor &self );
	void End( Actor &self );
	void AnimDone( Event *ev );
	virtual void Archive( Archiver &arc );
	virtual void Unarchive( Archiver &arc );
};

#endif /* mortician.h */
