summaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/items
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/itemsystem/items')
-rw-r--r--gamemode/itemsystem/items/anexample.lua18
-rw-r--r--gamemode/itemsystem/items/baits.lua26
-rw-r--r--gamemode/itemsystem/items/bananaseeds.lua26
-rw-r--r--gamemode/itemsystem/items/berry.lua49
-rw-r--r--gamemode/itemsystem/items/grainseeds.lua26
-rw-r--r--gamemode/itemsystem/items/herbs.lua26
-rw-r--r--gamemode/itemsystem/items/melonseeds.lua26
-rw-r--r--gamemode/itemsystem/items/orangeseeds.lua26
8 files changed, 222 insertions, 1 deletions
diff --git a/gamemode/itemsystem/items/anexample.lua b/gamemode/itemsystem/items/anexample.lua
new file mode 100644
index 0000000..19cdbd7
--- /dev/null
+++ b/gamemode/itemsystem/items/anexample.lua
@@ -0,0 +1,18 @@
+--This file is to help developers add new items to the game
+
+ITEM = {}
+
+--The name of this item
+ITEM.Name = "An Example"
+
+--A description that shows up when hovering over the item in the inventory
+ITEM.Description = "Why did I even write this? No one will ever read it!"
+
+--The icon that this item users, relative to the gmsurvival/content/materials directory
+ITEM.Icon = "test.png"
+
+--If this item has "unique data", for example batteries that run out of charge
+ITEM.UniqueData = false
+
+--Be sure to register when everything is said and done!
+GMS.RegisterResource(ITEM)
diff --git a/gamemode/itemsystem/items/baits.lua b/gamemode/itemsystem/items/baits.lua
new file mode 100644
index 0000000..47bf1d0
--- /dev/null
+++ b/gamemode/itemsystem/items/baits.lua
@@ -0,0 +1,26 @@
+ITEM = {}
+
+ITEM.Name = "Baits"
+ITEM.Description = "Something you can plant!"
+ITEM.Icon = "test.png"
+ITEM.UniqueData = false
+
+local drop1 = function(player)
+ print("Drop 1 called")
+end
+
+local dropall = function(player)
+ print("Drop all called")
+end
+
+local dropx = function(player)
+ print("Drop x called")
+end
+
+ITEM.Actions = {}
+ITEM.Actions["Drop"] = {}
+ITEM.Actions["Drop"]["Drop 1"] = drop1
+ITEM.Actions["Drop"]["Drop all"] = dropall
+ITEM.Actions["Drop"]["Drop X"] = dropx
+
+GMS.RegisterResource(ITEM)
diff --git a/gamemode/itemsystem/items/bananaseeds.lua b/gamemode/itemsystem/items/bananaseeds.lua
new file mode 100644
index 0000000..358ed63
--- /dev/null
+++ b/gamemode/itemsystem/items/bananaseeds.lua
@@ -0,0 +1,26 @@
+ITEM = {}
+
+ITEM.Name = "Banana Seeds"
+ITEM.Description = "Something you can plant!"
+ITEM.Icon = "test.png"
+ITEM.UniqueData = false
+
+local drop1 = function(player)
+ print("Drop 1 called")
+end
+
+local dropall = function(player)
+ print("Drop all called")
+end
+
+local dropx = function(player)
+ print("Drop x called")
+end
+
+ITEM.Actions = {}
+ITEM.Actions["Drop"] = {}
+ITEM.Actions["Drop"]["Drop 1"] = drop1
+ITEM.Actions["Drop"]["Drop all"] = dropall
+ITEM.Actions["Drop"]["Drop X"] = dropx
+
+GMS.RegisterResource(ITEM)
diff --git a/gamemode/itemsystem/items/berry.lua b/gamemode/itemsystem/items/berry.lua
index 610147f..2021ffd 100644
--- a/gamemode/itemsystem/items/berry.lua
+++ b/gamemode/itemsystem/items/berry.lua
@@ -1,6 +1,53 @@
ITEM = {}
-ITEM.Name = "Berry"
+ITEM.Name = "Berries"
ITEM.Description = "A delicious edible!"
+ITEM.Icon = "test.png"
+ITEM.UniqueData = false
+
+if(SERVER) then
+ util.AddNetworkString( "gms_eatberry" )
+end
+
+local eat = function(ln, player)
+ if(CLIENT) then
+ net.Start("gms_eatberry")
+ net.SendToServer()
+ end
+ if(SERVER) then
+ if(player.Resources[ITEM.Name] <= 0) then
+ player:SendMessage( "You don't have enough to do that!", 3, Color( 10, 200, 10, 255 ) )
+ return
+ end
+ startProcessGeneric(player,"Eating some berries",3,function()
+ 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
+ player:SetFood(math.Clamp(player.Hunger+100,0,1000))
+ player:SetThirst(math.Clamp(player.Thirst+100,0,1000))
+ end)
+ end
+end
+net.Receive( "gms_eatberry", eat)
+
+local drop1 = function(player)
+ genericDropResource(player,ITEM.Name,1)
+end
+
+local dropall = function(player)
+ genericDropResource(player,ITEM.Name,9999)
+end
+
+local dropx = function(player)
+ print("Drop x called")
+end
+
+ITEM.Actions = {}
+ITEM.Actions["EatBerry"] = eat
+
+ITEM.Actions["Drop"] = {}
+ITEM.Actions["Drop"]["Drop 1"] = drop1
+ITEM.Actions["Drop"]["Drop all"] = dropall
+ITEM.Actions["Drop"]["Drop X"] = dropx
GMS.RegisterResource(ITEM)
diff --git a/gamemode/itemsystem/items/grainseeds.lua b/gamemode/itemsystem/items/grainseeds.lua
new file mode 100644
index 0000000..9b22a0b
--- /dev/null
+++ b/gamemode/itemsystem/items/grainseeds.lua
@@ -0,0 +1,26 @@
+ITEM = {}
+
+ITEM.Name = "Grain Seeds"
+ITEM.Description = "Something you can plant, or mash up into flour"
+ITEM.Icon = "test.png"
+ITEM.UniqueData = false
+
+local drop1 = function(player)
+ print("Drop 1 called")
+end
+
+local dropall = function(player)
+ print("Drop all called")
+end
+
+local dropx = function(player)
+ print("Drop x called")
+end
+
+ITEM.Actions = {}
+ITEM.Actions["Drop"] = {}
+ITEM.Actions["Drop"]["Drop 1"] = drop1
+ITEM.Actions["Drop"]["Drop all"] = dropall
+ITEM.Actions["Drop"]["Drop X"] = dropx
+
+GMS.RegisterResource(ITEM)
diff --git a/gamemode/itemsystem/items/herbs.lua b/gamemode/itemsystem/items/herbs.lua
new file mode 100644
index 0000000..9db5417
--- /dev/null
+++ b/gamemode/itemsystem/items/herbs.lua
@@ -0,0 +1,26 @@
+ITEM = {}
+
+ITEM.Name = "Herbs"
+ITEM.Description = "Something you can plant!"
+ITEM.Icon = "test.png"
+ITEM.UniqueData = false
+
+local drop1 = function(player)
+ print("Drop 1 called")
+end
+
+local dropall = function(player)
+ print("Drop all called")
+end
+
+local dropx = function(player)
+ print("Drop x called")
+end
+
+ITEM.Actions = {}
+ITEM.Actions["Drop"] = {}
+ITEM.Actions["Drop"]["Drop 1"] = drop1
+ITEM.Actions["Drop"]["Drop all"] = dropall
+ITEM.Actions["Drop"]["Drop X"] = dropx
+
+GMS.RegisterResource(ITEM)
diff --git a/gamemode/itemsystem/items/melonseeds.lua b/gamemode/itemsystem/items/melonseeds.lua
new file mode 100644
index 0000000..874ac46
--- /dev/null
+++ b/gamemode/itemsystem/items/melonseeds.lua
@@ -0,0 +1,26 @@
+ITEM = {}
+
+ITEM.Name = "Melon Seeds"
+ITEM.Description = "Something you can plant!"
+ITEM.Icon = "test.png"
+ITEM.UniqueData = false
+
+local drop1 = function(player)
+ print("Drop 1 called")
+end
+
+local dropall = function(player)
+ print("Drop all called")
+end
+
+local dropx = function(player)
+ print("Drop x called")
+end
+
+ITEM.Actions = {}
+ITEM.Actions["Drop"] = {}
+ITEM.Actions["Drop"]["Drop 1"] = drop1
+ITEM.Actions["Drop"]["Drop all"] = dropall
+ITEM.Actions["Drop"]["Drop X"] = dropx
+
+GMS.RegisterResource(ITEM)
diff --git a/gamemode/itemsystem/items/orangeseeds.lua b/gamemode/itemsystem/items/orangeseeds.lua
new file mode 100644
index 0000000..33fd698
--- /dev/null
+++ b/gamemode/itemsystem/items/orangeseeds.lua
@@ -0,0 +1,26 @@
+ITEM = {}
+
+ITEM.Name = "Orange Seeds"
+ITEM.Description = "Something you can plant!"
+ITEM.Icon = "test.png"
+ITEM.UniqueData = false
+
+local drop1 = function(player)
+ print("Drop 1 called")
+end
+
+local dropall = function(player)
+ print("Drop all called")
+end
+
+local dropx = function(player)
+ print("Drop x called")
+end
+
+ITEM.Actions = {}
+ITEM.Actions["Drop"] = {}
+ITEM.Actions["Drop"]["Drop 1"] = drop1
+ITEM.Actions["Drop"]["Drop all"] = dropall
+ITEM.Actions["Drop"]["Drop X"] = dropx
+
+GMS.RegisterResource(ITEM)