summaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/items/orangeseeds.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/itemsystem/items/orangeseeds.lua')
-rw-r--r--gamemode/itemsystem/items/orangeseeds.lua32
1 files changed, 19 insertions, 13 deletions
diff --git a/gamemode/itemsystem/items/orangeseeds.lua b/gamemode/itemsystem/items/orangeseeds.lua
index 33fd698..c9c3963 100644
--- a/gamemode/itemsystem/items/orangeseeds.lua
+++ b/gamemode/itemsystem/items/orangeseeds.lua
@@ -5,22 +5,28 @@ ITEM.Description = "Something you can plant!"
ITEM.Icon = "test.png"
ITEM.UniqueData = false
-local drop1 = function(player)
- print("Drop 1 called")
-end
+--Things needed to make something plantable
+ITEM.GrowTime = 1
+ITEM.OnGrow = function(self, aor, owner)
+ print("Owner:")
+ print(owner)
+ local plant = GAMEMODE.MakeGenericPlant( owner, self:GetPos() + Vector( 0, 0, -12 ), "models/props/cs_office/plant01_p1.mdl" )
+ plant.Children = 0
-local dropall = function(player)
- print("Drop all called")
-end
+ plant:SetCollisionGroup( 0 )
+ plant:SetSolid( SOLID_NONE )
+ plant.Children = 0
+
+ local num = 1
+ if ( IsValid( owner ) && owner:HasUnlock( "Adept_Farmer" ) ) then num = num + math.random( 0, 1 ) end
+ if ( IsValid( owner ) && owner:HasUnlock( "Expert_Farmer" ) ) then num = num + math.random( 0, 2 ) end
-local dropx = function(player)
- print("Drop x called")
+ for i = 1, num do
+ GAMEMODE.MakeGenericPlantChild( owner, self:GetPos() + Vector( math.random( -5, 5 ), math.random( -5, 5 ), math.random( 13, 30 ) ), "models/props/cs_italy/orange.mdl", plant )
+ end
end
-ITEM.Actions = {}
-ITEM.Actions["Drop"] = {}
-ITEM.Actions["Drop"]["Drop 1"] = drop1
-ITEM.Actions["Drop"]["Drop all"] = dropall
-ITEM.Actions["Drop"]["Drop X"] = dropx
+genericMakePlantable(ITEM)
+genericMakeDroppable(ITEM)
GMS.RegisterResource(ITEM)