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

#ifndef __QUANTUMD_H__
#define __QUANTUMD_H__

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

class QuantumDestabilizer : public BulletWeapon
{
private:
	float power;
	SentientPtr trapped_sent;

public:
	CLASS_PROTOTYPE( QuantumDestabilizer );

	QuantumDestabilizer();
	virtual void Shoot( Event* ev );
	virtual void ReleaseFire( float holdfiretime );
	void EatAmmo( Event* ev );
	void Destruct( Event* ev );
	void StartSelfDestruct( Event* ev );
	void SuckSentient( Vector pos, Vector org );
	qboolean ShootSentient( Vector pos, Vector dir );
	void SentientOverload( Event* ev );
	void TraceAttack( const Vector& start, const Vector& end, int damage, trace_t* trace, int numricochets, int kick, int dflags );
	virtual qboolean Drop( void );
	virtual void SecondaryUse( Event* ev ); //###
	virtual void Archive( Archiver& arc );
	virtual void Unarchive( Archiver& arc );
};

inline void QuantumDestabilizer::Archive( Archiver& arc )
{
	BulletWeapon::Archive( arc );

	arc.WriteFloat( power );
	arc.WriteSafePointer( trapped_sent );
}

inline void QuantumDestabilizer::Unarchive( Archiver& arc )
{
	BulletWeapon::Unarchive( arc );

	power = arc.ReadFloat();
	arc.ReadSafePointer( &trapped_sent );
}

#endif /* quantumd.h */
