Nice edits to the muzzle flash

This commit is contained in:
Fesiug 2024-03-06 16:48:55 -05:00
parent 06f79d633a
commit eaa404bef1
Signed by: Fesiug
GPG Key ID: 374BFF45E1EEF243
1 changed files with 14 additions and 12 deletions

View File

@ -74,7 +74,7 @@ function EFFECT:Init( data )
-- Spark! -- Spark!
local atti = self.en:GetAttachment( self.ea ) local atti = self.en:GetAttachment( self.ea )
if true then if false then
local emitter = ParticleEmitter( atti.Pos, false ) local emitter = ParticleEmitter( atti.Pos, false )
for i=1, 8 do for i=1, 8 do
local p = emitter:Add( mat_spark, atti.Pos ) local p = emitter:Add( mat_spark, atti.Pos )
@ -119,8 +119,10 @@ function EFFECT:Render()
p:SetDieTime( FrameTime()+0.001 ) p:SetDieTime( FrameTime()+0.001 )
p:SetStartAlpha( 255 ) p:SetStartAlpha( 255 )
p:SetEndAlpha( 255 ) p:SetEndAlpha( 255 )
p:SetStartSize( Lerp( tf, 6, 4 ) ) p:SetStartSize( Lerp( tf, 2, 16 ) )
p:SetEndSize( Lerp( tf, 6, 4 ) ) p:SetEndSize( Lerp( tf, 2, 16 ) )
p:SetStartAlpha( Lerp( tf, 255, 127 ) )
p:SetEndAlpha( Lerp( tf, 255, 127 ) )
p:SetNextThink( UnPredictedCurTime() ) p:SetNextThink( UnPredictedCurTime() )
p:SetThinkFunction( function( pa ) p:SetThinkFunction( function( pa )
timer.Simple( 0, function() timer.Simple( 0, function()
@ -138,7 +140,7 @@ function EFFECT:Render()
if true then if true then
local emitter = ParticleEmitter( atti.Pos, false ) local emitter = ParticleEmitter( atti.Pos, false )
for i=1, 1 do for i=1, 1 do
local p = emitter:Add( mat_beam, atti.Pos ) local p = emitter:Add( mat_arm, atti.Pos )
if p then if p then
p:SetAngles( atti.Ang ) p:SetAngles( atti.Ang )
p:SetVelocity( atti.Ang:Forward() / (2^16) ) p:SetVelocity( atti.Ang:Forward() / (2^16) )
@ -147,12 +149,12 @@ function EFFECT:Render()
p:SetColor( 255, 250, 150 ) p:SetColor( 255, 250, 150 )
p:SetLifeTime( 0 ) p:SetLifeTime( 0 )
p:SetDieTime( FrameTime()+0.001 ) p:SetDieTime( FrameTime()+0.001 )
p:SetStartAlpha( math.Clamp( Lerp( tf, 127, -127 ), 0, 255 ) ) p:SetStartAlpha( Lerp( tf, 255, 0 ) )
p:SetEndAlpha( math.Clamp( Lerp( tf, 127, -127 ), 0, 255 ) ) p:SetEndAlpha( Lerp( tf, 255, 0 ) )
p:SetStartSize( Lerp( tf, 16, 4 ) ) p:SetStartSize( Lerp( tf, 16, 4 ) )
p:SetStartLength( Lerp( tf, 12, 16 ) ) p:SetStartLength( Lerp( tf, 0, 32 ) )
p:SetEndSize( Lerp( tf, 16, 4 ) ) p:SetEndSize( Lerp( tf, 16, 4 ) )
p:SetEndLength( Lerp( tf, 12, 16 ) ) p:SetEndLength( Lerp( tf, 0, 32 ) )
p:SetNextThink( UnPredictedCurTime() ) p:SetNextThink( UnPredictedCurTime() )
p:SetThinkFunction( function( pa ) p:SetThinkFunction( function( pa )
timer.Simple( 0, function() timer.Simple( 0, function()
@ -189,10 +191,10 @@ function EFFECT:Render()
p:SetDieTime( FrameTime()+0.001 ) p:SetDieTime( FrameTime()+0.001 )
p:SetStartAlpha( Lerp( tf, 64, 0 ) ) p:SetStartAlpha( Lerp( tf, 64, 0 ) )
p:SetEndAlpha( Lerp( tf, 64, 0 ) ) p:SetEndAlpha( Lerp( tf, 64, 0 ) )
p:SetStartSize( Lerp( tf, 1, 12 ) ) p:SetStartSize( Lerp( tf, 8, 16 ) )
p:SetStartLength( Lerp( tf, 10, 1 ) ) p:SetStartLength( Lerp( tf, 16, 24 ) )
p:SetEndSize( Lerp( tf, 1, 12 ) ) p:SetEndSize( Lerp( tf, 8, 16 ) )
p:SetEndLength( Lerp( tf, 10, 1 ) ) p:SetEndLength( Lerp( tf, 16, 24 ) )
p:SetNextThink( UnPredictedCurTime() ) p:SetNextThink( UnPredictedCurTime() )
p:SetThinkFunction( function( pa ) p:SetThinkFunction( function( pa )
timer.Simple( 0, function() timer.Simple( 0, function()