From a1859baa1e8ec974be1fee72ca9aa60d9824d003 Mon Sep 17 00:00:00 2001 From: larentoun <31931237+larentoun@users.noreply.github.com> Date: Fri, 19 Apr 2024 19:31:15 +0300 Subject: [PATCH] autohiss cyrillic (#136) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## About The Pull Request Модульная поддержка автохиса ## Changelog :cl: add: Добавлен автохисс для мух и ящуров /:cl: --- modular_bandastation/autohiss/_autohiss.dm | 4 ++ modular_bandastation/autohiss/_autohiss.dme | 3 ++ .../autohiss/code/autohiss.dm | 41 +++++++++++++++++++ modular_bandastation/modular_bandastation.dme | 1 + 4 files changed, 49 insertions(+) create mode 100644 modular_bandastation/autohiss/_autohiss.dm create mode 100644 modular_bandastation/autohiss/_autohiss.dme create mode 100644 modular_bandastation/autohiss/code/autohiss.dm diff --git a/modular_bandastation/autohiss/_autohiss.dm b/modular_bandastation/autohiss/_autohiss.dm new file mode 100644 index 0000000000000..e4ce14c2b2389 --- /dev/null +++ b/modular_bandastation/autohiss/_autohiss.dm @@ -0,0 +1,4 @@ +/datum/modpack/autohiss + name = "Обновленный Autohiss" + desc = "Замена авто-шипения и подобного в речи" + author = "furior" diff --git a/modular_bandastation/autohiss/_autohiss.dme b/modular_bandastation/autohiss/_autohiss.dme new file mode 100644 index 0000000000000..74587c83a2df9 --- /dev/null +++ b/modular_bandastation/autohiss/_autohiss.dme @@ -0,0 +1,3 @@ +#include "_autohiss.dm" + +#include "code/autohiss.dm" diff --git a/modular_bandastation/autohiss/code/autohiss.dm b/modular_bandastation/autohiss/code/autohiss.dm new file mode 100644 index 0000000000000..2d2eb567ac46d --- /dev/null +++ b/modular_bandastation/autohiss/code/autohiss.dm @@ -0,0 +1,41 @@ +// TODO: Prefs for autohiss? + +/obj/item/organ/internal/tongue/rat/modify_speech(datum/source, list/speech_args) + . = ..() + var/message = lowertext(speech_args[SPEECH_MESSAGE]) + if(message == "привет" || message == "привет.") + speech_args[SPEECH_MESSAGE] = "Сыррретствую вас!" + if(message == "привет?") + speech_args[SPEECH_MESSAGE] = "Мм... сыррретствую вас?" + +/obj/item/organ/internal/tongue/fly/modify_speech(datum/source, list/speech_args) + . = ..() + var/static/regex/fly_buzz = new("з+", "g") + var/static/regex/fly_buZZ = new("З+", "g") + var/message = speech_args[SPEECH_MESSAGE] + if(message[1] != "*") + message = fly_buzz.Replace(message, "ззз") + message = fly_buZZ.Replace(message, "ЗЗЗ") + message = replacetext(message, "с", "з") + message = replacetext(message, "С", "З") + speech_args[SPEECH_MESSAGE] = message + +/obj/item/organ/internal/tongue/lizard/modify_speech(datum/source, list/speech_args) + . = ..() + var/static/regex/lizard_hiss = new("с+", "g") + var/static/regex/lizard_hiSS = new("С+", "g") + var/static/regex/lizard_che = new("ч+", "g") + var/static/regex/lizard_cHE = new("Ч+", "g") + var/message = speech_args[SPEECH_MESSAGE] + if(message[1] != "*") + message = lizard_hiss.Replace(message, "ссс") + message = lizard_hiSS.Replace(message, "ССС") + message = lizard_che.Replace(message, "щ") + message = lizard_cHE.Replace(message, "Щ") + speech_args[SPEECH_MESSAGE] = message + +/* TODO: Do these someday later +/obj/item/organ/internal/tongue/zombie/modify_speech(datum/source, list/speech_args) + +/obj/item/organ/internal/tongue/snail/modify_speech(datum/source, list/speech_args) +*/ diff --git a/modular_bandastation/modular_bandastation.dme b/modular_bandastation/modular_bandastation.dme index 44ade7b380e7b..ef8c94f191c4f 100644 --- a/modular_bandastation/modular_bandastation.dme +++ b/modular_bandastation/modular_bandastation.dme @@ -7,6 +7,7 @@ #include "_singletons/_singletons.dme" #include "aesthetics/_aesthetics.dme" #include "ai_laws/_ai_laws.dme" +#include "autohiss/_autohiss.dme" #include "barsigns/_barsigns.dme" #include "communication/_communication.dme" //#include "crawl_speed/_crawl_speed.dme" // Fixing floored melee brawl, or first steps to remove RP speed