Skip to content

Commit

Permalink
Add Pain and Die soundscripts for female assassins
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeSlave committed Jan 7, 2025
1 parent e7e3cc7 commit 71c2080
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions dlls/hassassin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class CHAssassin : public CFollowingMonster
void PlayUnUseSentence();
void DeathSound( void );
void IdleSound( void );
void PainSound( void );
void OnDying();
CUSTOM_SCHEDULES

Expand All @@ -112,11 +113,16 @@ class CHAssassin : public CFollowingMonster
int m_iFrustration;
float m_nextWalkFootstep;

float m_flNextPainTime;

int m_iShell;

static const NamedSoundScript shotSoundScript;
static const NamedSoundScript cloakSoundScript;
static const NamedSoundScript footstepSoundScript;

static const NamedSoundScript painSoundScript;
static const NamedSoundScript dieSoundScript;
};

LINK_ENTITY_TO_CLASS( monster_human_assassin, CHAssassin )
Expand All @@ -135,6 +141,7 @@ TYPEDESCRIPTION CHAssassin::m_SaveData[] =

DEFINE_FIELD( CHAssassin, m_iTargetRanderamt, FIELD_INTEGER ),
DEFINE_FIELD( CHAssassin, m_iFrustration, FIELD_INTEGER ),
DEFINE_FIELD( CHAssassin, m_flNextPainTime, FIELD_TIME ),
};

IMPLEMENT_SAVERESTORE( CHAssassin, CFollowingMonster )
Expand Down Expand Up @@ -163,6 +170,18 @@ const NamedSoundScript CHAssassin::cloakSoundScript = {
"HAssassin.Cloak"
};

const NamedSoundScript CHAssassin::painSoundScript = {
CHAN_VOICE,
{},
"HAssassin.Pain"
};

const NamedSoundScript CHAssassin::dieSoundScript = {
CHAN_VOICE,
{},
"HAssassin.Die"
};

void CHAssassin::PlayUseSentence()
{
SENTENCEG_PlayRndSz( ENT( pev ), "HA_OK", 0.6, ATTN_NORM, 0, 90 );
Expand All @@ -178,6 +197,7 @@ void CHAssassin::PlayUnUseSentence()
//=========================================================
void CHAssassin::DeathSound( void )
{
EmitSoundScript(dieSoundScript);
}

//=========================================================
Expand All @@ -187,6 +207,15 @@ void CHAssassin::IdleSound( void )
{
}

void CHAssassin::PainSound( void )
{
if( gpGlobals->time > m_flNextPainTime )
{
EmitSoundScript(painSoundScript);
m_flNextPainTime = gpGlobals->time + 1;
}
}

void CHAssassin::OnDying()
{
#if FEATURE_HASSSASSIN_DROP_AMMO || FEATURE_MONSTERS_DROP_HANDGRENADES
Expand Down Expand Up @@ -426,6 +455,9 @@ void CHAssassin::Precache()
RegisterAndPrecacheSoundScript(footstepSoundScript);
RegisterAndPrecacheSoundScript(cloakSoundScript);

RegisterAndPrecacheSoundScript(painSoundScript);
RegisterAndPrecacheSoundScript(dieSoundScript);

m_iShell = PRECACHE_MODEL( "models/shell.mdl" );// brass shell
}

Expand Down

0 comments on commit 71c2080

Please sign in to comment.