From 45a9714ea61a3db54e693308c925fe0dbcfb44fd Mon Sep 17 00:00:00 2001 From: cypress Date: Tue, 21 Nov 2023 12:28:34 -0500 Subject: [PATCH] SERVER: Hellhounds stalk their prey --- source/server/ai/dog_core.qc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/source/server/ai/dog_core.qc b/source/server/ai/dog_core.qc index a1f19aa..523f8cc 100644 --- a/source/server/ai/dog_core.qc +++ b/source/server/ai/dog_core.qc @@ -121,18 +121,25 @@ void() Dog_Walk_Setup = dog_runanim(); }; -// decide our walktype based on player distance void() Dog_Think = { - if(vlen(self.enemy.origin - self.origin) < 200) - self.walktype = 2; - else + // Hellhounds begin to run whenever their target is in their line of sight. + // So perform a tracemove and see if it hits it + if (self.ads_release == 0) { + float result = tracemove(self.origin, VEC_HULL_MIN, VEC_HULL_MAX, self.enemy.origin, TRUE, self); + self.ads_release = result; + } + + // Stalk... + if (self.ads_release == 0) self.walktype = 1; + // Charge... + else + self.walktype = 2; } float dogCount; - void(entity ent) Dog_Death_Cleanup = { // Already dead if(ent.aistatus == "0") {