Muzzleflash tweaks

This commit is contained in:
Fesiug 2024-03-03 10:18:48 -05:00
parent 37a7945450
commit 03c4af020c
1 changed files with 10 additions and 4 deletions

View File

@ -22,7 +22,7 @@ function EFFECT:Init( data )
self.particles = 1 self.particles = 1
self.CreationTime = UnPredictedCurTime() self.CreationTime = UnPredictedCurTime()
self.DieTime = UnPredictedCurTime() + 0.1 self.DieTime = UnPredictedCurTime() + 0.05
self:SetRenderBounds( rbb, rba ) self:SetRenderBounds( rbb, rba )
@ -32,7 +32,13 @@ function EFFECT:Init( data )
local dlight = DynamicLight( self.el:EntIndex() ) local dlight = DynamicLight( self.el:EntIndex() )
if ( dlight ) then if ( dlight ) then
dlight.Pos = self.el:GetPos() + self.el:GetAngles():Forward()*24 + self.el:GetAngles():Up()*16 local tr = {
start = self.el:GetPos(),
endpos = self.el:GetPos() + self.el:GetAngles():Forward()*72 + self.el:GetAngles():Up()*16,
filter = self.el:GetOwner(),
}
tr = util.TraceLine( tr )
dlight.Pos = tr.HitPos
dlight.r = 255 dlight.r = 255
dlight.g = 200 dlight.g = 200
dlight.b = 150 dlight.b = 150
@ -113,8 +119,8 @@ 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, 0 ) ) p:SetStartSize( Lerp( tf, 6, 4 ) )
p:SetEndSize( Lerp( tf, 6, 0 ) ) p:SetEndSize( Lerp( tf, 6, 4 ) )
p:SetNextThink( UnPredictedCurTime() ) p:SetNextThink( UnPredictedCurTime() )
p:SetThinkFunction( function( pa ) p:SetThinkFunction( function( pa )
timer.Simple( 0, function() timer.Simple( 0, function()