#pragma	  once

enum EffectMotionStep
{
	eEffectMotion_Step_Null				= 0,
	eEffectMotion_Step_Appear,
	eEffectMotion_Step_Idle,
	eEffectMotion_Step_Disappear,
	eEffectMotion_Step_Explode,
	eEffectMotion_Step_Dead,
};

class CEffectSprite : public IBaseSprite
{
public:
	CEffectSprite();
	virtual ~CEffectSprite();

	virtual	void					ReceiveDestruct( IBaseSprite* pSprite );
	virtual	void					Update( float elapseTime );

	// touch motion event
	virtual	void					MotionEvent( int type );
	
	virtual void					BeginSprite( IBaseSprite* pSprite, int point );
	virtual void					SetRelative( IBaseSprite* pRelative )			{ m_pRelative = pRelative; }
	virtual IBaseSprite*			GetRelative()									{ return m_pRelative; }
	virtual void					SetOffset( CRuVector3& offset )					{ m_offset = offset; }
	virtual CRuVector3				GetOffset()										{ return m_offset; }
	virtual void					SetAttachPoint( int point )						{ m_attachPoint = point; }
	virtual int						GetAttachPoint()								{ return m_attachPoint; }	
	virtual void					SetEffectMotionStep( int step );
	virtual int						GetEffectMotionStep()							{ return m_effectMotionStep; }

	virtual void					SetMagicInfo( int id, int hp, int mp );

protected:
	virtual	void					SetEffectPos( CRuVector3& pos, float elapseTime )	{ SetPos(pos); }	

protected:
	IBaseSprite*					m_pBegin;
	int								m_beginAttachPoint;
	bool							m_isInitialPos;

	IBaseSprite*					m_pRelative;					// 關連角色物件
	CRuVector3						m_offset;						// 偏移量
	int								m_attachPoint;					// 關連參考點
	int								m_effectMotionStep;
	float							m_effectStepTime;

	// 數值資料
	int								m_magicId;
	int								m_damageHp;
	int								m_damageMp;
};

class CLineEffectSprite : public CEffectSprite
{
public:
	CLineEffectSprite();
	virtual ~CLineEffectSprite();

	virtual	void					ReceiveDestruct( IBaseSprite* pSprite );
	virtual void					BeginSprite( IBaseSprite* pSprite, int point );
	virtual void					SetEffectMotionStep( int step );
	virtual void					AttachExplodeEffect( CEffectSprite* pExplode );
	
protected:
	virtual void					ReleaseExplode();
	virtual	void					SetEffectPos( CRuVector3& pos, float elapseTime );

protected:
	float							m_flyDelta;						// 飛行增加量
	CEffectSprite*					m_pExplode;						// 爆炸
};