mirror of
https://github.com/ENSL/NS.git
synced 2024-11-22 12:41:33 +00:00
alien sound changes
- fps independant idle and primal scream sounds - slightly reduced the max volume of alien movement sounds
This commit is contained in:
parent
1f3940091a
commit
0f1365b785
1 changed files with 6 additions and 6 deletions
|
@ -9463,11 +9463,11 @@ void AvHPlayer::UpdateAmbientSounds()
|
||||||
int theBaseSpeed, theMaxSpeed;
|
int theBaseSpeed, theMaxSpeed;
|
||||||
this->GetSpeeds(theBaseSpeed, theMaxSpeed);
|
this->GetSpeeds(theBaseSpeed, theMaxSpeed);
|
||||||
|
|
||||||
float theAlienSoundFreq = 0.3f;
|
float theAlienSoundFreq = 0.3f * gpGlobals->frametime;
|
||||||
float theChanceOfPlayingSound = gpGlobals->frametime*theAlienSoundFreq*(theVelocity/((float)theMaxSpeed));
|
float theChanceOfPlayingSound = theAlienSoundFreq*(theVelocity/((float)theMaxSpeed));
|
||||||
if(RANDOM_FLOAT(0, 1) < theChanceOfPlayingSound)
|
if(RANDOM_FLOAT(0, 1) < theChanceOfPlayingSound)
|
||||||
{
|
{
|
||||||
float theVolume = RANDOM_FLOAT(.5, 1.0)*theSilenceVolumeFactor;
|
float theVolume = RANDOM_FLOAT(0.5f, 0.95f /*.5, 1.0*/)*theSilenceVolumeFactor;
|
||||||
if(theVolume > 0.01f)
|
if(theVolume > 0.01f)
|
||||||
{
|
{
|
||||||
this->PlayRandomRoleSound(kPlayerLevelMoveSoundList, CHAN_VOICE, theVolume);
|
this->PlayRandomRoleSound(kPlayerLevelMoveSoundList, CHAN_VOICE, theVolume);
|
||||||
|
@ -9481,7 +9481,7 @@ void AvHPlayer::UpdateAmbientSounds()
|
||||||
float theSilenceVolumeFactor = this->GetAlienAdjustedEventVolume();
|
float theSilenceVolumeFactor = this->GetAlienAdjustedEventVolume();
|
||||||
|
|
||||||
// If player is part of primal scream, scream defiance!
|
// If player is part of primal scream, scream defiance!
|
||||||
if(RANDOM_FLOAT(0, 1) < .02f && theSilenceVolumeFactor > 0.0)
|
if(RANDOM_FLOAT(0, 1) < (2.0f * gpGlobals->frametime) && theSilenceVolumeFactor > 0.0)
|
||||||
{
|
{
|
||||||
EMIT_SOUND(this->edict(), CHAN_VOICE, kPrimalScreamResponseSound, theSilenceVolumeFactor, ATTN_NORM);
|
EMIT_SOUND(this->edict(), CHAN_VOICE, kPrimalScreamResponseSound, theSilenceVolumeFactor, ATTN_NORM);
|
||||||
}
|
}
|
||||||
|
@ -9491,7 +9491,7 @@ void AvHPlayer::UpdateAmbientSounds()
|
||||||
bool theIsGestating = (this->GetUser3() == AVH_USER3_ALIEN_EMBRYO);
|
bool theIsGestating = (this->GetUser3() == AVH_USER3_ALIEN_EMBRYO);
|
||||||
|
|
||||||
// if idle, check chance for playing idle sound
|
// if idle, check chance for playing idle sound
|
||||||
float theBaseChance = 0.0005f;
|
float theBaseChance = 0.05f * gpGlobals->frametime;
|
||||||
if(theIsGestating)
|
if(theIsGestating)
|
||||||
{
|
{
|
||||||
theBaseChance *= 10;
|
theBaseChance *= 10;
|
||||||
|
@ -9499,7 +9499,7 @@ void AvHPlayer::UpdateAmbientSounds()
|
||||||
|
|
||||||
if(RANDOM_FLOAT(0, 1) < theBaseChance)
|
if(RANDOM_FLOAT(0, 1) < theBaseChance)
|
||||||
{
|
{
|
||||||
float theVolume = RANDOM_FLOAT(.2, .4)*theSilenceVolumeFactor;
|
float theVolume = RANDOM_FLOAT(0.2f, 0.4f)*theSilenceVolumeFactor;
|
||||||
if(theVolume > 0.01f)
|
if(theVolume > 0.01f)
|
||||||
{
|
{
|
||||||
if(theIsGestating)
|
if(theIsGestating)
|
||||||
|
|
Loading…
Reference in a new issue