diff options
Diffstat (limited to 'entities')
| -rw-r--r-- | entities/entities/gms_generic_plantable.lua | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/entities/entities/gms_generic_plantable.lua b/entities/entities/gms_generic_plantable.lua index 81f31b1..b5fcdf2 100644 --- a/entities/entities/gms_generic_plantable.lua +++ b/entities/entities/gms_generic_plantable.lua @@ -24,99 +24,3 @@ function ENT:OnInitialize() self:Remove() end) end - -function ENT:Grow() - local ply = self:GetOwner() - local pos = self:GetPos() - - local num = 1 - if ( IsValid( ply ) && ply:HasUnlock( "Adept_Farmer" ) ) then num = num + math.random( 0, 1 ) end - if ( IsValid( ply ) && ply:HasUnlock( "Expert_Farmer" ) ) then num = num + math.random( 0, 2 ) end - - if ( self.Type == "tree" ) then - GAMEMODE.MakeTree( pos ) - elseif ( self.Type == "melon" ) then - GAMEMODE.MakeMelon( pos, num, ply ) - elseif ( self.Type == "banana" ) then - GAMEMODE.MakeBanana( pos, num, ply ) - elseif ( self.Type == "orange" ) then - GAMEMODE.MakeOrange( pos, num, ply ) - elseif ( self.Type == "grain" ) then - GAMEMODE.MakeGrain( pos, ply ) - elseif ( self.Type == "berry" ) then - GAMEMODE.MakeBush( pos, ply ) - end - - self.Grown = true - self:Fadeout() -end - -function ENT:OnRemove() - if ( !self.Grown && self.Type != "tree" && IsValid( self:GetOwner() ) ) then - self:GetOwner():SetNWInt( "plants", self:GetOwner():GetNWInt( "plants" ) - 1 ) - end - timer.Destroy( "GMS_SeedTimers_" .. self:EntIndex() ) -end - -function GAMEMODE.MakeGenericPlant( ply, pos, mdl, isTree ) - local ent = ents.Create( "prop_dynamic" ) - ent:SetAngles( Angle( 0, math.random( 0, 360 ), 0 ) ) - ent:SetSolid( SOLID_VPHYSICS ) - ent:SetModel( mdl ) - ent:SetPos( pos ) - ent:Spawn() - ent.IsPlant = true - ent:SetName( "gms_plant" .. ent:EntIndex() ) - - ent:Fadein() - ent:RiseFromGround( 1, 50 ) - - if ( !isTree && IsValid( ply ) ) then - ent:SetNWEntity( "plantowner", ply ) - SPropProtection.PlayerMakePropOwner( ply, ent ) - else - ent:SetNWString( "Owner", "World" ) - end - - local phys = ent:GetPhysicsObject() - if ( IsValid( phys ) ) then phys:EnableMotion( false ) end - ent.PhysgunDisabled = true - - return ent -end - -function GAMEMODE.MakeTree( pos ) - //GAMEMODE.MakeGenericPlant( ply, pos, GMS.TreeModels[ math.random( 1, #GMS.TreeModels ) ], true ) - local ent = ents.Create( "gms_tree" ) - ent:SetPos( pos ) - ent:Spawn() - ent.GMSAutoSpawned = true - ent:SetNetworkedString( "Owner", "World" ) -end - - -function GAMEMODE.MakeBush( pos, ply ) - GAMEMODE.MakeGenericPlant( ply, pos + Vector( math.random( -10, 10 ), math.random( -10, 10 ), 16 ), "models/props/pi_shrub.mdl" ) -end - -function GAMEMODE.MakeMelon( pos, num, ply ) - local plant = GAMEMODE.MakeGenericPlant( ply, pos + Vector( 0, 0, 13 ), "models/props/CS_militia/fern01.mdl" ) - plant.Children = 0 - - for i = 1, num do - GAMEMODE.MakeGenericPlantChild( ply, pos + Vector( math.random( -25, 25 ), math.random( -25, 25 ), math.random( 5, 7 ) ), "models/props_junk/watermelon01.mdl", plant ) - end -end - -function GAMEMODE.MakeOrange( pos, num, ply ) - local plant = GAMEMODE.MakeGenericPlant( ply, pos + Vector( 0, 0, -12 ), "models/props/cs_office/plant01_p1.mdl" ) - plant.Children = 0 - - plant:SetCollisionGroup( 0 ) - plant:SetSolid( SOLID_NONE ) - plant.Children = 0 - - for i = 1, num do - GAMEMODE.MakeGenericPlantChild( ply, pos + Vector( math.random( -5, 5 ), math.random( -5, 5 ), math.random( 13, 30 ) ), "models/props/cs_italy/orange.mdl", plant ) - end -end |
