//-----------------------------------------------------------------------------
//
//  $Logfile:: /game/grapple.h                                                $
// $Revision:: 2                                                              $
//   $Author:: Burgermac                                                      $
//     $Date:: 12/27/00 6:54 PM                                               $
//
// Copyright (C) 1998 by Ritual Entertainment, Inc.
// All rights reserved.
//
// This source may not be distributed and/or modified without
// expressly written permission by Ritual Entertainment, Inc.
//
// DESCRIPTION:
// Grappling Hook

#ifndef __GRAPPLE_H__
#define __GRAPPLE_H__

#include "g_local.h"
#include "item.h"
#include "weapon.h"
#include "specialfx.h"

class Hook : public Projectile
{
private:
	float speed;

public:
	CLASS_PROTOTYPE( Hook );

	void                    Setup( Entity* owner, Vector pos, Vector dir );
	virtual void      Archive( Archiver& arc );
	virtual void      Unarchive( Archiver& arc );
	virtual void      Touch( Event* ev );
};

inline void Hook::Archive( Archiver& arc )
{
	Projectile::Archive( arc );

	arc.WriteFloat( speed );
}

inline void Hook::Unarchive( Archiver& arc )
{
	Projectile::Unarchive( arc );

	speed = arc.ReadFloat();
}

typedef SafePtr<Hook> HookPtr;
typedef SafePtr<Beam> BeamPtr;

class Grapple : public Weapon
{
private:
	HookPtr hook;
	BeamPtr beam;

public:
	CLASS_PROTOTYPE( Grapple );

	Grapple();
	~Grapple();
	virtual void        Shoot( Event* ev );
	virtual qboolean  HasAmmo( void );
	virtual void      ReleaseFire( float t );
	virtual void      UpdateBeam( Event* ev );
};

#endif /* grapple.h */
