Skip to content

Commit

Permalink
Merge pull request mapbase-source#5 from 1upD/maplabs
Browse files Browse the repository at this point in the history
Manhack changes required for npc_lost_soul
  • Loading branch information
Sir-Tokialot authored Oct 16, 2020
2 parents 17d1a04 + 1cab694 commit 88e8719
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 12 deletions.
28 changes: 24 additions & 4 deletions sp/src/game/server/hl2/npc_manhack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ int CNPC_Manhack::OnTakeDamage_Alive( const CTakeDamageInfo &info )
m_vForceVelocity = vecBestDir * info.GetDamage() * 0.5f;
m_flBladeSpeed = 10.0;

EmitSound( "NPC_Manhack.Bat" );
PlayDamagedSound();

// tdInfo.SetDamage( 1.0 );

Expand Down Expand Up @@ -3177,16 +3177,36 @@ void CNPC_Manhack::ShowHostile( bool hostile /*= true*/)
//TODO: Open the manhack panels or close them, depending on the state
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
{
EmitSound( "NPC_Manhack.ChargeEnd" );
EmitSound("NPC_Manhack.ChargeEnd");
}
}


//-----------------------------------------------------------------------------
// Purpose: Play a sound before charging at the player
//-----------------------------------------------------------------------------
void CNPC_Manhack::PlayDamagedSound(void)
{
EmitSound("NPC_Manhack.Bat");
}



//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
Expand Down
19 changes: 11 additions & 8 deletions sp/src/game/server/hl2/npc_manhack.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ DECLARE_SERVERCLASS();

virtual float GetHeadTurnRate( void ) { return 45.0f; } // Degrees per second

void CheckCollisions(float flInterval);
virtual void CheckCollisions(float flInterval);
virtual void GatherEnemyConditions( CBaseEntity *pEnemy );
void PlayFlySound(void);
virtual void PlayFlySound(void);
virtual void PlayAttackSound(bool bHostile);
virtual void PlayDamagedSound(void);
virtual void StopLoopingSounds(void);

void Precache(void);
Expand All @@ -113,9 +115,9 @@ DECLARE_SERVERCLASS();
void Activate();
void StartTask( const Task_t *pTask );

void BladesInit();
void SoundInit( void );
void StartEye( void );
virtual void BladesInit();
virtual void SoundInit( void );
virtual void StartEye( void );

bool HandleInteraction(int interactionType, void* data, CBaseCombatCharacter* sourceEnt);

Expand All @@ -126,7 +128,7 @@ DECLARE_SERVERCLASS();

void SpinBlades(float flInterval);

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 Splash( const Vector &vecSplashPos );

Expand Down Expand Up @@ -177,6 +179,7 @@ DECLARE_SERVERCLASS();
m_iHealth = 0;
}

virtual void SetEyeState(int state);

DEFINE_CUSTOM_AI;

Expand All @@ -191,9 +194,8 @@ DECLARE_SERVERCLASS();
void StopBurst( bool bInterruptSchedule = false );

void UpdatePanels( void );
void SetEyeState( int state );

void ShowHostile( bool hostile = true );


bool IsFlyingActivity( Activity baseAct );

Expand All @@ -212,6 +214,7 @@ DECLARE_SERVERCLASS();
// Are we being held by the physcannon?
bool IsHeldByPhyscannon( );

void ShowHostile(bool hostile = true);
void StartLoitering( const Vector &vecLoiterPosition );
void StopLoitering() { m_vecLoiterPosition = vec3_invalid; m_fTimeNextLoiterPulse = gpGlobals->curtime; }
bool IsLoitering() { return m_vecLoiterPosition != vec3_invalid; }
Expand Down

0 comments on commit 88e8719

Please sign in to comment.