diff options
| author | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-04-16 02:02:00 -0400 |
|---|---|---|
| committer | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-04-16 02:02:00 -0400 |
| commit | 7e5db609550cca0d8b8a76c4bf78ba4658962167 (patch) | |
| tree | 4df54e0c4eccff0b022e0732c258b7b193fd6cfe /entities/effects/gms_loot_effect.lua | |
| download | gmstranded-7e5db609550cca0d8b8a76c4bf78ba4658962167.tar.gz gmstranded-7e5db609550cca0d8b8a76c4bf78ba4658962167.tar.bz2 gmstranded-7e5db609550cca0d8b8a76c4bf78ba4658962167.zip | |
Initial commit
Diffstat (limited to 'entities/effects/gms_loot_effect.lua')
| -rw-r--r-- | entities/effects/gms_loot_effect.lua | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/entities/effects/gms_loot_effect.lua b/entities/effects/gms_loot_effect.lua new file mode 100644 index 0000000..0b8d1ef --- /dev/null +++ b/entities/effects/gms_loot_effect.lua @@ -0,0 +1,41 @@ + +AddCSLuaFile() + +function EFFECT:Init( data ) + local pos = data:GetOrigin() + local NumParticles = 8 + local emitter = ParticleEmitter( pos, true ) + local color = Color( 255, 255, 100, 255 ) + + for i = 0, NumParticles do + local offset = Vector( math.random( -16, 16 ), math.random( -16, 16 ), 0 ) + local particle = emitter:Add( "particle/fire", pos + offset ) + if ( particle ) then + particle:SetLifeTime( 0 ) + particle:SetDieTime( 3 ) + + particle:SetGravity( Vector( 0, 0, 32 ) ) + particle:SetVelocity( Vector( math.random( -16, 16 ), math.random( -16, 16 ), 0 ) ) + + particle:SetStartSize( math.Rand( 3, 6 ) ) + particle:SetEndSize( 0 ) + + particle:SetRoll( math.Rand( 0, 360 ) ) + particle:SetRollDelta( math.Rand( -4, 4 ) ) + + local RandDarkness = math.Rand( 0, 0.5 ) + particle:SetColor( color.r * RandDarkness, color.g * RandDarkness, color.b * RandDarkness ) + particle:SetAngleVelocity( Angle( math.Rand( -180, 180 ), math.Rand( -180, 180 ), math.Rand( -180, 180 ) ) ) + //particle:SetLighting( true ) + end + end + + emitter:Finish() +end + +function EFFECT:Think() + return false +end + +function EFFECT:Render() +end |
