#ifndef DRAGONBALL_H
#define DRAGONBALL_H

/**
* Dragonball
* @version 19-9-2001
* @author Herwin 'harSens' van Welbergen
*/
class CDragonBall: public CBaseEntity
{
public:
	/**
	* Spawns the ball
	*/
	void Spawn( void );
	
	/**
	* Precaches the models
	*/
	void Precache( void );

	/**
	* Creates a dragonball
	* @param Vector origin: the origin of the ball
	* @param int nr: the number of the ball (appearing on the model)
	*/
	static CDragonBall *CreateDragonBall(Vector origin,int nr);

	/**
	* Throws a dragonball
	* @param entvars_t *pevOwner: the one who throws it
	* @param Vector vecStart: start pos
	* @param Vector vecVelocity: throwing velocity
	* @param int nr: nr of the ball
	*/	
	static CDragonBall *ThrowDragonBall(entvars_t *pevOwner,Vector vecStart, Vector vecVelocity, int nr);

	/**
	* the dragonball is touched by something else
	* @param CBaseEntity *pOther: the one touching the db
	*/
	void EXPORT PickupTouch(CBaseEntity *pOther);

	/**
	* Spreads the dragonballs
	*/
	void Spread();

	/**
	* turns the dragonballs into stone
	*/
	void Stonify();

	/**
	* turns the dragonballs back to normal
	*/
	void EXPORT UnStoneThink();

	/**
	* Think function for spreading the balls
	*/
	void EXPORT SpreadThink ( void );

	/**
	* Makes it glow
	*/
	void Glow(void);

	/**
	* Stops Glowing
	*/
	void UnGlow(void);

	int m_fSpreading;
	float m_flDropped;
private:
	int m_iNumber;
	short m_sTrailSprite;
	float m_flPreviousZ;	
};

#endif
