Lost Soul: Fixed manhack sounds playing on charge and stun

This commit is contained in:
1upD 2018-10-16 19:10:02 -04:00
parent 759328b805
commit f85c30d547
3 changed files with 32 additions and 10 deletions

View File

@ -3135,16 +3135,27 @@ void CNPC_Manhack::ShowHostile( bool hostile /*= true*/)
//TODO: Open the manhack panels or close them, depending on the state //TODO: Open the manhack panels or close them, depending on the state
m_bShowingHostile = hostile; m_bShowingHostile = hostile;
if ( hostile ) PlayAttackSound(hostile);
}
//-----------------------------------------------------------------------------
// Purpose: Play a sound before charging at the player
// Input : hostile -
//-----------------------------------------------------------------------------
void CNPC_Manhack::PlayAttackSound(bool hostile /*= true*/)
{
if (hostile)
{ {
EmitSound( "NPC_Manhack.ChargeAnnounce" ); EmitSound("NPC_Manhack.ChargeAnnounce");
} }
else else
{ {
EmitSound( "NPC_Manhack.ChargeEnd" ); EmitSound("NPC_Manhack.ChargeEnd");
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: // Purpose:
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -102,9 +102,10 @@ public:
virtual float GetHeadTurnRate( void ) { return 45.0f; } // Degrees per second virtual float GetHeadTurnRate( void ) { return 45.0f; } // Degrees per second
virtual void CheckCollisions(float flInterval); virtual void CheckCollisions(float flInterval);
virtual void GatherEnemyConditions( CBaseEntity *pEnemy ); virtual void GatherEnemyConditions( CBaseEntity *pEnemy );
virtual void PlayFlySound(void); virtual void PlayFlySound(void);
virtual void PlayAttackSound(bool bHostile);
virtual void StopLoopingSounds(void); virtual void StopLoopingSounds(void);
void Precache(void); void Precache(void);
@ -126,7 +127,7 @@ public:
void SpinBlades(float flInterval); void SpinBlades(float flInterval);
virtual void Slice( CBaseEntity *pHitEntity, float flInterval, trace_t &tr ); virtual void Slice( CBaseEntity *pHitEntity, float flInterval, trace_t &tr );
void Bump( CBaseEntity *pHitEntity, float flInterval, trace_t &tr ); void Bump( CBaseEntity *pHitEntity, float flInterval, trace_t &tr );
void Splash( const Vector &vecSplashPos ); void Splash( const Vector &vecSplashPos );
@ -170,7 +171,7 @@ public:
m_iHealth = 0; m_iHealth = 0;
} }
virtual void ShowHostile(bool hostile = true); virtual void SetEyeState(int state);
DEFINE_CUSTOM_AI; DEFINE_CUSTOM_AI;
@ -185,7 +186,6 @@ private:
void StopBurst( bool bInterruptSchedule = false ); void StopBurst( bool bInterruptSchedule = false );
void UpdatePanels( void ); void UpdatePanels( void );
void SetEyeState( int state );
@ -206,6 +206,7 @@ private:
// Are we being held by the physcannon? // Are we being held by the physcannon?
bool IsHeldByPhyscannon( ); bool IsHeldByPhyscannon( );
void ShowHostile(bool hostile = true);
void StartLoitering( const Vector &vecLoiterPosition ); void StartLoitering( const Vector &vecLoiterPosition );
void StopLoitering() { m_vecLoiterPosition = vec3_invalid; m_fTimeNextLoiterPulse = gpGlobals->curtime; } void StopLoitering() { m_vecLoiterPosition = vec3_invalid; m_fTimeNextLoiterPulse = gpGlobals->curtime; }
bool IsLoitering() { return m_vecLoiterPosition != vec3_invalid; } bool IsLoitering() { return m_vecLoiterPosition != vec3_invalid; }

View File

@ -92,7 +92,8 @@ public:
void MoveToTarget(float flInterval, const Vector &MoveTarget); void MoveToTarget(float flInterval, const Vector &MoveTarget);
void ShowHostile(bool hostile = true); void PlayAttackSound(bool hostile = true);
void SetEyeState(int state);
DECLARE_DATADESC(); DECLARE_DATADESC();
@ -493,7 +494,7 @@ void CNPC_LostSoul::CheckCollisions(float flInterval)
// Purpose: // Purpose:
// Input : hostile - // Input : hostile -
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void CNPC_LostSoul::ShowHostile(bool hostile /*= true*/) void CNPC_LostSoul::PlayAttackSound(bool hostile /*= true*/)
{ {
if (hostile) if (hostile)
{ {
@ -505,6 +506,15 @@ void CNPC_LostSoul::ShowHostile(bool hostile /*= true*/)
} }
} }
//-----------------------------------------------------------------------------
// Purpose:
// Input : state -
//-----------------------------------------------------------------------------
void CNPC_LostSoul::SetEyeState(int state)
{
// Do nothing for now
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: // Purpose:
// //