diff --git a/code/__HELPERS/name_helpers.dm b/code/__HELPERS/name_helpers.dm index 2df7ee93c128..75ee54731240 100644 --- a/code/__HELPERS/name_helpers.dm +++ b/code/__HELPERS/name_helpers.dm @@ -133,10 +133,10 @@ GLOBAL_VAR(syndicate_code_response) //Code response for traitors. ) var/safety[] = list(1,2,3)//Tells the proc which options to remove later on. - var/nouns[] = list("love","hate","anger","peace","pride","sympathy","bravery","loyalty","honesty","integrity","compassion","charity","success","courage","deceit","skill","beauty","brilliance","pain","misery","beliefs","dreams","justice","truth","faith","liberty","knowledge","thought","information","culture","trust","dedication","progress","education","hospitality","leisure","trouble","friendships", "relaxation") - var/drinks[] = list("vodka and tonic","gin fizz","bahama mama","manhattan","black Russian","whiskey soda","long island tea","margarita","Irish coffee"," manly dwarf","Irish cream","doctor's delight","Beepksy Smash","tequila sunrise","brave bull","gargle blaster","bloody mary","whiskey cola","white Russian","vodka martini","martini","Cuba libre","kahlua","vodka","wine","moonshine") - var/locations[] = length(SSmapping.teleportlocs) ? SSmapping.teleportlocs : drinks//if null, defaults to drinks instead. - + // var/nouns[] = list("love","hate","anger","peace","pride","sympathy","bravery","loyalty","honesty","integrity","compassion","charity","success","courage","deceit","skill","beauty","brilliance","pain","misery","beliefs","dreams","justice","truth","faith","liberty","knowledge","thought","information","culture","trust","dedication","progress","education","hospitality","leisure","trouble","friendships", "relaxation") + // var/drinks[] = list("vodka and tonic","gin fizz","bahama mama","manhattan","black Russian","whiskey soda","long island tea","margarita","Irish coffee"," manly dwarf","Irish cream","doctor's delight","Beepksy Smash","tequila sunrise","brave bull","gargle blaster","bloody mary","whiskey cola","white Russian","vodka martini","martini","Cuba libre","kahlua","vodka","wine","moonshine") + // var/locations[] = length(SSmapping.teleportlocs) ? SSmapping.teleportlocs : drinks//if null, defaults to drinks instead. + // SS220 DELETE var/names[] = list() for(var/datum/data/record/t in GLOB.data_core.general)//Picks from crew manifest. names += t.fields["name"] @@ -157,19 +157,19 @@ GLOBAL_VAR(syndicate_code_response) //Code response for traitors. if(names.len) code_phrase += pick(names) if(2) - code_phrase += pick(GLOB.joblist)//Returns a job. + code_phrase += pick(GLOB.jobs)//Returns a job. // SS220 EDIT - ORIGINAL: (GLOB.joblist) safety -= 1 if(2) switch(rand(1,2))//Places or things. if(1) - code_phrase += pick(drinks) + code_phrase += pick(GLOB.cocktails) // SS220 EDIT - ORIGINAL: (drinks) if(2) - code_phrase += pick(locations) + code_phrase += pick(GLOB.locations) // SS220 EDIT - ORIGINAL: (locations) safety -= 2 if(3) switch(rand(1,3))//Nouns, adjectives, verbs. Can be selected more than once. if(1) - code_phrase += pick(nouns) + code_phrase += pick(GLOB.nouns) // SS220 EDIT - ORIGINAL: (nouns) if(2) code_phrase += pick(GLOB.adjectives) if(3) diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 1405baa53ef7..87a0f3aff53c 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -69,10 +69,10 @@ //Returns null if there is any bad text in the string /proc/reject_bad_text(text, max_length=512) - if(length(text) > max_length) return //message too long + if(length_char(text) > max_length) return //message too long // SS220 EDIT - ORIGINAL: (length(text) var/non_whitespace = 0 - for(var/i=1, i<=length(text), i++) - switch(text2ascii(text,i)) + for(var/i=1, i<=length_char(text), i++) // ORIGINAL: length(text) + switch(text2ascii_char(text,i)) // ORIGINAL: text2ascii if(62,60,92,47) return //rejects the text if it contains these bad characters: <, >, \ or / if(127 to 255) return //rejects weird letters like � if(0 to 31) return //more weird stuff @@ -105,25 +105,25 @@ /proc/reject_bad_name(t_in, allow_numbers=0, max_length=MAX_NAME_LEN) // Decode so that names with characters like < are still rejected t_in = html_decode(t_in) - if(!t_in || length(t_in) > max_length) + if(!t_in || length_char(t_in) > max_length) // SS220 EDIT - ORIGINAL: length return //Rejects the input if it is null or if it is longer than the max length allowed var/number_of_alphanumeric = 0 var/last_char_group = 0 var/t_out = "" - for(var/i=1, i<=length(t_in), i++) - var/ascii_char = text2ascii(t_in,i) + for(var/i=1, i<=length_char(t_in), i++) // SS220 EDIT - ORIGINAL: for(var/i=1, i<=length(t_in), i++) + var/ascii_char = text2ascii_char(t_in,i) // ORIGINAL: var/ascii_char = text2ascii(t_in,i) switch(ascii_char) - // A .. Z - if(65 to 90) //Uppercase Letters + // A .. Z, // SS220 ADDITION: А .. Я, Ё | 1040 to 1071, 1025 + if(65 to 90, 1040 to 1071, 1025) //Uppercase Letters t_out += ascii2text(ascii_char) number_of_alphanumeric++ last_char_group = 4 - // a .. z - if(97 to 122) //Lowercase Letters - if(last_char_group<2) t_out += ascii2text(ascii_char-32) //Force uppercase first character + // a .. z, // SS220 ADDITION: а .. я, ё | 1072 to 1103, 1105 + if(97 to 122, 1072 to 1103, 1105) //Lowercase Letters + if(last_char_group<2) t_out += uppertext(ascii2text(ascii_char)) //Force uppercase first character else t_out += ascii2text(ascii_char) number_of_alphanumeric++ last_char_group = 4 @@ -194,21 +194,21 @@ /proc/dd_hasprefix(text, prefix) var/start = 1 var/end = length(prefix) + 1 - return findtext(text, prefix, start, end) + return findtext_char(text, prefix, start, end) // SS220 EDIT - ORIGINAL: findtext //Checks the beginning of a string for a specified sub-string. This proc is case sensitive //Returns the position of the substring or 0 if it was not found /proc/dd_hasprefix_case(text, prefix) var/start = 1 var/end = length(prefix) + 1 - return findtextEx(text, prefix, start, end) + return findtextEx_char(text, prefix, start, end) // SS220 EDIT - ORIGINAL: findtext //Checks the end of a string for a specified substring. //Returns the position of the substring or 0 if it was not found /proc/dd_hassuffix(text, suffix) var/start = length(text) - length(suffix) if(start) - return findtext(text, suffix, start, null) + return findtext_char(text, suffix, start, null) // SS220 EDIT - ORIGINAL: findtext return //Checks the end of a string for a specified substring. This proc is case sensitive @@ -216,7 +216,7 @@ /proc/dd_hassuffix_case(text, suffix) var/start = length(text) - length(suffix) if(start) - return findtextEx(text, suffix, start, null) + return findtextEx_char(text, suffix, start, null)// SS220 EDIT - ORIGINAL: findtext /* * Text modification @@ -224,7 +224,7 @@ // See bygex.dm /proc/replace_characters(t, list/repl_chars) for(var/char in repl_chars) - t = replacetext(t, char, repl_chars[char]) + t = replacetext_char(t, char, repl_chars[char]) // SS220 EDIT - ORIGINAL: replacetext return t //Strips the first char and returns it and the new string as a list @@ -274,7 +274,7 @@ //Returns a string with the first element of the string capitalized. /proc/capitalize(t as text) - return uppertext(copytext(t, 1, 2)) + copytext(t, 2) + return uppertext(copytext_char(t, 1, 2)) + copytext_char(t, 2) // SS220 EDIT - ORIGINAL: copytext //Centers text by adding spaces to either side of the string. /proc/dd_centertext(message, length) @@ -364,7 +364,7 @@ else break if(max_length) - input = copytext(input,1,max_length) + input = copytext_char(input,1,max_length) // SS220 EDIT - ORIGINAL: copytext return sanitize(input, allow_lines ? list("\t" = " ") : list("\n" = " ", "\t" = " ")) /proc/trim_strip_html_properly(input, max_length = MAX_MESSAGE_LEN, allow_lines = 0) @@ -383,7 +383,7 @@ //alternative copytext() for encoded text, doesn't break html entities (" and other) /proc/copytext_preserve_html(text, first, last) - return html_encode(copytext(html_decode(text), first, last)) + return html_encode(copytext_char(html_decode(text), first, last)) // SS220 EDIT - ORIGINAL: copytext //Run sanitize(), but remove <, >, " first to prevent displaying them as > < &34; in some places, after html_encode(). //Best used for sanitize object names, window titles. diff --git a/code/_globalvars/lists/names.dm b/code/_globalvars/lists/names.dm index 01f0e5b34ffe..6888cf87717a 100644 --- a/code/_globalvars/lists/names.dm +++ b/code/_globalvars/lists/names.dm @@ -28,3 +28,8 @@ GLOBAL_LIST_INIT(dream_strings, file2list("config/names/dreams.txt")) GLOBAL_LIST_INIT(nightmare_strings, file2list("config/names/nightmares.txt")) //loaded on startup because of " //would include in rsc if ' was used + +// SS220 ADDITION - CYRILLIC SUPPORT +GLOBAL_LIST_INIT(cocktails, file2list("config/names/cocktails.txt")) +GLOBAL_LIST_INIT(jobs, file2list("config/names/jobs.txt")) +GLOBAL_LIST_INIT(locations, file2list("config/names/locations.txt")) diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index f389f04df606..7cca4aed6650 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -240,6 +240,7 @@ var/html = {" +