Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7950c43

Browse files
authored
Merge pull request Interkarma#2403 from petchema/classic-death-sound-option
Classic player death sound option
2 parents 266c131 + 96f9a23 commit 7950c43

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Assets/Scripts/Game/PlayerDeath.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class PlayerDeath : MonoBehaviour
2828

2929
const float fallSpeed = 2.5f;
3030

31+
public const SoundClips classicPlayerDeathSound = SoundClips.WoodElfMalePain1;
3132
public float FadeDuration = 2f;
3233
public float TimeBeforeReset = 3;
3334

@@ -160,9 +161,13 @@ private void PlayerEntity_OnDeath(DaggerfallEntity entity)
160161
currentCameraHeight = startCameraHeight;
161162
DaggerfallUI.Instance.FadeBehaviour.FadeHUDToBlack(FadeDuration);
162163

163-
// There are 3 pain-like sounds for each race/gender. The third one, used here, sounds like
164-
// it may have been meant for when the player dies.
165-
SoundClips sound = GetRaceGenderPain3Sound(playerEntity.Race, playerEntity.Gender);
164+
SoundClips sound = classicPlayerDeathSound;
165+
if (DaggerfallUnity.Settings.CombatVoices)
166+
{
167+
// There are 3 pain-like sounds for each race/gender. The third one, used here, sounds like
168+
// it may have been meant for when the player dies.
169+
sound = GetRaceGenderPain3Sound(playerEntity.Race, playerEntity.Gender);
170+
}
166171

167172
if (DaggerfallUI.Instance.DaggerfallAudioSource)
168173
DaggerfallUI.Instance.DaggerfallAudioSource.PlayOneShot(sound, 0);

0 commit comments

Comments
 (0)