diff --git a/code/modules/mob/language.dm b/code/modules/mob/language.dm index 88a89bc3c87..4ab6036d9cf 100644 --- a/code/modules/mob/language.dm +++ b/code/modules/mob/language.dm @@ -4,6 +4,7 @@ /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/colour = "say_quote" // CSS style to use for strings in this language. var/key = "x" // Character used to speak in language eg. :o for Unathi. @@ -12,69 +13,56 @@ /datum/language/unathi name = "Sinta'unathi" + desc = "The common language of Moghes, composed of sibilant hisses and rattles. Spoken natively by Unathi." speech_verb = "hisses" colour = "soghun" - key = "o" - native = "Unathi" - flags = RESTRICTED + key = "una" + flags = WHITELISTED /datum/language/tajaran - name = "Siik'tjar" + name = "Siik'tajr" + desc = "An expressive language that combines yowls and chirps with posture, tail and ears. Native to the Tajaran." speech_verb = "mrowls" colour = "tajaran" - key = "j" - native = "Tajaran" - flags = RESTRICTED + key = "taj" + flags = WHITELISTED /datum/language/skrell name = "Skrellian" + desc = "A melodic and complex language spoken by the Skrell of Qerrbalak. Some of the notes are inaudible to humans." speech_verb = "warbles" colour = "skrell" - key = "k" - native = "Skrell" - flags = RESTRICTED + key = "skr" + flags = WHITELISTED /datum/language/vox name = "Vox-pidgin" + desc = "The common tongue of the various Vox ships making up the Shoal. It sounds like chaotic shrieking to everyone else." speech_verb = "shrieks" colour = "vox" - key = "v" - native = "Vox" + key = "vox" flags = RESTRICTED +/* /datum/language/human name = "Sol Common" - key = "1" - native = "Human" + desc = "A bastardized hybrid of informal English and elements of Mandarin Chinese; the common language of the Sol system." + key = "hum" flags = RESTRICTED -//Pidgin languages, imperfectly speakable by people not a member of the core species. - -/datum/language/unathi/common - name = "Common Unathi" - flags = WHITELISTED - -/datum/language/tajaran/common - name = "Siik'mas" - flags = WHITELISTED - -/datum/language/skrell/common - name = "Common Skrell" - flags = WHITELISTED - -/datum/language/human/common - name = "Common Human" - flags = WHITELISTED - // Galactic common languages (systemwide accepted standards). - /datum/language/trader name = "Tradeband" + desc = "Maintained by the various trading cartels in major systems, this elegant, structured language is used for bartering and bargaining." + speech_verb = "enunciates" key = "tra" /datum/language/gutter name = "Gutter" + desc = "Much like Standard, this crude pidgin tongue descended from numerous languages and serves as Tradeband for criminal elements." + speech_verb = "growls" key = "gut" +*/ // Language handling. /mob/proc/add_language(var/language) diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index fbc06d00c6b..b79b974d537 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -105,7 +105,10 @@ message = slur(message) ..(message) -/mob/living/carbon/human/say_understands(var/other) +/mob/living/carbon/human/say_understands(var/other,var/datum/language/speaking = null) + + if(has_brain_worms()) //Brain worms translate everything. Even mice and alien speak. + return 1 if (istype(other, /mob/living/silicon/ai)) return 1 if (istype(other, /mob/living/silicon/decoy)) diff --git a/code/modules/mob/living/carbon/species.dm b/code/modules/mob/living/carbon/species.dm index 4ddd67e90c3..e2638d01c39 100644 --- a/code/modules/mob/living/carbon/species.dm +++ b/code/modules/mob/living/carbon/species.dm @@ -58,7 +58,7 @@ name = "Tajaran" icobase = 'icons/mob/human_races/r_tajaran.dmi' deform = 'icons/mob/human_races/r_def_tajaran.dmi' - language = "Siik'mas" + language = "Siik'tajr" tail = "tajtail" attack_verb = "scratch" darksight = 8 diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index a73e7230bf1..69d62106f48 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -86,7 +86,6 @@ var/list/department_radio_keys = list( /mob/living/say(var/message) - //world << "[src] speaks! [message]" message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN)) message = capitalize(message) @@ -125,7 +124,7 @@ var/list/department_radio_keys = list( var/italics = 0 var/message_range = null var/message_mode = null - var/datum/language/speaking //For use if a specific language is being spoken. + var/datum/language/speaking = null //For use if a specific language is being spoken. // If brain damaged, talk on headset at random. if (getBrainLoss() >= 60 && prob(50)) @@ -146,11 +145,9 @@ var/list/department_radio_keys = list( //Check if the person is speaking a language that they know. for(var/datum/language/L in languages) if(lowertext(channel_prefix) == ":[L.key]") - //world << "Key [L.key] matches [lowertext(channel_prefix)] for [src]." speaking = L break message_mode = department_radio_keys[channel_prefix] - //world << "channel_prefix=[channel_prefix]; message_mode=[message_mode]" if (message_mode) message = trim(copytext(message, 3)) if (!(ishuman(src) || istype(src, /mob/living/simple_animal/parrot) || isrobot(src) && (message_mode=="department" || (message_mode in radiochannels)))) @@ -367,38 +364,12 @@ var/list/department_radio_keys = list( for (var/M in listening) if(hascall(M,"say_understands")) - if ((M:say_understands(src) && !speaking)) - //world << "[M] understood [src] (0)." + if (M:say_understands(src,speaking)) heard_a += M - else if(ismob(M)) - - // If speaking is set, it means that a language has been found that uses the given key. - // If it hasn't, then they are likely just speaking English. - - var/understood - var/mob/P = M - if (speaking) - for(var/datum/language/L in P.languages) - if(speaking.name == L.name) - understood = 1 - if(understood || P.universal_speak) - //world << "[M] understood [src] (1)." - heard_a += M - else if(istype(P,/mob/living/carbon/human)) - var/mob/living/carbon/human/H = P - if(H.has_brain_worms()) // Brain worms act like Babelfish. - heard_a += M - else - heard_b += M - else - //world << "[M] didn't understand [src]." - heard_b += M - else - heard_a += M - else - //world << "[M] understood [src] (2)." - heard_a += M + heard_b += M + else + heard_a += M var/speech_bubble_test = say_test(message) var/image/speech_bubble = image('icons/mob/talk.dmi',src,"h[speech_bubble_test]") diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 43c617ffdda..9be3e84095e 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -61,17 +61,30 @@ M.show_message(rendered, 2) //Takes into account blindness and such. return -/mob/proc/say_understands(var/mob/other) +/mob/proc/say_understands(var/mob/other,var/datum/language/speaking = null) if(!other) return 1 - if (src.stat == 2) - return 1 - else if (istype(other, src.type)) + else if (src.stat == 2) return 1 + else if (speaking) //Language check. + + var/understood + for(var/datum/language/L in src.languages) + if(speaking.name == L.name) + understood = 1 + break + + if(understood || universal_speak) + return 1 + else + return 0 + else if(other.universal_speak || src.universal_speak) return 1 else if(isAI(src) && ispAI(other)) return 1 + else if (istype(other, src.type)) + return 1 return 0 /mob/proc/say_quote(var/text,var/datum/language/speaking) @@ -80,26 +93,28 @@ //tcomms code is still runtiming somewhere here var/ending = copytext(text, length(text)) - if (speaking) - return "[speaking.speech_verb] in [speaking.name], \"[text]\""; + var/speechverb = "" -//Needs Virus2 -// if (src.disease_symptoms & DISEASE_HOARSE) -// return "rasps, \"[text]\""; - if (src.stuttering) - return "stammers, \"[text]\""; - if (src.slurring) - return "slurrs, \"[text]\""; - if(isliving(src)) + if (speaking) + speechverb = "[speaking.speech_verb], \"" + else if (src.stuttering) + speechverb = "stammers, \"" + else if (src.slurring) + speechverb = "slurrs, \"" + else if (ending == "?") + speechverb = "asks, \"" + else if (ending == "!") + speechverb = "exclaims, \"" + else if(isliving(src)) var/mob/living/L = src if (L.getBrainLoss() >= 60) - return "gibbers, \"[text]\""; - if (ending == "?") - return "asks, \"[text]\""; - if (ending == "!") - return "exclaims, \"[text]\""; + speechverb = "gibbers, \"" + else + speechverb = "says, \"" + else + speechverb = "says, \"" - return "says, \"[text]\""; + return "[speechverb][text]\"" /mob/proc/emote(var/act, var/type, var/message) if(act == "me")