summaryrefslogtreecommitdiff
path: root/entities/effects/player_gib/init.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-05-30 21:01:18 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-05-30 21:01:18 -0400
commitd62058fcdea5fc6736a2a373f47dc6c14c70c319 (patch)
tree79a1325190e3f1f1b6d6a2dbcdfc1ba3fa866ac9 /entities/effects/player_gib/init.lua
parentc38f00182ba6c282806eecb39a42e64d5feafa37 (diff)
downloadredead-d62058fcdea5fc6736a2a373f47dc6c14c70c319.tar.gz
redead-d62058fcdea5fc6736a2a373f47dc6c14c70c319.tar.bz2
redead-d62058fcdea5fc6736a2a373f47dc6c14c70c319.zip
Removed exessive whitespace so future commits will be cleaner
Diffstat (limited to 'entities/effects/player_gib/init.lua')
-rw-r--r--entities/effects/player_gib/init.lua31
1 files changed, 15 insertions, 16 deletions
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
-