diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-30 14:42:09 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-30 14:42:09 -0400 |
| commit | 2736f498f30220b858fc6fac23e7ddc4a597df6d (patch) | |
| tree | 374ceadedb654b00e09dac321620a8320830f734 /entities/effects/headshot/init.lua | |
| download | redead-2736f498f30220b858fc6fac23e7ddc4a597df6d.tar.gz redead-2736f498f30220b858fc6fac23e7ddc4a597df6d.tar.bz2 redead-2736f498f30220b858fc6fac23e7ddc4a597df6d.zip | |
Inital commit
Diffstat (limited to 'entities/effects/headshot/init.lua')
| -rw-r--r-- | entities/effects/headshot/init.lua | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/entities/effects/headshot/init.lua b/entities/effects/headshot/init.lua new file mode 100644 index 0000000..7aadb41 --- /dev/null +++ b/entities/effects/headshot/init.lua @@ -0,0 +1,66 @@ + + +function EFFECT:Init( data ) + + local pos = data:GetOrigin() + local emitter = ParticleEmitter( pos ) + + local particle = emitter:Add( "effects/blood_core", pos ) + particle:SetDieTime( 0.3 ) + particle:SetStartAlpha( 255 ) + particle:SetEndAlpha( 0 ) + particle:SetStartSize( math.random( 5, 10 ) ) + particle:SetEndSize( math.random( 50, 100 ) ) + particle:SetRoll( math.random( -360, 360 ) ) + particle:SetColor( 50, 0, 0 ) + + local particle = emitter:Add( "particles/smokey", pos ) + particle:SetDieTime( math.Rand( 10, 20 ) ) + particle:SetStartAlpha( math.random( 20, 40 ) ) + particle:SetEndAlpha( 0 ) + particle:SetStartSize( math.random( 20, 40 ) ) + particle:SetEndSize( 10 ) + particle:SetRoll( math.random( -360, 360 ) ) + particle:SetColor( 50, 0, 0 ) + + for i=1, math.random(2,4) do + + local particle = emitter:Add( "effects/blood", pos ) + particle:SetVelocity( VectorRand() * 100 + Vector(0,math.random(-25,25),50) ) + particle:SetDieTime( 1.0 ) + particle:SetStartAlpha( 255 ) + particle:SetEndAlpha( 0 ) + particle:SetStartSize( math.random( 2, 4 ) ) + particle:SetEndSize( math.random( 10, 20 ) ) + particle:SetRoll( math.random( -360, 360 ) ) + particle:SetColor( 50, 0, 0 ) + particle:SetGravity( Vector( 0, 0, -300 ) ) + + end + + emitter:Finish() + + if LocalPlayer():GetPos():Distance( pos ) <= 100 then + + local frac = 1 - ( LocalPlayer():GetPos():Distance( pos ) / 100 ) + + for i=1, math.Round( frac * 3 ) do + + AddStain() + + end + + end + +end + +function EFFECT:Think( ) + + return false + +end + +function EFFECT:Render() + +end + |
