diff options
| author | Scott <scotth0828@gmail.com> | 2016-04-30 20:31:37 -0400 |
|---|---|---|
| committer | Scott <scotth0828@gmail.com> | 2016-04-30 20:31:37 -0400 |
| commit | e8fc8b5bf824ed3283dede946e66f5fd843d54ff (patch) | |
| tree | cf935647c5c5ae0c44b30e8a1256df7799c41a5a /ftp_gmstranded/entities/effects/gms_loot_effect.lua | |
| parent | 6f6cce0561c19e7af14bcc6e6b1c7de2d5efc530 (diff) | |
| download | gmstranded-e8fc8b5bf824ed3283dede946e66f5fd843d54ff.tar.gz gmstranded-e8fc8b5bf824ed3283dede946e66f5fd843d54ff.tar.bz2 gmstranded-e8fc8b5bf824ed3283dede946e66f5fd843d54ff.zip | |
Some changes
Diffstat (limited to 'ftp_gmstranded/entities/effects/gms_loot_effect.lua')
| -rw-r--r-- | ftp_gmstranded/entities/effects/gms_loot_effect.lua | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/ftp_gmstranded/entities/effects/gms_loot_effect.lua b/ftp_gmstranded/entities/effects/gms_loot_effect.lua new file mode 100644 index 0000000..0b8d1ef --- /dev/null +++ b/ftp_gmstranded/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 |
