aboutsummaryrefslogtreecommitdiff
path: root/gamemode/npcsystem
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/npcsystem
parent61bc16dae5a1b61bcd237d9f0be36125829d95b1 (diff)
downloadartery-233e478e40d72a091f70f18dc6846066a4f52016.tar.gz
artery-233e478e40d72a091f70f18dc6846066a4f52016.tar.bz2
artery-233e478e40d72a091f70f18dc6846066a4f52016.zip
Fix all linter warnings
Diffstat (limited to 'gamemode/npcsystem')
-rw-r--r--gamemode/npcsystem/sv_zombie.lua30
1 files changed, 15 insertions, 15 deletions
diff --git a/gamemode/npcsystem/sv_zombie.lua b/gamemode/npcsystem/sv_zombie.lua
index 7f7e496..a612e92 100644
--- a/gamemode/npcsystem/sv_zombie.lua
+++ b/gamemode/npcsystem/sv_zombie.lua
@@ -1,5 +1,5 @@
local n = nrequire("sv_npcsystem.lua")
-local ncom = nrequire("sv_common.lua")
+--local ncom = nrequire("sv_common.lua")
local NPC = {}
NPC.Name = "Zombie"
NPC.Desc = "The living dead, argh!"
@@ -70,7 +70,7 @@ local doattack = function(self,ply)
self.lastattack = CurTime()
self:StartActivity(ACT_MELEE_ATTACK1)
timer.Simple(1,function() --It looks like you're hit about 1/2s after animation start
- if (not IsValid(self)) or( not IsValid(ply)) then return end --Make sure we're both still alive!
+ if (not IsValid(self)) or ( not IsValid(ply)) then return end --Make sure we're both still alive!
local sp,pp = self:GetPos(),ply:GetPos()
local cross = sp:Cross(pp)
local fppj = cross:GetNormalized():Dot(self:GetForward())
@@ -86,7 +86,7 @@ local doattack = function(self,ply)
print("tr.hit was",tr.Hit,"entity was",tr.Entity)
end
else
- print('Player was not in front, or distance too great')
+ print("Player was not in front, or distance too great")
print(fppj)
print(sp:Distance(pp))
end
@@ -95,7 +95,7 @@ end
--At least 1 check function must return greater than -1
local checkrun = function(self,ply)
- local isnearby = (1000 - ply:GetPos():Distance(self:GetPos()))/1000 --Zombies work on smell or something, idk, line of sight is hard to do cheaply
+ local isnearby = (1000 - ply:GetPos():Distance(self:GetPos())) / 1000 --Zombies work on smell or something, idk, line of sight is hard to do cheaply
--But we want attack priority to override this, so only return a max of 1
return isnearby
end
@@ -147,15 +147,15 @@ function NPC:Act(deltat)
end
--What to replace ENT:OnStuck with
-function NPC:Stuck()
- --Find out what we're stuck on
- local tr = util.TraceLine({
- start = self:GetPos() + Vector(0,0,50), --Start at about waist height
- endpos =( self:GetForward()*50) + self:GetPos() + Vector(0,0,50),
- filter = self
- })
-
-end
+-- function NPC:Stuck()
+-- --Find out what we're stuck on
+-- -- local tr = util.TraceLine({
+-- -- start = self:GetPos() + Vector(0,0,50), --Start at about waist height
+-- -- endpos =( self:GetForward() * 50) + self:GetPos() + Vector(0,0,50),
+-- -- filter = self
+-- -- })
+--
+-- 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.
@@ -163,7 +163,7 @@ function NPC:OnSpawn()
self.lastattack = CurTime()
self.lastwalk = CurTime()
end
-/*
+--[[
--If we need to do more than just reduce health on dammage
function NPC:OnDammage(ammount)
end
@@ -182,6 +182,6 @@ end
--Called when the npc is attacking anything with any attack
function NPC:OnAttack(target)
end
-*/
+--]]
n.RegisterNPC(NPC)