April sync (#360)
* Maps and things no code/icons * helpers defines globalvars * Onclick world.dm orphaned_procs * subsystems Round vote and shuttle autocall done here too * datums * Game folder * Admin - chatter modules * clothing - mining * modular computers - zambies * client * mob level 1 * mob stage 2 + simple_animal * silicons n brains * mob stage 3 + Alien/Monkey * human mobs * icons updated * some sounds * emitter y u no commit * update tgstation.dme * compile fixes * travis fixes Also removes Fast digest mode, because reasons. * tweaks for travis Mentors are broke again Also fixes Sizeray guns * oxygen loss fix for vore code. * removes unused code * some code updates * bulk fixes * further fixes * outside things * whoops. * Maint bar ported * GLOBs.
This commit is contained in:
70
code/modules/language/common.dm
Normal file
70
code/modules/language/common.dm
Normal file
@@ -0,0 +1,70 @@
|
||||
// 'basic' language; spoken by default.
|
||||
/datum/language/common
|
||||
name = "Galactic Common"
|
||||
desc = "The common galactic tongue."
|
||||
speech_verb = "says"
|
||||
whisper_verb = "whispers"
|
||||
key = "0"
|
||||
flags = TONGUELESS_SPEECH
|
||||
default_priority = 100
|
||||
|
||||
//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")
|
||||
14
code/modules/language/drone.dm
Normal file
14
code/modules/language/drone.dm
Normal file
@@ -0,0 +1,14 @@
|
||||
/datum/language/drone
|
||||
name = "Drone"
|
||||
desc = "A heavily encoded damage control coordination stream, with special flags for hats."
|
||||
speech_verb = "chitters"
|
||||
ask_verb = "chitters inquisitively"
|
||||
exclaim_verb = "chitters loudly"
|
||||
spans = list(SPAN_ROBOT)
|
||||
key = "d"
|
||||
flags = NO_STUTTER
|
||||
syllables = list(".", "|")
|
||||
// ...|..||.||||.|.||.|.|.|||.|||
|
||||
space_chance = 0
|
||||
sentence_chance = 0
|
||||
default_priority = 20
|
||||
95
code/modules/language/language.dm
Normal file
95
code/modules/language/language.dm
Normal file
@@ -0,0 +1,95 @@
|
||||
#define SCRAMBLE_CACHE_LEN 20
|
||||
|
||||
/*
|
||||
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/speech_verb = "says" // 'says', 'hisses', 'farts'.
|
||||
var/ask_verb = "asks" // Used when sentence ends in a ?
|
||||
var/exclaim_verb = "exclaims" // Used when sentence ends in a !
|
||||
var/whisper_verb = "whispers" // Optional. When not specified speech_verb + quietly/softly is used instead.
|
||||
var/list/signlang_verb = list("signs", "gestures") // list of emotes that might be displayed if this language has NONVERBAL or SIGNLANG flags
|
||||
var/key = "x" // Character used to speak in language
|
||||
var/flags // Various language flags.
|
||||
var/list/syllables // Used when scrambling text for a non-speaker.
|
||||
var/list/sentence_chance = 5 // Likelihood of making a new sentence after each syllable.
|
||||
var/list/space_chance = 55 // Likelihood of getting a space in the random scramble string
|
||||
var/list/spans = list()
|
||||
var/static/list/scramble_cache = list()
|
||||
var/default_priority = 0 // the language that an atom knows with the highest "default_priority" is selected by default.
|
||||
|
||||
/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), 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/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 = scramble_cache[input]
|
||||
if(lookup)
|
||||
scramble_cache -= input
|
||||
scramble_cache[input] = lookup
|
||||
return lookup
|
||||
|
||||
var/input_size = length(input)
|
||||
var/scrambled_text = ""
|
||||
var/capitalize = TRUE
|
||||
|
||||
while(length(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(scrambled_text, length(scrambled_text))
|
||||
if(ending == ".")
|
||||
scrambled_text = copytext(scrambled_text,1,length(scrambled_text)-1)
|
||||
var/input_ending = copytext(input, input_size)
|
||||
if(input_ending in list("!","?","."))
|
||||
scrambled_text += input_ending
|
||||
|
||||
// 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)
|
||||
|
||||
return scrambled_text
|
||||
|
||||
/datum/language/proc/get_spoken_verb(msg_end)
|
||||
switch(msg_end)
|
||||
if("!")
|
||||
return exclaim_verb
|
||||
if("?")
|
||||
return ask_verb
|
||||
return speech_verb
|
||||
|
||||
#undef SCRAMBLE_CACHE_LEN
|
||||
88
code/modules/language/language_menu.dm
Normal file
88
code/modules/language/language_menu.dm
Normal file
@@ -0,0 +1,88 @@
|
||||
/datum/language_menu
|
||||
var/mob/living/owner
|
||||
|
||||
/datum/language_menu/New(new_owner)
|
||||
owner = new_owner
|
||||
|
||||
/datum/language_menu/Destroy()
|
||||
owner = null
|
||||
. = ..()
|
||||
|
||||
/datum/language_menu/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.language_menu_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "language_menu", "Language Menu", 700, 800, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/datum/language_menu/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
var/datum/language/mob_default_language = owner.get_default_language()
|
||||
|
||||
data["languages"] = list()
|
||||
for(var/ld in owner.languages)
|
||||
var/datum/language/LD = ld
|
||||
var/list/L = list()
|
||||
|
||||
L["name"] = initial(LD.name)
|
||||
L["desc"] = initial(LD.desc)
|
||||
L["key"] = initial(LD.key)
|
||||
L["is_default"] = (LD == mob_default_language)
|
||||
L["can_speak"] = owner.can_speak_in_language(LD)
|
||||
|
||||
data["languages"] += list(L)
|
||||
|
||||
if(check_rights_for(user.client, R_ADMIN))
|
||||
data["admin_mode"] = TRUE
|
||||
data["omnitongue"] = HAS_SECONDARY_FLAG(owner, OMNITONGUE)
|
||||
|
||||
data["unknown_languages"] = list()
|
||||
for(var/ld in subtypesof(/datum/language))
|
||||
if(owner.has_language(ld))
|
||||
continue
|
||||
var/datum/language/LD = ld
|
||||
var/list/L = list()
|
||||
|
||||
L["name"] = initial(LD.name)
|
||||
L["desc"] = initial(LD.desc)
|
||||
L["key"] = initial(LD.key)
|
||||
|
||||
data["unknown_languages"] += list(L)
|
||||
return data
|
||||
|
||||
/datum/language_menu/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
var/mob/user = usr
|
||||
|
||||
var/language_name = params["language_name"]
|
||||
var/datum/language/language_datum
|
||||
for(var/ld in subtypesof(/datum/language))
|
||||
var/datum/language/LD = ld
|
||||
if(language_name == initial(LD.name))
|
||||
language_datum = LD
|
||||
var/is_admin = check_rights_for(user.client, R_ADMIN)
|
||||
|
||||
switch(action)
|
||||
if("select_default")
|
||||
if(language_datum)
|
||||
owner.selected_default_language = language_datum
|
||||
. = TRUE
|
||||
if("grant_language")
|
||||
if(is_admin && language_datum)
|
||||
owner.grant_language(language_datum)
|
||||
message_admins("[key_name_admin(user)] granted the [language_name] language to [key_name_admin(owner)].")
|
||||
log_admin("[key_name(user)] granted the language [language_name] to [key_name(owner)].")
|
||||
. = TRUE
|
||||
if("remove_language")
|
||||
if(is_admin && language_datum)
|
||||
owner.remove_language(language_datum)
|
||||
message_admins("[key_name_admin(user)] removed the [language_name] language to [key_name_admin(owner)].")
|
||||
log_admin("[key_name(user)] removed the language [language_name] to [key_name(owner)].")
|
||||
. = TRUE
|
||||
if("toggle_omnitongue")
|
||||
if(is_admin)
|
||||
TOGGLE_SECONDARY_FLAG(owner, OMNITONGUE)
|
||||
message_admins("[key_name_admin(user)] [HAS_SECONDARY_FLAG(owner, OMNITONGUE) ? "enabled" : "disabled"] the ability to speak all languages (that they know) of [key_name_admin(owner)].")
|
||||
log_admin("[key_name(user)] [HAS_SECONDARY_FLAG(owner, OMNITONGUE) ? "enabled" : "disabled"] the ability to speak all languages (that_they know) of [key_name(owner)].")
|
||||
. = TRUE
|
||||
17
code/modules/language/machine.dm
Normal file
17
code/modules/language/machine.dm
Normal file
@@ -0,0 +1,17 @@
|
||||
/datum/language/machine
|
||||
name = "Encoded Audio Language"
|
||||
desc = "An efficient language of encoded tones developed by synthetics and cyborgs."
|
||||
speech_verb = "whistles"
|
||||
ask_verb = "chirps"
|
||||
exclaim_verb = "whistles loudly"
|
||||
spans = list(SPAN_ROBOT, "changeling")
|
||||
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
|
||||
|
||||
/datum/language/machine/get_random_name()
|
||||
if(prob(70))
|
||||
return "[pick(GLOB.posibrain_names)]-[rand(100, 999)]"
|
||||
return pick(GLOB.ai_names)
|
||||
10
code/modules/language/monkey.dm
Normal file
10
code/modules/language/monkey.dm
Normal file
@@ -0,0 +1,10 @@
|
||||
/datum/language/monkey
|
||||
name = "Chimpanzee"
|
||||
desc = "Ook ook ook."
|
||||
speech_verb = "chimpers"
|
||||
ask_verb = "chimpers"
|
||||
exclaim_verb = "screeches"
|
||||
key = "1"
|
||||
space_chance = 100
|
||||
syllables = list("oop", "aak", "chee", "eek")
|
||||
default_priority = 80
|
||||
12
code/modules/language/ratvar.dm
Normal file
12
code/modules/language/ratvar.dm
Normal file
@@ -0,0 +1,12 @@
|
||||
/datum/language/ratvar
|
||||
name = "Ratvarian"
|
||||
desc = "A timeless language full of power and incomprehensible to the unenlightened."
|
||||
speech_verb = "clinks"
|
||||
ask_verb = "clunks"
|
||||
exclaim_verb = "clanks"
|
||||
key = "r"
|
||||
default_priority = 10
|
||||
spans = list(SPAN_ROBOT, "brass")
|
||||
|
||||
/datum/language/ratvar/scramble(var/input)
|
||||
. = text2ratvar(input)
|
||||
10
code/modules/language/slime.dm
Normal file
10
code/modules/language/slime.dm
Normal file
@@ -0,0 +1,10 @@
|
||||
/datum/language/slime
|
||||
name = "Slime"
|
||||
desc = "A melodic and complex language spoken by slimes. Some of the notes are inaudible to humans."
|
||||
speech_verb = "warbles"
|
||||
ask_verb = "warbles"
|
||||
exclaim_verb = "warbles"
|
||||
spans = list("slime")
|
||||
key = "k"
|
||||
syllables = list("qr","qrr","xuq","qil","quum","xuqm","vol","xrim","zaoo","qu-uu","qix","qoo","zix","*","!")
|
||||
default_priority = 70
|
||||
42
code/modules/language/swarmer.dm
Normal file
42
code/modules/language/swarmer.dm
Normal file
@@ -0,0 +1,42 @@
|
||||
/datum/language/swarmer
|
||||
name = "Swarmer"
|
||||
desc = "A language only consisting of musical notes."
|
||||
speech_verb = "tones"
|
||||
ask_verb = "tones inquisitively"
|
||||
exclaim_verb = "tones loudly"
|
||||
spans = list(SPAN_ROBOT)
|
||||
key = "s"
|
||||
flags = NO_STUTTER
|
||||
space_chance = 100
|
||||
sentence_chance = 0
|
||||
default_priority = 60
|
||||
// since various flats and sharps are the same,
|
||||
// all non-accidental notes are doubled in the list
|
||||
/* The list with unicode symbols for the accents.
|
||||
syllables = list(
|
||||
"C", "C",
|
||||
"C♯", "D♭",
|
||||
"D", "D",
|
||||
"D♯", "E♭",
|
||||
"E", "E",
|
||||
"F", "F",
|
||||
"F♯", "G♭",
|
||||
"G", "G",
|
||||
"G♯", "A♭",
|
||||
"A", "A",
|
||||
"A♯", "B♭",
|
||||
"B", "B")
|
||||
*/
|
||||
syllables = list(
|
||||
"C", "C",
|
||||
"C#", "Db",
|
||||
"D", "D",
|
||||
"D#", "Eb",
|
||||
"E", "E",
|
||||
"F", "F",
|
||||
"F#", "Gb",
|
||||
"G", "G",
|
||||
"G#", "Ab",
|
||||
"A", "A",
|
||||
"A#", "Bb",
|
||||
"B", "B")
|
||||
10
code/modules/language/xenocommon.dm
Normal file
10
code/modules/language/xenocommon.dm
Normal file
@@ -0,0 +1,10 @@
|
||||
/datum/language/xenocommon
|
||||
name = "Xenomorph"
|
||||
desc = "The common tongue of the xenomorphs."
|
||||
speech_verb = "hisses"
|
||||
ask_verb = "hisses"
|
||||
exclaim_verb = "hisses"
|
||||
spans = list("alien")
|
||||
key = "4"
|
||||
syllables = list("sss","sSs","SSS")
|
||||
default_priority = 50
|
||||
Reference in New Issue
Block a user