Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions sp/src/game/server/ez2/ez2_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2066,6 +2066,30 @@ void CEZ2_Player::Event_DisplacerPistolRelease( CBaseCombatWeapon *pWeapon, CBas
}
}

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CEZ2_Player::LostEnemySound( CBaseEntity *pEnemy )
{
AI_CriteriaSet modifiers;
ModifyOrAppendEnemyCriteria( modifiers, pEnemy );

modifiers.AppendCriteria( "lastseenenemy", gpGlobals->curtime - GetNPCComponent()->GetEnemies()->LastTimeSeen( pEnemy ) );

SpeakIfAllowed( TLK_LOSTENEMY, modifiers );
}

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CEZ2_Player::FoundEnemySound( CBaseEntity *pEnemy )
{
AI_CriteriaSet modifiers;
ModifyOrAppendEnemyCriteria( modifiers, pEnemy );

SpeakIfAllowed( TLK_REFINDENEMY, modifiers );
}

//-----------------------------------------------------------------------------
// Purpose: called when a game event is fired
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -2914,6 +2938,20 @@ bool CAI_PlayerNPCDummy::UpdateEnemyMemory( CBaseEntity *pEnemy, const Vector &p
return false;
}

//-----------------------------------------------------------------------------
void CAI_PlayerNPCDummy::LostEnemySound( CBaseEntity *pEnemy )
{
if (GetOuter())
GetOuter()->LostEnemySound( pEnemy );
}

//-----------------------------------------------------------------------------
void CAI_PlayerNPCDummy::FoundEnemySound( CBaseEntity *pEnemy )
{
if (GetOuter())
GetOuter()->FoundEnemySound( pEnemy );
}

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions sp/src/game/server/ez2/ez2_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ class CEZ2_Player : public CAI_ExpresserHost<CHL2_Player>, public CGameEventList
void Event_DisplacerPistolDisplace( CBaseCombatWeapon *pWeapon, CBaseEntity *pVictimEntity );
void Event_DisplacerPistolRelease( CBaseCombatWeapon *pWeapon, CBaseEntity *pReleaseEntity, CBaseEntity *pVictimEntity );

void LostEnemySound( CBaseEntity *pEnemy );
void FoundEnemySound( CBaseEntity *pEnemy );

void FireGameEvent( IGameEvent *event );

void InputFinishBonusChallenge( inputdata_t &inputdata );
Expand Down Expand Up @@ -346,6 +349,9 @@ class CAI_PlayerNPCDummy : public CAI_SensingDummy<CAI_BaseNPC>

bool UpdateEnemyMemory( CBaseEntity *pEnemy, const Vector &position, CBaseEntity *pInformer = NULL );

void LostEnemySound( CBaseEntity *pEnemy );
void FoundEnemySound( CBaseEntity *pEnemy );

void DrawDebugGeometryOverlays( void );

// Special handling for info_remarkable
Expand Down
Loading