From cba34785b4e60e068459296dbe05565ee35cb828 Mon Sep 17 00:00:00 2001 From: Blixibon Date: Sun, 26 Nov 2023 15:20:19 -0600 Subject: [PATCH] Fix nemesis manhacks not initializing eye properly + Add SetNemesisManhack input * Fix nemesis manhacks not initializing eye properly + Add SetNemesis input * Change SetNemesis input to SetNemesisManhack --- sp/src/game/server/hl2/npc_manhack.cpp | 38 ++++++++++++++++++++++---- sp/src/game/server/hl2/npc_manhack.h | 8 ++++++ 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/sp/src/game/server/hl2/npc_manhack.cpp b/sp/src/game/server/hl2/npc_manhack.cpp index 2e5df4200c2..c6786b6d0e3 100644 --- a/sp/src/game/server/hl2/npc_manhack.cpp +++ b/sp/src/game/server/hl2/npc_manhack.cpp @@ -208,6 +208,10 @@ BEGIN_DATADESC( CNPC_Manhack ) DEFINE_INPUTFUNC( FIELD_VOID, "DisableSprites", InputDisableSprites ), #endif +#ifdef EZ2 + DEFINE_INPUTFUNC( FIELD_BOOLEAN, "SetNemesisManhack", InputSetNemesisManhack ), +#endif + DEFINE_ENTITYFUNC( CrashTouch ), DEFINE_BASENPCINTERACTABLE_DATADESC(), @@ -2614,9 +2618,20 @@ EyeGlow_t * CNPC_Manhack::GetEyeGlowData(int index) } else { - eyeGlow->red = 255; - eyeGlow->green = 0; - eyeGlow->blue = 0; +#ifdef EZ2 + if (m_bNemesis) + { + eyeGlow->red = 0; + eyeGlow->green = 255; + eyeGlow->blue = 255; + } + else +#endif + { + eyeGlow->red = 255; + eyeGlow->green = 0; + eyeGlow->blue = 0; + } } eyeGlow->renderMode = kRenderTransAdd; eyeGlow->scale = 0.25f; @@ -2639,9 +2654,20 @@ EyeGlow_t * CNPC_Manhack::GetEyeGlowData(int index) } else { - eyeGlow->red = 255; - eyeGlow->green = 0; - eyeGlow->blue = 0; +#ifdef EZ2 + if (m_bNemesis) + { + eyeGlow->red = 0; + eyeGlow->green = 255; + eyeGlow->blue = 255; + } + else +#endif + { + eyeGlow->red = 255; + eyeGlow->green = 0; + eyeGlow->blue = 0; + } } eyeGlow->renderMode = kRenderTransAdd; eyeGlow->scale = 0.25f; diff --git a/sp/src/game/server/hl2/npc_manhack.h b/sp/src/game/server/hl2/npc_manhack.h index b45a7308065..f1379f613e0 100644 --- a/sp/src/game/server/hl2/npc_manhack.h +++ b/sp/src/game/server/hl2/npc_manhack.h @@ -205,6 +205,14 @@ DECLARE_SERVERCLASS(); #ifdef EZ2 void TurnIntoNemesis() { m_bNemesis = true; } + + void InputSetNemesisManhack( inputdata_t &inputdata ) + { + // Turn the sprites off and on again so their colors will change. + KillSprites(0.0f); + m_bNemesis = inputdata.value.Bool(); + StartEye(); + } #endif DEFINE_CUSTOM_AI;