diff options
Diffstat (limited to 'gamemode/itemsystem')
| -rw-r--r-- | gamemode/itemsystem/weapons/rustyaxe.lua | 31 |
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 |
