From 0812ceb64b2a20cf72519cdd0cb3ad5298814b50 Mon Sep 17 00:00:00 2001 From: Aylong Date: Thu, 18 Jan 2024 15:12:57 +0200 Subject: [PATCH 1/3] Megaphone fix --- modular_ss220/text_to_speech/_tts.dme | 1 + .../text_to_speech/code/tts_megaphone.dm | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 modular_ss220/text_to_speech/code/tts_megaphone.dm diff --git a/modular_ss220/text_to_speech/_tts.dme b/modular_ss220/text_to_speech/_tts.dme index 4facec666490..15376354e8cd 100644 --- a/modular_ss220/text_to_speech/_tts.dme +++ b/modular_ss220/text_to_speech/_tts.dme @@ -13,6 +13,7 @@ #include "code/tts_provider.dm" #include "code/tts_seed.dm" #include "code/tts_subsystem.dm" +#include "code/tts_megaphone.dm" #include "code/base_seeds/mobs/_base.dm" #include "code/base_seeds/mobs/alien.dm" diff --git a/modular_ss220/text_to_speech/code/tts_megaphone.dm b/modular_ss220/text_to_speech/code/tts_megaphone.dm new file mode 100644 index 000000000000..5edcecec7124 --- /dev/null +++ b/modular_ss220/text_to_speech/code/tts_megaphone.dm @@ -0,0 +1,19 @@ +/obj/item/megaphone/say_msg(mob/living/user, message) + if(HAS_TRAIT(src, TRAIT_CMAGGED)) + playsound(src, "sound/items/bikehorn.ogg", 50, TRUE) + else + playsound(src, "sound/items/megaphone.ogg", 100, FALSE, 5) + + audible_message("[user.GetVoice()] [user.GetAltName()] broadcasts, \"[message]\"", hearing_distance = 14) + log_say("(MEGAPHONE) [message]", user) + user.create_log(SAY_LOG, "(megaphone) '[message]'") + for(var/obj/O in view(14, get_turf(src))) + O.hear_talk(user, message_to_multilingual("[message]")) + + for(var/mob/M in get_mobs_in_view(7, src)) + if((M.client?.prefs.toggles2 & PREFTOGGLE_2_RUNECHAT) && M.can_hear()) + M.create_chat_message(user, message, FALSE, "big") + var/effect = SOUND_EFFECT_MEGAPHONE + if(isrobot(user)) + effect = SOUND_EFFECT_MEGAPHONE_ROBOT + INVOKE_ASYNC(GLOBAL_PROC, /proc/tts_cast, user, M, message, user.tts_seed, FALSE, effect) From 72861156ecaab0f55812e88282de84ecd804fdb4 Mon Sep 17 00:00:00 2001 From: Aylong Date: Thu, 18 Jan 2024 15:17:35 +0200 Subject: [PATCH 2/3] MODULARITY --- modular_ss220/text_to_speech/code/tts_megaphone.dm | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/modular_ss220/text_to_speech/code/tts_megaphone.dm b/modular_ss220/text_to_speech/code/tts_megaphone.dm index 5edcecec7124..a673a671136b 100644 --- a/modular_ss220/text_to_speech/code/tts_megaphone.dm +++ b/modular_ss220/text_to_speech/code/tts_megaphone.dm @@ -1,18 +1,6 @@ /obj/item/megaphone/say_msg(mob/living/user, message) - if(HAS_TRAIT(src, TRAIT_CMAGGED)) - playsound(src, "sound/items/bikehorn.ogg", 50, TRUE) - else - playsound(src, "sound/items/megaphone.ogg", 100, FALSE, 5) - - audible_message("[user.GetVoice()] [user.GetAltName()] broadcasts, \"[message]\"", hearing_distance = 14) - log_say("(MEGAPHONE) [message]", user) - user.create_log(SAY_LOG, "(megaphone) '[message]'") - for(var/obj/O in view(14, get_turf(src))) - O.hear_talk(user, message_to_multilingual("[message]")) - + . = ..() for(var/mob/M in get_mobs_in_view(7, src)) - if((M.client?.prefs.toggles2 & PREFTOGGLE_2_RUNECHAT) && M.can_hear()) - M.create_chat_message(user, message, FALSE, "big") var/effect = SOUND_EFFECT_MEGAPHONE if(isrobot(user)) effect = SOUND_EFFECT_MEGAPHONE_ROBOT From 96b661c5ca110be4dd71fa555482ea8ab15ee71b Mon Sep 17 00:00:00 2001 From: Aylong Date: Thu, 18 Jan 2024 15:27:28 +0200 Subject: [PATCH 3/3] Radius 14 --- modular_ss220/text_to_speech/code/tts_megaphone.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modular_ss220/text_to_speech/code/tts_megaphone.dm b/modular_ss220/text_to_speech/code/tts_megaphone.dm index a673a671136b..f714b9643f06 100644 --- a/modular_ss220/text_to_speech/code/tts_megaphone.dm +++ b/modular_ss220/text_to_speech/code/tts_megaphone.dm @@ -1,6 +1,6 @@ /obj/item/megaphone/say_msg(mob/living/user, message) . = ..() - for(var/mob/M in get_mobs_in_view(7, src)) + for(var/mob/M in get_mobs_in_view(14, src)) var/effect = SOUND_EFFECT_MEGAPHONE if(isrobot(user)) effect = SOUND_EFFECT_MEGAPHONE_ROBOT