mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
Force LF line endings with gitattributes and convert repo (#52266)
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
This commit is contained in:
co-authored by
Aleksej Komarov
parent
39e8bd721f
commit
62676e72a8
@@ -1,10 +1,10 @@
|
||||
/datum/language/buzzwords
|
||||
name = "Buzzwords"
|
||||
desc = "A common language to all insects, made by the rhythmic beating of wings."
|
||||
key = "z"
|
||||
space_chance = 0
|
||||
syllables = list(
|
||||
"bzz","zzz","z","bz","bzzz","zzzz", "bzzzz", "b", "zz", "zzzzz"
|
||||
)
|
||||
icon_state = "buzz"
|
||||
default_priority = 90
|
||||
/datum/language/buzzwords
|
||||
name = "Buzzwords"
|
||||
desc = "A common language to all insects, made by the rhythmic beating of wings."
|
||||
key = "z"
|
||||
space_chance = 0
|
||||
syllables = list(
|
||||
"bzz","zzz","z","bz","bzzz","zzzz", "bzzzz", "b", "zz", "zzzzz"
|
||||
)
|
||||
icon_state = "buzz"
|
||||
default_priority = 90
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/datum/language/calcic
|
||||
name = "Calcic"
|
||||
desc = "The disjointed and staccato language of plasmamen. Also understood by skeletons."
|
||||
key = "b"
|
||||
space_chance = 10
|
||||
syllables = list(
|
||||
"k", "ck", "ack", "ick", "cl", "tk", "sk", "isk", "tak",
|
||||
"kl", "hs", "ss", "ks", "lk", "dk", "gk", "ka", "ska", "la", "pk",
|
||||
"wk", "ak", "ik", "ip", "ski", "bk", "kb", "ta", "is", "it", "li", "di",
|
||||
"ds", "ya", "sck", "crk", "hs", "ws", "mk", "aaa", "skraa", "skee", "hss",
|
||||
"raa", "klk", "tk", "stk", "clk"
|
||||
)
|
||||
icon_state = "calcic"
|
||||
default_priority = 90
|
||||
|
||||
// Yeah, this goes to skeletons too, since it's basically just skeleton clacking.
|
||||
/datum/language/calcic
|
||||
name = "Calcic"
|
||||
desc = "The disjointed and staccato language of plasmamen. Also understood by skeletons."
|
||||
key = "b"
|
||||
space_chance = 10
|
||||
syllables = list(
|
||||
"k", "ck", "ack", "ick", "cl", "tk", "sk", "isk", "tak",
|
||||
"kl", "hs", "ss", "ks", "lk", "dk", "gk", "ka", "ska", "la", "pk",
|
||||
"wk", "ak", "ik", "ip", "ski", "bk", "kb", "ta", "is", "it", "li", "di",
|
||||
"ds", "ya", "sck", "crk", "hs", "ws", "mk", "aaa", "skraa", "skee", "hss",
|
||||
"raa", "klk", "tk", "stk", "clk"
|
||||
)
|
||||
icon_state = "calcic"
|
||||
default_priority = 90
|
||||
|
||||
// Yeah, this goes to skeletons too, since it's basically just skeleton clacking.
|
||||
|
||||
@@ -1,70 +1,70 @@
|
||||
// 'basic' language; spoken by default.
|
||||
/datum/language/common
|
||||
name = "Galactic Common"
|
||||
desc = "The common galactic tongue."
|
||||
key = "0"
|
||||
flags = TONGUELESS_SPEECH | LANGUAGE_HIDE_ICON_IF_UNDERSTOOD
|
||||
default_priority = 100
|
||||
|
||||
icon_state = "galcom"
|
||||
|
||||
//Syllable Lists
|
||||
/*
|
||||
This list really long, mainly because I can't make up my mind about which mandarin syllables should be removed,
|
||||
and the english syllables had to be duplicated so that there is roughly a 50-50 weighting.
|
||||
|
||||
Sources:
|
||||
http://www.sttmedia.com/syllablefrequency-english
|
||||
http://www.chinahighlights.com/travelguide/learning-chinese/pinyin-syllables.htm
|
||||
*/
|
||||
/datum/language/common/syllables = list(
|
||||
"a", "ai", "an", "ang", "ao", "ba", "bai", "ban", "bang", "bao", "bei", "ben", "beng", "bi", "bian", "biao",
|
||||
"bie", "bin", "bing", "bo", "bu", "ca", "cai", "can", "cang", "cao", "ce", "cei", "cen", "ceng", "cha", "chai",
|
||||
"chan", "chang", "chao", "che", "chen", "cheng", "chi", "chong", "chou", "chu", "chua", "chuai", "chuan", "chuang", "chui", "chun",
|
||||
"chuo", "ci", "cong", "cou", "cu", "cuan", "cui", "cun", "cuo", "da", "dai", "dan", "dang", "dao", "de", "dei",
|
||||
"den", "deng", "di", "dian", "diao", "die", "ding", "diu", "dong", "dou", "du", "duan", "dui", "dun", "duo", "e",
|
||||
"ei", "en", "er", "fa", "fan", "fang", "fei", "fen", "feng", "fo", "fou", "fu", "ga", "gai", "gan", "gang",
|
||||
"gao", "ge", "gei", "gen", "geng", "gong", "gou", "gu", "gua", "guai", "guan", "guang", "gui", "gun", "guo", "ha",
|
||||
"hai", "han", "hang", "hao", "he", "hei", "hen", "heng", "hm", "hng", "hong", "hou", "hu", "hua", "huai", "huan",
|
||||
"huang", "hui", "hun", "huo", "ji", "jia", "jian", "jiang", "jiao", "jie", "jin", "jing", "jiong", "jiu", "ju", "juan",
|
||||
"jue", "jun", "ka", "kai", "kan", "kang", "kao", "ke", "kei", "ken", "keng", "kong", "kou", "ku", "kua", "kuai",
|
||||
"kuan", "kuang", "kui", "kun", "kuo", "la", "lai", "lan", "lang", "lao", "le", "lei", "leng", "li", "lia", "lian",
|
||||
"liang", "liao", "lie", "lin", "ling", "liu", "long", "lou", "lu", "luan", "lun", "luo", "ma", "mai", "man", "mang",
|
||||
"mao", "me", "mei", "men", "meng", "mi", "mian", "miao", "mie", "min", "ming", "miu", "mo", "mou", "mu", "na",
|
||||
"nai", "nan", "nang", "nao", "ne", "nei", "nen", "neng", "ng", "ni", "nian", "niang", "niao", "nie", "nin", "ning",
|
||||
"niu", "nong", "nou", "nu", "nuan", "nuo", "o", "ou", "pa", "pai", "pan", "pang", "pao", "pei", "pen", "peng",
|
||||
"pi", "pian", "piao", "pie", "pin", "ping", "po", "pou", "pu", "qi", "qia", "qian", "qiang", "qiao", "qie", "qin",
|
||||
"qing", "qiong", "qiu", "qu", "quan", "que", "qun", "ran", "rang", "rao", "re", "ren", "reng", "ri", "rong", "rou",
|
||||
"ru", "rua", "ruan", "rui", "run", "ruo", "sa", "sai", "san", "sang", "sao", "se", "sei", "sen", "seng", "sha",
|
||||
"shai", "shan", "shang", "shao", "she", "shei", "shen", "sheng", "shi", "shou", "shu", "shua", "shuai", "shuan", "shuang", "shui",
|
||||
"shun", "shuo", "si", "song", "sou", "su", "suan", "sui", "sun", "suo", "ta", "tai", "tan", "tang", "tao", "te",
|
||||
"teng", "ti", "tian", "tiao", "tie", "ting", "tong", "tou", "tu", "tuan", "tui", "tun", "tuo", "wa", "wai", "wan",
|
||||
"wang", "wei", "wen", "weng", "wo", "wu", "xi", "xia", "xian", "xiang", "xiao", "xie", "xin", "xing", "xiong", "xiu",
|
||||
"xu", "xuan", "xue", "xun", "ya", "yan", "yang", "yao", "ye", "yi", "yin", "ying", "yong", "you", "yu", "yuan",
|
||||
"yue", "yun", "za", "zai", "zan", "zang", "zao", "ze", "zei", "zen", "zeng", "zha", "zhai", "zhan", "zhang", "zhao",
|
||||
"zhe", "zhei", "zhen", "zheng", "zhi", "zhong", "zhou", "zhu", "zhua", "zhuai", "zhuan", "zhuang", "zhui", "zhun", "zhuo", "zi",
|
||||
"zong", "zou", "zuan", "zui", "zun", "zuo", "zu",
|
||||
"al", "an", "ar", "as", "at", "ea", "ed", "en", "er", "es", "ha", "he", "hi", "in", "is", "it",
|
||||
"le", "me", "nd", "ne", "ng", "nt", "on", "or", "ou", "re", "se", "st", "te", "th", "ti", "to",
|
||||
"ve", "wa", "all", "and", "are", "but", "ent", "era", "ere", "eve", "for", "had", "hat", "hen", "her", "hin",
|
||||
"his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi",
|
||||
"al", "an", "ar", "as", "at", "ea", "ed", "en", "er", "es", "ha", "he", "hi", "in", "is", "it",
|
||||
"le", "me", "nd", "ne", "ng", "nt", "on", "or", "ou", "re", "se", "st", "te", "th", "ti", "to",
|
||||
"ve", "wa", "all", "and", "are", "but", "ent", "era", "ere", "eve", "for", "had", "hat", "hen", "her", "hin",
|
||||
"his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi",
|
||||
"al", "an", "ar", "as", "at", "ea", "ed", "en", "er", "es", "ha", "he", "hi", "in", "is", "it",
|
||||
"le", "me", "nd", "ne", "ng", "nt", "on", "or", "ou", "re", "se", "st", "te", "th", "ti", "to",
|
||||
"ve", "wa", "all", "and", "are", "but", "ent", "era", "ere", "eve", "for", "had", "hat", "hen", "her", "hin",
|
||||
"his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi",
|
||||
"al", "an", "ar", "as", "at", "ea", "ed", "en", "er", "es", "ha", "he", "hi", "in", "is", "it",
|
||||
"le", "me", "nd", "ne", "ng", "nt", "on", "or", "ou", "re", "se", "st", "te", "th", "ti", "to",
|
||||
"ve", "wa", "all", "and", "are", "but", "ent", "era", "ere", "eve", "for", "had", "hat", "hen", "her", "hin",
|
||||
"his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi",
|
||||
"al", "an", "ar", "as", "at", "ea", "ed", "en", "er", "es", "ha", "he", "hi", "in", "is", "it",
|
||||
"le", "me", "nd", "ne", "ng", "nt", "on", "or", "ou", "re", "se", "st", "te", "th", "ti", "to",
|
||||
"ve", "wa", "all", "and", "are", "but", "ent", "era", "ere", "eve", "for", "had", "hat", "hen", "her", "hin",
|
||||
"his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi",
|
||||
"al", "an", "ar", "as", "at", "ea", "ed", "en", "er", "es", "ha", "he", "hi", "in", "is", "it",
|
||||
"le", "me", "nd", "ne", "ng", "nt", "on", "or", "ou", "re", "se", "st", "te", "th", "ti", "to",
|
||||
"ve", "wa", "all", "and", "are", "but", "ent", "era", "ere", "eve", "for", "had", "hat", "hen", "her", "hin",
|
||||
"his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi")
|
||||
// 'basic' language; spoken by default.
|
||||
/datum/language/common
|
||||
name = "Galactic Common"
|
||||
desc = "The common galactic tongue."
|
||||
key = "0"
|
||||
flags = TONGUELESS_SPEECH | LANGUAGE_HIDE_ICON_IF_UNDERSTOOD
|
||||
default_priority = 100
|
||||
|
||||
icon_state = "galcom"
|
||||
|
||||
//Syllable Lists
|
||||
/*
|
||||
This list really long, mainly because I can't make up my mind about which mandarin syllables should be removed,
|
||||
and the english syllables had to be duplicated so that there is roughly a 50-50 weighting.
|
||||
|
||||
Sources:
|
||||
http://www.sttmedia.com/syllablefrequency-english
|
||||
http://www.chinahighlights.com/travelguide/learning-chinese/pinyin-syllables.htm
|
||||
*/
|
||||
/datum/language/common/syllables = list(
|
||||
"a", "ai", "an", "ang", "ao", "ba", "bai", "ban", "bang", "bao", "bei", "ben", "beng", "bi", "bian", "biao",
|
||||
"bie", "bin", "bing", "bo", "bu", "ca", "cai", "can", "cang", "cao", "ce", "cei", "cen", "ceng", "cha", "chai",
|
||||
"chan", "chang", "chao", "che", "chen", "cheng", "chi", "chong", "chou", "chu", "chua", "chuai", "chuan", "chuang", "chui", "chun",
|
||||
"chuo", "ci", "cong", "cou", "cu", "cuan", "cui", "cun", "cuo", "da", "dai", "dan", "dang", "dao", "de", "dei",
|
||||
"den", "deng", "di", "dian", "diao", "die", "ding", "diu", "dong", "dou", "du", "duan", "dui", "dun", "duo", "e",
|
||||
"ei", "en", "er", "fa", "fan", "fang", "fei", "fen", "feng", "fo", "fou", "fu", "ga", "gai", "gan", "gang",
|
||||
"gao", "ge", "gei", "gen", "geng", "gong", "gou", "gu", "gua", "guai", "guan", "guang", "gui", "gun", "guo", "ha",
|
||||
"hai", "han", "hang", "hao", "he", "hei", "hen", "heng", "hm", "hng", "hong", "hou", "hu", "hua", "huai", "huan",
|
||||
"huang", "hui", "hun", "huo", "ji", "jia", "jian", "jiang", "jiao", "jie", "jin", "jing", "jiong", "jiu", "ju", "juan",
|
||||
"jue", "jun", "ka", "kai", "kan", "kang", "kao", "ke", "kei", "ken", "keng", "kong", "kou", "ku", "kua", "kuai",
|
||||
"kuan", "kuang", "kui", "kun", "kuo", "la", "lai", "lan", "lang", "lao", "le", "lei", "leng", "li", "lia", "lian",
|
||||
"liang", "liao", "lie", "lin", "ling", "liu", "long", "lou", "lu", "luan", "lun", "luo", "ma", "mai", "man", "mang",
|
||||
"mao", "me", "mei", "men", "meng", "mi", "mian", "miao", "mie", "min", "ming", "miu", "mo", "mou", "mu", "na",
|
||||
"nai", "nan", "nang", "nao", "ne", "nei", "nen", "neng", "ng", "ni", "nian", "niang", "niao", "nie", "nin", "ning",
|
||||
"niu", "nong", "nou", "nu", "nuan", "nuo", "o", "ou", "pa", "pai", "pan", "pang", "pao", "pei", "pen", "peng",
|
||||
"pi", "pian", "piao", "pie", "pin", "ping", "po", "pou", "pu", "qi", "qia", "qian", "qiang", "qiao", "qie", "qin",
|
||||
"qing", "qiong", "qiu", "qu", "quan", "que", "qun", "ran", "rang", "rao", "re", "ren", "reng", "ri", "rong", "rou",
|
||||
"ru", "rua", "ruan", "rui", "run", "ruo", "sa", "sai", "san", "sang", "sao", "se", "sei", "sen", "seng", "sha",
|
||||
"shai", "shan", "shang", "shao", "she", "shei", "shen", "sheng", "shi", "shou", "shu", "shua", "shuai", "shuan", "shuang", "shui",
|
||||
"shun", "shuo", "si", "song", "sou", "su", "suan", "sui", "sun", "suo", "ta", "tai", "tan", "tang", "tao", "te",
|
||||
"teng", "ti", "tian", "tiao", "tie", "ting", "tong", "tou", "tu", "tuan", "tui", "tun", "tuo", "wa", "wai", "wan",
|
||||
"wang", "wei", "wen", "weng", "wo", "wu", "xi", "xia", "xian", "xiang", "xiao", "xie", "xin", "xing", "xiong", "xiu",
|
||||
"xu", "xuan", "xue", "xun", "ya", "yan", "yang", "yao", "ye", "yi", "yin", "ying", "yong", "you", "yu", "yuan",
|
||||
"yue", "yun", "za", "zai", "zan", "zang", "zao", "ze", "zei", "zen", "zeng", "zha", "zhai", "zhan", "zhang", "zhao",
|
||||
"zhe", "zhei", "zhen", "zheng", "zhi", "zhong", "zhou", "zhu", "zhua", "zhuai", "zhuan", "zhuang", "zhui", "zhun", "zhuo", "zi",
|
||||
"zong", "zou", "zuan", "zui", "zun", "zuo", "zu",
|
||||
"al", "an", "ar", "as", "at", "ea", "ed", "en", "er", "es", "ha", "he", "hi", "in", "is", "it",
|
||||
"le", "me", "nd", "ne", "ng", "nt", "on", "or", "ou", "re", "se", "st", "te", "th", "ti", "to",
|
||||
"ve", "wa", "all", "and", "are", "but", "ent", "era", "ere", "eve", "for", "had", "hat", "hen", "her", "hin",
|
||||
"his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi",
|
||||
"al", "an", "ar", "as", "at", "ea", "ed", "en", "er", "es", "ha", "he", "hi", "in", "is", "it",
|
||||
"le", "me", "nd", "ne", "ng", "nt", "on", "or", "ou", "re", "se", "st", "te", "th", "ti", "to",
|
||||
"ve", "wa", "all", "and", "are", "but", "ent", "era", "ere", "eve", "for", "had", "hat", "hen", "her", "hin",
|
||||
"his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi",
|
||||
"al", "an", "ar", "as", "at", "ea", "ed", "en", "er", "es", "ha", "he", "hi", "in", "is", "it",
|
||||
"le", "me", "nd", "ne", "ng", "nt", "on", "or", "ou", "re", "se", "st", "te", "th", "ti", "to",
|
||||
"ve", "wa", "all", "and", "are", "but", "ent", "era", "ere", "eve", "for", "had", "hat", "hen", "her", "hin",
|
||||
"his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi",
|
||||
"al", "an", "ar", "as", "at", "ea", "ed", "en", "er", "es", "ha", "he", "hi", "in", "is", "it",
|
||||
"le", "me", "nd", "ne", "ng", "nt", "on", "or", "ou", "re", "se", "st", "te", "th", "ti", "to",
|
||||
"ve", "wa", "all", "and", "are", "but", "ent", "era", "ere", "eve", "for", "had", "hat", "hen", "her", "hin",
|
||||
"his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi",
|
||||
"al", "an", "ar", "as", "at", "ea", "ed", "en", "er", "es", "ha", "he", "hi", "in", "is", "it",
|
||||
"le", "me", "nd", "ne", "ng", "nt", "on", "or", "ou", "re", "se", "st", "te", "th", "ti", "to",
|
||||
"ve", "wa", "all", "and", "are", "but", "ent", "era", "ere", "eve", "for", "had", "hat", "hen", "her", "hin",
|
||||
"his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi",
|
||||
"al", "an", "ar", "as", "at", "ea", "ed", "en", "er", "es", "ha", "he", "hi", "in", "is", "it",
|
||||
"le", "me", "nd", "ne", "ng", "nt", "on", "or", "ou", "re", "se", "st", "te", "th", "ti", "to",
|
||||
"ve", "wa", "all", "and", "are", "but", "ent", "era", "ere", "eve", "for", "had", "hat", "hen", "her", "hin",
|
||||
"his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi")
|
||||
|
||||
+107
-107
@@ -1,107 +1,107 @@
|
||||
#define SCRAMBLE_CACHE_LEN 50 //maximum of 50 specific scrambled lines per language
|
||||
|
||||
/*
|
||||
Datum based languages. Easily editable and modular.
|
||||
*/
|
||||
|
||||
/datum/language
|
||||
var/name = "an unknown language" // Fluff name of language if any.
|
||||
var/desc = "A language." // Short description for 'Check Languages'.
|
||||
var/key // Character used to speak in language
|
||||
// If key is null, then the language isn't real or learnable.
|
||||
var/flags // Various language flags.
|
||||
var/list/syllables // Used when scrambling text for a non-speaker.
|
||||
var/sentence_chance = 5 // Likelihood of making a new sentence after each syllable.
|
||||
var/space_chance = 55 // Likelihood of getting a space in the random scramble string
|
||||
var/list/spans = list()
|
||||
var/list/scramble_cache = list()
|
||||
var/default_priority = 0 // the language that an atom knows with the highest "default_priority" is selected by default.
|
||||
|
||||
// if you are seeing someone speak popcorn language, then something is wrong.
|
||||
var/icon = 'icons/misc/language.dmi'
|
||||
var/icon_state = "popcorn"
|
||||
|
||||
/datum/language/proc/display_icon(atom/movable/hearer)
|
||||
var/understands = hearer.has_language(src.type)
|
||||
if(flags & LANGUAGE_HIDE_ICON_IF_UNDERSTOOD && understands)
|
||||
return FALSE
|
||||
if(flags & LANGUAGE_HIDE_ICON_IF_NOT_UNDERSTOOD && !understands)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/language/proc/get_icon()
|
||||
var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/goonchat)
|
||||
return sheet.icon_tag("language-[icon_state]")
|
||||
|
||||
/datum/language/proc/get_random_name(gender, name_count=2, syllable_count=4, syllable_divisor=2)
|
||||
if(!syllables || !syllables.len)
|
||||
if(gender==FEMALE)
|
||||
return capitalize(pick(GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names))
|
||||
else
|
||||
return capitalize(pick(GLOB.first_names_male)) + " " + capitalize(pick(GLOB.last_names))
|
||||
|
||||
var/full_name = ""
|
||||
var/new_name = ""
|
||||
|
||||
for(var/i in 0 to name_count)
|
||||
new_name = ""
|
||||
var/Y = rand(FLOOR(syllable_count/syllable_divisor, 1), syllable_count)
|
||||
for(var/x in Y to 0)
|
||||
new_name += pick(syllables)
|
||||
full_name += " [capitalize(lowertext(new_name))]"
|
||||
|
||||
return "[trim(full_name)]"
|
||||
|
||||
/datum/language/proc/check_cache(input)
|
||||
var/lookup = scramble_cache[input]
|
||||
if(lookup)
|
||||
scramble_cache -= input
|
||||
scramble_cache[input] = lookup
|
||||
. = lookup
|
||||
|
||||
/datum/language/proc/add_to_cache(input, scrambled_text)
|
||||
// Add it to cache, cutting old entries if the list is too long
|
||||
scramble_cache[input] = scrambled_text
|
||||
if(scramble_cache.len > SCRAMBLE_CACHE_LEN)
|
||||
scramble_cache.Cut(1, scramble_cache.len-SCRAMBLE_CACHE_LEN-1)
|
||||
|
||||
/datum/language/proc/scramble(input)
|
||||
|
||||
if(!syllables || !syllables.len)
|
||||
return stars(input)
|
||||
|
||||
// If the input is cached already, move it to the end of the cache and return it
|
||||
var/lookup = check_cache(input)
|
||||
if(lookup)
|
||||
return lookup
|
||||
|
||||
var/input_size = length_char(input)
|
||||
var/scrambled_text = ""
|
||||
var/capitalize = TRUE
|
||||
|
||||
while(length_char(scrambled_text) < input_size)
|
||||
var/next = pick(syllables)
|
||||
if(capitalize)
|
||||
next = capitalize(next)
|
||||
capitalize = FALSE
|
||||
scrambled_text += next
|
||||
var/chance = rand(100)
|
||||
if(chance <= sentence_chance)
|
||||
scrambled_text += ". "
|
||||
capitalize = TRUE
|
||||
else if(chance > sentence_chance && chance <= space_chance)
|
||||
scrambled_text += " "
|
||||
|
||||
scrambled_text = trim(scrambled_text)
|
||||
var/ending = copytext_char(scrambled_text, -1)
|
||||
if(ending == ".")
|
||||
scrambled_text = copytext_char(scrambled_text, 1, -2)
|
||||
var/input_ending = copytext_char(input, -1)
|
||||
if(input_ending in list("!","?","."))
|
||||
scrambled_text += input_ending
|
||||
|
||||
add_to_cache(input, scrambled_text)
|
||||
|
||||
return scrambled_text
|
||||
|
||||
#undef SCRAMBLE_CACHE_LEN
|
||||
#define SCRAMBLE_CACHE_LEN 50 //maximum of 50 specific scrambled lines per language
|
||||
|
||||
/*
|
||||
Datum based languages. Easily editable and modular.
|
||||
*/
|
||||
|
||||
/datum/language
|
||||
var/name = "an unknown language" // Fluff name of language if any.
|
||||
var/desc = "A language." // Short description for 'Check Languages'.
|
||||
var/key // Character used to speak in language
|
||||
// If key is null, then the language isn't real or learnable.
|
||||
var/flags // Various language flags.
|
||||
var/list/syllables // Used when scrambling text for a non-speaker.
|
||||
var/sentence_chance = 5 // Likelihood of making a new sentence after each syllable.
|
||||
var/space_chance = 55 // Likelihood of getting a space in the random scramble string
|
||||
var/list/spans = list()
|
||||
var/list/scramble_cache = list()
|
||||
var/default_priority = 0 // the language that an atom knows with the highest "default_priority" is selected by default.
|
||||
|
||||
// if you are seeing someone speak popcorn language, then something is wrong.
|
||||
var/icon = 'icons/misc/language.dmi'
|
||||
var/icon_state = "popcorn"
|
||||
|
||||
/datum/language/proc/display_icon(atom/movable/hearer)
|
||||
var/understands = hearer.has_language(src.type)
|
||||
if(flags & LANGUAGE_HIDE_ICON_IF_UNDERSTOOD && understands)
|
||||
return FALSE
|
||||
if(flags & LANGUAGE_HIDE_ICON_IF_NOT_UNDERSTOOD && !understands)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/datum/language/proc/get_icon()
|
||||
var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/goonchat)
|
||||
return sheet.icon_tag("language-[icon_state]")
|
||||
|
||||
/datum/language/proc/get_random_name(gender, name_count=2, syllable_count=4, syllable_divisor=2)
|
||||
if(!syllables || !syllables.len)
|
||||
if(gender==FEMALE)
|
||||
return capitalize(pick(GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names))
|
||||
else
|
||||
return capitalize(pick(GLOB.first_names_male)) + " " + capitalize(pick(GLOB.last_names))
|
||||
|
||||
var/full_name = ""
|
||||
var/new_name = ""
|
||||
|
||||
for(var/i in 0 to name_count)
|
||||
new_name = ""
|
||||
var/Y = rand(FLOOR(syllable_count/syllable_divisor, 1), syllable_count)
|
||||
for(var/x in Y to 0)
|
||||
new_name += pick(syllables)
|
||||
full_name += " [capitalize(lowertext(new_name))]"
|
||||
|
||||
return "[trim(full_name)]"
|
||||
|
||||
/datum/language/proc/check_cache(input)
|
||||
var/lookup = scramble_cache[input]
|
||||
if(lookup)
|
||||
scramble_cache -= input
|
||||
scramble_cache[input] = lookup
|
||||
. = lookup
|
||||
|
||||
/datum/language/proc/add_to_cache(input, scrambled_text)
|
||||
// Add it to cache, cutting old entries if the list is too long
|
||||
scramble_cache[input] = scrambled_text
|
||||
if(scramble_cache.len > SCRAMBLE_CACHE_LEN)
|
||||
scramble_cache.Cut(1, scramble_cache.len-SCRAMBLE_CACHE_LEN-1)
|
||||
|
||||
/datum/language/proc/scramble(input)
|
||||
|
||||
if(!syllables || !syllables.len)
|
||||
return stars(input)
|
||||
|
||||
// If the input is cached already, move it to the end of the cache and return it
|
||||
var/lookup = check_cache(input)
|
||||
if(lookup)
|
||||
return lookup
|
||||
|
||||
var/input_size = length_char(input)
|
||||
var/scrambled_text = ""
|
||||
var/capitalize = TRUE
|
||||
|
||||
while(length_char(scrambled_text) < input_size)
|
||||
var/next = pick(syllables)
|
||||
if(capitalize)
|
||||
next = capitalize(next)
|
||||
capitalize = FALSE
|
||||
scrambled_text += next
|
||||
var/chance = rand(100)
|
||||
if(chance <= sentence_chance)
|
||||
scrambled_text += ". "
|
||||
capitalize = TRUE
|
||||
else if(chance > sentence_chance && chance <= space_chance)
|
||||
scrambled_text += " "
|
||||
|
||||
scrambled_text = trim(scrambled_text)
|
||||
var/ending = copytext_char(scrambled_text, -1)
|
||||
if(ending == ".")
|
||||
scrambled_text = copytext_char(scrambled_text, 1, -2)
|
||||
var/input_ending = copytext_char(input, -1)
|
||||
if(input_ending in list("!","?","."))
|
||||
scrambled_text += input_ending
|
||||
|
||||
add_to_cache(input, scrambled_text)
|
||||
|
||||
return scrambled_text
|
||||
|
||||
#undef SCRAMBLE_CACHE_LEN
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/datum/language/machine
|
||||
name = "Encoded Audio Language"
|
||||
desc = "An efficient language of encoded tones developed by synthetics and cyborgs."
|
||||
spans = list(SPAN_ROBOT)
|
||||
key = "6"
|
||||
flags = NO_STUTTER
|
||||
syllables = list("beep","beep","beep","beep","beep","boop","boop","boop","bop","bop","dee","dee","doo","doo","hiss","hss","buzz","buzz","bzz","ksssh","keey","wurr","wahh","tzzz")
|
||||
space_chance = 10
|
||||
default_priority = 90
|
||||
|
||||
icon_state = "eal"
|
||||
|
||||
/datum/language/machine/get_random_name()
|
||||
if(prob(70))
|
||||
return "[pick(GLOB.posibrain_names)]-[rand(100, 999)]"
|
||||
return pick(GLOB.ai_names)
|
||||
/datum/language/machine
|
||||
name = "Encoded Audio Language"
|
||||
desc = "An efficient language of encoded tones developed by synthetics and cyborgs."
|
||||
spans = list(SPAN_ROBOT)
|
||||
key = "6"
|
||||
flags = NO_STUTTER
|
||||
syllables = list("beep","beep","beep","beep","beep","boop","boop","boop","bop","bop","dee","dee","doo","doo","hiss","hss","buzz","buzz","bzz","ksssh","keey","wurr","wahh","tzzz")
|
||||
space_chance = 10
|
||||
default_priority = 90
|
||||
|
||||
icon_state = "eal"
|
||||
|
||||
/datum/language/machine/get_random_name()
|
||||
if(prob(70))
|
||||
return "[pick(GLOB.posibrain_names)]-[rand(100, 999)]"
|
||||
return pick(GLOB.ai_names)
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/datum/language/moffic
|
||||
name = "Moffic"
|
||||
desc = "The language of the Mothpeople borders on complete unintelligibility."
|
||||
key = "m"
|
||||
space_chance = 10
|
||||
syllables = list(
|
||||
"år", "i", "går", "sek", "mo", "ff", "ok", "gj", "ø", "gå", "la", "le",
|
||||
"lit", "ygg", "van", "dår", "næ", "møt", "idd", "hvo", "ja", "på", "han",
|
||||
"så", "ån", "det", "att", "nå", "gö", "bra", "int", "tyc", "om", "när",
|
||||
"två", "må", "dag", "sjä", "vii", "vuo", "eil", "tun", "käyt", "teh", "vä",
|
||||
"hei", "huo", "suo", "ää", "ten", "ja", "heu", "stu", "uhr", "kön", "we", "hön"
|
||||
)
|
||||
icon_state = "moth"
|
||||
default_priority = 90
|
||||
|
||||
// Fuck guest accounts, and fuck language testing.
|
||||
/datum/language/moffic
|
||||
name = "Moffic"
|
||||
desc = "The language of the Mothpeople borders on complete unintelligibility."
|
||||
key = "m"
|
||||
space_chance = 10
|
||||
syllables = list(
|
||||
"år", "i", "går", "sek", "mo", "ff", "ok", "gj", "ø", "gå", "la", "le",
|
||||
"lit", "ygg", "van", "dår", "næ", "møt", "idd", "hvo", "ja", "på", "han",
|
||||
"så", "ån", "det", "att", "nå", "gö", "bra", "int", "tyc", "om", "när",
|
||||
"två", "må", "dag", "sjä", "vii", "vuo", "eil", "tun", "käyt", "teh", "vä",
|
||||
"hei", "huo", "suo", "ää", "ten", "ja", "heu", "stu", "uhr", "kön", "we", "hön"
|
||||
)
|
||||
icon_state = "moth"
|
||||
default_priority = 90
|
||||
|
||||
// Fuck guest accounts, and fuck language testing.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/datum/language/monkey
|
||||
name = "Chimpanzee"
|
||||
desc = "Ook ook ook."
|
||||
key = "1"
|
||||
space_chance = 100
|
||||
syllables = list("oop", "aak", "chee", "eek")
|
||||
default_priority = 80
|
||||
|
||||
icon_state = "animal"
|
||||
/datum/language/monkey
|
||||
name = "Chimpanzee"
|
||||
desc = "Ook ook ook."
|
||||
key = "1"
|
||||
space_chance = 100
|
||||
syllables = list("oop", "aak", "chee", "eek")
|
||||
default_priority = 80
|
||||
|
||||
icon_state = "animal"
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// You n'wah!
|
||||
// many thanks to https://casualscrolls.fandom.com/wiki/Dunmeri_language, for providing this list of syllables
|
||||
/datum/language/shadowtongue
|
||||
name = "Shadowtongue"
|
||||
desc = "What a grand and intoxicating innocence."
|
||||
key = "x"
|
||||
space_chance = 50
|
||||
syllables = list(
|
||||
"er", "sint", "en", "et", "nor", "bahr", "sint", "un", "ku'elm", "lakor", "eri",
|
||||
"noj", "dashilu", "as", "ot", "lih", "morh", "ghinu", "kin", "sha", "marik", "jibu",
|
||||
"sudas", "fut", "kol", "bivi", "pohim", "devohr", "ru", "huirf", "neiris", "sut",
|
||||
"devehr", "iru", "gher", "gan", "ujil", "lacor", "bahris", "ghar", "alnef", "wah",
|
||||
"khurdhar", "bar", "et", "ilu", "dash", "diru", "noj", "de", "damjulan", "luvahr",
|
||||
"telshahr", "tifur", "enhi", "am", "bahr", "nei", "neibahri", "n'chow", "n'wah",
|
||||
"s'wit", "b'vehk", "f'lah", "muth", "sera", "sedura", "bal", "dun"
|
||||
)
|
||||
icon_state = "shadow"
|
||||
default_priority = 90
|
||||
// You n'wah!
|
||||
// many thanks to https://casualscrolls.fandom.com/wiki/Dunmeri_language, for providing this list of syllables
|
||||
/datum/language/shadowtongue
|
||||
name = "Shadowtongue"
|
||||
desc = "What a grand and intoxicating innocence."
|
||||
key = "x"
|
||||
space_chance = 50
|
||||
syllables = list(
|
||||
"er", "sint", "en", "et", "nor", "bahr", "sint", "un", "ku'elm", "lakor", "eri",
|
||||
"noj", "dashilu", "as", "ot", "lih", "morh", "ghinu", "kin", "sha", "marik", "jibu",
|
||||
"sudas", "fut", "kol", "bivi", "pohim", "devohr", "ru", "huirf", "neiris", "sut",
|
||||
"devehr", "iru", "gher", "gan", "ujil", "lacor", "bahris", "ghar", "alnef", "wah",
|
||||
"khurdhar", "bar", "et", "ilu", "dash", "diru", "noj", "de", "damjulan", "luvahr",
|
||||
"telshahr", "tifur", "enhi", "am", "bahr", "nei", "neibahri", "n'chow", "n'wah",
|
||||
"s'wit", "b'vehk", "f'lah", "muth", "sera", "sedura", "bal", "dun"
|
||||
)
|
||||
icon_state = "shadow"
|
||||
default_priority = 90
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
// The language of the podpeople. Yes, it's a shameless ripoff of elvish.
|
||||
/datum/language/sylvan
|
||||
name = "Sylvan"
|
||||
desc = "A complicated, ancient language spoken by sentient plants."
|
||||
key = "h"
|
||||
space_chance = 20
|
||||
syllables = list(
|
||||
"fii", "sii", "rii", "rel", "maa", "ala", "san", "tol", "tok", "dia", "eres",
|
||||
"fal", "tis", "bis", "qel", "aras", "losk", "rasa", "eob", "hil", "tanl", "aere",
|
||||
"fer", "bal", "pii", "dala", "ban", "foe", "doa", "cii", "uis", "mel", "wex",
|
||||
"incas", "int", "elc", "ent", "aws", "qip", "nas", "vil", "jens", "dila", "fa",
|
||||
"la", "re", "do", "ji", "ae", "so", "qe", "ce", "na", "mo", "ha", "yu"
|
||||
)
|
||||
icon_state = "plant"
|
||||
default_priority = 90
|
||||
// The language of the podpeople. Yes, it's a shameless ripoff of elvish.
|
||||
/datum/language/sylvan
|
||||
name = "Sylvan"
|
||||
desc = "A complicated, ancient language spoken by sentient plants."
|
||||
key = "h"
|
||||
space_chance = 20
|
||||
syllables = list(
|
||||
"fii", "sii", "rii", "rel", "maa", "ala", "san", "tol", "tok", "dia", "eres",
|
||||
"fal", "tis", "bis", "qel", "aras", "losk", "rasa", "eob", "hil", "tanl", "aere",
|
||||
"fer", "bal", "pii", "dala", "ban", "foe", "doa", "cii", "uis", "mel", "wex",
|
||||
"incas", "int", "elc", "ent", "aws", "qip", "nas", "vil", "jens", "dila", "fa",
|
||||
"la", "re", "do", "ji", "ae", "so", "qe", "ce", "na", "mo", "ha", "yu"
|
||||
)
|
||||
icon_state = "plant"
|
||||
default_priority = 90
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/datum/language/terrum
|
||||
name = "Terrum"
|
||||
desc = "The language of the golems. Sounds similar to old-earth Hebrew."
|
||||
key = "g"
|
||||
space_chance = 40
|
||||
syllables = list(
|
||||
"sha", "vu", "nah", "ha", "yom", "ma", "cha", "ar", "et", "mol", "lua",
|
||||
"ch", "na", "sh", "ni", "yah", "bes", "ol", "hish", "ev", "la", "ot", "la",
|
||||
"khe", "tza", "chak", "hak", "hin", "hok", "lir", "tov", "yef", "yfe",
|
||||
"cho", "ar", "kas", "kal", "ra", "lom", "im", "'", "'", "'", "'", "bok",
|
||||
"erev", "shlo", "lo", "ta", "im", "yom"
|
||||
)
|
||||
icon_state = "golem"
|
||||
default_priority = 90
|
||||
/datum/language/terrum
|
||||
name = "Terrum"
|
||||
desc = "The language of the golems. Sounds similar to old-earth Hebrew."
|
||||
key = "g"
|
||||
space_chance = 40
|
||||
syllables = list(
|
||||
"sha", "vu", "nah", "ha", "yom", "ma", "cha", "ar", "et", "mol", "lua",
|
||||
"ch", "na", "sh", "ni", "yah", "bes", "ol", "hish", "ev", "la", "ot", "la",
|
||||
"khe", "tza", "chak", "hak", "hin", "hok", "lir", "tov", "yef", "yfe",
|
||||
"cho", "ar", "kas", "kal", "ra", "lom", "im", "'", "'", "'", "'", "bok",
|
||||
"erev", "shlo", "lo", "ta", "im", "yom"
|
||||
)
|
||||
icon_state = "golem"
|
||||
default_priority = 90
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// One of these languages will actually work, I'm certain of it.
|
||||
/datum/language/voltaic
|
||||
name = "Voltaic"
|
||||
desc = "A sparky language made by manipulating electrical discharge."
|
||||
key = "v"
|
||||
space_chance = 20
|
||||
syllables = list(
|
||||
"bzzt", "skrrt", "zzp", "mmm", "hzz", "tk", "shz", "k", "z",
|
||||
"bzt", "zzt", "skzt", "skzz", "hmmt", "zrrt", "hzzt", "hz",
|
||||
"vzt", "zt", "vz", "zip", "tzp", "lzzt", "dzzt", "zdt", "kzt",
|
||||
"zzzz", "mzz"
|
||||
)
|
||||
icon_state = "volt"
|
||||
default_priority = 90
|
||||
// One of these languages will actually work, I'm certain of it.
|
||||
/datum/language/voltaic
|
||||
name = "Voltaic"
|
||||
desc = "A sparky language made by manipulating electrical discharge."
|
||||
key = "v"
|
||||
space_chance = 20
|
||||
syllables = list(
|
||||
"bzzt", "skrrt", "zzp", "mmm", "hzz", "tk", "shz", "k", "z",
|
||||
"bzt", "zzt", "skzt", "skzz", "hmmt", "zrrt", "hzzt", "hz",
|
||||
"vzt", "zt", "vz", "zip", "tzp", "lzzt", "dzzt", "zdt", "kzt",
|
||||
"zzzz", "mzz"
|
||||
)
|
||||
icon_state = "volt"
|
||||
default_priority = 90
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/datum/language/xenocommon
|
||||
name = "Xenomorph"
|
||||
desc = "The common tongue of the xenomorphs."
|
||||
key = "4"
|
||||
syllables = list("sss","sSs","SSS")
|
||||
default_priority = 50
|
||||
|
||||
icon_state = "xeno"
|
||||
/datum/language/xenocommon
|
||||
name = "Xenomorph"
|
||||
desc = "The common tongue of the xenomorphs."
|
||||
key = "4"
|
||||
syllables = list("sss","sSs","SSS")
|
||||
default_priority = 50
|
||||
|
||||
icon_state = "xeno"
|
||||
|
||||
Reference in New Issue
Block a user