//-----------------------------------------------------------------------------
//
//  $Logfile:: /game/earthquake.h                                             $
// $Revision:: 2                                                              $
//   $Author:: Burgermac                                                      $
//     $Date:: 12/27/00 7:12 PM                                               $
//
// Copyright (C) 1997 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:
// Earthquake trigger causes a localized earthquake when triggered.
// The earthquake effect is visible to the user as the shaking of his screen.
//

#ifndef __EARTHQUAKE_H__
#define __EARTHQUAKE_H__

#include "g_local.h"
#include "trigger.h"

#define EARTHQUAKE_STRENGTH 100

class Earthquake : public Trigger
{
protected:
	qboolean quakeactive;
	float duration;

public:
	CLASS_PROTOTYPE( Earthquake );
	Earthquake();
	void Activate( Event* ev );
	void Deactivate( Event* ev );
	qboolean EarthquakeActive()
	{
		return quakeactive;
	};
	virtual void      Archive( Archiver& arc );
	virtual void      Unarchive( Archiver& arc );
};

inline void Earthquake::Archive( Archiver& arc )
{
	Trigger::Archive( arc );

	arc.WriteBoolean( quakeactive );
	arc.WriteFloat( duration );
}

inline void Earthquake::Unarchive( Archiver& arc )
{
	Trigger::Unarchive( arc );

	quakeactive = arc.ReadBoolean();
	duration = arc.ReadFloat();
}

#endif /* Earthquake.h */
