From eaa404bef1a14da11f0cb036e55c34f1556c8781 Mon Sep 17 00:00:00 2001 From: Fesiug Date: Wed, 6 Mar 2024 16:48:55 -0500 Subject: [PATCH] Nice edits to the muzzle flash --- .../entities/effects/benny_muzzleflash.lua | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/gamemodes/benny/entities/effects/benny_muzzleflash.lua b/gamemodes/benny/entities/effects/benny_muzzleflash.lua index ab309d2..1110e0f 100644 --- a/gamemodes/benny/entities/effects/benny_muzzleflash.lua +++ b/gamemodes/benny/entities/effects/benny_muzzleflash.lua @@ -74,7 +74,7 @@ function EFFECT:Init( data ) -- Spark! local atti = self.en:GetAttachment( self.ea ) - if true then + if false then local emitter = ParticleEmitter( atti.Pos, false ) for i=1, 8 do local p = emitter:Add( mat_spark, atti.Pos ) @@ -119,8 +119,10 @@ function EFFECT:Render() p:SetDieTime( FrameTime()+0.001 ) p:SetStartAlpha( 255 ) p:SetEndAlpha( 255 ) - p:SetStartSize( Lerp( tf, 6, 4 ) ) - p:SetEndSize( Lerp( tf, 6, 4 ) ) + p:SetStartSize( Lerp( tf, 2, 16 ) ) + p:SetEndSize( Lerp( tf, 2, 16 ) ) + p:SetStartAlpha( Lerp( tf, 255, 127 ) ) + p:SetEndAlpha( Lerp( tf, 255, 127 ) ) p:SetNextThink( UnPredictedCurTime() ) p:SetThinkFunction( function( pa ) timer.Simple( 0, function() @@ -138,7 +140,7 @@ function EFFECT:Render() if true then local emitter = ParticleEmitter( atti.Pos, false ) for i=1, 1 do - local p = emitter:Add( mat_beam, atti.Pos ) + local p = emitter:Add( mat_arm, atti.Pos ) if p then p:SetAngles( atti.Ang ) p:SetVelocity( atti.Ang:Forward() / (2^16) ) @@ -147,12 +149,12 @@ function EFFECT:Render() p:SetColor( 255, 250, 150 ) p:SetLifeTime( 0 ) p:SetDieTime( FrameTime()+0.001 ) - p:SetStartAlpha( math.Clamp( Lerp( tf, 127, -127 ), 0, 255 ) ) - p:SetEndAlpha( math.Clamp( Lerp( tf, 127, -127 ), 0, 255 ) ) + p:SetStartAlpha( Lerp( tf, 255, 0 ) ) + p:SetEndAlpha( Lerp( tf, 255, 0 ) ) 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:SetEndLength( Lerp( tf, 12, 16 ) ) + p:SetEndLength( Lerp( tf, 0, 32 ) ) p:SetNextThink( UnPredictedCurTime() ) p:SetThinkFunction( function( pa ) timer.Simple( 0, function() @@ -189,10 +191,10 @@ function EFFECT:Render() p:SetDieTime( FrameTime()+0.001 ) p:SetStartAlpha( Lerp( tf, 64, 0 ) ) p:SetEndAlpha( Lerp( tf, 64, 0 ) ) - p:SetStartSize( Lerp( tf, 1, 12 ) ) - p:SetStartLength( Lerp( tf, 10, 1 ) ) - p:SetEndSize( Lerp( tf, 1, 12 ) ) - p:SetEndLength( Lerp( tf, 10, 1 ) ) + p:SetStartSize( Lerp( tf, 8, 16 ) ) + p:SetStartLength( Lerp( tf, 16, 24 ) ) + p:SetEndSize( Lerp( tf, 8, 16 ) ) + p:SetEndLength( Lerp( tf, 16, 24 ) ) p:SetNextThink( UnPredictedCurTime() ) p:SetThinkFunction( function( pa ) timer.Simple( 0, function()