new jumpland sound system, showweapon cvar, smooth weapon sway

This commit is contained in:
2022-04-23 22:09:00 +03:00
parent eba26ee7fe
commit 5a834d269c
35 changed files with 156 additions and 215 deletions

View File

@@ -960,7 +960,9 @@ namespace Game
{
// Avoid overlapping with recent landing sound
if (Time.GameTime - lastLanded > 0.3)
AudioManager.PlaySound("jumpland", Actor, 0, rootActor.Position, 1f /*, new Vector2(0.7f, 1.3f)*/);
{
PlayJumpLandSound(false, false);
}
}
return true;
@@ -969,7 +971,20 @@ namespace Game
private void OnLanded(Vector3 landingVelocity, bool hardLanding)
{
if (!predicting)
AudioManager.PlaySound("jumpland", Actor, 1, rootActor.Position, hardLanding ? 1.0f : 1.0f/*, new Vector2(0.7f, 1.3f)*/);
PlayJumpLandSound(true, hardLanding);
}
private void PlayJumpLandSound(bool landing, bool hardLanding)
{
if (!landing)
lastLanded = -1; // Reset so double jumps have double sounds
float volume = 0.8f;
Vector2 pitchRange = new Vector2(0.9f, 1.05f);
Vector2 secondStepDelayRange = new Vector2(0.031f, 0.067f);
AudioManager.PlaySound("jumpland", Actor, 0, AudioFlags.None, rootActor.Position, volume , pitchRange);
AudioManager.PlaySoundDelayed(secondStepDelayRange, "jumpland", Actor, 0, rootActor.Position, volume, pitchRange);
}
private static void ApplyFriction(ref Vector3 velocity)