summaryrefslogtreecommitdiff
path: root/gamemode/itemsystem
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/itemsystem')
-rw-r--r--gamemode/itemsystem/common.lua2
-rw-r--r--gamemode/itemsystem/items/berry.lua2
-rw-r--r--gamemode/itemsystem/items/orangeseeds.lua2
-rw-r--r--gamemode/itemsystem/items/sprout.lua11
-rw-r--r--gamemode/itemsystem/items/waterbottle.lua14
-rw-r--r--gamemode/itemsystem/items/wood.lua10
6 files changed, 29 insertions, 12 deletions
diff --git a/gamemode/itemsystem/common.lua b/gamemode/itemsystem/common.lua
index b002a43..114340b 100644
--- a/gamemode/itemsystem/common.lua
+++ b/gamemode/itemsystem/common.lua
@@ -13,7 +13,7 @@ function startProcessGeneric(player, string, time, ondone)
player:Freeze(false)
player.InProcess = false
player:StopProcessBar()
- ondone()
+ ondone(player)
end)
end
diff --git a/gamemode/itemsystem/items/berry.lua b/gamemode/itemsystem/items/berry.lua
index 77a3a35..734cb60 100644
--- a/gamemode/itemsystem/items/berry.lua
+++ b/gamemode/itemsystem/items/berry.lua
@@ -14,7 +14,7 @@ local eat_client = function(ln, player)
net.SendToServer()
end
-local finishedeating = function()
+local finishedeating = function(player)
player:DecResource( "Berries", 1 )
player:SendMessage( "You're a little less hungry and thirsty now.", 3, Color( 10, 200, 10, 255 ) )
--Set hunger and thirst
diff --git a/gamemode/itemsystem/items/orangeseeds.lua b/gamemode/itemsystem/items/orangeseeds.lua
index c9c3963..8f369b8 100644
--- a/gamemode/itemsystem/items/orangeseeds.lua
+++ b/gamemode/itemsystem/items/orangeseeds.lua
@@ -8,8 +8,6 @@ ITEM.UniqueData = false
--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
diff --git a/gamemode/itemsystem/items/sprout.lua b/gamemode/itemsystem/items/sprout.lua
index 218ff2c..93d5646 100644
--- a/gamemode/itemsystem/items/sprout.lua
+++ b/gamemode/itemsystem/items/sprout.lua
@@ -1 +1,10 @@
-print("Hello from sprout.lua!")
+ITEM = {}
+
+ITEM.Name = "Sprouts"
+ITEM.Description = "Something you can craft with!"
+ITEM.Icon = "test.png"
+ITEM.UniqueData = false
+
+genericMakeDroppable(ITEM)
+
+GMS.RegisterResource(ITEM)
diff --git a/gamemode/itemsystem/items/waterbottle.lua b/gamemode/itemsystem/items/waterbottle.lua
index df43749..944d501 100644
--- a/gamemode/itemsystem/items/waterbottle.lua
+++ b/gamemode/itemsystem/items/waterbottle.lua
@@ -1,7 +1,7 @@
ITEM = {}
-ITEM.Name = "Water Bottle"
-ITEM.Description = "A delicious edible!"
+ITEM.Name = "Water Bottles"
+ITEM.Description = "Something you can drink!"
ITEM.Icon = "test.png"
ITEM.UniqueData = false
@@ -9,20 +9,20 @@ if(SERVER) then
util.AddNetworkString( "gms_drinkwaterbottle" )
end
-local eat_client = function(ln, player)
+local drink_client = function(ln, player)
net.Start("gms_drinkwaterbottle")
net.SendToServer()
end
-local finisheddrink = function()
- player:DecResource( "Water Bottle", 1 )
- player:SendMessage( "You're a little less hungry and thirsty now.", 3, Color( 10, 200, 10, 255 ) )
+local finisheddrink = function(player)
+ player:DecResource( "Water Bottles", 1 )
+ player:SendMessage( "You're a little less thirsty now.", 3, Color( 10, 200, 10, 255 ) )
--Set thirst
player:SetThirst(math.Clamp(player.Thirst+100,0,1000))
end
local drink = function(ln, player)
- if(player.Resources["Water Bottle"] <= 0) then
+ if(player.Resources["Water Bottles"] <= 0) then
player:SendMessage( "You don't have enough to do that!", 3, Color( 10, 200, 10, 255 ) )
return
end
diff --git a/gamemode/itemsystem/items/wood.lua b/gamemode/itemsystem/items/wood.lua
new file mode 100644
index 0000000..ec9c261
--- /dev/null
+++ b/gamemode/itemsystem/items/wood.lua
@@ -0,0 +1,10 @@
+ITEM = {}
+
+ITEM.Name = "Wood"
+ITEM.Description = "Something you can craft with!"
+ITEM.Icon = "test.png"
+ITEM.UniqueData = false
+
+genericMakeDroppable(ITEM)
+
+GMS.RegisterResource(ITEM)