Added sounds for unlocking achievements. (#77968)

## About The Pull Request
Unlocking an achievement now plays a sound. Which sound is played
depends on the associated preference of the player, found in the Sound
category of the game preferences UI.
The current options are a [glockenspiel
ping](https://freesound.org/people/FunWithSound/sounds/456965/), a
[beeps jingle](https://freesound.org/people/Eponn/sounds/619838/) and a
["tada!"
fanfare](https://freesound.org/people/plasterbrain/sounds/397355/), with
the obvious fourth option to not play a sound at all.

All sounds are from Freesound and are public domain. As such,
attributions are not required. The sounds have been also converted to
.OGG mono 44.1 Khz in accordance to the standards.

## Why It's Good For The Game
Enhancing the player feedback for unlocking an achievement with
choosable sounds.

## Changelog

🆑
sound: Unlocking an achievement now plays a sound by default. You can
change it in the Sound category of the game preferences.
/🆑
This commit is contained in:
Ghom
2023-08-29 21:10:38 +02:00
committed by GitHub
parent 6fef21b7f7
commit fed2abfc05
8 changed files with 42 additions and 0 deletions
+16
View File
@@ -50,6 +50,22 @@
/datum/preference/numeric/sound_tts_volume/create_default_value()
return maximum
/datum/preference/choiced/sound_achievement
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "sound_achievement"
savefile_identifier = PREFERENCE_PLAYER
/datum/preference/choiced/sound_achievement/init_possible_values()
return list(CHEEVO_SOUND_PING, CHEEVO_SOUND_JINGLE, CHEEVO_SOUND_TADA, CHEEVO_SOUND_OFF)
/datum/preference/choiced/sound_achievement/create_default_value()
return CHEEVO_SOUND_PING
/datum/preference/choiced/sound_achievement/apply_to_client_updated(client/client, value)
var/sound/sound_to_send = LAZYACCESS(GLOB.achievement_sounds, value)
if(sound_to_send)
SEND_SOUND(client.mob, sound_to_send)
/// Controls hearing dance machines
/datum/preference/toggle/sound_jukebox
category = PREFERENCE_CATEGORY_GAME_PREFERENCES