Skip to content

Commit

Permalink
New sound channels for Suit Energy Regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
sabianroberts committed Dec 15, 2023
1 parent bb9c62a commit f1ad09d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions binary/common/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,13 @@
#define CHAN_NETWORKVOICE_BASE 7 // voice data coming across the network
#define CHAN_NETWORKVOICE_END 500 // network voice data reserves slots (CHAN_NETWORKVOICE_BASE through CHAN_NETWORKVOICE_END).
#define CHAN_BOT 501 // channel used for bot chatter.
#define CHAN_WEP1 8
#define CHAN_WEP2 9
#define CHAN_WEP3 10
#define CHAN_WEP4 11
#define CHAN_SHIELD1 12
#define CHAN_SHIELD2 13
#define CHAN_SHIELD3 14

// attenuation values
#define ATTN_NONE 0
Expand Down
10 changes: 5 additions & 5 deletions binary/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4666,19 +4666,19 @@ void CBasePlayer :: UpdateClientData( void )
{
m_flNextSuitRegenTime = 0.0f;
m_fRegenOn = false;
STOP_SOUND(ENT(pev), CHAN_STATIC, "items/suitcharge_no_lp.wav");
EMIT_SOUND(ENT(pev), CHAN_ITEM, "buttons/bell1.wav", 0.85, ATTN_NORM);
STOP_SOUND(ENT(pev), CHAN_SHIELD2, "items/suitcharge_no_lp.wav");
EMIT_SOUND(ENT(pev), CHAN_SHIELD1, "buttons/bell1.wav", 0.85, ATTN_NORM);
}
else if (!m_fRegenOn) // when shield starts recharging
{
m_fRegenOn = true;
EMIT_SOUND(ENT(pev), CHAN_ITEM, "items/suitchargeok1.wav", 0.85, ATTN_NORM);
EMIT_SOUND(ENT(pev), CHAN_SHIELD1, "items/suitchargeok1.wav", 0.85, ATTN_NORM);
}
else // as it's recharging
{
STOP_SOUND(ENT(pev), CHAN_STATIC, "items/suitcharge_no_lp.wav");
STOP_SOUND(ENT(pev), CHAN_SHIELD2, "items/suitcharge_no_lp.wav");
// too loud
EMIT_SOUND(ENT(pev), CHAN_STATIC, "items/suitcharge_no_lp.wav", 0.25, ATTN_NORM);
EMIT_SOUND(ENT(pev), CHAN_SHIELD2, "items/suitcharge_no_lp.wav", 0.25, ATTN_NORM);
}

m_flNextSuitRegenTime = gpGlobals->time + sv_aura_regeneration_wait.value;
Expand Down

0 comments on commit f1ad09d

Please sign in to comment.