diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-30 21:01:18 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-30 21:01:18 -0400 |
| commit | d62058fcdea5fc6736a2a373f47dc6c14c70c319 (patch) | |
| tree | 79a1325190e3f1f1b6d6a2dbcdfc1ba3fa866ac9 /entities/effects | |
| parent | c38f00182ba6c282806eecb39a42e64d5feafa37 (diff) | |
| download | redead-d62058fcdea5fc6736a2a373f47dc6c14c70c319.tar.gz redead-d62058fcdea5fc6736a2a373f47dc6c14c70c319.tar.bz2 redead-d62058fcdea5fc6736a2a373f47dc6c14c70c319.zip | |
Removed exessive whitespace so future commits will be cleaner
Diffstat (limited to 'entities/effects')
| -rw-r--r-- | entities/effects/barrel_gib/init.lua | 19 | ||||
| -rw-r--r-- | entities/effects/biohazard/init.lua | 46 | ||||
| -rw-r--r-- | entities/effects/body_gib/init.lua | 73 | ||||
| -rw-r--r-- | entities/effects/bomb_explosion/init.lua | 66 | ||||
| -rw-r--r-- | entities/effects/c4_explosion/init.lua | 80 | ||||
| -rw-r--r-- | entities/effects/energy_explosion/init.lua | 34 | ||||
| -rw-r--r-- | entities/effects/fire_explosion/init.lua | 34 | ||||
| -rw-r--r-- | entities/effects/fire_tracer/init.lua | 50 | ||||
| -rw-r--r-- | entities/effects/gore_explosion/init.lua | 64 | ||||
| -rw-r--r-- | entities/effects/head_gib/init.lua | 45 | ||||
| -rw-r--r-- | entities/effects/headshot/init.lua | 31 | ||||
| -rw-r--r-- | entities/effects/immolate/init.lua | 52 | ||||
| -rw-r--r-- | entities/effects/player_gib/init.lua | 31 | ||||
| -rw-r--r-- | entities/effects/puke_explosion/init.lua | 58 | ||||
| -rw-r--r-- | entities/effects/puke_spray/init.lua | 58 | ||||
| -rw-r--r-- | entities/effects/rad_explosion/init.lua | 24 | ||||
| -rw-r--r-- | entities/effects/radiation/init.lua | 42 | ||||
| -rw-r--r-- | entities/effects/smoke_crater/init.lua | 24 |
18 files changed, 409 insertions, 422 deletions
diff --git a/entities/effects/barrel_gib/init.lua b/entities/effects/barrel_gib/init.lua index f635312..1c2008f 100644 --- a/entities/effects/barrel_gib/init.lua +++ b/entities/effects/barrel_gib/init.lua @@ -5,33 +5,33 @@ function EFFECT:Init( data ) self.Entity:PhysicsInit( SOLID_VPHYSICS ) //self.Entity:SetMaterial( "models/flesh" ) - + self.Entity:SetCollisionGroup( COLLISION_GROUP_DEBRIS ) self.Entity:SetCollisionBounds( Vector( -128 -128, -128 ), Vector( 128, 128, 128 ) ) self.Entity:SetAngles( Angle( math.Rand(0,360), math.Rand(0,360), math.Rand(0,360) ) ) - + local phys = self.Entity:GetPhysicsObject() - + if IsValid( phys ) then - + local vec = VectorRand() vec.z = math.Clamp( vec.z, -0.4, 0.8 ) - + phys:Wake() phys:SetMass( 100 ) phys:AddAngleVelocity( VectorRand() * 500 ) phys:SetVelocity( vec * math.Rand( 100, 200 ) ) - + end - + self.LifeTime = CurTime() + 15 - + end function EFFECT:Think( ) return self.LifeTime > CurTime() - + end function EFFECT:Render() @@ -39,4 +39,3 @@ function EFFECT:Render() self.Entity:DrawModel() end - diff --git a/entities/effects/biohazard/init.lua b/entities/effects/biohazard/init.lua index 8af6357..ca80b2d 100644 --- a/entities/effects/biohazard/init.lua +++ b/entities/effects/biohazard/init.lua @@ -5,14 +5,14 @@ function EFFECT:Init( data ) self.DieTime = CurTime() + 1.5 self.SoundTime = 0 - + local pos = data:GetOrigin() + Vector(0,0,10) local emitter = ParticleEmitter( pos ) - + self.Pos = pos - + for i=1, math.random(4,8) do - + local particle = emitter:Add( "effects/blood", pos ) particle:SetVelocity( VectorRand() * 100 + Vector(0,math.random(-25,25),50) ) particle:SetDieTime( 1.0 ) @@ -23,14 +23,14 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( self.Color.r, self.Color.g, 0 ) particle:SetGravity( Vector( 0, 0, -300 ) ) - + end - + for i=1, 10 do - + local vec = VectorRand() vec.z = math.Rand( -0.2, 1.0 ) - + local particle = emitter:Add( "nuke/gore" .. math.random(1,2), pos ) particle:SetVelocity( vec * 250 ) particle:SetDieTime( math.Rand( 0.8, 1.0 ) ) @@ -41,14 +41,14 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( self.Color.r, self.Color.g + math.random(0,20), 0 ) particle:SetGravity( Vector( 0, 0, -400 ) ) - + end - + for i=1, math.random(3,6) do - + local vec = VectorRand() vec.z = math.Rand( -0.2, 1.0 ) - + local particle = emitter:Add( "nuke/gore" .. math.random( 1, 2 ), pos + Vector( 0, 0, math.random( -10, 10 ) ) ) particle:SetVelocity( vec * 300 ) particle:SetLifeTime( 0 ) @@ -59,37 +59,37 @@ function EFFECT:Init( data ) particle:SetEndSize( 1 ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( self.Color.r, self.Color.g, 0 ) - + particle:SetGravity( Vector( 0, 0, -500 ) ) particle:SetCollide( true ) particle:SetBounce( 0.5 ) - + particle:SetCollideCallback( function( part, pos, normal ) - + util.Decal( "yellowblood", pos + normal, pos - normal ) - + end ) - + end emitter:Finish() - + end function EFFECT:Think() if self.SoundTime < CurTime() then - + sound.Play( table.Random( GAMEMODE.GoreSplat ), self.Pos, 100, math.random(90,110) ) - + self.SoundTime = CurTime() + 0.5 - + end return self.DieTime > CurTime() - + end function EFFECT:Render() - + end diff --git a/entities/effects/body_gib/init.lua b/entities/effects/body_gib/init.lua index d433bce..586927e 100644 --- a/entities/effects/body_gib/init.lua +++ b/entities/effects/body_gib/init.lua @@ -4,13 +4,13 @@ function EFFECT:Init( data ) self.DieTime = CurTime() + 1.5 self.SoundTime = CurTime() + math.Rand( 0.2, 1.0 ) - + local pos = data:GetOrigin() + Vector(0,0,50) local emitter = ParticleEmitter( pos ) - + self.Pos = pos self.Normal = data:GetNormal() - + local particle = emitter:Add( "effects/blood_core", pos ) particle:SetDieTime( math.Rand( 0.5, 1.0 ) ) particle:SetStartAlpha( 255 ) @@ -19,7 +19,7 @@ function EFFECT:Init( data ) particle:SetEndSize( math.random( 100, 150 ) ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 50, 0, 0 ) - + local particle = emitter:Add( "effects/blood_core", pos ) particle:SetDieTime( math.Rand( 6.0, 8.0 ) ) particle:SetStartAlpha( 50 ) @@ -29,9 +29,9 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 50, 0, 0 ) particle:SetGravity( Vector( 0, 0, -5 ) ) - + for i=1, math.random(4,8) do - + local particle = emitter:Add( "effects/blood", pos ) particle:SetVelocity( VectorRand() * 100 + Vector(0,math.random(-25,25),50) ) particle:SetDieTime( 1.0 ) @@ -42,14 +42,14 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 50, 0, 0 ) particle:SetGravity( Vector( 0, 0, -300 ) ) - + end - + for i=1, 12 do - + local vec = VectorRand() vec.z = math.Rand( -0.2, 1.0 ) - + local particle = emitter:Add( "nuke/gore" .. math.random(1,2), pos ) particle:SetVelocity( vec * 250 + ( self.Normal * ( i * 10 ) ) ) particle:SetDieTime( math.Rand( 0.5, 1.0 ) ) @@ -60,14 +60,14 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 50, 0, 0 ) particle:SetGravity( Vector( 0, 0, -300 ) ) - + end - + for i=1, math.random(3,6) do - + local vec = VectorRand() vec.z = math.Rand( -0.2, 1.0 ) - + local particle = emitter:Add( "nuke/gore" .. math.random(1,2), pos + Vector(0,0,math.random(-10,10)) ) particle:SetVelocity( vec * 300 ) particle:SetLifeTime( 0 ) @@ -78,65 +78,64 @@ function EFFECT:Init( data ) particle:SetEndSize( 1 ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 40, 0, 0 ) - + particle:SetGravity( Vector( 0, 0, -500 ) ) particle:SetCollide( true ) particle:SetBounce( 0.5 ) - + particle:SetCollideCallback( function( part, pos, normal ) - + util.Decal( "Blood", pos + normal, pos - normal ) - + end ) - + end emitter:Finish() - + for i=1, 8 do - + local ed = EffectData() ed:SetOrigin( pos + Vector(0,0,math.random(0,30)) ) - + if i < 4 then ed:SetScale( 1 ) else ed:SetScale( 2 ) end - + util.Effect( "player_gib", ed, true, true ) - + end - + if LocalPlayer():GetPos():Distance( pos ) <= 300 then - + local frac = 1 - ( LocalPlayer():GetPos():Distance( pos ) / 300 ) - + for i=1, math.Round( frac * 6 ) do - + AddStain() - + end - + end - + end function EFFECT:Think( ) if self.SoundTime < CurTime() then - + sound.Play( table.Random( GAMEMODE.GoreSplat ), self.Pos, 100, math.random(90,110) ) - + self.SoundTime = CurTime() + math.Rand( 0.2, 0.6 ) - + end return self.DieTime > CurTime() - + end function EFFECT:Render() - -end +end diff --git a/entities/effects/bomb_explosion/init.lua b/entities/effects/bomb_explosion/init.lua index 459c3bd..9078921 100644 --- a/entities/effects/bomb_explosion/init.lua +++ b/entities/effects/bomb_explosion/init.lua @@ -4,19 +4,19 @@ local matRefraction = Material( "refract_ring" ) function EFFECT:Init( data ) self.Entity:SetRenderBounds( Vector() * -1024, Vector() * 1024 ) - + self.Pos = data:GetOrigin() self.Norm = data:GetNormal() self.Emitter = ParticleEmitter( self.Pos ) self.DieTime = CurTime() + 5 - + for i=1, math.random(3,6) do - + local vec = self.Norm + VectorRand() * 0.7 vec.x = math.Clamp( vec.x, -1.0, 0 ) - + local particle = self.Emitter:Add( "effects/fire_cloud2", self.Pos ) - + particle:SetVelocity( vec * math.random( 400, 600 ) ) particle:SetDieTime( 1.0 ) particle:SetStartAlpha( 255 ) @@ -24,19 +24,19 @@ function EFFECT:Init( data ) particle:SetStartSize( 5 ) particle:SetEndSize( 0 ) particle:SetColor( math.random( 150, 255 ), math.random( 100, 150 ), 100 ) - + particle:SetGravity( Vector( 0, 0, math.random( -700, -500 ) ) ) particle:SetAirResistance( math.random( 20, 60 ) ) particle:SetCollide( true ) - + particle:SetLifeTime( 0 ) particle:SetThinkFunction( CloudThink ) particle:SetNextThink( CurTime() + 0.1 ) - + end - + for i=1, 15 do - + local particle = self.Emitter:Add( "effects/muzzleflash"..math.random(1,4), self.Pos ) particle:SetVelocity( self.Norm * math.random(50,100) + VectorRand() * math.random(50,100) ) @@ -48,9 +48,9 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetRollDelta( math.Rand( -0.2, 0.2 ) ) particle:SetColor( math.random( 150, 255 ), math.random( 100, 150 ), 100 ) - + local particle = self.Emitter:Add( "particle/particle_smokegrenade", self.Pos ) - + particle:SetDieTime( math.Rand( 1.5, 2.0 ) ) particle:SetStartAlpha( 255 ) particle:SetEndAlpha( 0 ) @@ -58,32 +58,32 @@ function EFFECT:Init( data ) particle:SetEndSize( math.Rand( 100, 150 ) ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetRollDelta( math.Rand( -0.1, 0.1 ) ) - + local vec = VectorRand() vec.x = math.Rand( -0.1, 0.1 ) - + if i % 2 == 0 then - + particle:SetVelocity( self.Norm * math.random(100,150) + vec * math.random(40,80) ) - + else - + particle:SetVelocity( vec * math.random(100,150) ) - + end - + local dark = math.random( 10, 50 ) particle:SetColor( dark, dark, dark ) - + particle:SetGravity( Vector(0,0,-50) ) particle:SetCollide( true ) - + end - + local dlight = DynamicLight( self.Entity:EntIndex() ) - + if dlight then - + dlight.Pos = self.Pos dlight.r = 250 dlight.g = 200 @@ -92,17 +92,17 @@ function EFFECT:Init( data ) dlight.Decay = 2048 dlight.size = 2048 dlight.DieTime = CurTime() + 5 - + end - + self.Emitter:Finish() - + end function EFFECT:Think( ) - return self.DieTime > CurTime() - + return self.DieTime > CurTime() + end function EFFECT:Render() @@ -118,9 +118,9 @@ function CloudThink( part ) local emitter = ParticleEmitter( pos ) local vec = VectorRand() vec.x = math.Rand( -0.1, 0 ) - + local particle = emitter:Add( "particle/particle_smokegrenade", pos ) - + particle:SetVelocity( vec * 3 + ( WindVector * ( 2 * ( 1 - scale ) ) ) ) particle:SetDieTime( math.Rand( 2.0, 3.0 ) + scale * 1.0 ) particle:SetStartAlpha( math.random( 100, 150 ) ) @@ -129,10 +129,10 @@ function CloudThink( part ) particle:SetEndSize( math.random( 1, 5 ) + scale * 30 ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetRollDelta( math.Rand( -0.1, 0.1 ) ) - + local dark = math.random( 10, 50 ) particle:SetColor( dark, dark, dark ) - + emitter:Finish() end diff --git a/entities/effects/c4_explosion/init.lua b/entities/effects/c4_explosion/init.lua index bb676cc..55fe627 100644 --- a/entities/effects/c4_explosion/init.lua +++ b/entities/effects/c4_explosion/init.lua @@ -1,12 +1,12 @@ function EFFECT:Init( data ) - + local pos = data:GetOrigin() - + local emitter = ParticleEmitter( pos ) - + for i=1,math.random(10,15) do - + local particle = emitter:Add( "particles/smokey", pos ) particle:SetVelocity( Vector(math.random(-90, 90),math.random(-90, 90), math.random(-70, 70) ) ) @@ -17,11 +17,11 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( -95, 95 ) ) particle:SetRollDelta( math.Rand( -0.12, 0.12 ) ) particle:SetColor( 10,10,10 ) - + end - + for i=1, math.random(10,15) do - + local particle = emitter:Add( "effects/muzzleflash"..math.random(1,4), pos + Vector(math.random(-40,40),math.random(-40,40),math.random(-30,50))) particle:SetVelocity( Vector(math.random(-150,150),math.random(-150,150),math.random(100,200)) ) @@ -33,11 +33,11 @@ function EFFECT:Init( data ) particle:SetRollDelta( math.Rand( -1, 1 ) ) particle:SetColor( math.Rand( 150, 255 ), math.Rand( 100, 150 ), 100 ) particle:VelocityDecay( false ) - + end - + for i=1, math.random(15,25) do - + local particle = emitter:Add( "effects/muzzleflash"..math.random(1,4), pos + Vector(math.random(-40,40),math.random(-40,40),math.random(10,20))) particle:SetVelocity( Vector(math.random(-200,200),math.random(-200,200),math.random(0,60)) ) @@ -48,12 +48,12 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( 360,480 ) ) particle:SetRollDelta( math.Rand( -1, 1 ) ) particle:SetColor( math.Rand( 150, 255 ), math.Rand( 100, 150 ), 100 ) - particle:VelocityDecay( true ) - + particle:VelocityDecay( true ) + end - + for i=0,math.random(5,9) do - + local particle = emitter:Add( "effects/fire_embers"..math.random(1,3), pos ) particle:SetVelocity( Vector(math.random(-400,400),math.random(-400,400),math.random(300,550)) ) particle:SetDieTime(math.Rand(2,5)) @@ -66,18 +66,18 @@ function EFFECT:Init( data ) particle:SetColor(255, 220, 100) particle:SetGravity(Vector(0,0,-520)) //-600 is normal particle:SetCollide(true) - particle:SetBounce(0.45) - + particle:SetBounce(0.45) + end - + for i=1, 5 do - + local particle = emitter:Add( "particle/particle_smokegrenade", pos ) - + particle:SetDieTime( math.Rand( 2.0, 4.0 ) ) particle:SetStartAlpha( 255 ) particle:SetEndAlpha( 0 ) - + if i % 2 == 1 then particle:SetVelocity( Vector( math.random(-100,100), math.random(-100,100), math.random(0,50) ) ) particle:SetStartSize( math.Rand( 50, 100 ) ) @@ -87,15 +87,15 @@ function EFFECT:Init( data ) particle:SetStartSize( math.Rand( 50, 100 ) ) particle:SetEndSize( math.Rand( 200, 400 ) ) end - + particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetRollDelta( math.Rand( -0.1, 0.1 ) ) - + local dark = math.random( 10, 50 ) particle:SetColor( dark, dark, dark ) - + if math.random(1,4) != 1 then - + local vec = Vector( math.Rand(-8,8), math.Rand(-8,8), math.Rand(8,12) ) local particle = emitter:Add( "effects/fire_cloud2", pos + vec * 10 ) @@ -106,7 +106,7 @@ function EFFECT:Init( data ) particle:SetStartSize( 8 ) particle:SetEndSize( 0 ) particle:SetColor( math.random( 150, 255 ), math.random( 100, 150 ), 100 ) - + particle:SetGravity( Vector( 0, 0, math.random( -700, -500 ) ) ) particle:SetAirResistance( math.random( 20, 60 ) ) particle:SetCollide( true ) @@ -114,17 +114,17 @@ function EFFECT:Init( data ) particle:SetLifeTime( 0 ) particle:SetThinkFunction( CloudThink ) particle:SetNextThink( CurTime() + 0.1 ) - + end - + end - + emitter:Finish() - + local dlight = DynamicLight( self.Entity:EntIndex() ) - + if dlight then - + dlight.Pos = pos dlight.r = 250 dlight.g = 200 @@ -133,19 +133,19 @@ function EFFECT:Init( data ) dlight.Decay = 1024 dlight.size = 1024 dlight.DieTime = CurTime() + 5 - + end - + end function EFFECT:Think( ) return false - + end function EFFECT:Render() - + end function CloudThink( part ) @@ -155,22 +155,22 @@ function CloudThink( part ) local scale = 1 - part:GetLifeTime() local pos = part:GetPos() local emitter = ParticleEmitter( pos ) - + local particle = emitter:Add( "particle/particle_smokegrenade", pos ) - + particle:SetVelocity( VectorRand() * 3 + ( WindVector * ( 3 * ( 1 - scale ) ) ) ) particle:SetDieTime( math.Rand( 2.0, 3.0 ) + scale * 1.0 ) particle:SetStartAlpha( math.random( 100, 150 ) ) particle:SetEndAlpha( 0 ) particle:SetStartSize( math.random( 1, 3 ) + scale * math.random( 20, 50 ) ) particle:SetEndSize( math.random( 1, 5 ) + scale * math.random( 30, 50 ) ) - + particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetRollDelta( math.Rand( -0.1, 0.1 ) ) - + local dark = math.random( 10, 50 ) particle:SetColor( dark, dark, dark ) - + emitter:Finish() end diff --git a/entities/effects/energy_explosion/init.lua b/entities/effects/energy_explosion/init.lua index d959e8a..8077791 100644 --- a/entities/effects/energy_explosion/init.lua +++ b/entities/effects/energy_explosion/init.lua @@ -3,13 +3,13 @@ function EFFECT:Init( data ) self.DieTime = CurTime() + 1.5 - + local pos = data:GetOrigin() local normal = data:GetNormal() local emitter = ParticleEmitter( pos ) - + for i=1, 20 do - + local particle = emitter:Add( "effects/muzzleflash"..math.random(1,4), pos ) particle:SetVelocity( VectorRand() * 100 ) particle:SetDieTime( math.Rand( 0.3, 0.6 ) ) @@ -19,14 +19,14 @@ function EFFECT:Init( data ) particle:SetEndSize( math.Rand( 40, 80 ) ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 50, 100, 250 ) - + end - + for i=1, math.random(3,6) do - + local vec = normal * math.random( 150, 200 )+ VectorRand() * 50 local normalized = vec:GetNormal():Angle() - + local particle = emitter:Add( "effects/yellowflare", pos ) particle:SetVelocity( normal * math.random(150,200) + VectorRand() * 50 ) particle:SetAngles( normalized ) @@ -39,16 +39,16 @@ function EFFECT:Init( data ) particle:SetEndLength( 20 ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 50, 100, 200 ) - + particle:SetGravity( Vector( 0, 0, -300 ) ) - + end - + for i=1, math.random(3,6) do - + local vec = VectorRand() * 500 local normalized = vec:GetNormal():Angle() - + local particle = emitter:Add( "effects/yellowflare", pos ) particle:SetVelocity( vec ) particle:SetAngles( normalized ) @@ -60,23 +60,23 @@ function EFFECT:Init( data ) particle:SetEndLength( 20 ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 50, 100, 200 ) - + particle:SetGravity( Vector( 0, 0, -500 ) ) particle:SetCollide( true ) particle:SetBounce( 1.0 ) - + end emitter:Finish() - + end function EFFECT:Think( ) return self.DieTime > CurTime() - + end function EFFECT:Render() - + end diff --git a/entities/effects/fire_explosion/init.lua b/entities/effects/fire_explosion/init.lua index d51b1c3..f4fe339 100644 --- a/entities/effects/fire_explosion/init.lua +++ b/entities/effects/fire_explosion/init.lua @@ -3,11 +3,11 @@ function EFFECT:Init( data ) self.DieTime = CurTime() + 1.5 - + local pos = data:GetOrigin() local normal = data:GetNormal() local emitter = ParticleEmitter( pos ) - + local particle = emitter:Add( "effects/blood_core", pos ) particle:SetDieTime( math.Rand( 1.0, 1.5 ) ) particle:SetStartAlpha( 255 ) @@ -16,9 +16,9 @@ function EFFECT:Init( data ) particle:SetEndSize( math.random( 50, 100 ) ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 50, 50, 50 ) - + for i=1, 10 do - + local particle = emitter:Add( "effects/muzzleflash"..math.random(1,4), pos ) particle:SetVelocity( VectorRand() * 50 + normal * 50 ) particle:SetDieTime( math.Rand( 0.3, 0.6 ) ) @@ -28,14 +28,14 @@ function EFFECT:Init( data ) particle:SetEndSize( math.Rand( 30, 60 ) ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 200, 150, 100 ) - + end - + for i=1, math.random(5,10) do - + local vec = normal * math.random( 150, 200 ) + VectorRand() * 50 local normalized = vec:GetNormal():Angle() - + local particle = emitter:Add( "effects/yellowflare", pos ) particle:SetVelocity( normal * math.random(150,200) + VectorRand() * 50 ) particle:SetLifeTime( 0 ) @@ -46,19 +46,19 @@ function EFFECT:Init( data ) particle:SetEndSize( 0 ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 200, 100, 50 ) - + particle:SetGravity( Vector( 0, 0, -500 ) ) particle:SetCollide( true ) particle:SetBounce( math.Rand( 0, 0.2 ) ) - + end emitter:Finish() - + local dlight = DynamicLight( self:EntIndex() ) - + if dlight then - + dlight.Pos = pos dlight.r = 255 dlight.g = 150 @@ -67,17 +67,17 @@ function EFFECT:Init( data ) dlight.Decay = 512 dlight.size = 256 * math.Rand( 0.5, 1.0 ) dlight.DieTime = CurTime() + 5 - + end - + end function EFFECT:Think( ) return self.DieTime > CurTime() - + end function EFFECT:Render() - + end diff --git a/entities/effects/fire_tracer/init.lua b/entities/effects/fire_tracer/init.lua index 3f8842b..eef727a 100644 --- a/entities/effects/fire_tracer/init.lua +++ b/entities/effects/fire_tracer/init.lua @@ -7,24 +7,24 @@ function EFFECT:Init( data ) self.Position = data:GetStart() self.WeaponEnt = data:GetEntity() self.Attachment = data:GetAttachment() - + self.StartPos = self:GetTracerShootPos( self.Position, self.WeaponEnt, self.Attachment ) self.EndPos = data:GetOrigin() - + local dir = self.StartPos - self.EndPos dir:Normalize() - + self.Dir = dir - + self.Entity:SetRenderBoundsWS( self.StartPos, self.EndPos ) - + self.Alpha = 100 self.Color = Color( 250, 150, 50, self.Alpha ) - + local dlight = DynamicLight( self:EntIndex() ) - + if dlight then - + dlight.Pos = self.StartPos dlight.r = 255 dlight.g = 150 @@ -33,7 +33,7 @@ function EFFECT:Init( data ) dlight.Decay = 256 dlight.size = 256 * math.Rand( 0.5, 1.0 ) dlight.DieTime = CurTime() + 5 - + end end @@ -44,7 +44,7 @@ function EFFECT:Think( ) self.Alpha = self.Alpha - FrameTime() * 200 self.Color = Color( 250, 150, 50, self.Alpha ) - + return self.Alpha > 0 end @@ -52,36 +52,36 @@ end function EFFECT:Render( ) if self.Alpha < 1 then return end - + --[[self.Length = ( self.StartPos - self.EndPos ):Length() - + render.SetMaterial( self.Mat ) render.DrawBeam( self.StartPos, self.EndPos, ( 100 / self.Alpha ) * 0.5 + 0.5, 0, 0, self.Color )]] - + if ( self.Alpha < 1 ) then return end self.Length = (self.StartPos - self.EndPos):Length() - + local texcoord = CurTime() * -0.2 - + for i = 1, 10 do - + render.SetMaterial( self.Mat ) - + texcoord = texcoord + i * 0.05 * texcoord - - render.DrawBeam( self.StartPos, - self.EndPos, - i * self.Alpha * 0.03, - texcoord, - texcoord + (self.Length / (128 + self.Alpha)), + + render.DrawBeam( self.StartPos, + self.EndPos, + i * self.Alpha * 0.03, + texcoord, + texcoord + (self.Length / (128 + self.Alpha)), self.Color ) - + render.SetMaterial( self.Sprite ) render.DrawSprite( self.StartPos + self.Dir * i, i * 5, i * 5, Color( self.Color.r, self.Color.g, self.Color.b, self.Alpha ) ) render.DrawSprite( self.EndPos, i * 5, i * 5, Color( self.Color.r, self.Color.g, self.Color.b, self.Alpha ) ) - + end end diff --git a/entities/effects/gore_explosion/init.lua b/entities/effects/gore_explosion/init.lua index e4406a1..66a8641 100644 --- a/entities/effects/gore_explosion/init.lua +++ b/entities/effects/gore_explosion/init.lua @@ -3,10 +3,10 @@ function EFFECT:Init( data ) self.DieTime = CurTime() + 1.5 - + local pos = data:GetOrigin() + Vector(0,0,50) local emitter = ParticleEmitter( pos ) - + local particle = emitter:Add( "effects/blood_core", pos ) particle:SetDieTime( math.Rand( 0.5, 1.0 ) ) particle:SetStartAlpha( 255 ) @@ -15,7 +15,7 @@ function EFFECT:Init( data ) particle:SetEndSize( math.random( 150, 200 ) ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 50, 0, 0 ) - + local particle = emitter:Add( "effects/blood_core", pos ) particle:SetDieTime( math.Rand( 6.0, 8.0 ) ) particle:SetStartAlpha( 50 ) @@ -25,9 +25,9 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 50, 0, 0 ) particle:SetGravity( Vector( 0, 0, -5 ) ) - + for i=1, math.random(4,8) do - + local particle = emitter:Add( "effects/blood", pos ) particle:SetVelocity( VectorRand() * 100 + Vector(0,math.random(-25,25),50) ) particle:SetDieTime( 1.0 ) @@ -38,14 +38,14 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 50, 0, 0 ) particle:SetGravity( Vector( 0, 0, -300 ) ) - + end - + for i=1, 12 do - + local vec = VectorRand() vec.z = math.Rand( -0.2, 1.0 ) - + local particle = emitter:Add( "nuke/gore" .. math.random(1,2), pos ) particle:SetVelocity( vec * 250 + Vector(0,0,50) ) particle:SetDieTime( math.Rand( 0.8, 1.0 ) ) @@ -56,14 +56,14 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 50, 0, 0 ) particle:SetGravity( Vector( 0, 0, -300 ) ) - + end - + for i=1, math.random(3,6) do - + local vec = VectorRand() vec.z = math.Rand( -0.2, 1.0 ) - + local particle = emitter:Add( "nuke/gore" .. math.random(1,2), pos + Vector(0,0,math.random(-10,10)) ) particle:SetVelocity( vec * 300 ) particle:SetLifeTime( 0 ) @@ -74,56 +74,56 @@ function EFFECT:Init( data ) particle:SetEndSize( 1 ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 40, 0, 0 ) - + particle:SetGravity( Vector( 0, 0, -500 ) ) particle:SetCollide( true ) particle:SetBounce( 0.5 ) - + particle:SetCollideCallback( function( part, pos, normal ) - + util.Decal( "Blood", pos + normal, pos - normal ) - + end ) - + end emitter:Finish() - + for i=1, 15 do - + local ed = EffectData() ed:SetOrigin( pos + Vector(0,0,math.random(0,30)) ) - + if i < 5 then ed:SetScale( 1 ) else ed:SetScale( 2 ) end - + util.Effect( "player_gib", ed, true, true ) - + end - + if LocalPlayer():GetPos():Distance( pos ) <= 300 then - + local frac = 1 - ( LocalPlayer():GetPos():Distance( pos ) / 300 ) - + for i=1, math.Round( frac * 12 ) do - + AddStain() - + end - + end - + end function EFFECT:Think( ) return self.DieTime > CurTime() - + end function EFFECT:Render() - + end diff --git a/entities/effects/head_gib/init.lua b/entities/effects/head_gib/init.lua index 8a36dd9..6258735 100644 --- a/entities/effects/head_gib/init.lua +++ b/entities/effects/head_gib/init.lua @@ -1,10 +1,10 @@ function EFFECT:Init( data ) - - local pos = data:GetOrigin() + + local pos = data:GetOrigin() local emitter = ParticleEmitter( pos ) - + local particle = emitter:Add( "effects/blood_core", pos ) particle:SetDieTime( 0.5 ) particle:SetStartAlpha( 255 ) @@ -13,7 +13,7 @@ function EFFECT:Init( data ) particle:SetEndSize( math.random( 50, 100 ) ) particle:SetRoll( math.random( -360, 360 ) ) particle:SetColor( 50, 0, 0 ) - + local particle = emitter:Add( "effects/blood_core", pos ) particle:SetDieTime( math.Rand( 5.0, 7.0 ) ) particle:SetStartAlpha( 50 ) @@ -23,9 +23,9 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 50, 0, 0 ) particle:SetGravity( Vector( 0, 0, -5 ) ) - + for i=1, math.random(5,10) do - + local particle = emitter:Add( "effects/blood", pos ) particle:SetVelocity( VectorRand() * 100 + Vector(0,math.random(-25,25),50) ) particle:SetDieTime( 1.0 ) @@ -36,11 +36,11 @@ function EFFECT:Init( data ) particle:SetRoll( math.random( -360, 360 ) ) particle:SetColor( 50, 0, 0 ) particle:SetGravity( Vector( 0, 0, -300 ) ) - + end - + for i=1, 6 do - + local particle = emitter:Add( "nuke/gore" .. math.random(1,2), pos ) particle:SetVelocity( VectorRand() * 100 + Vector(0,0,75) ) particle:SetDieTime( 0.5 ) @@ -51,41 +51,40 @@ function EFFECT:Init( data ) particle:SetRoll( math.random( -360, 360 ) ) particle:SetColor( 50, 0, 0 ) particle:SetGravity( Vector( 0, 0, -300 ) ) - + end emitter:Finish() - + for i=1, 3 do - + local ed = EffectData() ed:SetOrigin( pos ) ed:SetScale( 1 ) util.Effect( "player_gib", ed, true, true ) - + end - + if LocalPlayer():GetPos():Distance( pos ) <= 100 then - + local frac = 1 - ( LocalPlayer():GetPos():Distance( pos ) / 100 ) - + for i=1, math.Round( frac * 6 ) do - + AddStain() - + end - + end - + end function EFFECT:Think( ) return false - + end function EFFECT:Render() - -end +end diff --git a/entities/effects/headshot/init.lua b/entities/effects/headshot/init.lua index 7aadb41..1bc08c1 100644 --- a/entities/effects/headshot/init.lua +++ b/entities/effects/headshot/init.lua @@ -1,10 +1,10 @@ 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 ) @@ -13,7 +13,7 @@ function EFFECT:Init( data ) 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 ) ) @@ -22,9 +22,9 @@ function EFFECT:Init( data ) 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 ) @@ -35,32 +35,31 @@ function EFFECT:Init( data ) 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 +end diff --git a/entities/effects/immolate/init.lua b/entities/effects/immolate/init.lua index e6a7cc1..c562638 100644 --- a/entities/effects/immolate/init.lua +++ b/entities/effects/immolate/init.lua @@ -4,47 +4,47 @@ function EFFECT:Init( data ) self.DieTime = CurTime() + 5 self.SmokeTime = 0 self.Ent = data:GetEntity() - + if not IsValid( self.Ent ) then self.DieTime = 0 return end - + self.Emitter = ParticleEmitter( self.Ent:GetPos() ) - + if LocalPlayer() != self.Ent then return end - + LocalPlayer():EmitSound( "ambient/fire/ignite.wav", 100, 80 ) - + end function EFFECT:Think() if IsValid( self.Ent ) then - + if self.Ent:IsPlayer() and ( !self.Ent:Alive() or self.Ent == LocalPlayer() ) then - + self.DieTime = 0 - + end - + end if self.DieTime < CurTime() or not IsValid( self.Ent ) then - + if self.Emitter then - + self.Emitter:Finish() - + end - + return false - + end local pos - + for i=1, 3 do - + pos = self.Ent:GetPos() + Vector(0,0,math.random(1,50)) + Vector(math.random(-10,10),math.random(-10,10),0) - + local particle = self.Emitter:Add( "effects/muzzleflash" .. math.random(1,4), pos ) particle:SetVelocity( Vector(0,0,80) ) particle:SetDieTime( math.Rand( 0.2, 0.4 ) ) @@ -55,13 +55,13 @@ function EFFECT:Think() particle:SetRoll( math.random(-180,180) ) particle:SetColor( 255, 200, 200 ) particle:SetGravity( Vector( 0, 0, 500 ) ) - + end - + if self.SmokeTime < CurTime() then - + self.SmokeTime = CurTime() + 0.02 - + local particle = self.Emitter:Add( "particles/smokey", pos ) particle:SetVelocity( Vector(0,0,30) ) particle:SetDieTime( math.Rand( 1.0, 2.5 ) ) @@ -72,17 +72,13 @@ function EFFECT:Think() particle:SetRoll( 0 ) particle:SetColor( 50, 50, 50 ) particle:SetGravity( Vector( 0, 0, 30 ) ) - + end return true - -end -function EFFECT:Render() - end +function EFFECT:Render() - - +end diff --git a/entities/effects/player_gib/init.lua b/entities/effects/player_gib/init.lua index 2afcae0..62b5916 100644 --- a/entities/effects/player_gib/init.lua +++ b/entities/effects/player_gib/init.lua @@ -6,48 +6,48 @@ function EFFECT:Init( data ) if scale < 2 then self.Entity:SetModel( table.Random( GAMEMODE.SmallGibs ) ) else - self.Entity:SetModel( table.Random( GAMEMODE.BigGibs ) ) + self.Entity:SetModel( table.Random( GAMEMODE.BigGibs ) ) end self.Entity:PhysicsInit( SOLID_VPHYSICS ) self.Entity:SetMaterial( "models/flesh" ) - + self.Entity:SetCollisionGroup( COLLISION_GROUP_DEBRIS ) self.Entity:SetCollisionBounds( Vector( -128 -128, -128 ), Vector( 128, 128, 128 ) ) self.Entity:SetAngles( Angle( math.Rand(0,360), math.Rand(0,360), math.Rand(0,360) ) ) - + local phys = self.Entity:GetPhysicsObject() - + if IsValid( phys ) then - + local vec = VectorRand() vec.z = math.Clamp( vec.z, -0.4, 0.8 ) - + phys:Wake() phys:SetMass( 100 ) phys:AddAngleVelocity( VectorRand() * 500 ) phys:SetMaterial( "gmod_silent" ) - + if scale < 2 then - + phys:SetVelocity( vec * math.Rand( 100, 200 ) ) - + else - + phys:SetVelocity( vec * math.Rand( 300, 600 ) ) - + end - + end - + self.LifeTime = CurTime() + 15 - + end function EFFECT:Think( ) return self.LifeTime > CurTime() - + end function EFFECT:Render() @@ -55,4 +55,3 @@ function EFFECT:Render() self.Entity:DrawModel() end - diff --git a/entities/effects/puke_explosion/init.lua b/entities/effects/puke_explosion/init.lua index 9a13226..afc00f6 100644 --- a/entities/effects/puke_explosion/init.lua +++ b/entities/effects/puke_explosion/init.lua @@ -5,12 +5,12 @@ function EFFECT:Init( data ) self.DieTime = CurTime() + 1.5 self.SoundTime = 0 - + local pos = data:GetOrigin() + Vector(0,0,50) local emitter = ParticleEmitter( pos ) - + self.Pos = pos - + local particle = emitter:Add( "effects/blood_core", pos ) particle:SetDieTime( math.Rand( 0.5, 1.0 ) ) particle:SetStartAlpha( 255 ) @@ -19,9 +19,9 @@ function EFFECT:Init( data ) particle:SetEndSize( math.random( 100, 150 ) ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( self.Color.r, self.Color.g, 0 ) - + for i=1, math.random(4,8) do - + local particle = emitter:Add( "effects/blood", pos ) particle:SetVelocity( VectorRand() * 100 + Vector(0,math.random(-25,25),50) ) particle:SetDieTime( 1.0 ) @@ -32,14 +32,14 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( self.Color.r, self.Color.g, 0 ) particle:SetGravity( Vector( 0, 0, -300 ) ) - + end - + for i=1, 10 do - + local vec = VectorRand() vec.z = math.Rand( -0.2, 1.0 ) - + local particle = emitter:Add( "nuke/gore" .. math.random(1,2), pos ) particle:SetVelocity( vec * 300 ) particle:SetDieTime( math.Rand( 0.8, 1.0 ) ) @@ -50,14 +50,14 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( self.Color.r, self.Color.g + math.random(0,20), 0 ) particle:SetGravity( Vector( 0, 0, -400 ) ) - + end - + for i=1, math.random(3,6) do - + local vec = VectorRand() vec.z = math.Rand( -0.2, 1.0 ) - + local particle = emitter:Add( "nuke/gore" .. math.random( 1, 2 ), pos + Vector( 0, 0, math.random( -10, 10 ) ) ) particle:SetVelocity( vec * 300 ) particle:SetLifeTime( 0 ) @@ -68,52 +68,52 @@ function EFFECT:Init( data ) particle:SetEndSize( 1 ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( self.Color.r, self.Color.g, 0 ) - + particle:SetGravity( Vector( 0, 0, -500 ) ) particle:SetCollide( true ) particle:SetBounce( 0.5 ) - + particle:SetCollideCallback( function( part, pos, normal ) - + util.Decal( "yellowblood", pos + normal, pos - normal ) - + end ) - + end emitter:Finish() - + for i=1, 10 do - + local ed = EffectData() ed:SetOrigin( pos + Vector( 0, 0, math.random( 0, 30 ) ) ) - + if i < 5 then ed:SetScale( 1 ) else ed:SetScale( 2 ) end - + util.Effect( "player_gib", ed, true, true ) - + end - + end function EFFECT:Think() if self.SoundTime < CurTime() then - + sound.Play( table.Random( GAMEMODE.GoreSplat ), self.Pos, 100, math.random(90,110) ) - + self.SoundTime = CurTime() + 0.5 - + end return self.DieTime > CurTime() - + end function EFFECT:Render() - + end diff --git a/entities/effects/puke_spray/init.lua b/entities/effects/puke_spray/init.lua index b2d73ac..f7bb955 100644 --- a/entities/effects/puke_spray/init.lua +++ b/entities/effects/puke_spray/init.lua @@ -5,12 +5,12 @@ function EFFECT:Init( data ) self.DieTime = CurTime() + 1.5 self.SoundTime = 0 - + local pos = data:GetOrigin() + Vector(0,0,50) local emitter = ParticleEmitter( pos ) - + self.Pos = pos - + local particle = emitter:Add( "effects/blood_core", pos ) particle:SetDieTime( math.Rand( 0.5, 1.0 ) ) particle:SetStartAlpha( 255 ) @@ -19,9 +19,9 @@ function EFFECT:Init( data ) particle:SetEndSize( math.random( 100, 150 ) ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( self.Color.r, self.Color.g, 0 ) - + for i=1, math.random(4,8) do - + local particle = emitter:Add( "effects/blood", pos ) particle:SetVelocity( VectorRand() * 100 + Vector(0,math.random(-25,25),50) ) particle:SetDieTime( 1.0 ) @@ -32,14 +32,14 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( self.Color.r, self.Color.g, 0 ) particle:SetGravity( Vector( 0, 0, -300 ) ) - + end - + for i=1, 10 do - + local vec = VectorRand() vec.z = math.Rand( -0.2, 1.0 ) - + local particle = emitter:Add( "nuke/gore" .. math.random(1,2), pos ) particle:SetVelocity( vec * 200 ) particle:SetDieTime( math.Rand( 0.8, 1.0 ) ) @@ -50,14 +50,14 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( self.Color.r, self.Color.g + math.random(0,20), 0 ) particle:SetGravity( Vector( 0, 0, -300 ) ) - + end - + for i=1, math.random(3,6) do - + local vec = VectorRand() vec.z = math.Rand( -0.2, 1.0 ) - + local particle = emitter:Add( "nuke/gore" .. math.random(1,2), pos + Vector(0,0,math.random(-10,10)) ) particle:SetVelocity( vec * 300 ) particle:SetLifeTime( 0 ) @@ -68,52 +68,52 @@ function EFFECT:Init( data ) particle:SetEndSize( 1 ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( self.Color.r, self.Color.g, 0 ) - + particle:SetGravity( Vector( 0, 0, -500 ) ) particle:SetCollide( true ) particle:SetBounce( 0.5 ) - + particle:SetCollideCallback( function( part, pos, normal ) - + util.Decal( "yellowblood", pos + normal, pos - normal ) - + end ) - + end emitter:Finish() - + for i=1, 5 do - + local ed = EffectData() ed:SetOrigin( pos + Vector(0,0,math.random(0,30)) ) - + if i < 3 then ed:SetScale( 1 ) else ed:SetScale( 2 ) end - + util.Effect( "player_gib", ed, true, true ) - + end - + end function EFFECT:Think( ) if self.SoundTime < CurTime() then - + sound.Play( table.Random( GAMEMODE.GoreSplat ), self.Pos, 100, math.random(90,110) ) - + self.SoundTime = CurTime() + 0.5 - + end return self.DieTime > CurTime() - + end function EFFECT:Render() - + end diff --git a/entities/effects/rad_explosion/init.lua b/entities/effects/rad_explosion/init.lua index e888a2e..75e7ec5 100644 --- a/entities/effects/rad_explosion/init.lua +++ b/entities/effects/rad_explosion/init.lua @@ -1,11 +1,11 @@ function EFFECT:Init( data ) - + local pos = data:GetOrigin() + Vector(0,0,40) local emitter = ParticleEmitter( pos ) - + for i=1, math.random(4,8) do - + local particle = emitter:Add( "effects/blood", pos ) particle:SetVelocity( VectorRand() * 100 + Vector(0,math.random(-25,25),50) ) particle:SetDieTime( 1.0 ) @@ -16,14 +16,14 @@ function EFFECT:Init( data ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetColor( 100, 200, 0 ) particle:SetGravity( Vector( 0, 0, -300 ) ) - + end - + for i=1, 20 do - + local vec = VectorRand() vec.z = math.Rand( -0.2, 1.0 ) - + local particle = emitter:Add( "effects/yellowflare", pos ) particle:SetVelocity( vec * 300 ) particle:SetDieTime( math.Rand( 2.5, 3.5 ) ) @@ -34,22 +34,22 @@ function EFFECT:Init( data ) particle:SetRoll( math.random( -360, 360 ) ) particle:SetColor( 100, 200, 0 ) particle:SetGravity( Vector( 0, 0, -300 ) ) - + particle:SetCollide( true ) particle:SetBounce( math.Rand( 0.1, 0.5 ) ) - + end emitter:Finish() - + end function EFFECT:Think( ) return false - + end function EFFECT:Render() - + end diff --git a/entities/effects/radiation/init.lua b/entities/effects/radiation/init.lua index e9021c9..5a4281e 100644 --- a/entities/effects/radiation/init.lua +++ b/entities/effects/radiation/init.lua @@ -4,43 +4,43 @@ function EFFECT:Init( data ) self.DieTime = CurTime() + 5 self.PartTime = 0 self.Ent = data:GetEntity() - + if not IsValid( self.Ent ) then self.DieTime = 0 return end - + self.Emitter = ParticleEmitter( self.Ent:GetPos() ) - + end function EFFECT:Think() if IsValid( self.Ent ) then - + if self.Ent:IsPlayer() and ( !self.Ent:Alive() or self.Ent == LocalPlayer() ) then - + self.DieTime = 0 - + end - + end if self.DieTime < CurTime() or not IsValid( self.Ent ) then - + if self.Emitter then - + self.Emitter:Finish() - + end - + return false - + end if self.PartTime < CurTime() then - + self.PartTime = CurTime() + math.Rand( 0.2, 0.4 ) - + local pos = self.Ent:GetPos() + Vector(0,0,math.random(1,40)) + Vector(math.random(-10,10),math.random(-10,10),0) - + local particle = self.Emitter:Add( "effects/yellowflare", pos ) particle:SetVelocity( VectorRand() * 5 ) particle:SetDieTime( math.Rand( 2.0, 4.0 ) ) @@ -51,20 +51,16 @@ function EFFECT:Think() particle:SetRoll( math.random( -180, 180 ) ) particle:SetColor( 100, 200, 0 ) particle:SetGravity( Vector( 0, 0, -500 ) ) - + particle:SetCollide( true ) particle:SetBounce( math.Rand( 0, 0.2 ) ) - + end return true - -end -function EFFECT:Render() - end +function EFFECT:Render() - - +end diff --git a/entities/effects/smoke_crater/init.lua b/entities/effects/smoke_crater/init.lua index 68c713b..e16d873 100644 --- a/entities/effects/smoke_crater/init.lua +++ b/entities/effects/smoke_crater/init.lua @@ -4,7 +4,7 @@ function EFFECT:Init( data ) self.Pos = data:GetOrigin() self.Magnitude = data:GetMagnitude() or 1 - + self.Emitter = ParticleEmitter( self.Pos ) self.DieTime = CurTime() + 15 self.Interval = 0 @@ -15,9 +15,9 @@ end function EFFECT:Think( ) if self.Interval < CurTime() then - + self.Interval = CurTime() + 0.2 - + local particle = self.Emitter:Add( "particles/smokey", self.Pos + VectorRand() * 10 ) particle:SetVelocity( Vector( math.Rand(-3,3), math.Rand(-3,3), math.Rand(20,40) ) + WindVector ) @@ -28,25 +28,25 @@ function EFFECT:Think( ) particle:SetEndSize( math.Rand( 50, 200 ) * self.Magnitude ) particle:SetRoll( math.Rand( -360, 360 ) ) particle:SetRollDelta( math.Rand( -0.1, 0.1 ) ) - + local rand = math.random(10,50) - particle:SetColor( rand, rand, rand ) + particle:SetColor( rand, rand, rand ) end - + if self.DieTime > CurTime() then - + return true - + else - + self.Emitter:Finish() return false - + end - + end function EFFECT:Render() - + end |
