aboutsummaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/weapons/rustyaxe.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-05-07 13:47:40 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2017-05-07 13:47:40 -0400
commit9e0537b0aa417e88a6a61238484ddcef74080ae0 (patch)
treee2bd590ec3de41d384aa5f6206b14e1a73647846 /gamemode/itemsystem/weapons/rustyaxe.lua
parent191ba416c8b611ea4901cead138789a357c56134 (diff)
downloadartery-9e0537b0aa417e88a6a61238484ddcef74080ae0.tar.gz
artery-9e0537b0aa417e88a6a61238484ddcef74080ae0.tar.bz2
artery-9e0537b0aa417e88a6a61238484ddcef74080ae0.zip
Added tons of stuff
Diffstat (limited to 'gamemode/itemsystem/weapons/rustyaxe.lua')
-rw-r--r--gamemode/itemsystem/weapons/rustyaxe.lua31
1 files changed, 29 insertions, 2 deletions
diff --git a/gamemode/itemsystem/weapons/rustyaxe.lua b/gamemode/itemsystem/weapons/rustyaxe.lua
index 00547c8..4f613de 100644
--- a/gamemode/itemsystem/weapons/rustyaxe.lua
+++ b/gamemode/itemsystem/weapons/rustyaxe.lua
@@ -1,15 +1,17 @@
--[[
An axe that you can swing around!
]]
-local pac
+local pac,swi
if SERVER then
pac = nrequire("core/pac/sv_pac.lua")
+ swi = nrequire("core/combat/sv_weaponswing.lua")
end
local reg = nrequire("core/inventory/item.lua")
local com = nrequire("core/inventory/common/weapons.lua")
local itm = nrequire("core/inventory/common/items.lua")
+
local item = {}
--Required, a name, all item names must be unique
@@ -56,6 +58,29 @@ item.Shape = {
--Optional, If this item can be equiped in any player slots, put them here.
item.Equipable = "Right Hand"
+item.attacks = {
+ ["forward"] = {
+ time = 2.33,
+ anim = "axe_swing_up",
+ },
+ ["left"] = {
+ time = 2.33,
+ anim = "axe_swing_left",
+ },
+ ["left"] = {
+ time = 2.33,
+ anim = "axe_swing_right",
+ },
+}
+
+--The path garrysmod/data/artery/pacs/<pacname>.txt must be a pac file
+item.pacname = "rustyaxe"
+
+if SERVER then
+ --Before makeSwingable is called, an item needs a .Name field and a .attacks field and a .pacname field
+ swi.makeSwingable(item)
+end
+--[[
local swingdata = {
["fwd"] = {
{0.011,Vector(-25,-3,-11)},
@@ -212,7 +237,9 @@ item.onClick = function(self,owner)
print("At time of doing playermovedir, com is", com)
movementtbl[com.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)
@@ -234,7 +261,7 @@ item.onUnEquip = function(self,who)
who:GetActiveWeapon():SetHoldType("normal")
if SERVER then pac.RemovePac(who,"rustyaxe") end
end
-
+]]
item.onDropped = function(self, ent)
if SERVER then pac.ApplyPac(ent,"rustyaxe") end
end