From 4fbb9bc60246562c7c6e4f38c4c1c11a2bba5904 Mon Sep 17 00:00:00 2001 From: Blixibon Date: Thu, 11 Nov 2021 19:05:09 -0600 Subject: [PATCH] Added basic support for vortigaunts using the grenade AI from CNPC_PlayerCompanion --- sp/src/game/server/hl2/npc_vortigaunt_episodic.cpp | 10 +++++++++- sp/src/game/server/hl2/npc_vortigaunt_episodic.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sp/src/game/server/hl2/npc_vortigaunt_episodic.cpp b/sp/src/game/server/hl2/npc_vortigaunt_episodic.cpp index 839c18d9..218da1a5 100644 --- a/sp/src/game/server/hl2/npc_vortigaunt_episodic.cpp +++ b/sp/src/game/server/hl2/npc_vortigaunt_episodic.cpp @@ -1070,9 +1070,17 @@ Activity CNPC_Vortigaunt::NPC_TranslateActivity( Activity eNewActivity ) if ( GetReadinessLevel() >= AIRL_STIMULATED ) return ACT_IDLE_STIMULATED; } - + if ( eNewActivity == ACT_RANGE_ATTACK2 ) + { +#ifdef MAPBASE + // If we're capable of using grenades, use ACT_COMBINE_THROW_GRENADE + if (IsGrenadeCapable()) + return ACT_COMBINE_THROW_GRENADE; + else +#endif return (Activity) ACT_VORTIGAUNT_DISPEL; + } return BaseClass::NPC_TranslateActivity( eNewActivity ); } diff --git a/sp/src/game/server/hl2/npc_vortigaunt_episodic.h b/sp/src/game/server/hl2/npc_vortigaunt_episodic.h index 5c281d59..91e6a3c6 100644 --- a/sp/src/game/server/hl2/npc_vortigaunt_episodic.h +++ b/sp/src/game/server/hl2/npc_vortigaunt_episodic.h @@ -141,6 +141,8 @@ public: #ifdef MAPBASE // Use the vortigaunts' default subtitle color (188,241,174) bool GetGameTextSpeechParams( hudtextparms_t ¶ms ) { params.r1 = 188; params.g1 = 241; params.b1 = 174; return BaseClass::GetGameTextSpeechParams( params ); } + + const char* GetGrenadeAttachment() { return "rightclaw"; } #endif private: