Skip to content

Commit

Permalink
[MIRROR] Small Social Anxiety Fixes (#1778)
Browse files Browse the repository at this point in the history
* Small Social Anxiety Fixes (#82387)

## About The Pull Request

- Speech filters from speech impairments don't apply unless they
actually change the message
- Psicodine properly stops stutter

## Changelog

:cl: Melbert
fix: Psicodine helps Socially Anxious people again (as does signing) 
fix: Speech effects such as stuttering no longer applies its TTS filter
if the resulting message doesn't actually change the message
/:cl:

* Small Social Anxiety Fixes

---------

Co-authored-by: MrMelbert <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Apr 3, 2024
1 parent 6875b7d commit 836d25b
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions code/datums/status_effects/debuffs/speech_debuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,21 @@
if(!length(phrase))
return

if(length(tts_filter) > 0)
message_args[TREAT_TTS_FILTER_ARG] += tts_filter
if(make_tts_message_original)
message_args[TREAT_TTS_MESSAGE_ARG] = message_args[TREAT_MESSAGE_ARG]

var/final_phrase = ""
var/original_char = ""

for(var/i = 1, i <= length(phrase), i += length(original_char))
original_char = phrase[i]

final_phrase += apply_speech(original_char)

if(final_phrase == phrase)
return // No change was done, whatever

if(length(tts_filter) > 0)
message_args[TREAT_TTS_FILTER_ARG] += tts_filter
if(make_tts_message_original)
message_args[TREAT_TTS_MESSAGE_ARG] = message_args[TREAT_MESSAGE_ARG]

message_args[TREAT_MESSAGE_ARG] = sanitize(final_phrase)

/**
Expand Down Expand Up @@ -100,8 +102,11 @@
remove_on_fullheal = FALSE

/datum/status_effect/speech/stutter/anxiety/handle_message(datum/source, list/message_args)
var/datum/quirk/social_anxiety/host_quirk = owner.get_quirk(/datum/quirk/social_anxiety)
stutter_prob = clamp(host_quirk?.calculate_mood_mod() * 0.5, 5, 50)
if(HAS_TRAIT(owner, TRAIT_FEARLESS) || HAS_TRAIT(owner, TRAIT_SIGN_LANG))
stutter_prob = 0
else
var/datum/quirk/social_anxiety/host_quirk = owner.get_quirk(/datum/quirk/social_anxiety)
stutter_prob = clamp(host_quirk?.calculate_mood_mod() * 0.5, 5, 50)
return ..()

/datum/status_effect/speech/stutter/derpspeech
Expand Down

0 comments on commit 836d25b

Please sign in to comment.