/**
* Class wich handles guide magic attacks
* @version 13-4-2001
* @author Herwin 'harSens' van Welbergen
*/
class CGuidedAttack : public CBeamAttack
{
public:
	/**
	* Create a guided magical attack 
	* @param entvars_t *pevOwner: Monster/Player who shoots it
	* @param Vector vecStart: Origin vector of the attack
	* @param Vector vecVelocity: Velocity of the attack
	* @param int damage: Amount of damage the attack does
	* @param char *attack: Name of the attack
	* @param float size: relative size of the attack (0..1)
	* @param int explosioncolor: the color of the explosion
	* @param int trail: the sprite for the trailing beam
	* @param int starta: the sprite for the beam flare
	* @param int startb: the sprite for the beam flare
	* @param int flarea: the sprite for the beam start
	* @param int flareb: the sprite for the beam start
	* @param int radius: the radius for the beam
	* @param int attachment: the attachment for the beam trail
	* @param int trailquality: the quality of the trail
	* @return *CGuidedAttack: The created MagicAttack 
	*/
	static CGuidedAttack *ShootGuidedMagic( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, int damage, char *attack, float size, int explosioncolor, short trail, short starta, short startb, short flarea, short flareb, int radius, float turn, int attachment,int trailqualit);

	/**
	* for magics wich follow the crosshair
	*/
	void EXPORT FollowThink ( void );

	/**
	* stops the beam, and sets stopped to true
	*/
	void EXPORT StopTouch ( CBaseEntity *pOther );

	/**
	* Struggles for power with another magic attack
	*/
	virtual void EXPORT PowerStruggleThink ( void );
	
	/**
	 * Releases attack, so no more controlling it
	 */
	virtual void Release(void);
	
	virtual int IsGuided(){return true;}
	
	void SetFollower(CBaseEntity *follower, CBasePlayer *pPlayer);

	int m_fReleased;	
protected:
	
	/**
	 * Check if this attack can vaporize a player
	 * @return 1 if this attack can vaporize a player, 0 otherwise
	 */
	virtual int CanVaporizePlayer(){return 1;}

	/**
	 * Swats the attack away
	 * CBasePlayer *pPlayer: player that swats it
	 * int fRandomDir: false, player can aim, true: random dir
	 */
	/*
	virtual void SwatAway(CBasePlayer *pPlayer, int fRandomDir);
	*/

	float m_flRateOfTurn;	
	CBaseEntity *m_pFollower;
};
