[DOWNSTREAM] Cyrillic Support v2 (#24075)

* cyrillic fixes https://github.com/ss220club/Paradise/commit/cbdad6f11f0e0e16694cdb60f8ccb3d6dd23fe92

* fix: remove control characters

* utf-8 support

* more fixes

* spellbook to utf8

* Update code/modules/research/server.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/research/server.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/paperwork/paper.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/paperwork/folders.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/mob/mob_say_base.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* update formatting

* fix ai alerts

* fix spaceheater

* fix noticeboard

---------

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
larentoun
2024-03-11 09:35:08 +00:00
committed by GitHub
co-authored by Burzah
parent d0514fef1f
commit c5c911d252
68 changed files with 185 additions and 185 deletions
+28 -28
View File
@@ -235,12 +235,12 @@
return n
var/te = n
var/t = ""
n = length(n)
n = length_char(n)
var/p = null
p = 1
while(p <= n)
if((copytext(te, p, p + 1) == " " || prob(pr)))
t = "[t][copytext(te, p, p + 1)]"
if((copytext_char(te, p, p + 1) == " " || prob(pr)))
t = "[t][copytext_char(te, p, p + 1)]"
else
t = "[t]*"
p++
@@ -252,12 +252,12 @@
/proc/slur(phrase, list/slurletters = ("'"))//use a different list as an input if you want to make robots slur with $#@%! characters
phrase = html_decode(phrase)
var/leng=length(phrase)
var/counter=length(phrase)
var/newphrase=""
var/newletter=""
while(counter>=1)
newletter=copytext(phrase,(leng-counter)+1,(leng-counter)+2)
var/leng = length_char(phrase)
var/counter = length_char(phrase)
var/newphrase = ""
var/newletter = ""
while(counter >= 1)
newletter=copytext_char(phrase, (leng - counter) + 1, (leng - counter) + 2)
if(rand(1,3)==3)
if(lowertext(newletter)=="o") newletter="u"
if(lowertext(newletter)=="s") newletter="ch"
@@ -276,12 +276,12 @@
/proc/stutter(n)
var/te = html_decode(n)
var/t = "" //placed before the message. Not really sure what it's for.
n = length(n) //length of the entire word
n = length_char(n) //length of the entire word
var/p = null
p = 1 //1 is the start of any word
while(p <= n) //while P, which starts at 1 is less or equal to N which is the length.
var/n_letter = copytext(te, p, p + 1)//copies text from a certain distance. In this case, only one letter at a time.
if(prob(80) && (ckey(n_letter) in list("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z")))
var/n_letter = copytext_char(te, p, p + 1)//copies text from a certain distance. In this case, only one letter at a time.
if(prob(80) && (lowertext(n_letter) in list("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z")))
if(prob(5))
n_letter = text("[n_letter]-[n_letter]-[n_letter]") //replaces the current letter with this instead.
else
@@ -291,18 +291,18 @@
n_letter = text("[n_letter]-[n_letter]")
t = text("[t][n_letter]") //since the above is ran through for each letter, the text just adds up back to the original word.
p++ //for each letter p is increased to find where the next letter will be.
return sanitize(copytext(t,1,MAX_MESSAGE_LEN))
return sanitize(copytext_char(t, 1, MAX_MESSAGE_LEN))
/proc/robostutter(n) //for robutts
var/te = html_decode(n)
var/t = ""//placed before the message. Not really sure what it's for.
n = length(n)//length of the entire word
n = length_char(n)//length of the entire word
var/p = null
p = 1//1 is the start of any word
while(p <= n)//while P, which starts at 1 is less or equal to N which is the length.
var/robotletter = pick("@", "!", "#", "$", "%", "&", "?") //for beep boop
var/n_letter = copytext(te, p, p + 1)//copies text from a certain distance. In this case, only one letter at a time.
if(prob(80) && (ckey(n_letter) in list("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z")))
var/n_letter = copytext_char(te, p, p + 1)//copies text from a certain distance. In this case, only one letter at a time.
if(prob(80) && (lowertext(n_letter) in list("b","c","d","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z")))
if(prob(10))
n_letter = text("[n_letter]-[robotletter]-[n_letter]-[n_letter]")//replaces the current letter with this instead.
else
@@ -315,15 +315,15 @@
n_letter = text("[n_letter]-[n_letter]")
t = text("[t][n_letter]")//since the above is ran through for each letter, the text just adds up back to the original word.
p++//for each letter p is increased to find where the next letter will be.
return sanitize(copytext(t,1,MAX_MESSAGE_LEN))
return sanitize(copytext_char(t, 1, MAX_MESSAGE_LEN))
/proc/Gibberish(t, p, replace_rate = 50)//t is the inputted message, and any value higher than 70 for p will cause letters to be replaced instead of added. replace_rate is the chance a letter is corrupted.
/* Turn text into complete gibberish! */
var/returntext = ""
for(var/i = 1, i <= length(t), i++)
for(var/i = 1, i <= length_char(t), i++)
var/letter = copytext(t, i, i+1)
var/letter = copytext_char(t, i, i + 1)
if(prob(replace_rate))
if(p >= 70)
letter = ""
@@ -342,12 +342,12 @@
/proc/muffledspeech(phrase)
phrase = html_decode(phrase)
var/leng=length(phrase)
var/counter=length(phrase)
var/newphrase=""
var/newletter=""
while(counter>=1)
newletter=copytext(phrase,(leng-counter)+1,(leng-counter)+2)
var/leng = length_char(phrase)
var/counter = length_char(phrase)
var/newphrase = ""
var/newletter = ""
while(counter >= 1)
newletter=copytext_char(phrase, (leng - counter) + 1, (leng - counter) + 2)
if(newletter in list(" ", "!", "?", ".", ","))
// Skip these
counter -= 1
@@ -685,12 +685,12 @@
/proc/cultslur(n) // Inflicted on victims of a stun talisman
var/phrase = html_decode(n)
var/leng = length(phrase)
var/counter=length(phrase)
var/leng = length_char(phrase)
var/counter = length_char(phrase)
var/newphrase=""
var/newletter=""
while(counter>=1)
newletter=copytext(phrase,(leng-counter)+1,(leng-counter)+2)
newletter=copytext_char(phrase, (leng - counter) + 1, (leng - counter) + 2)
if(rand(1,2)==2)
if(lowertext(newletter)=="o")
newletter="u"