diff options
Diffstat (limited to 'gamemode/npcsystem/sv_zombie.lua')
| -rw-r--r-- | gamemode/npcsystem/sv_zombie.lua | 30 |
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) |
