Skip to content

Commit

Permalink
Fix nemesis manhacks not initializing eye properly + Add SetNemesisMa…
Browse files Browse the repository at this point in the history
…nhack input

* Fix nemesis manhacks not initializing eye properly + Add SetNemesis input
* Change SetNemesis input to SetNemesisManhack
  • Loading branch information
Blixibon authored Nov 26, 2023
1 parent 992068b commit cba3478
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
38 changes: 32 additions & 6 deletions sp/src/game/server/hl2/npc_manhack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions sp/src/game/server/hl2/npc_manhack.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cba3478

Please sign in to comment.