summaryrefslogtreecommitdiff
path: root/entities/entities/sent_radiation/cl_init.lua
blob: e07f410ff0da072ae06b7befa97d47205f0ed424 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
include('shared.lua')

function ENT:Initialize()

	self.Emitter = ParticleEmitter( self.Entity:GetPos() )
	self.DieTime = CurTime() + 30
	self.LightTime = 0

end

function ENT:Think()

	self.Scale = ( self.DieTime - CurTime() ) / 30
	
	if self.LightTime < CurTime() then
	
		self.LightTime = CurTime() + 0.1
	
		local dlight = DynamicLight( self.Entity:EntIndex() )
	
		if dlight then
		
			dlight.Pos = self.Entity:GetPos()
			dlight.r = 150
			dlight.g = 255
			dlight.b = 50
			dlight.Brightness = 2
			dlight.Decay = 0
			dlight.size = self.Scale * self.Entity:GetNWInt( "Distance", 300 ) 
			dlight.DieTime = CurTime() + 1
			
		end
	
	end

end

function ENT:OnRemove()

	if self.Emitter then
	
		self.Emitter:Finish()
	
	end

end

function ENT:Draw()
	
end