

/*---------------------------------------------------------
   Initializes the effect. The data is a table of data 
   which was passed from the server.
---------------------------------------------------------*/
function EFFECT:Init( data )
	
	self.Position = data:GetStart()
	self.WeaponEnt = data:GetEntity()
	self.Attachment = data:GetAttachment()
	
	// Keep the start and end pos - we're going to interpolate between them
	local Pos = self:GetTracerShootPos( self.Position, self.WeaponEnt, self.Attachment )
	
	local Velocity 	= data:GetNormal()
	Velocity.z = 0
	
	Pos = Pos + data:GetNormal() * 8
	
	local LightColor = render.GetLightColor( Pos ) * 255
	LightColor.r = mathx.Clamp( LightColor.r, 90, 255 )
	LightColor.g = mathx.Clamp( LightColor.g, 90, 255 )
	LightColor.b = mathx.Clamp( LightColor.b, 90, 255 )
	
	local emitter = ParticleEmitter( Pos )
		
			local particle = emitter:Add( "particles/smokey", Pos )

				particle:SetVelocity( Velocity * mathx.Rand( 1, 10 ) )
				particle:SetDieTime( mathx.Rand( 30, 60 ) )
				particle:SetStartAlpha( mathx.Rand( 10, 50 ) )
				particle:SetStartSize( mathx.Rand( 8, 16 ) )
				particle:SetEndSize( mathx.Rand( 48, 128 ) )
				particle:SetRoll( mathx.Rand( -25, 25 ) )
				particle:SetRollDelta( mathx.Rand( -0.1, 0.1 ) )
				particle:SetColor( LightColor.r, LightColor.g, LightColor.b )
				
	emitter:Finish()
	
end


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

	// Die instantly
	return false
	
end


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

	// Do nothing - this effect is only used to spawn the particles in Init
	
end



