--Initializes the effect. The data is a table of data
--which was passed from the server.
function EFFECT:Init( data )
self.Position = data:GetOrigin()
self.Speed = data:GetMagnitude()
local Pos = self.Position
local Norm = Vector(0,0,1)
local emitter = ParticleEmitter( Pos )
--firecloud
for i=1, 5 do
local particle = emitter:Add( "particle/particle_smokegrenade1", Pos)
particle:SetVelocity( Vector(math.random(-50,50) * self.Speed,math.random(-50,50) * self.Speed,math.random(-50,50) * self.Speed) )
particle:SetDieTime( 5 )
particle:SetStartAlpha( math.Rand( 200, 240 ) )
particle:SetStartSize( math.Rand( 10, 30 ) )
particle:SetEndSize( math.Rand( 40, 60 ) )
particle:SetRoll( math.Rand( 360, 480 ) )
particle:SetRollDelta( math.Rand( -1, 1 ) )
particle:SetColor( 255, 225, 0 )
particle:VelocityDecay( false )
end
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