#ifndef __BOB_H__
#define __BOB_H__

#include "g_local.h"
#include "actor.h"
#include "trigger.h"
#include "concussion.h"
#include "crossbow.h"

// varient of the Plasma Bow that's the secondary fire only
class BobBow : public Weapon
{
public:
	CLASS_PROTOTYPE(BobBow);

	BobBow();
	virtual void Shoot(Event *ev);
};

extern Event EV_Bob_Concussion;

class Bob:public Actor
{
private:
	float concussiontime;

	int blastcount; // fire counter
	Vector lastfirepos; // where it last fired from
	Vector lastfiredir; // direction it last fired in

public:
	CLASS_PROTOTYPE(Bob);
		
	Bob();
	virtual void Prethink(void);
	void Killed(Event *ev);
	qboolean InConcussionFOV(Vector pos);
	void FireConcussion(Event *ev);
	void ConcussionEffect(Event *ev);

	virtual void Archive( Archiver &arc );
	virtual void Unarchive( Archiver &arc );
};

inline void Bob::Archive (Archiver &arc)
{
	Actor::Archive(arc);
	
	arc.WriteFloat(concussiontime);
	arc.WriteInteger(blastcount);
	arc.WriteVector(lastfirepos);
	arc.WriteVector(lastfiredir);
}

inline void Bob::Unarchive (Archiver &arc)
{
	Actor::Unarchive(arc);
	
	concussiontime = arc.ReadFloat();
	blastcount = arc.ReadInteger();
	arc.ReadVector(&lastfirepos);
	arc.ReadVector(&lastfiredir);
}

#endif
