Randomize tts voice more appropriately (#95272)

## About The Pull Request

Adds a helper `SStts.random_tts_voice(gender)` which attempts to pick an
appropriate voice for the passed gender

## Why It's Good For The Game

Randomization into a completely wrong voice kinda ruins it

## Changelog

🆑 Melbert
qol: TTS voice is more appropriately randomized to gender
qol: Getting randomized through means such as mulligan toxin randomizes
TTS voices
/🆑

---------

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
This commit is contained in:
MrMelbert
2026-04-04 07:25:12 -05:00
committed by GitHub
parent 0f450388cb
commit b79743df08
8 changed files with 27 additions and 11 deletions
+2 -1
View File
@@ -3,6 +3,7 @@
savefile_identifier = PREFERENCE_CHARACTER
savefile_key = "tts_voice"
category = PREFERENCE_CATEGORY_NON_CONTEXTUAL
priority = PREFERENCE_PRIORITY_BODY_TYPE
should_update_preview = FALSE
/datum/preference/choiced/voice/is_accessible(datum/preferences/preferences)
@@ -23,7 +24,7 @@
/datum/preference/choiced/voice/apply_to_human(mob/living/carbon/human/target, value)
if(SStts.tts_enabled && !(value in SStts.available_speakers))
value = pick(SStts.available_speakers) // As a failsafe
value = SStts.random_tts_voice(target.gender) // As a failsafe
target.voice = value
/datum/preference/numeric/tts_voice_pitch