aboutsummaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/weapons/knuckledclaw.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2017-08-24 20:32:34 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2017-08-24 20:32:34 -0400
commit233e478e40d72a091f70f18dc6846066a4f52016 (patch)
treecf34be714088889731736c81bd44e198c792625a /gamemode/itemsystem/weapons/knuckledclaw.lua
parent61bc16dae5a1b61bcd237d9f0be36125829d95b1 (diff)
downloadartery-233e478e40d72a091f70f18dc6846066a4f52016.tar.gz
artery-233e478e40d72a091f70f18dc6846066a4f52016.tar.bz2
artery-233e478e40d72a091f70f18dc6846066a4f52016.zip
Fix all linter warnings
Diffstat (limited to 'gamemode/itemsystem/weapons/knuckledclaw.lua')
-rw-r--r--gamemode/itemsystem/weapons/knuckledclaw.lua328
1 files changed, 164 insertions, 164 deletions
diff --git a/gamemode/itemsystem/weapons/knuckledclaw.lua b/gamemode/itemsystem/weapons/knuckledclaw.lua
index c738f2e..1c2b8f6 100644
--- a/gamemode/itemsystem/weapons/knuckledclaw.lua
+++ b/gamemode/itemsystem/weapons/knuckledclaw.lua
@@ -1,164 +1,164 @@
---[[
- An example item
-]]
-do return end
-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.DoOnEquipPanel(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!
-nrequire("item.lua").RegisterItem(item)
+-- --[[
+-- An example item
+-- ]]
+-- do return end
+-- 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.DoOnEquipPanel(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!
+-- nrequire("item.lua").RegisterItem(item)