Skip to content
This repository has been archived by the owner on Nov 11, 2021. It is now read-only.

Commit

Permalink
антибугурт
Browse files Browse the repository at this point in the history
  • Loading branch information
RedFoxIV committed Feb 14, 2022
1 parent 5c1495b commit 067ce90
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 22 deletions.
5 changes: 5 additions & 0 deletions code/modules/mob/mob_say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand Down
56 changes: 34 additions & 22 deletions white/hule/wordlist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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("<big>[uppertext(W)]...</big>"))

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]-й раз.<br>(<u>[strip_html(msg)]</u>) [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]

0 comments on commit 067ce90

Please sign in to comment.