summaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/items/melonseeds.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/itemsystem/items/melonseeds.lua')
-rw-r--r--gamemode/itemsystem/items/melonseeds.lua26
1 files changed, 12 insertions, 14 deletions
diff --git a/gamemode/itemsystem/items/melonseeds.lua b/gamemode/itemsystem/items/melonseeds.lua
index 874ac46..8d82f7a 100644
--- a/gamemode/itemsystem/items/melonseeds.lua
+++ b/gamemode/itemsystem/items/melonseeds.lua
@@ -5,22 +5,20 @@ ITEM.Description = "Something you can plant!"
ITEM.Icon = "test.png"
ITEM.UniqueData = false
-local drop1 = function(player)
- print("Drop 1 called")
-end
+ITEM.GrowTime = 1
+ITEM.OnGrow = function(self, aor, owner)
+ local plant = GAMEMODE.MakeGenericPlant( owner, self:GetPos() + Vector( 0, 0, 13 ), "models/props/CS_militia/fern01.mdl" )
+ plant.Children = 0
-local dropall = function(player)
- print("Drop all called")
-end
+ 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
-local dropx = function(player)
- print("Drop x called")
+ for i = 1, num do
+ GAMEMODE.MakeGenericPlantChild( owner, self:GetPos() + Vector( math.random( -25, 25 ), math.random( -25, 25 ), math.random( 5, 7 ) ), "models/props_junk/watermelon01.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
+genericMakeDroppable(ITEM)
+genericMakePlantable(ITEM)
GMS.RegisterResource(ITEM)