aboutsummaryrefslogtreecommitdiff
path: root/gamemode/npcsystem/npcs
diff options
context:
space:
mode:
authorAlexander Pickering <Alexander.Pickering@anondomain.site90.net>2016-01-02 22:24:46 -0500
committerAlexander Pickering <Alexander.Pickering@anondomain.site90.net>2016-01-02 22:24:46 -0500
commitb94ae1f187c46f1f775575daadc893a35890b6c3 (patch)
treee2701501e160ce23e96da9260fc80468e50d1630 /gamemode/npcsystem/npcs
parenta7a1e3a2d23e4aa10d874ad1b663d2116c1f62cb (diff)
downloadwintersurvival2-b94ae1f187c46f1f775575daadc893a35890b6c3.tar.gz
wintersurvival2-b94ae1f187c46f1f775575daadc893a35890b6c3.tar.bz2
wintersurvival2-b94ae1f187c46f1f775575daadc893a35890b6c3.zip
Introduced npc-determined spawn position
Diffstat (limited to 'gamemode/npcsystem/npcs')
-rw-r--r--gamemode/npcsystem/npcs/zombie.lua76
1 files changed, 0 insertions, 76 deletions
diff --git a/gamemode/npcsystem/npcs/zombie.lua b/gamemode/npcsystem/npcs/zombie.lua
index 216ca43..a725a04 100644
--- a/gamemode/npcsystem/npcs/zombie.lua
+++ b/gamemode/npcsystem/npcs/zombie.lua
@@ -108,82 +108,6 @@ function NPC:Stuck()
--If we're stuck, jump backwards
end
---What to replace ENT:RunBehaviour with
---[[
-function NPC:Behave()
- --[[
- print("Going into antlion's custom behaviour")
- while ( true ) do
- --self:PlaySequenceAndWait( "Idle" )
-
- --Main loop for ai
-
- --Update aware enemies
- local players = ents.FindByClass("Player")
- for k,v in pairs(players) do
- if(v:IsPigeon()) then continue end
- local dist = v:GetPos():Distance(self:GetPos())
- if( dist < self.Stats["AwareDist"]) then
- table.insert(self.AwareEnemies,v)
- end
- end
-
- --Find the enemy with the highest priority
- local maxpriority = -1
- local maxprioritytarget = nil
- for k,v in pairs(self.AwareEnemies) do
- local priority = self:AttackPriority(v)
- if(priority > maxpriority) then
- maxpriority = priority
- maxprioritytarget = v
- end
- end
- self.Target = maxprioritytarget
-
- --If we can't find anyone to attack, just stay idle
- if(self.Target == nil) then
- print("Couldn't find anyone to attack!")
- --Play an idle sequence
- local randanim = math.Round(math.Rand(0,#self.IdleSequences))
- self:PlaySequenceAndWait( self.IdleSequences[randanim] )
- self:StartActivity( ACT_IDLE )
- else
- --We have a target to attack!
- print("We found something to attack!")
- --Find which attack will do the most dammage
- local maxdammage = -1
- local maxdammagefunc = nil
- for k,v in pairs(self.Attacks) do
- local dammagefunc = nil
- local attackfunc = nil
- for i,j in pairs(v) do
- dammagefunc = i
- attackfunc = j
- end
- print("Using damagefunc:")
- print(dammagefunc)
- local dammage = dammagefunc(self, self.Target)
- print("dammage is ")
- print(dammage)
- if(dammage > maxdammage) then
- maxdammage = dammage
- maxdammagefunc = attackfunc
- end
- end
-
- --Do that attack
- if(maxdammagefunc) then
- maxdammagefunc(self, self.Target)
- else
- print("It looked like we could attack, but we can't!")
- end
- end
- --coroutine.yield()
- end
-
- coroutine.yield()
-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.
/*
function NPC:OnSpawn()