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

Commit

Permalink
реfuckтор
Browse files Browse the repository at this point in the history
  • Loading branch information
RedFoxIV committed Feb 15, 2022
1 parent 1ba1f11 commit 7632459
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 26 deletions.
19 changes: 13 additions & 6 deletions code/modules/mob/mob_say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@

//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, TRUE)

if(message && proverka_na_detey(message, src))

if(message)
if(stat != DEAD)
if(GLOB.ic_autocorrect[message])
message = "*[GLOB.ic_autocorrect[message]]"
check_for_brainrot(message, src)
SSspeech_controller.queue_say_for_mob(src, message, SPEECH_CONTROLLER_QUEUE_SAY_VERB)

///Whisper verb
Expand All @@ -27,8 +31,10 @@
to_chat(usr, span_danger("Не могу шептать."))
return

message = fix_brainrot(message)
if(message && proverka_na_detey(message, src))
//if(GLOB.ic_autocorrect[message]) // Не работает >> шепчет, "*laugh"
// message = "*[GLOB.ic_autocorrect[message]]"
if(message)
check_for_brainrot(message, src)
SSspeech_controller.queue_say_for_mob(src, message, SPEECH_CONTROLLER_QUEUE_WHISPER_VERB)

///whisper a message
Expand All @@ -48,8 +54,9 @@
var/ckeyname = "[usr.ckey]/[usr.name]"
webhook_send_me(ckeyname, message)

message = fix_brainrot(message)
if(proverka_na_detey(message, src))

if(message)
check_for_brainrot(message, src)
SSspeech_controller.queue_say_for_mob(src, message, SPEECH_CONTROLLER_QUEUE_EMOTE_VERB)

///Speak as a dead person (ghost etc)
Expand Down
35 changes: 15 additions & 20 deletions white/hule/wordlist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ GLOBAL_LIST_INIT(exc_start, world.file2list("cfg/autoeban/exc_start.fackuobema")
GLOBAL_LIST_INIT(exc_end, world.file2list("cfg/autoeban/exc_end.fackuobema"))
GLOBAL_LIST_INIT(exc_full, world.file2list("cfg/autoeban/exc_full.fackuobema"))

/proc/proverka_na_detey(var/msg, var/mob/target)
/proc/check_for_brainrot(var/msg, var/mob/target)
if(!target.client)
return TRUE
return
msg = lowertext(msg)

for(var/bad_word in GLOB.bad_words)
bad_word = lowertext(bad_word)
if(findtext_char(msg, bad_word) && isliving(target) && bad_word != "")
Expand All @@ -16,37 +17,31 @@ GLOBAL_LIST_INIT(exc_full, world.file2list("cfg/autoeban/exc_full.fackuobema"))
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
return

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
return

if(bad_word in GLOB.exc_full)
for(var/word in words)
if(findtext_char(word, bad_word) && (word != bad_word))
return TRUE
return


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
return
return

/client
var/bad_word_counter = 0


/proc/fix_brainrot(var/word, make_into_emote = FALSE)
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 "[make_into_emote ? "*" : ""][simple[word]]"
GLOBAL_LIST_INIT(ic_autocorrect, list( ")" = "smile", "(" = "frown", \
"))" = "laugh", "((" = "cry", \
"лол" = "laugh", "lol" = "laugh", \
"лмао" = "laugh", "lmao" = "laugh", \
"рофл" = "laugh", "rofl" = "laugh", \
"кек" = "giggle", "kek" = "giggle", \
"хз" = "shrug", "hz" = "shrug"))

0 comments on commit 7632459

Please sign in to comment.