aboutsummaryrefslogtreecommitdiff
path: root/gamemode/shared
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-01-08 22:28:08 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2017-01-08 22:28:08 -0500
commit98e0462e4f6b13ff26af5211409352d45dd9453e (patch)
treefbff14dc9a0fffdda409d9989f2e34cd4bb265f6 /gamemode/shared
parent4879eb1d78520ce0ac9b0bb0ef5244cf65ad7c99 (diff)
downloadartery-98e0462e4f6b13ff26af5211409352d45dd9453e.tar.gz
artery-98e0462e4f6b13ff26af5211409352d45dd9453e.tar.bz2
artery-98e0462e4f6b13ff26af5211409352d45dd9453e.zip
Add a ton of icons, more work on refactoring
Diffstat (limited to 'gamemode/shared')
-rw-r--r--gamemode/shared/concommands.lua2
-rw-r--r--gamemode/shared/itemsystem/armor/balaclava.lua80
-rw-r--r--gamemode/shared/itemsystem/exampleitem.lua85
-rw-r--r--gamemode/shared/itemsystem/foodstuffs/ratmeat.lua46
-rw-r--r--gamemode/shared/itemsystem/foodstuffs/watermelon.lua55
-rw-r--r--gamemode/shared/itemsystem/item_common.lua76
-rw-r--r--gamemode/shared/itemsystem/quest/rougebadge.lua38
-rw-r--r--gamemode/shared/itemsystem/quest/rougebook.lua68
-rw-r--r--gamemode/shared/itemsystem/quest/togglechip.lua24
-rw-r--r--gamemode/shared/itemsystem/scrapgun.lua60
-rw-r--r--gamemode/shared/itemsystem/utility/flashlight.lua88
-rw-r--r--gamemode/shared/itemsystem/weapons/knuckledclaw.lua163
-rw-r--r--gamemode/shared/itemsystem/weapons/rustyaxe.lua229
-rw-r--r--gamemode/shared/itemsystem/weapons/scraphammer.lua233
-rw-r--r--gamemode/shared/itemsystem/weapons/seratedknife.lua199
-rw-r--r--gamemode/shared/itemsystem/weapons_common.lua70
-rw-r--r--gamemode/shared/loaditems.lua3
-rw-r--r--gamemode/shared/log.lua2
-rw-r--r--gamemode/shared/npcsystem/blockingdummy.lua105
-rw-r--r--gamemode/shared/npcsystem/dummy.lua95
-rw-r--r--gamemode/shared/npcsystem/rat.lua113
-rw-r--r--gamemode/shared/sh_setup.lua3
22 files changed, 8 insertions, 1829 deletions
diff --git a/gamemode/shared/concommands.lua b/gamemode/shared/concommands.lua
index b4e844a..64d9a35 100644
--- a/gamemode/shared/concommands.lua
+++ b/gamemode/shared/concommands.lua
@@ -2,7 +2,7 @@
Various console command helper functions
]]
-local fuzzel = include("fuzzel.lua")
+local fuzzel = nrequire("fuzzel.lua")
local concmd = {}
diff --git a/gamemode/shared/itemsystem/armor/balaclava.lua b/gamemode/shared/itemsystem/armor/balaclava.lua
deleted file mode 100644
index 8b4b8d2..0000000
--- a/gamemode/shared/itemsystem/armor/balaclava.lua
+++ /dev/null
@@ -1,80 +0,0 @@
---[[
- An example item
-]]
-local item = {}
-
---Required, a name, all item names must be unique
-item.Name = "Balaclava"
-
---Optional, a tooltip to display
-item.Tooltip = "Something to cover your face"
-
---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, you'll need to use the net library.
-function item.GetOptions(self)
- local options = {}
- options["test"] = function() print("You pressed test!") end
- options["toste"] = function() print("You pressed toste!") end
- options["drop"] = ART.DropItem(self)
- return options
-end
-
-function item.DoOnPanel(dimagebutton)
- dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe.png")
-end
-
-function item.DoOnEqupPanel(dimagebutton)
- print("called with panel:",panel)
- dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe_eq.png")
-end
-
---[[
-function item.Paint(self,width,height)
- --print("painting with values",self,width,height)
- draw.RoundedBox(4, 0,0,width,height,Color(0,100,0))
-end
-
-function item.PaintEquiped(self,width,height)
- --print("painting with values",self,width,height)
- draw.RoundedBox(4, 0,0,width,height,Color(0,100,0))
-end
-]]
-
---Required, the shape of this item.
-item.Shape = {
- {true,true},
- {true,true},
-}
-
---Optional, If this item can be equiped in any player slots, put them here.
-item.Equipable = "Head"
-
---Optional, if we should do something special on equip(like draw the PAC for this weapon)
-item.onEquip = function(self,who)
- print("onEquip",who)
- if CLIENT then print("onEquip client!") end
- if SERVER then
- PrintTable(pac)
- ART.ApplyPAC(who,"balaclava")
- end
-end
-
---Optional, if we should do something speical on unequip(like setting animations back to normal)
-item.onUnEquip = function(self,who)
- ART.RemovePAC(who,"balaclava")
-end
-
-print("Hello from balaclava.lua")
---Don't forget to register the item!
-ART.RegisterItem(item)
diff --git a/gamemode/shared/itemsystem/exampleitem.lua b/gamemode/shared/itemsystem/exampleitem.lua
deleted file mode 100644
index 066e107..0000000
--- a/gamemode/shared/itemsystem/exampleitem.lua
+++ /dev/null
@@ -1,85 +0,0 @@
---[[
- An example item
-]]
-local item = {}
-
---Required, a name, all item names must be unique
-item.Name = "Test item"
-
---Optional, a tooltip to display when hovered over
-item.Tooltip = "An old axe, probably good for fighting."
-
---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
-
---Optional. Something run once when this item is drawn in a backpack
-function item.DoOnPanel(dimagebutton)
- dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe.png")
-end
-
---Optional. Something run once when this item is drawn in an equiped slot
-function item.DoOnEqupPanel(dimagebutton)
- print("called with panel:",panel)
- dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe_eq.png")
-end
-
---Optional. Called continuously, use if you need the item to display different stuff at different tiems in the backpack.
-function item.Paint(self,width,height)
- draw.RoundedBox(4, 0,0,width,height,Color(0,100,0))
-end
-
---Optional. Called continuously, use if you need the item to display different stuff at different tiems when equiped.
-function item.PaintEquiped(self,width,height)
- draw.RoundedBox(4, 0,0,width,height,Color(0,100,0))
-end
-
---Required, the shape of this item in a backpack.
-item.Shape = {
- {true},
- {true},
- {true},
-}
-
---Optional, If this item can be equiped in any player slots, put them here.
-item.Equipable = "Right"
-
---Optional, what to do when the player clicks, and this item is in the slot in inventory. only works for items equipable in left and right
-item.onClick = function(self,owner)
- print("pew pew!")
-end
-
---Optional, if we should do something special on equip(like draw the PAC for this weapon). See ART.ApplyPAC in /gamemode/shared/sh_pac.lua
-item.onEquip = function(self,who)
- print("Oh boy! I'm getting used!")
-end
-
---Optional, if we should do something speical on unequip(like setting PAC back to normal). Sett ART.RemovePAC in /gamemode/shared/sh_pac.lua
-item.onUnEquip = function(self,who)
- print("Aw, I'm being stored :(")
-end
-
---Technically optional, but item will display as a rock if you don't have it. If you want to do something other than drop on dropped, remove ent.
-item.onDropped = function(self,ent)
- print("I've been dropped!(BUVVV WUB WUB WUB WUB WUB)")
-end
-
-print("Hello from exampleitem.lua")
---Don't forget to register the item!
-nrequire("item.lua").RegisterItem(item)
diff --git a/gamemode/shared/itemsystem/foodstuffs/ratmeat.lua b/gamemode/shared/itemsystem/foodstuffs/ratmeat.lua
deleted file mode 100644
index 5310fe2..0000000
--- a/gamemode/shared/itemsystem/foodstuffs/ratmeat.lua
+++ /dev/null
@@ -1,46 +0,0 @@
---[[
- An example item
-]]
-local item = {}
-
---Required, a name, all item names must be unique
-item.Name = "Rat Meat"
-
---Optional, a tooltip to display when hovered over
-item.Tooltip = "Disgusting, disease-ridden meat."
-
---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
-
---Optional. Something run once when this item is drawn in a backpack
-function item.DoOnPanel(dimagebutton)
- --dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe.png")
-end
-
---Required, the shape of this item in a backpack.
-item.Shape = {
- {true}
-}
-
-item.onDropped = function(self, ent)
- ART.ApplyPAC(ent,"ratmeat")
-end
---Don't forget to register the item!
-ART.RegisterItem(item)
diff --git a/gamemode/shared/itemsystem/foodstuffs/watermelon.lua b/gamemode/shared/itemsystem/foodstuffs/watermelon.lua
deleted file mode 100644
index 2b9f7cb..0000000
--- a/gamemode/shared/itemsystem/foodstuffs/watermelon.lua
+++ /dev/null
@@ -1,55 +0,0 @@
---[[
- 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},
-}
-
-item.onDropped = function(self, ent)
- ART.ApplyPAC(ent,"Watermelon")
-end
-
-print("Hello from exampleitem.lua")
---Don't forget to register the item!
-ART.RegisterItem(item)
diff --git a/gamemode/shared/itemsystem/item_common.lua b/gamemode/shared/itemsystem/item_common.lua
deleted file mode 100644
index b4b7cce..0000000
--- a/gamemode/shared/itemsystem/item_common.lua
+++ /dev/null
@@ -1,76 +0,0 @@
-if CLIENT then
- ART.DropItem = function(item)
- local i = item
- print("Trying to drop item, Item was ")
- PrintTable(item)
- return function()
- local data = item:Serialize()
- net.Start("dropitem")
- net.WriteString(item.Name)
- net.WriteUInt(#data,32)
- net.WriteData(data,#data)
- net.SendToServer()
- end
- end
-
-else
- util.AddNetworkString("dropitem")
-
- function gencompareto(item)
- --Two items are equal if their Serialize()s are the same.
- local tserialize = item:Serialize()
- return function(otheritem)
- local oserialize = otheritem:Serialize()
- return tserialize == oserialize
- end
- end
-
- function ART.CreateDroppedItem(itemtbl, where)
- local e = ents.Create("art_droppeditem")
- e.Model = "models/props_junk/Rock001a.mdl"
- e.Item = itemtbl
- e:SetPos(where)
- e:Spawn()
- end
-
- net.Receive("dropitem",function(len,ply)
- local itemtype = net.ReadString()
- local itemdatalen = net.ReadUInt(32)
- local itemdata = net.ReadData(itemdatalen)
- local itemtbl = ART.GetItemByName(itemtype)
- local item = itemtbl:DeSerialize(itemdata)
-
- print("I want to drop:")
- PrintTable(item)
- print("Do I have one?")
- local row,col,n = ply:HasItem(gencompareto(item))
- print("row",row,"col",col,"n",n)
- --To find out where to drop the item, go out from player's view, then down.
- local pes = ply:GetPos()+Vector(0,0,64)
- local pee = ply:GetForward()*50 + Vector(0,0,64) + ply:GetPos()
- local tr1d = {
- ["start"] = pes,
- ["endpos"] = pee,
- ["filter"] = ply,
- }
- local tr1r = util.TraceLine(tr1d)
- local fes
- if tr1r.hit then --Use where it hit and go down
- fes = tr1r.HitPos
- else --Use the spot 50 units in front of us
- fes = pee
- end
- local tr2d = {
- ["start"] = fes,
- ["endpos"] = fes + Vector(0,0,-64),
- }
- local tr2r = util.TraceLine(tr2d)
- local itempos = tr2r.HitPos
- print("Dropping item at",itempos)
- if row and col and n then
- print("DropItem is",ART.DropItem)
- ART.CreateDroppedItem(item,itempos)
- ply:RemoveItemAt(n,row,col)
- end
- end)
-end
diff --git a/gamemode/shared/itemsystem/quest/rougebadge.lua b/gamemode/shared/itemsystem/quest/rougebadge.lua
deleted file mode 100644
index dad0f71..0000000
--- a/gamemode/shared/itemsystem/quest/rougebadge.lua
+++ /dev/null
@@ -1,38 +0,0 @@
---[[
- 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/itemsystem/quest/rougebook.lua b/gamemode/shared/itemsystem/quest/rougebook.lua
deleted file mode 100644
index 4eabe06..0000000
--- a/gamemode/shared/itemsystem/quest/rougebook.lua
+++ /dev/null
@@ -1,68 +0,0 @@
---[[
- A quest item for the prayer book quest
-]]
-local item = {}
-
-item.Name = "Orders of the Silent Circle"
-
-item.Serialize = function(self)
- print("Trying to serailize!")
- return ""
-end
-
-item.DeSerialize = function(self,string)
- print("Trying to deserialize!")
- return self
-end
-
-item.Shape = {
- {true,true},
- {true,true},
-}
-
-local rougeadvice = {
- "He who refuses to trim his beard will find himself in a hairy situation.",
- "You'll get tired defending from a man in a car",
- "You'll get exhaused attacking a man in a car.",
- "Sex is not the answer, it is the question. And the answer is 'yes'.",
- "The 'Darkest Hour' is when you can't find the matches.",
- "If you eat beans before church, you will sit in your own pew.",
- "He who seeks challenges will be puzzeled.",
- "He who fishes in another man's well is likely to catch crabs.",
- "Enjoy masturbation, it's sex with someone you love.",
-}
-
-local lhint = 1
-
-function item.GetOptions(self)
- local options = {}
- options["Read"] = function()
- local readframe = vgui.Create( "DFrame" )
- readframe:SetPos( ScrW()/2 - 100, ScrH()/2 - 100)
- readframe:SetSize(200,200)
- readframe:SetTitle("Orders of the Silent Circle")
- readframe:MakePopup()
-
-
- local readpanel = vgui.Create( "DPanel", readframe )
- readpanel:SetPos( 5, 30 )
- readpanel:SetSize( 190, 170 )
- function readpanel:Paint(w,h) end
-
-
- local readtext = vgui.Create( "DLabel", readpanel )
- readtext:SetPos( 40, 40 )
- readtext:SetText(rougeadvice[lhint])
- readtext:SetDark()
- readtext:Dock(FILL)
- readtext:SetWrap(true)
- lhint = (lhint % #rougeadvice) + 1
- end
- return options
-end
-
-item.onDropped = function(self, ent)
- ART.ApplyPAC(ent,"book1")
-end
-
-ART.RegisterItem(item)
diff --git a/gamemode/shared/itemsystem/quest/togglechip.lua b/gamemode/shared/itemsystem/quest/togglechip.lua
deleted file mode 100644
index 7b8ee04..0000000
--- a/gamemode/shared/itemsystem/quest/togglechip.lua
+++ /dev/null
@@ -1,24 +0,0 @@
---[[
- A toggle chip (quest item) for subterr_generator quest
-]]
-local item = {}
-
-item.Name = "Toggle Chip"
-
-item.Serialize = function(self)
- print("Trying to serailize!")
- return ""
-end
-
-item.DeSerialize = function(self,string)
- print("Trying to deserialize!")
- return self
-end
-
-item.Shape = {
- {true,true},
- {true,true},
-}
-
-print("Hello from togglechip.lua")
-ART.RegisterItem(item)
diff --git a/gamemode/shared/itemsystem/scrapgun.lua b/gamemode/shared/itemsystem/scrapgun.lua
deleted file mode 100644
index bf21b42..0000000
--- a/gamemode/shared/itemsystem/scrapgun.lua
+++ /dev/null
@@ -1,60 +0,0 @@
---[[
- An example item
-]]
-local item = {}
-
---Required, a name, all item names must be unique
-item.Name = "Scrap gun"
-
---Optional, a tooltip to display
-item.Tooltip = "A gun made from bits of scrap"
-
---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, you'll need to use the net library.
-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.
-item.Shape = {
- {true,true},
- {true},
-}
-
---Optional, If this item can be equiped in any player slots, put them here.
-item.Equipable = "Left"
-
---Optional, what to do when the player clicks, and this item is in the slot in inventory
-item.onClick = function(self,owner)
- print("pew pew!")
-end
-
---Optional, if we should do something special on equip(like draw the PAC for this weapon)
-item.onEquip = function(self,who)
- print("onEquip",who)
- if CLIENT then print("onEquip client!") end
- if SERVER then
- PrintTable(pac)
- --local outfit = pac.luadata.ReadFile("pac3/mech.txt")
- --who:AttachPACPart(outfit)
- --print("onEquip server!")
- end
-end
-
-print("Hello from scrapgun.lua")
---Don't forget to register the item!
-ART.RegisterItem(item)
diff --git a/gamemode/shared/itemsystem/utility/flashlight.lua b/gamemode/shared/itemsystem/utility/flashlight.lua
deleted file mode 100644
index 9f2cc69..0000000
--- a/gamemode/shared/itemsystem/utility/flashlight.lua
+++ /dev/null
@@ -1,88 +0,0 @@
---[[
- An example item
-]]
-local item = {}
-
---Required, a name, all item names must be unique
-item.Name = "Flashlight"
-
---Optional, a tooltip to display when hovered over
-item.Tooltip = "An old axe, probably good for fighting."
-
---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
-
---Optional. Something run once when this item is drawn in a backpack
-function item.DoOnPanel(dimagebutton)
- dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe.png")
-end
-
---Optional. Something run once when this item is drawn in an equiped slot
-function item.DoOnEqupPanel(dimagebutton)
- print("called with panel:",panel)
- dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe_eq.png")
-end
-
---Optional. Called continuously, use if you need the item to display different stuff at different tiems in the backpack.
-function item.Paint(self,width,height)
- draw.RoundedBox(4, 0,0,width,height,Color(0,100,0))
-end
-
---Optional. Called continuously, use if you need the item to display different stuff at different tiems when equiped.
-function item.PaintEquiped(self,width,height)
- draw.RoundedBox(4, 0,0,width,height,Color(0,100,0))
-end
-
---Required, the shape of this item in a backpack.
-item.Shape = {
- {true,true},
-}
-
---Optional, If this item can be equiped in any player slots, put them here.
-item.Equipable = "Left"
-
---Optional, what to do when the player clicks, and this item is in the slot in inventory. only works for items equipable in left and right
-local lastontime = {}
-item.onClick = function(self,owner)
- if CLIENT then return end
- if lastontime[owner] then return end
- lastontime[owner] = true
- timer.Simple(5,function()
- lastontime[owner] = nil
- end)
- owner:Flashlight( not owner:FlashlightIsOn() )
-end
-
---Optional, if we should do something special on equip(like draw the PAC for this weapon). See ART.ApplyPAC in /gamemode/shared/sh_pac.lua
-item.onEquip = function(self,who)
- if CLIENT then return end
- who:AllowFlashlight(true)
-end
-
---Optional, if we should do something speical on unequip(like setting PAC back to normal). Sett ART.RemovePAC in /gamemode/shared/sh_pac.lua
-item.onUnEquip = function(self,who)
- if CLIENT then return end
- who:Flashlight(false)
- who:AllowFlashlight(false)
-end
-
-
---Don't forget to register the item!
-ART.RegisterItem(item)
diff --git a/gamemode/shared/itemsystem/weapons/knuckledclaw.lua b/gamemode/shared/itemsystem/weapons/knuckledclaw.lua
deleted file mode 100644
index 2db8117..0000000
--- a/gamemode/shared/itemsystem/weapons/knuckledclaw.lua
+++ /dev/null
@@ -1,163 +0,0 @@
---[[
- An example item
-]]
-local item = {}
-
---Required, a name, all item names must be unique
-item.Name = "Knuckled Claws"
-
---Optional, a tooltip to display
-item.Tooltip = "Bits of scrap put togeather to resembel a hammer"
-
---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, you'll need to use the net library.
-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
-
-function item.DoOnPanel(dimagebutton)
- dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe.png")
-end
-
-function item.DoOnEqupPanel(dimagebutton)
- print("called with panel:",panel)
- dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe_eq.png")
-end
-
---[[
-function item.Paint(self,width,height)
- --print("painting with values",self,width,height)
- draw.RoundedBox(4, 0,0,width,height,Color(0,100,0))
-end
-
-function item.PaintEquiped(self,width,height)
- --print("painting with values",self,width,height)
- draw.RoundedBox(4, 0,0,width,height,Color(0,100,0))
-end
-]]
-
---Required, the shape of this item.
-item.Shape = {
- {true,true},
-}
-
---Optional, If this item can be equiped in any player slots, put them here.
-item.Equipable = "Right"
-
-
-
---Optional, what to do when the player clicks, and this item is in the slot in inventory. only works for items equipable in left and right
-item.lastSwing = {}
-item.onClick = function(self,owner)
- item.lastSwing[owner] = item.lastSwing[owner] or 0
- if item.lastSwing[owner] > CurTime() then
- print("returning because item.lastSwing is " .. item.lastSwing[owner], "but Curtime is",CurTime())
- return end
- item.lastSwing[owner] = CurTime()+1.25
- local fow,rig,up = owner:GetForward(),owner:GetRight(),owner:GetUp()
- local movementtbl = {
- ["forward"] = function()
- owner:SetLuaAnimation("fist_swing_up")
- timer.Simple(1.75,function()
- owner:StopLuaAnimation("fist_swing_up")
- end)
- local hits = ART.swingarc(owner,{
- 0.5,0.57,0.65,0.73
- },{
- fow*20 + up*90,
- fow*45 + up*70,
- fow*35 + up*45,
- fow*20 + up*30,
- },function(tr)
- if tr.Entity.TakeDamage ~= nil and tr.Entity ~= owner then
- tr.Entity:TakeDamage(4, owner, owner:GetActiveWeapon())
- end
- print("Hit",tr.Entity)
- end)
- end,
- ["backward"] = function()
- owner:SetLuaAnimation("fist_swing_down")
- timer.Simple(1.75,function()
- owner:StopLuaAnimation("fist_swing_down")
- end)
- local hits = ART.swingarc(owner,{
- 0.5,0.57,0.65,0.73
- },{
- fow*15 + up*30,
- fow*35 + up*45,
- fow*25 + up*70,
- fow*15 + up*90,
- },function(tr)
- if tr.Entity.TakeDamage ~= nil and tr.Entity ~= owner then
- tr.Entity:TakeDamage(4, owner, owner:GetActiveWeapon())
- end
- print("Hit",tr.Entity)
- end)
- end,
- ["left"] = function()
- owner:SetLuaAnimation("fist_swing_left")
- timer.Simple(2,function()
- owner:StopLuaAnimation("fist_swing_left")
- end)
- local hits = ART.swingarc(owner,{
- 0.5,0.57,0.65,0.73
- },{
- rig*-30 + up*59,
- rig*-10 + fow*30 + up*55,
- rig*10 + fow*30 + up*54,
- rig*30 + up*50,
- },function(tr)
- if tr.Entity.TakeDamage ~= nil and tr.Entity ~= owner then
- tr.Entity:TakeDamage(4, owner, owner:GetActiveWeapon())
- end
- print("Hit",tr.Entity)
- end)
- end,
- ["right"] = function()
-
- end,
- }
- movementtbl[ART.playermovedir(owner)]()
-end
-
---Optional, if we should do something special on equip(like draw the PAC for this weapon)
-item.onEquip = function(self,who)
- print("onEquip",who)
- if CLIENT then print("onEquip client!") end
- if SERVER then
- PrintTable(pac)
- who:GetActiveWeapon():SetHoldType("fist")
- ART.ApplyPAC(who,"knuckledclaws")
- --local outfit = pac.luadata.ReadFile("pac3/mech.txt")
- --who:AttachPACPart(outfit)
- --print("onEquip server!")
- end
-end
-
---Optional, if we should do something speical on unequip(like setting animations back to normal)
-item.onUnEquip = function(self,who)
- who:GetActiveWeapon():SetHoldType("normal")
- ART.RemovePAC(who,"knuckledclaws")
-end
-
-item.onDropped = function(self, ent)
- ART.ApplyPAC(ent,"knuckledclaws")
-end
-
-print("Hello from scrapgun.lua")
---Don't forget to register the item!
-ART.RegisterItem(item)
diff --git a/gamemode/shared/itemsystem/weapons/rustyaxe.lua b/gamemode/shared/itemsystem/weapons/rustyaxe.lua
deleted file mode 100644
index b26597c..0000000
--- a/gamemode/shared/itemsystem/weapons/rustyaxe.lua
+++ /dev/null
@@ -1,229 +0,0 @@
---[[
- An example item
-]]
-local item = {}
-
---Required, a name, all item names must be unique
-item.Name = "Rusty Axe"
-
---Optional, a tooltip to display
-item.Tooltip = "An old axe, probably good for fighting."
-
---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, you'll need to use the net library.
-function item.GetOptions(self)
- local options = {}
- options["test"] = function() print("You pressed test!") end
- options["toste"] = function() print("You pressed toste!") end
- options["Drop"] = ART.DropItem(self)
- return options
-end
-
-function item.DoOnPanel(dimagebutton)
- dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe.png")
-end
-
-function item.DoOnEqupPanel(dimagebutton)
- print("called with panel:",panel)
- dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe_eq.png")
-end
-
---Required, the shape of this item.
-item.Shape = {
- {true,true},
- {true},
- {true},
-}
-
---Optional, If this item can be equiped in any player slots, put them here.
-item.Equipable = "Right"
-
-local swingdata = {
- ["fwd"] = {
- {0.011,Vector(-25,-3,-11)},
- {0.020,Vector(-25,-1,-3)},
- {0.031,Vector(-21,0,7)},
- {0.040,Vector(-13,-1,16)},
- {0.051,Vector(0,-5,22)},
- {0.060,Vector(17,-12,19)},
- {0.069,Vector(27,-18,11)},
- {0.077,Vector(31,-22,2)},
- {0.087,Vector(32,-26,-6)},
- {0.098,Vector(32,-28,-12)},
- {0.107,Vector(31,-29,-16)},
- {0.117,Vector(31,-29,-17)},
- {0.128,Vector(31,-29,-16)},
- {0.141,Vector(31,-29,-16)},
- },
- ["lft"] = {
- {0.009,Vector(-34,-25,3)},
- {0.021,Vector(-29,-33,3)},
- {0.031,Vector(-21,-41,2)},
- {0.042,Vector(-9,-47,0)},
- {0.053,Vector(5,-48,-2)},
- {0.064,Vector(20,-44,-6)},
- {0.075,Vector(31,-34,-10)},
- {0.086,Vector(37,-24,-15)},
- {0.095,Vector(39,-16,-17)},
- {0.106,Vector(39,-10,-19)},
- {0.116,Vector(39,-8,-20)},
- {0.126,Vector(39,-8,-19)},
- {0.134,Vector(39,-9,-19)},
- {0.146,Vector(39,-10,-18)},
- },
- ["rig"] = {
- {0.021,Vector(-2,9,11)},
- {0.031,Vector(5,10,10)},
- {0.042,Vector(12,8,9)},
- {0.053,Vector(19,4,6)},
- {0.062,Vector(26,-4,2)},
- {0.072,Vector(29,-12,-4)},
- {0.083,Vector(29,-21,-12)},
- {0.093,Vector(25,-27,-18)},
- {0.102,Vector(22,-30,-22)},
- {0.113,Vector(20,-31,-25)},
- {0.123,Vector(19,-32,-25)},
- {0.133,Vector(19,-32,-25)},
- },
-}
-
---Optional, what to do when the player clicks, and this item is in the slot in inventory. only works for items equipable in left and right
-item.lastSwing = {}
-item.onClick = function(self,owner)
- item.lastSwing[owner] = item.lastSwing[owner] or 0
- if item.lastSwing[owner] > CurTime() then
- print("returning because item.lastSwing is " .. item.lastSwing[owner], "but Curtime is",CurTime())
- return end
- item.lastSwing[owner] = CurTime()+1.33
- local fwd,rig,up = owner:GetForward(),owner:GetRight(),owner:GetUp()
- local movementtbl = {
- ["forward"] = function()
- owner:SetLuaAnimation("axe_swing_up")
- timer.Simple(2.33,function()
- owner:StopLuaAnimation("axe_swing_up")
- end)
- timer.Simple(1,function()
- ART.TraceWeapon = true
- end)
- timer.Simple(1.33,function()
- ART.TraceWeapon = false
- end)
-
- local times,pos = {},{}
- for k,v in ipairs(swingdata["fwd"]) do
- times[k] = 1 + v[1]
- pos[k] = Vector(v[2])
- pos[k]:Rotate(owner:GetAimVector():Angle())
- end
- if pos[1] == nil then return end
- local hits = ART.swingarc(owner,times,pos,function(tr)
- if not tr.Hit then return end
- if tr.Entity.Blocking ~= nil and tr.Entity.Blocking == "forward" then
- ART.ApplyEffect(owner,"weapon_blocked")
- elseif tr.Entity.TakeDamage ~= nil and tr.Entity ~= owner then
- tr.Entity:TakeDamage(5, owner, owner:GetActiveWeapon())
- end
- end)
-
- end,
- ["backward"] = function()
-
- end,
- ["left"] = function()
- owner:SetLuaAnimation("axe_swing_left")
- timer.Simple(2.33,function()
- owner:StopLuaAnimation("axe_swing_left")
- end)
- timer.Simple(1,function()
- ART.TraceWeapon = true
- end)
- timer.Simple(1.33,function()
- ART.TraceWeapon = false
- end)
-
- local times,pos = {},{}
- for k,v in ipairs(swingdata["lft"]) do
- times[k] = 1 + v[1]
- pos[k] = Vector(v[2])
- pos[k]:Rotate(owner:GetAimVector():Angle())
- end
- if pos[1] == nil then return end
- local hits = ART.swingarc(owner,times,pos,function(tr)
- if not tr.Hit then return end
- if tr.Entity.Blocking ~= nil and tr.Entity.Blocking == "left" then
- ART.ApplyEffect(owner,"weapon_blocked")
- elseif tr.Entity.TakeDamage ~= nil and tr.Entity ~= owner then
- tr.Entity:TakeDamage(5, owner, owner:GetActiveWeapon())
- end
- end)
- end,
- ["right"] = function()
- owner:SetLuaAnimation("axe_swing_right")
- timer.Simple(2.33,function()
- owner:StopLuaAnimation("axe_swing_right")
- end)
- timer.Simple(1,function()
- ART.TraceWeapon = true
- end)
- timer.Simple(1.33,function()
- ART.TraceWeapon = false
- end)
-
- local times,pos = {},{}
- for k,v in ipairs(swingdata["rig"]) do
- times[k] = 1 + v[1]
- pos[k] = Vector(v[2])
- pos[k]:Rotate(owner:GetAimVector():Angle())
- end
- if pos[1] == nil then return end
- local hits = ART.swingarc(owner,times,pos,function(tr)
- if not tr.Hit then return end
- if tr.Entity.Blocking ~= nil and tr.Entity.Blocking == "right" then
- ART.ApplyEffect(owner,"weapon_blocked")
- elseif tr.Entity.TakeDamage ~= nil and tr.Entity ~= owner then
- tr.Entity:TakeDamage(5, owner, owner:GetActiveWeapon())
- end
- end)
- end,
- }
- movementtbl[ART.playermovedir(owner)]()
-end
-
---Optional, if we should do something special on equip(like draw the PAC for this weapon)
-item.onEquip = function(self,who)
- print("onEquip",who)
- if CLIENT then print("onEquip client!") end
- if SERVER then
- PrintTable(pac)
- who:GetActiveWeapon():SetHoldType("melee")
- ART.ApplyPAC(who,"rustyaxe")
- --local outfit = pac.luadata.ReadFile("pac3/mech.txt")
- --who:AttachPACPart(outfit)
- --print("onEquip server!")
- end
-end
-
---Optional, if we should do something speical on unequip(like setting animations back to normal)
-item.onUnEquip = function(self,who)
- who:GetActiveWeapon():SetHoldType("normal")
- ART.RemovePAC(who,"rustyaxe")
-end
-
-item.onDropped = function(self, ent)
- ART.ApplyPAC(ent,"rustyaxe")
-end
-
-print("Hello from scrapgun.lua")
---Don't forget to register the item!
-ART.RegisterItem(item)
diff --git a/gamemode/shared/itemsystem/weapons/scraphammer.lua b/gamemode/shared/itemsystem/weapons/scraphammer.lua
deleted file mode 100644
index 299d4e2..0000000
--- a/gamemode/shared/itemsystem/weapons/scraphammer.lua
+++ /dev/null
@@ -1,233 +0,0 @@
---[[
- An example item
-]]
-local item = {}
-
---Required, a name, all item names must be unique
-item.Name = "Scrap Hammer"
-
---Optional, a tooltip to display
-item.Tooltip = "Bits of scrap put togeather to resembel a hammer"
-
---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, you'll need to use the net library.
-function item.GetOptions(self)
- local options = {}
- options["test"] = function() print("You pressed test!") end
- options["toste"] = function() print("You pressed toste!") end
- options["Drop"] = ART.DropItem(self)
- return options
-end
-
-function item.DoOnPanel(dimagebutton)
- dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe.png")
-end
-
-function item.DoOnEqupPanel(dimagebutton)
- print("called with panel:",panel)
- dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe_eq.png")
-end
-
---[[
-function item.Paint(self,width,height)
- --print("painting with values",self,width,height)
- draw.RoundedBox(4, 0,0,width,height,Color(0,100,0))
-end
-
-function item.PaintEquiped(self,width,height)
- --print("painting with values",self,width,height)
- draw.RoundedBox(4, 0,0,width,height,Color(0,100,0))
-end
-]]
-
---Required, the shape of this item.
-item.Shape = {
- {true,true,true},
- {false,true},
- {false,true},
-}
-
---Optional, If this item can be equiped in any player slots, put them here.
-item.Equipable = "Right"
-
-local swingdata = {
- ["fwd"] = {
- {0.007,Vector(-27,1,9)},
- {0.014,Vector(-20,3,16)},
- {0.020,Vector(-11,6,22)},
- {0.027,Vector(0,7,26)},
- {0.032,Vector(15,7,25)},
- {0.039,Vector(28,6,21)},
- {0.045,Vector(38,4,14)},
- {0.052,Vector(46,0,3)},
- {0.059,Vector(50,-3,-6)},
- {0.065,Vector(52,-6,-15)},
- {0.072,Vector(52,-8,-22)},
- {0.078,Vector(51,-10,-28)},
- {0.084,Vector(50,-11,-31)},
- {0.091,Vector(50,-11,-32)},
- {0.097,Vector(50,-11,-32)}
- },
- ["lft"] = {
- {0.007,Vector(-6,24,2)},
- {0.014,Vector(-1,26,2)},
- {0.020,Vector(5,28,1)},
- {0.027,Vector(12,28,-1)},
- {0.035,Vector(19,27,-4)},
- {0.042,Vector(27,24,-7)},
- {0.048,Vector(37,17,-13)},
- {0.055,Vector(42,12,-17)},
- {0.061,Vector(45,5,-20)},
- {0.068,Vector(48,-2,-23)},
- {0.075,Vector(49,-8,-25)},
- {0.084,Vector(49,-14,-26)},
- {0.091,Vector(49,-19,-27)},
- {0.097,Vector(48,-22,-27)},
- {0.104,Vector(48,-25,-27)},
- {0.110,Vector(48,-26,-27)},
- {0.117,Vector(48,-27,-27)},
- {0.123,Vector(48,-26,-27)},
- {0.131,Vector(48,-26,-27)}
- },
- ["rig"] = {
- {0.009,Vector(-3,25,2)},
- {0.017,Vector(3,27,1)},
- {0.025,Vector(11,28,-1)},
- {0.032,Vector(20,27,-4)},
- {0.040,Vector(28,24,-7)},
- {0.051,Vector(36,19,-12)},
- {0.059,Vector(42,11,-17)},
- {0.067,Vector(47,2,-22)},
- {0.075,Vector(49,-5,-25)},
- {0.083,Vector(49,-13,-27)},
- {0.090,Vector(49,-19,-28)},
- {0.098,Vector(48,-24,-28)},
- {0.106,Vector(48,-27,-28)},
- {0.114,Vector(48,-28,-28)},
- {0.121,Vector(48,-27,-28)},
- {0.129,Vector(48,-27,-27)}
- },
-}
-
---Optional, what to do when the player clicks, and this item is in the slot in inventory. only works for items equipable in left and right
-item.lastSwing = {}
-item.onClick = function(self,owner)
- item.lastSwing[owner] = item.lastSwing[owner] or 0
- if item.lastSwing[owner] > CurTime() then
- print("returning because item.lastSwing is " .. item.lastSwing[owner], "but Curtime is",CurTime())
- return end
- item.lastSwing[owner] = CurTime()+1.33
- local fwd,rig,up = owner:GetForward(),owner:GetRight(),owner:GetUp()
- local movementtbl = {
- ["forward"] = function()
- owner:SetLuaAnimation("hammer_swing_up")
- timer.Simple(2.33,function()
- owner:StopLuaAnimation("hammer_swing_up")
- end)
-
- local times,pos = {},{}
- for k,v in ipairs(swingdata["fwd"]) do
- times[k] = 1 + v[1]
- pos[k] = Vector(v[2])
- pos[k]:Rotate(owner:GetAimVector():Angle())
- end
- if pos[1] == nil then return end
- local hits = ART.swingarc(owner,times,pos,function(tr)
- if not tr.Hit then return end
- if tr.Entity.Blocking ~= nil and tr.Entity.Blocking == "forward" then
- ART.ApplyEffect(owner,"weapon_blocked")
- elseif tr.Entity.TakeDamage ~= nil and tr.Entity ~= owner then
- tr.Entity:TakeDamage(5, owner, owner:GetActiveWeapon())
- end
- end)
-
- end,
- ["backward"] = function()
-
- end,
- ["left"] = function()
- owner:SetLuaAnimation("hammer_swing_left")
- timer.Simple(2.33,function()
- owner:StopLuaAnimation("hammer_swing_left")
- end)
-
- local times,pos = {},{}
- for k,v in ipairs(swingdata["lft"]) do
- times[k] = 1 + v[1]
- pos[k] = Vector(v[2])
- pos[k]:Rotate(owner:GetAimVector():Angle())
- end
- if pos[1] == nil then return end
- local hits = ART.swingarc(owner,times,pos,function(tr)
- if not tr.Hit then return end
- if tr.Entity.Blocking ~= nil and tr.Entity.Blocking == "left" then
- ART.ApplyEffect(owner,"weapon_blocked")
- elseif tr.Entity.TakeDamage ~= nil and tr.Entity ~= owner then
- tr.Entity:TakeDamage(5, owner, owner:GetActiveWeapon())
- end
- end)
- end,
- ["right"] = function()
- owner:SetLuaAnimation("hammer_swing_right")
- timer.Simple(2.33,function()
- owner:StopLuaAnimation("hammer_swing_right")
- end)
-
- local times,pos = {},{}
- for k,v in ipairs(swingdata["rig"]) do
- times[k] = 1 + v[1]
- pos[k] = Vector(v[2])
- pos[k]:Rotate(owner:GetAimVector():Angle())
- end
- if pos[1] == nil then return end
- local hits = ART.swingarc(owner,times,pos,function(tr)
- if not tr.Hit then return end
- if tr.Entity.Blocking ~= nil and tr.Entity.Blocking == "right" then
- ART.ApplyEffect(owner,"weapon_blocked")
- elseif tr.Entity.TakeDamage ~= nil and tr.Entity ~= owner then
- tr.Entity:TakeDamage(5, owner, owner:GetActiveWeapon())
- end
- end)
- end,
- }
- movementtbl[ART.playermovedir(owner)]()
-end
-
---Optional, if we should do something special on equip(like draw the PAC for this weapon)
-item.onEquip = function(self,who)
- print("onEquip",who)
- if CLIENT then print("onEquip client!") end
- if SERVER then
- PrintTable(pac)
- who:GetActiveWeapon():SetHoldType("melee2")
- ART.ApplyPAC(who,"scraphammer")
- --local outfit = pac.luadata.ReadFile("pac3/mech.txt")
- --who:AttachPACPart(outfit)
- --print("onEquip server!")
- end
-end
-
---Optional, if we should do something speical on unequip(like setting animations back to normal)
-item.onUnEquip = function(self,who)
- who:GetActiveWeapon():SetHoldType("normal")
- ART.RemovePAC(who,"scraphammer")
-end
-
-item.onDropped = function(self, ent)
- ART.ApplyPAC(ent,"scraphammer")
-end
-
-print("Hello from scrapgun.lua")
---Don't forget to register the item!
-ART.RegisterItem(item)
diff --git a/gamemode/shared/itemsystem/weapons/seratedknife.lua b/gamemode/shared/itemsystem/weapons/seratedknife.lua
deleted file mode 100644
index 2daec36..0000000
--- a/gamemode/shared/itemsystem/weapons/seratedknife.lua
+++ /dev/null
@@ -1,199 +0,0 @@
---[[
- An example item
-]]
-local item = {}
-
---Required, a name, all item names must be unique
-item.Name = "Serated Knife"
-
---Optional, a tooltip to display
-item.Tooltip = "Bits of scrap put togeather to resembel a hammer"
-
---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, you'll need to use the net library.
-function item.GetOptions(self)
- local options = {}
- options["test"] = function() print("You pressed test!") end
- options["toste"] = function() print("You pressed toste!") end
- options["Drop"] = ART.DropItem(self)
- return options
-end
-
-function item.DoOnPanel(dimagebutton)
- dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe.png")
-end
-
-function item.DoOnEqupPanel(dimagebutton)
- print("called with panel:",panel)
- dimagebutton:SetImage( "weapons/rustyaxe/rustyaxe_eq.png")
-end
-
---[[
-function item.Paint(self,width,height)
- --print("painting with values",self,width,height)
- draw.RoundedBox(4, 0,0,width,height,Color(0,100,0))
-end
-
-function item.PaintEquiped(self,width,height)
- --print("painting with values",self,width,height)
- draw.RoundedBox(4, 0,0,width,height,Color(0,100,0))
-end
-]]
-
---Required, the shape of this item.
-item.Shape = {
- {true,true},
-}
-
---Optional, If this item can be equiped in any player slots, put them here.
-item.Equipable = "Right"
-
-local function attacktrace(tr,owner)
- if not tr.Hit then return end
- if tr.Entity.TakeDamage ~= nil and tr.Entity ~= owner then
- tr.Entity:TakeDamage(5, owner, owner:GetActiveWeapon())
- end
-end
-
-
---Optional, what to do when the player clicks, and this item is in the slot in inventory. only works for items equipable in left and right
-item.lastSwing = {}
-local animationtime = 1.833333
-item.onClick = function(self,owner)
- item.lastSwing[owner] = item.lastSwing[owner] or 0
- if item.lastSwing[owner] > CurTime() then
- print("returning because item.lastSwing is " .. item.lastSwing[owner], "but Curtime is",CurTime())
- return end
- item.lastSwing[owner] = CurTime()+animationtime
- local fow,rig,up = owner:GetForward(),owner:GetRight(),owner:GetUp()
- local movementtbl = {
- ["forward"] = function()
- owner:SetLuaAnimation("knife_swing_up")
- timer.Simple(animationtime,function()
- owner:StopLuaAnimation("knife_swing_up")
- end)
- local hits = ART.swingarc(owner,{
- 0.5,0.611,0.722,0.833
- },{
- fow*20 + up*90,
- fow*45 + up*70,
- fow*35 + up*45,
- fow*20 + up*30,
- },function(tr)
- if not tr.Hit then return end
- if tr.Entity.Blocking ~= nil and tr.Entity.Blocking == "forward" then
- print("Entity blocked!")
- ART.ApplyEffect(owner,"weapon_blocked")
- elseif tr.Entity.TakeDamage ~= nil and tr.Entity ~= owner then
- print("Got past blocking, it was",tr.Entity.Blocking)
- tr.Entity:TakeDamage(5, owner, owner:GetActiveWeapon())
- end
- end)
- end,
- ["backward"] = function()
- owner:SetLuaAnimation("knife_swing_down")
- timer.Simple(animationtime,function()
- owner:StopLuaAnimation("knife_swing_down")
- end)
- local hits = ART.swingarc(owner,{
- 0.5,0.611,0.722,0.833
- },{
- fow*15 + up*30,
- fow*35 + up*45,
- fow*25 + up*70,
- fow*15 + up*90,
- },function(tr)
- if not tr.Hit then return end
- if tr.Entity.Blocking ~= nil and tr.Entity.Blocking == "backward" then
- print("Entity blocked!")
- elseif tr.Entity.TakeDamage ~= nil and tr.Entity ~= owner then
- print("Got past blocking, it was",tr.Entity.Blocking)
- tr.Entity:TakeDamage(5, owner, owner:GetActiveWeapon())
- end
- end)
- end,
- ["left"] = function()
- owner:SetLuaAnimation("knife_swing_left")
- timer.Simple(animationtime,function()
- owner:StopLuaAnimation("knife_swing_left")
- end)
- local hits = ART.swingarc(owner,{
- 0.5,0.611,0.722,0.833
- },{
- rig*30 + up*59,
- rig*10 + fow*30 + up*55,
- rig*-10 + fow*30 + up*54,
- rig*-30 + up*50,
- },function(tr)
- if not tr.Hit then return end
- if tr.Entity.Blocking ~= nil and tr.Entity.Blocking == "left" then
- print("Entity blocked!")
- elseif tr.Entity.TakeDamage ~= nil and tr.Entity ~= owner then
- print("Got past blocking, it was",tr.Entity.Blocking)
- tr.Entity:TakeDamage(5, owner, owner:GetActiveWeapon())
- end
- end)
- end,
- ["right"] = function()
- owner:SetLuaAnimation("knife_swing_right")
- timer.Simple(animationtime,function()
- owner:StopLuaAnimation("knife_swing_right")
- end)
- local hits = ART.swingarc(owner,{
- 0.5,0.611,0.722,0.833
- },{
- rig*-30 + up*59,
- rig*-10 + fow*30 + up*55,
- rig*10 + fow*30 + up*54,
- rig*30 + up*50,
- },function(tr)
- if not tr.Hit then return end
- if tr.Entity.Blocking ~= nil and tr.Entity.Blocking == "right" then
- print("Entity blocked!")
- elseif tr.Entity.TakeDamage ~= nil and tr.Entity ~= owner then
- print("Got past blocking, it was",tr.Entity.Blocking)
- tr.Entity:TakeDamage(5, owner, owner:GetActiveWeapon())
- end
- end)
- end,
- }
- movementtbl[ART.playermovedir(owner)]()
-end
-
---Optional, if we should do something special on equip(like draw the PAC for this weapon)
-item.onEquip = function(self,who)
- print("onEquip",who)
- if CLIENT then print("onEquip client!") end
- if SERVER then
- PrintTable(pac)
- who:GetActiveWeapon():SetHoldType("knife")
- ART.ApplyPAC(who,"seratedknife")
- --local outfit = pac.luadata.ReadFile("pac3/mech.txt")
- --who:AttachPACPart(outfit)
- --print("onEquip server!")
- end
-end
-
---Optional, if we should do something speical on unequip(like setting animations back to normal)
-item.onUnEquip = function(self,who)
- who:GetActiveWeapon():SetHoldType("normal")
- ART.RemovePAC(who,"seratedknife")
-end
-
-item.onDropped = function(self, ent)
- ART.ApplyPAC(ent,"seratedknife")
-end
-
---Don't forget to register the item!
-ART.RegisterItem(item)
diff --git a/gamemode/shared/itemsystem/weapons_common.lua b/gamemode/shared/itemsystem/weapons_common.lua
deleted file mode 100644
index 6f553fa..0000000
--- a/gamemode/shared/itemsystem/weapons_common.lua
+++ /dev/null
@@ -1,70 +0,0 @@
-
-ART = ART or {}
-
---- Finds the direction a player is moveing.
--- @param player The player to find the move direction of
--- @return The string "forward", "backward", "right", or "left"
-function ART.playermovedir(player)
- local vel = player:GetVelocity():GetNormalized()
- vel.z = 0
- local swings = {
- {player:GetForward(),"forward"},
- {-player:GetForward(),"backward"},
- {player:GetRight(),"right"},
- {-player:GetRight(),"left"}
- }
- table.sort(swings,function(a,b)
- return vel:Dot(a[1]) > vel:Dot(b[1])
- end)
- return swings[1][2]
-end
-
-
-local positionset = {}
---- The arc swing of a weapon.
--- Finds anything that a weapon should hit in it's swing, and calls a function on it.
--- @param player The player that's swinging the weapon
--- @param tiems A table of times that the trace calculations should be done at, this table needs to be the same length as the positions table
--- @param positions The position offsets from the player that swung that should be the start/end points of the arc
--- @param onhit A function to call on any entities that were hit in the swing of the weapon.
-function ART.swingarc(player,times,positions,onhit)
- local positionpoints = {}
- table.insert(positionset,positionpoints)
- for k,v in ipairs(times) do
- timer.Simple(v,function()
- ART.TraceWeapon = true
- ART.TraceStart = CurTime()
- print("positions[k]",positions[k],"playerpos",player:GetPos(),"add",Vector(0,0,64))
- local weaponpos = positions[k] + player:GetPos() + Vector(0,0,64)
- table.insert(positionpoints,weaponpos)
- if #positionpoints > 1 then
- --print("Trace from ", positionpoints[#positionpoints-1], " to ", positionpoints[#positionpoints])
- local tr = util.TraceLine({
- start = positionpoints[#positionpoints-1],
- endpos = positionpoints[#positionpoints],
- })
- onhit(tr)
- end
- end)
- end
- timer.Simple(times[#times],function()
- print("Inserted swing, drawn positions are now:")
- PrintTable(positionset)
- ART.TraceWeapon = false
- end)
-end
-
-hook.Add( "HUDPaint", "weaponswings", function()
- cam.Start3D() -- Start the 3D function so we can draw onto the screen.
- for k,v in pairs(positionset) do
- for i = 1,#v-1 do
- render.DrawLine( v[i], v[i+1], Color(255,0,0,255), false )
- render.DrawLine( v[i], v[i]+Vector(0,0,20),Color(0,255,0,255),false)
- end
- end
- --render.SetMaterial( material ) -- Tell render what material we want, in this case the flash from the gravgun
- --render.DrawSprite( pos, 16, 16, white ) -- Draw the sprite in the middle of the map, at 16x16 in it's original colour with full alpha.
- cam.End3D()
-end )
-
-return wcommon
diff --git a/gamemode/shared/loaditems.lua b/gamemode/shared/loaditems.lua
index 7a4dd22..9975bb3 100644
--- a/gamemode/shared/loaditems.lua
+++ b/gamemode/shared/loaditems.lua
@@ -1,3 +1,5 @@
+do return end
+--[=[
--[[
This file loads in all the items
]]
@@ -56,3 +58,4 @@ concommand.Add("artery_giveitem",function(ply,cmd,args)
print("Trying to give an item:" .. args[1])
ART.GiveItem(ply,args[1])
end, concmd.AutocompleteFunction(table.GetKeys(ART.Items)), "Give an item to the specified player, or yourself if no player is specified.")
+]=]
diff --git a/gamemode/shared/log.lua b/gamemode/shared/log.lua
index 63d3e0e..1ede67f 100644
--- a/gamemode/shared/log.lua
+++ b/gamemode/shared/log.lua
@@ -3,7 +3,7 @@ local fn = nrequire("fn.lua")
local col = nrequire("colortheme.lua")
local log = {}
-log.debug = fn.curry(
+log.debug = fn.compose(
fn.curry(
MsgC,
col.console.cyan),
diff --git a/gamemode/shared/npcsystem/blockingdummy.lua b/gamemode/shared/npcsystem/blockingdummy.lua
deleted file mode 100644
index 5c6008c..0000000
--- a/gamemode/shared/npcsystem/blockingdummy.lua
+++ /dev/null
@@ -1,105 +0,0 @@
-local NPC = {}
-NPC.Name = "Blocking Training Dummy"
-NPC.Desc = "A man made of straw. His dream is to have a brain."
-NPC.Class = "Ambient" --Ambient, Agressive, Boss
-NPC.Model = "models/headcrab.mdl"
-
-NPC.Stats = {
- ["Vitality"] = 100000,
- ["Speed"] = 400,
- ["AwareDist"] = 1000,
- ["Accel"] = 100,
- ["Decel"] = 200,
- ["Step"] = 20, --Step height
- ["Hull"] = HULL_TINY
-}
-
---Some npc's like birds have diffent names for their idle sequences
-NPC.IdleSequences = {
- [0] = "lookaround",
- [1] = "Idle01",
-}
-
---Drops should be formated as [index]={["item name"], percent_drop} where percent_drop is a number from 0 to 100
-
-NPC.Drops = {
-}
-
---Attacks should be formated as [i]={function attackpriority() = function doattack()}
-local checknothing = function(self,ply)
- return 1
-end
-
-local donothing = function(self,ply)
-end
-NPC.Attacks = {
- [1] = {--run away from the player
- [checknothing] = donothing
- },
-}
-
---A function that takes a position and returns true if this is an acceptable place to spawn
-function NPC:SpawnLocations(pos)
- return true
-end
-
---The entity that is this npc's current target, if it has one. Nil otherwise
-NPC.Target = nil
-
---All enemies that this NPC is aware of
-NPC.AwareEnemies = {}
---Attack priority is a fucntion that takes a player, and returns an int describing it's prority to attack (higher = more important) NPC will always attack the player with the highest priority
-function NPC:AttackPriority(ply)
- if not ply then return 0 end
- return 1
-end
-
---What to replace the ENT:RunBehaviour with
-function NPC:Act(deltat)
-end
-
---What to replace ENT:OnStuck with
-function NPC:Stuck()
-
-end
-
-local blockorder = {
- "forward",
- "right",
- "backward",
- "left"
-}
-local cursor = 0
-function NPC:OnDammage(ammount)
- self.Blocking = blockorder[cursor + 1]
- cursor = (cursor + 1) % 4
- print("A dummy was hit for",ammount:GetDamage(),"!")
- print("Blocking is now",self.Blocking)
-end
-
---These are just here to tell the editors/develoeprs what functions are available.. dont un-comment them out, as this could affect all the items.
-/*
-function NPC:OnSpawn()
-end
-
---If we need to do more than just reduce health on dammage
-function NPC:OnDammage(ammount)
-end
-
---If we need to do more than just drop items on death
-function NPC:OnDeath()
-end
-
---A particular spell was cast on this npc by player
-function NPC:OnSpell(spell, player)
-end
-
-function NPC:OnFindEnemy(enemy)
-end
-
---Called when the npc is attacking anything with any attack
-function NPC:OnAttack(target)
-end
-*/
-
-ART.RegisterNPC(NPC)
diff --git a/gamemode/shared/npcsystem/dummy.lua b/gamemode/shared/npcsystem/dummy.lua
deleted file mode 100644
index 869dd0e..0000000
--- a/gamemode/shared/npcsystem/dummy.lua
+++ /dev/null
@@ -1,95 +0,0 @@
-local NPC = {}
-NPC.Name = "Training Dummy"
-NPC.Desc = "A man made of straw. His dream is to have a brain."
-NPC.Class = "Ambient" --Ambient, Agressive, Boss
-NPC.Model = "models/headcrab.mdl"
-
-NPC.Stats = {
- ["Vitality"] = 100000,
- ["Speed"] = 400,
- ["AwareDist"] = 1000,
- ["Accel"] = 100,
- ["Decel"] = 200,
- ["Step"] = 20, --Step height
- ["Hull"] = HULL_TINY
-}
-
---Some npc's like birds have diffent names for their idle sequences
-NPC.IdleSequences = {
- [0] = "lookaround",
- [1] = "Idle01",
-}
-
---Drops should be formated as [index]={["item name"], percent_drop} where percent_drop is a number from 0 to 100
-
-NPC.Drops = {
-}
-
---Attacks should be formated as [i]={function attackpriority() = function doattack()}
-local checknothing = function(self,ply)
- return 1
-end
-
-local donothing = function(self,ply)
-end
-NPC.Attacks = {
- [1] = {--run away from the player
- [checknothing] = donothing
- },
-}
-
---A function that takes a position and returns true if this is an acceptable place to spawn
-function NPC:SpawnLocations(pos)
- return true
-end
-
---The entity that is this npc's current target, if it has one. Nil otherwise
-NPC.Target = nil
-
---All enemies that this NPC is aware of
-NPC.AwareEnemies = {}
---Attack priority is a fucntion that takes a player, and returns an int describing it's prority to attack (higher = more important) NPC will always attack the player with the highest priority
-function NPC:AttackPriority(ply)
- if not ply then return 0 end
- return 1
-end
-
---What to replace the ENT:RunBehaviour with
-function NPC:Act(deltat)
-end
-
---What to replace ENT:OnStuck with
-function NPC:Stuck()
-
-end
-
-function NPC:OnDammage(ammount)
- print("A dummy was hit for",ammount:GetDamage(),"!")
-end
-
---These are just here to tell the editors/develoeprs what functions are available.. dont un-comment them out, as this could affect all the items.
-/*
-function NPC:OnSpawn()
-end
-
---If we need to do more than just reduce health on dammage
-function NPC:OnDammage(ammount)
-end
-
---If we need to do more than just drop items on death
-function NPC:OnDeath()
-end
-
---A particular spell was cast on this npc by player
-function NPC:OnSpell(spell, player)
-end
-
-function NPC:OnFindEnemy(enemy)
-end
-
---Called when the npc is attacking anything with any attack
-function NPC:OnAttack(target)
-end
-*/
-
-ART.RegisterNPC(NPC)
diff --git a/gamemode/shared/npcsystem/rat.lua b/gamemode/shared/npcsystem/rat.lua
deleted file mode 100644
index ab96883..0000000
--- a/gamemode/shared/npcsystem/rat.lua
+++ /dev/null
@@ -1,113 +0,0 @@
-local NPC = {}
-NPC.Name = "Rat"
-NPC.Desc = "A nasty little guy"
-NPC.Class = "Ambient" --Ambient, Agressive, Boss
-NPC.Model = "models/headcrab.mdl"
-
-NPC.Stats = {
- ["Vitality"] = 10,
- ["Speed"] = 400,
- ["AwareDist"] = 1000,
- ["Accel"] = 100,
- ["Decel"] = 200,
- ["Step"] = 20, --Step height
- ["Hull"] = HULL_TINY
-}
-
---Some npc's like birds have diffent names for their idle sequences
-NPC.IdleSequences = {
- [0] = "lookaround",
- [1] = "Idle01",
-}
-
---Drops should be formated as [index]={["item name"], percent_drop} where percent_drop is a number from 0 to 100
-
-NPC.Drops = {
- [0] = {"Rat Meat",100},--Rats will drop at least 1 meat, and have a 50% chance of dropping 2
- [1] = {"Rat Meat",50},
-}
-
---Attacks should be formated as [i]={function attackpriority() = function doattack()}
-local checkrun = function(self,ply)
- --If we're aware of any enemies, run away!
- return 1
-end
-local runseq
-local dorun = function(self,ply)
- if runseq == nil then
- runseq = self:LookupSequence("Run1")
- end
- self:StartActivity(ACT_FLY)
- self:SetSequence( runseq )
- if(not ply or not ply:IsValid()) then return end
- --Find a position in roughly the oposite direction of the player
- local tpos = self:GetPos()
- local ppos = ply:GetPos()
- local direction = Vector(tpos.x - ppos.x, tpos.y - ppos.y, tpos.z - ppos.z)
- direction:Normalize()
- local addition = direction * 1000
- local topos = self:GetPos() + addition
- --print("I want to go to ", topos)
- self.TargetPos = topos
-end
-NPC.Attacks = {
- [1] = {--run away from the player
- [checkrun] = dorun
- },
-}
-
---A function that takes a position and returns true if this is an acceptable place to spawn
-function NPC:SpawnLocations(pos)
- return true
-end
-
---The entity that is this npc's current target, if it has one. Nil otherwise
-NPC.Target = nil
-
---All enemies that this NPC is aware of
-NPC.AwareEnemies = {}
---Attack priority is a fucntion that takes a player, and returns an int describing it's prority to attack (higher = more important) NPC will always attack the player with the highest priority
-function NPC:AttackPriority(ply)
- if not ply then return 0 end
- local plypos = ply:GetPos()
- local mypos = self:GetPos()
- if not plypos then return 0 end
- local dist = plypos:Distance(mypos)
- return self.Stats["AwareDist"] - dist
-end
-
---What to replace the ENT:RunBehaviour with
-function NPC:Act(deltat)
-end
-
---What to replace ENT:OnStuck with
-function NPC:Stuck()
-
-end
-
---These are just here to tell the editors/develoeprs what functions are available.. dont un-comment them out, as this could affect all the items.
-/*
-function NPC:OnSpawn()
-end
-
---If we need to do more than just reduce health on dammage
-function NPC:OnDammage(ammount)
-end
-
---If we need to do more than just drop items on death
-function NPC:OnDeath()
-end
-
---A particular spell was cast on this npc by player
-function NPC:OnSpell(spell, player)
-end
-
-function NPC:OnFindEnemy(enemy)
-end
-
---Called when the npc is attacking anything with any attack
-function NPC:OnAttack(target)
-end
-*/
-
-ART.RegisterNPC(NPC)
diff --git a/gamemode/shared/sh_setup.lua b/gamemode/shared/sh_setup.lua
index 9c44e57..66fb829 100644
--- a/gamemode/shared/sh_setup.lua
+++ b/gamemode/shared/sh_setup.lua
@@ -1,3 +1,5 @@
+do return end
+--[=[
--[[
Some values that need to be setup by the server owner
]]
@@ -163,3 +165,4 @@ if CLIENT then
scrollpanel:AddItem(savebutton)
end)
end
+]=]