aboutsummaryrefslogtreecommitdiff
path: root/gamemode/shared
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-10-24 12:12:19 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-10-24 12:12:19 -0400
commit74c7a160da34897ebdf18aaff02b8c9b65809949 (patch)
treedb2a084d02f4acc3d7c99ec20e573101e448aef6 /gamemode/shared
parentd7f44fc24da959658b597e64d842661aa41f6515 (diff)
downloadartery-74c7a160da34897ebdf18aaff02b8c9b65809949.tar.gz
artery-74c7a160da34897ebdf18aaff02b8c9b65809949.tar.bz2
artery-74c7a160da34897ebdf18aaff02b8c9b65809949.zip
Various other updates and bugfixes
Diffstat (limited to 'gamemode/shared')
-rw-r--r--gamemode/shared/animations/move_evade.lua75
-rw-r--r--gamemode/shared/inventory.lua2
-rw-r--r--gamemode/shared/itemcommon/common_inventory.lua4
-rw-r--r--gamemode/shared/itemsystem/armor/balaclava.lua2
-rw-r--r--gamemode/shared/itemsystem/foodstuffs/watermelon.lua51
-rw-r--r--gamemode/shared/itemsystem/quest/rougebadge.lua38
-rw-r--r--gamemode/shared/sh_buff.lua31
7 files changed, 165 insertions, 38 deletions
diff --git a/gamemode/shared/animations/move_evade.lua b/gamemode/shared/animations/move_evade.lua
new file mode 100644
index 0000000..a5595aa
--- /dev/null
+++ b/gamemode/shared/animations/move_evade.lua
@@ -0,0 +1,75 @@
+RegisterLuaAnimation('evade_left', {
+ FrameData = {
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_L_Calf'] = {
+ },
+ ['ValveBiped.Bip01_L_Thigh'] = {
+ },
+ ['ValveBiped.Bip01_R_Thigh'] = {
+ },
+ ['ValveBiped.Bip01_Pelvis'] = {
+ }
+ },
+ FrameRate = 1
+ },
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_L_Calf'] = {
+ RU = -44.9346,
+ RR = -4.9288,
+ RF = 5.1193
+ },
+ ['ValveBiped.Bip01_L_Thigh'] = {
+ RU = 49.7508,
+ RR = 11.8895,
+ RF = 74.14
+ },
+ ['ValveBiped.Bip01_R_Thigh'] = {
+ RU = 6.3191,
+ RR = 12.8315,
+ RF = -4.8611
+ },
+ ['ValveBiped.Bip01_Pelvis'] = {
+ }
+ },
+ FrameRate = 4
+ },
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_L_Calf'] = {
+ RU = -44.9346,
+ RR = -4.9288,
+ RF = 5.1193
+ },
+ ['ValveBiped.Bip01_L_Thigh'] = {
+ RU = 49.7508,
+ RR = 11.8895,
+ RF = 74.14
+ },
+ ['ValveBiped.Bip01_Pelvis'] = {
+ },
+ ['ValveBiped.Bip01_R_Thigh'] = {
+ RU = 6.3191,
+ RR = 12.8315,
+ RF = -4.8611
+ }
+ },
+ FrameRate = 4
+ },
+ {
+ BoneInfo = {
+ ['ValveBiped.Bip01_L_Calf'] = {
+ },
+ ['ValveBiped.Bip01_L_Thigh'] = {
+ },
+ ['ValveBiped.Bip01_Pelvis'] = {
+ },
+ ['ValveBiped.Bip01_R_Thigh'] = {
+ }
+ },
+ FrameRate = 2
+ }
+ },
+ Type = TYPE_STANCE
+})
diff --git a/gamemode/shared/inventory.lua b/gamemode/shared/inventory.lua
index 382ebd5..f83bb77 100644
--- a/gamemode/shared/inventory.lua
+++ b/gamemode/shared/inventory.lua
@@ -97,7 +97,7 @@ end
-- @return n The backpack number the item was found in.
function pmeta:HasItem(nameorcomparitor)
local comparitor
- if type(param) == "String" then
+ if type(nameorcomparitor) == "string" then
comparitor = function(t) return t.Name == nameorcomparitor end
else
comparitor = nameorcomparitor
diff --git a/gamemode/shared/itemcommon/common_inventory.lua b/gamemode/shared/itemcommon/common_inventory.lua
deleted file mode 100644
index f541ecc..0000000
--- a/gamemode/shared/itemcommon/common_inventory.lua
+++ /dev/null
@@ -1,4 +0,0 @@
---[[
- Stores some common functions related to items
-]]
-local common = {}
diff --git a/gamemode/shared/itemsystem/armor/balaclava.lua b/gamemode/shared/itemsystem/armor/balaclava.lua
index 177fa93..d77da61 100644
--- a/gamemode/shared/itemsystem/armor/balaclava.lua
+++ b/gamemode/shared/itemsystem/armor/balaclava.lua
@@ -77,5 +77,3 @@ end
print("Hello from balaclava.lua")
--Don't forget to register the item!
ART.RegisterItem(item)
-print("After registering balaclava, items are:")
-PrintTable(ART.Items)
diff --git a/gamemode/shared/itemsystem/foodstuffs/watermelon.lua b/gamemode/shared/itemsystem/foodstuffs/watermelon.lua
new file mode 100644
index 0000000..76c0398
--- /dev/null
+++ b/gamemode/shared/itemsystem/foodstuffs/watermelon.lua
@@ -0,0 +1,51 @@
+--[[
+ An example item
+]]
+local item = {}
+
+--Required, a name, all item names must be unique
+item.Name = "Watermelon"
+
+--Optional, a tooltip to display when hovered over
+item.Tooltip = "Where do they grow these in an apocolyptic wasteland???"
+
+--Required Returns the data needed to rebuild this item, should only contain the minimum data nessessary since this gets sent over the network
+item.Serialize = function(self)
+ print("Trying to serailize!")
+ return ""
+end
+
+--Required, Rebuilds the item from data created in Serialize, if the item is different from the "main" copy of the item, it should retun a tabl.Copy(self), with the appropriate fields set.
+item.DeSerialize = function(self,string)
+ print("Trying to deserialize!")
+ return self
+end
+if SERVER then
+ util.AddNetworkString("eat_watermelon")
+ net.Receive("eat_watermelon", function(len,ply)
+ local row,col,bp = ply:HasItem("Watermelon")
+ if row and col and bp then
+ ply:RemoveItemAt(bp,row,col)
+ end
+ end)
+end
+--Optional, when the player clicks this item, a menu will show up, if the menu item is clicked, the function is ran. This is all run client side, so if you want it to do something server side, you'll need to use the net library. Remember that items are in the shared domain, so you can define what it does in the same file!
+function item.GetOptions(self)
+ local options = {}
+ options["eat"] = function()
+ net.Start("eat_watermelon")
+ net.SendToServer()
+ end
+ return options
+end
+
+--Required, the shape of this item in a backpack.
+item.Shape = {
+ {true,true,true},
+ {true,true,true},
+ {true,true,true},
+}
+
+print("Hello from exampleitem.lua")
+--Don't forget to register the item!
+ART.RegisterItem(item)
diff --git a/gamemode/shared/itemsystem/quest/rougebadge.lua b/gamemode/shared/itemsystem/quest/rougebadge.lua
new file mode 100644
index 0000000..dad0f71
--- /dev/null
+++ b/gamemode/shared/itemsystem/quest/rougebadge.lua
@@ -0,0 +1,38 @@
+--[[
+ An example item
+]]
+local item = {}
+
+--Required, a name, all item names must be unique
+item.Name = "Rouge Newbie Badge"
+
+--Optional, a tooltip to display when hovered over
+item.Tooltip = "A tiny peice of metal, kinda looks like a dagger."
+
+--Required Returns the data needed to rebuild this item, should only contain the minimum data nessessary since this gets sent over the network
+item.Serialize = function(self)
+ print("Trying to serailize!")
+ return ""
+end
+
+--Required, Rebuilds the item from data created in Serialize, if the item is different from the "main" copy of the item, it should retun a tabl.Copy(self), with the appropriate fields set.
+item.DeSerialize = function(self,string)
+ print("Trying to deserialize!")
+ return self
+end
+
+--Optional, when the player clicks this item, a menu will show up, if the menu item is clicked, the function is ran. This is all run client side, so if you want it to do something server side, you'll need to use the net library. Remember that items are in the shared domain, so you can define what it does in the same file!
+function item.GetOptions(self)
+ local options = {}
+ options["test"] = function() print("You pressed test!") end
+ options["toste"] = function() print("You pressed toste!") end
+ return options
+end
+
+--Required, the shape of this item in a backpack.
+item.Shape = {
+ {true}
+}
+
+
+ART.RegisterItem(item)
diff --git a/gamemode/shared/sh_buff.lua b/gamemode/shared/sh_buff.lua
deleted file mode 100644
index ac46df9..0000000
--- a/gamemode/shared/sh_buff.lua
+++ /dev/null
@@ -1,31 +0,0 @@
---This was probably a mistake
-do return end
-
-local pmeta = FindMetaTable("Player")
-
-pmeta.buffs = {}
-local buffid = 0
-function pmeta:ApplyBuff(buff)
- if self.buffs[buff.type] == nil then
- self.buffs[buff.type] = {}
- end
- local id = buffid
- buffid = buffid + 1
- self.buffs[buff.type][id] = buff
- self.buffs[id] = buff.type
- return id
-end
-
-function pmeta:RemoveBuff(buffid)
- local bufftype = self.buffs[buffid]
- self.buffs[buff.type][buffid] = nil
- self.buffs[buffid] = nil
-end
-
-hook.Add("EntityTakeDamage","arterybuffs",function(ent,info)
-
-end)
-
---[[
- Add buff types here I guess
-]]