mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 21:53:46 +03:00
Upload
This commit is contained in:
116
lua/effects/simfphys_tankweapon_explosion_micro.lua
Normal file
116
lua/effects/simfphys_tankweapon_explosion_micro.lua
Normal file
@@ -0,0 +1,116 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
local Materials = {
|
||||
"particle/smokesprites_0001",
|
||||
"particle/smokesprites_0002",
|
||||
"particle/smokesprites_0003",
|
||||
"particle/smokesprites_0004",
|
||||
"particle/smokesprites_0005",
|
||||
"particle/smokesprites_0006",
|
||||
"particle/smokesprites_0007",
|
||||
"particle/smokesprites_0008",
|
||||
"particle/smokesprites_0009",
|
||||
"particle/smokesprites_0010",
|
||||
"particle/smokesprites_0011",
|
||||
"particle/smokesprites_0012",
|
||||
"particle/smokesprites_0013",
|
||||
"particle/smokesprites_0014",
|
||||
"particle/smokesprites_0015",
|
||||
"particle/smokesprites_0016"
|
||||
}
|
||||
|
||||
function EFFECT:Init( data )
|
||||
local Pos = data:GetOrigin()
|
||||
|
||||
self:Explosion( Pos )
|
||||
|
||||
sound.Play( "ambient/explosions/explode_4.wav", Pos, 95, 200, 0.5 )
|
||||
end
|
||||
|
||||
function EFFECT:Explosion( pos )
|
||||
local emitter = ParticleEmitter( pos, false )
|
||||
|
||||
for i = 0,20 do
|
||||
local particle = emitter:Add( Materials[math.random(1,table.Count( Materials ))], pos )
|
||||
|
||||
if particle then
|
||||
particle:SetVelocity( VectorRand() * 800 )
|
||||
particle:SetDieTime( math.Rand(1,2) )
|
||||
particle:SetAirResistance( math.Rand(1000,1500) )
|
||||
particle:SetStartAlpha( 255 )
|
||||
particle:SetStartSize( math.Rand(5,15) )
|
||||
particle:SetEndSize( math.Rand(30,50) )
|
||||
particle:SetRoll( math.Rand(-1,1) )
|
||||
particle:SetColor( 20,20,20 )
|
||||
particle:SetGravity( Vector( 0, 0, 100 ) )
|
||||
particle:SetCollide( false )
|
||||
end
|
||||
end
|
||||
|
||||
for i = 0, 20 do
|
||||
local particle = emitter:Add( "sprites/rico1", pos )
|
||||
|
||||
local vel = VectorRand() * 800
|
||||
|
||||
if particle then
|
||||
particle:SetVelocity( vel )
|
||||
particle:SetAngles( vel:Angle() + Angle(0,90,0) )
|
||||
particle:SetDieTime( math.Rand(0.1,0.15) )
|
||||
particle:SetStartAlpha( math.Rand( 200, 255 ) )
|
||||
particle:SetEndAlpha( 0 )
|
||||
particle:SetStartSize( math.Rand(6,12) )
|
||||
particle:SetEndSize( 0 )
|
||||
particle:SetRoll( math.Rand(-100,100) )
|
||||
particle:SetRollDelta( math.Rand(-100,100) )
|
||||
particle:SetColor( 255, 255, 255 )
|
||||
|
||||
particle:SetAirResistance( 0 )
|
||||
end
|
||||
end
|
||||
|
||||
for i = 0, 40 do
|
||||
local particle = emitter:Add( "sprites/flamelet"..math.random(1,5), pos )
|
||||
|
||||
if particle then
|
||||
particle:SetVelocity( VectorRand() * 300 )
|
||||
particle:SetDieTime( 0.14 )
|
||||
particle:SetStartAlpha( 255 )
|
||||
particle:SetStartSize( 5 )
|
||||
particle:SetEndSize( math.Rand(10,20) )
|
||||
particle:SetEndAlpha( 100 )
|
||||
particle:SetRoll( math.Rand( -1, 1 ) )
|
||||
particle:SetColor( 200,150,150 )
|
||||
particle:SetCollide( false )
|
||||
end
|
||||
end
|
||||
|
||||
emitter:Finish()
|
||||
|
||||
local dlight = DynamicLight( math.random(0,9999) )
|
||||
if dlight then
|
||||
dlight.pos = pos
|
||||
dlight.r = 255
|
||||
dlight.g = 180
|
||||
dlight.b = 100
|
||||
dlight.brightness = 8
|
||||
dlight.Decay = 2000
|
||||
dlight.Size = 100
|
||||
dlight.DieTime = CurTime() + 0.1
|
||||
end
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
return false
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
end
|
||||
Reference in New Issue
Block a user