From 067ce907272a6c8c968104aca19d6d755a75a17c Mon Sep 17 00:00:00 2001 From: RedFoxIV <38788538+RedFoxIV@users.noreply.github.com> Date: Tue, 15 Feb 2022 00:42:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B0=D0=BD=D1=82=D0=B8=D0=B1=D1=83=D0=B3?= =?UTF-8?q?=D1=83=D1=80=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/modules/mob/mob_say.dm | 5 ++++ white/hule/wordlist.dm | 56 ++++++++++++++++++++++--------------- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/code/modules/mob/mob_say.dm b/code/modules/mob/mob_say.dm index 43f02622e676..dc2930c80cf7 100644 --- a/code/modules/mob/mob_say.dm +++ b/code/modules/mob/mob_say.dm @@ -12,6 +12,8 @@ //queue this message because verbs are scheduled to process after SendMaps in the tick and speech is pretty expensive when it happens. //by queuing this for next tick the mc can compensate for its cost instead of having speech delay the start of the next tick + message = "*[fix_brainrot(message)]" + if(message && proverka_na_detey(message, src)) SSspeech_controller.queue_say_for_mob(src, message, SPEECH_CONTROLLER_QUEUE_SAY_VERB) @@ -24,6 +26,8 @@ if(GLOB.say_disabled) //This is here to try to identify lag problems to_chat(usr, span_danger("Не могу шептать.")) return + + message = "*[fix_brainrot(message)]" if(message && proverka_na_detey(message, src)) SSspeech_controller.queue_say_for_mob(src, message, SPEECH_CONTROLLER_QUEUE_WHISPER_VERB) @@ -44,6 +48,7 @@ var/ckeyname = "[usr.ckey]/[usr.name]" webhook_send_me(ckeyname, message) + message = fix_brainrot(message) if(proverka_na_detey(message, src)) SSspeech_controller.queue_say_for_mob(src, message, SPEECH_CONTROLLER_QUEUE_EMOTE_VERB) diff --git a/white/hule/wordlist.dm b/white/hule/wordlist.dm index 2fd8985a27a9..056d2a9cec90 100644 --- a/white/hule/wordlist.dm +++ b/white/hule/wordlist.dm @@ -8,33 +8,45 @@ GLOBAL_LIST_INIT(exc_full, world.file2list("cfg/autoeban/exc_full.fackuobema")) if(!target.client) return TRUE msg = lowertext(msg) - for(var/W in GLOB.bad_words) - W = lowertext(W) - if(findtext_char(msg, W) && isliving(target) && W != "") - var/list/ML = splittext(msg, " ") - - if(W in GLOB.exc_start) - for(var/WA in ML) - if(findtext_char(WA, "[W]") < findtext_char(WA, regex("^[W]"))) + for(var/bad_word in GLOB.bad_words) + bad_word = lowertext(bad_word) + if(findtext_char(msg, bad_word) && isliving(target) && bad_word != "") + var/list/words = splittext(msg, " ") + + if(bad_word in GLOB.exc_start) + for(var/word in words) + if(findtext_char(word, "[bad_word]") < findtext_char(word, regex("^[bad_word]"))) return TRUE - if(W in GLOB.exc_end) - for(var/WB in ML) - if(findtext_char(WB, "[W]") > findtext_char(WB, regex("^[W]"))) + if(bad_word in GLOB.exc_end) + for(var/word in words) + if(findtext_char(word, "[bad_word]") > findtext_char(word, regex("^[bad_word]"))) return TRUE - if(W in GLOB.exc_full) - for(var/WC in ML) - if(findtext_char(WC, W) && (WC != W)) + if(bad_word in GLOB.exc_full) + for(var/word in words) + if(findtext_char(word, bad_word) && (word != bad_word)) return TRUE + - target.overlay_fullscreen("brute", /atom/movable/screen/fullscreen/brute, 6) - addtimer(CALLBACK(target, /mob.proc/clear_fullscreen, "brute", 10), 10) - - to_chat(target, span_notice("[uppertext(W)]...")) - - SEND_SOUND(target, sound('sound/effects/singlebeat.ogg')) - - message_admins("[ADMIN_LOOKUPFLW(target)] попытался насрать на ИС словом \"[W]\". ([strip_html(msg)]) [ADMIN_SMITE(target)]") + target.client.bad_word_counter += 1 + message_admins("[ADMIN_LOOKUPFLW(target)], возможно, насрал на ИЦ словом \"[bad_word]\". Это его [target.client.bad_word_counter]-й раз.
([strip_html(msg)]) [ADMIN_SMITE(target)] [target.client.bad_word_counter > 1 ? "Возможно, он заслужил смайт." : ""]") return FALSE return TRUE + +/client + var/bad_word_counter = 0 + + +/proc/fix_brainrot(var/word) + var/static/list/simple = list( ")" = "smile", "(" = "frown", \ + "))" = "laugh", "((" = "cry", \ + "лол" = "laugh", "lol" = "laugh", \ + "лмао" = "laugh", "lmao" = "laugh", \ + "рофл" = "laugh", "rofl" = "laugh", \ + "кек" = "giggle", "kek" = "giggle", \ + "хз" = "shrug", "hz" = "shrug") + + . = word + if(simple[word]) + return simple[word]