

/*---------------------------------------------------------
   Initializes the effect. The data is a table of data 
   which was passed from the server.
---------------------------------------------------------*/
function EFFECT:Init( data )
	
	local Pos = data:GetOrigin()
	local Norm = data:GetNormal()
	
	local SurfaceColor = render.GetSurfaceColor( Pos+Norm, Pos-Norm*100 ) * 255
	
	SurfaceColor.r = mathx.Clamp( SurfaceColor.r+40, 0, 255 )
	SurfaceColor.g = mathx.Clamp( SurfaceColor.g+40, 0, 255 )
	SurfaceColor.b = mathx.Clamp( SurfaceColor.b+40, 0, 255 )
		
	local emitter = ParticleEmitter( Pos )
	
		local particle = emitter:Add( "particles/smokey", Pos + Norm * 16 )
			particle:SetVelocity( Norm * mathx.Rand( 1, 5 ) )
			particle:SetDieTime( mathx.Rand( 15, 60 ) )
			particle:SetStartAlpha( mathx.Rand( 50, 150 ) )
			particle:SetStartSize( mathx.Rand( 16, 32 ) )
			particle:SetEndSize( mathx.Rand( 128, 512 ) )
			particle:SetRoll( 0 )
			particle:SetColor( SurfaceColor.r, SurfaceColor.g, SurfaceColor.b )

		local particle = emitter:Add( "particles/smokey", Pos + Norm * 32 )
			particle:SetVelocity( Norm * 100 )
			particle:SetDieTime( 0.4 )
			particle:SetStartAlpha( 200 )
			particle:SetStartSize( 32 )
			particle:SetEndSize( mathx.Rand( 50, 140 ) )
			particle:SetRoll( 0 )
			particle:SetColor( SurfaceColor.r, SurfaceColor.g, SurfaceColor.b )
				
	emitter:Finish()
	
end


/*---------------------------------------------------------
   THINK
   Returning false makes the entity die
---------------------------------------------------------*/
function EFFECT:Think( )
	return false
end


/*---------------------------------------------------------
   Draw the effect
---------------------------------------------------------*/
function EFFECT:Render()	
end



