From 27722e4d7a183208be39a40639f31919cbe064d5 Mon Sep 17 00:00:00 2001 From: Daylight <18598676+Daylight2@users.noreply.github.com> Date: Tue, 26 Dec 2023 21:45:50 +0200 Subject: [PATCH] Trying to talk with oxygen damage makes you whisper instead of gasp (#23425) * Basics working * The rest of the PR * formatting suggestion Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> * Renames proc * Darn merge conflicts * Rename proc again * this doesn't do anything * I swear I commited this earlier. Grammar fix. * Behold, the code compressor 9000! Co-authored-by: Gaxeer <44334376+Gaxeer@users.noreply.github.com> * Update code/modules/mob/living/carbon/human/human_say.dm Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> --------- Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Co-authored-by: Gaxeer <44334376+Gaxeer@users.noreply.github.com> Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> --- code/datums/spell.dm | 2 +- code/game/gamemodes/cult/runes.dm | 2 +- code/game/objects/items/devices/radio/radio_objects.dm | 2 +- code/modules/mob/living/carbon/human/human_say.dm | 6 +++--- code/modules/mob/living/living_say.dm | 3 +++ code/modules/mob/mob.dm | 3 +++ 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/code/datums/spell.dm b/code/datums/spell.dm index a40432406b3..eac5f40356d 100644 --- a/code/datums/spell.dm +++ b/code/datums/spell.dm @@ -198,7 +198,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) /obj/effect/proc_holder/spell/proc/invocation(mob/user) //spelling the spell out and setting it on recharge/reducing charges amount switch(invocation_type) if("shout") - if(!user.IsVocal()) + if(!user.IsVocal() || user.cannot_speak_loudly()) user.custom_emote(EMOTE_VISIBLE, "makes frantic gestures!") else if(prob(50))//Auto-mute? Fuck that noise diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 6de5b794797..25b2bd9e46c 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -193,7 +193,7 @@ structure_check() searches for nearby cultist structures required for the invoca if(L.has_status_effect(STATUS_EFFECT_SUMMONEDGHOST)) ghost_invokers++ if(invocation) - if(!L.IsVocal()) + if(!L.IsVocal() || L.cannot_speak_loudly()) L.custom_emote(EMOTE_VISIBLE, message = pick("draws arcane sigils in the air.","gestures ominously.","silently mouths out an invocation.","places their hands on the rune, activating it.")) else L.say(invocation) diff --git a/code/game/objects/items/devices/radio/radio_objects.dm b/code/game/objects/items/devices/radio/radio_objects.dm index 717c3e1e243..c93f9e19089 100644 --- a/code/game/objects/items/devices/radio/radio_objects.dm +++ b/code/game/objects/items/devices/radio/radio_objects.dm @@ -366,7 +366,7 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems) if(wires.is_cut(WIRE_RADIO_TRANSMIT)) // The device has to have all its wires and shit intact return 0 - if(!M.IsVocal()) + if(!M.IsVocal() || M.cannot_speak_loudly()) return 0 if(is_type_in_list(get_area(src), blacklisted_areas)) diff --git a/code/modules/mob/living/carbon/human/human_say.dm b/code/modules/mob/living/carbon/human/human_say.dm index 39158d342de..551689b1ec6 100644 --- a/code/modules/mob/living/carbon/human/human_say.dm +++ b/code/modules/mob/living/carbon/human/human_say.dm @@ -69,13 +69,13 @@ return FALSE if((breathes && !L) || breathes && L && (L.status & ORGAN_DEAD)) return FALSE - if(getOxyLoss() > 10 || AmountLoseBreath() >= 8 SECONDS) - emote("gasp") - return FALSE if(mind) return !mind.miming return TRUE +/mob/living/carbon/human/cannot_speak_loudly() + return getOxyLoss() > 10 || AmountLoseBreath() >= 8 SECONDS + /mob/living/carbon/human/proc/SetSpecialVoice(new_voice) if(new_voice) special_voice = new_voice diff --git a/code/modules/mob/living/living_say.dm b/code/modules/mob/living/living_say.dm index b38ef5137b3..995b0b68fe3 100644 --- a/code/modules/mob/living/living_say.dm +++ b/code/modules/mob/living/living_say.dm @@ -182,6 +182,9 @@ GLOBAL_LIST_EMPTY(channel_to_radio_key) var/list/hsp = handle_speech_problems(message_pieces, verb) verb = hsp["verb"] + if(cannot_speak_loudly()) + return whisper(message) + // Do this so it gets logged for all types of communication var/log_message = "[message_mode ? "([message_mode])" : ""] '[message]'" create_log(SAY_LOG, log_message) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 6360aadf128..c3b9c8c4442 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1326,6 +1326,9 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ /mob/proc/IsVocal() return TRUE +/mob/proc/cannot_speak_loudly() + return FALSE + /mob/proc/get_access() return list() //must return list or IGNORE_ACCESS