diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-04-29 20:30:52 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-04-29 20:30:52 -0400 |
| commit | 6f6cce0561c19e7af14bcc6e6b1c7de2d5efc530 (patch) | |
| tree | a0a9e142b4741ed109a00059e3b98efc86b25b4d /gamemode/itemsystem/items | |
| parent | 534ce8e8612da3ba6d610a782eeaf10c9135b947 (diff) | |
| download | gmstranded-6f6cce0561c19e7af14bcc6e6b1c7de2d5efc530.tar.gz gmstranded-6f6cce0561c19e7af14bcc6e6b1c7de2d5efc530.tar.bz2 gmstranded-6f6cce0561c19e7af14bcc6e6b1c7de2d5efc530.zip | |
a halfway commit to show scott
Diffstat (limited to 'gamemode/itemsystem/items')
| -rw-r--r-- | gamemode/itemsystem/items/anexample.lua | 18 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/baits.lua | 26 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/bananaseeds.lua | 26 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/berry.lua | 49 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/grainseeds.lua | 26 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/herbs.lua | 26 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/melonseeds.lua | 26 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/orangeseeds.lua | 26 |
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) |
