mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Added a new language-scrambling proc for listeners who don't speak the language.
This commit is contained in:
@@ -84,6 +84,9 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
|
|||||||
/obj/machinery/hologram/holopad/hear_talk(mob/living/M, text, verb, datum/language/speaking)
|
/obj/machinery/hologram/holopad/hear_talk(mob/living/M, text, verb, datum/language/speaking)
|
||||||
if(M&&hologram&&master)//Master is mostly a safety in case lag hits or something.
|
if(M&&hologram&&master)//Master is mostly a safety in case lag hits or something.
|
||||||
if(!master.say_understands(M, speaking))//The AI will be able to understand most mobs talking through the holopad.
|
if(!master.say_understands(M, speaking))//The AI will be able to understand most mobs talking through the holopad.
|
||||||
|
if(speaking)
|
||||||
|
text = speaking.scramble(text)
|
||||||
|
else
|
||||||
text = stars(text)
|
text = stars(text)
|
||||||
var/name_used = M.GetVoice()
|
var/name_used = M.GetVoice()
|
||||||
//This communication is imperfect because the holopad "filters" voices and is only designed to connect to the master only.
|
//This communication is imperfect because the holopad "filters" voices and is only designed to connect to the master only.
|
||||||
|
|||||||
@@ -35,6 +35,9 @@
|
|||||||
if(istype(speaker,/mob/living/simple_animal))
|
if(istype(speaker,/mob/living/simple_animal))
|
||||||
var/mob/living/simple_animal/S = speaker
|
var/mob/living/simple_animal/S = speaker
|
||||||
message = pick(S.speak)
|
message = pick(S.speak)
|
||||||
|
else
|
||||||
|
if(language)
|
||||||
|
message = language.scramble(message)
|
||||||
else
|
else
|
||||||
message = stars(message)
|
message = stars(message)
|
||||||
|
|
||||||
@@ -96,6 +99,9 @@
|
|||||||
message = pick(S.speak)
|
message = pick(S.speak)
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
|
else
|
||||||
|
if(language)
|
||||||
|
message = language.scramble(language)
|
||||||
else
|
else
|
||||||
message = stars(message)
|
message = stars(message)
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,37 @@
|
|||||||
var/key = "x" // Character used to speak in language eg. :o for Unathi.
|
var/key = "x" // Character used to speak in language eg. :o for Unathi.
|
||||||
var/flags = 0 // Various language flags.
|
var/flags = 0 // Various language flags.
|
||||||
var/native // If set, non-native speakers will have trouble speaking.
|
var/native // If set, non-native speakers will have trouble speaking.
|
||||||
|
var/list/syllables // Used when scrambling text for a non-speaker.
|
||||||
|
var/list/space_chance = 55 // Likelihood of getting a space in the random scramble string.
|
||||||
|
|
||||||
|
/datum/language/proc/scramble(var/input)
|
||||||
|
|
||||||
|
if(!syllables || !syllables.len)
|
||||||
|
return stars(input)
|
||||||
|
|
||||||
|
var/input_size = length(input)
|
||||||
|
var/scrambled_text = ""
|
||||||
|
var/capitalize = 1
|
||||||
|
|
||||||
|
while(length(scrambled_text) < input_size)
|
||||||
|
var/next = pick(syllables)
|
||||||
|
if(capitalize)
|
||||||
|
next = capitalize(next)
|
||||||
|
capitalize = 0
|
||||||
|
scrambled_text += next
|
||||||
|
var/chance = rand(100)
|
||||||
|
if(chance <= 5)
|
||||||
|
scrambled_text += ". "
|
||||||
|
capitalize = 1
|
||||||
|
else if(chance > 5 && 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)
|
||||||
|
scrambled_text += copytext(input, length(input))
|
||||||
|
return scrambled_text
|
||||||
|
|
||||||
/datum/language/proc/format_message(message, verb)
|
/datum/language/proc/format_message(message, verb)
|
||||||
return "[verb], <span class='message'><span class='[colour]'>\"[capitalize(message)]\"</span></span>"
|
return "[verb], <span class='message'><span class='[colour]'>\"[capitalize(message)]\"</span></span>"
|
||||||
@@ -72,6 +103,7 @@
|
|||||||
colour = "soghun"
|
colour = "soghun"
|
||||||
key = "o"
|
key = "o"
|
||||||
flags = WHITELISTED
|
flags = WHITELISTED
|
||||||
|
syllables = list("ss","ss","ss","ss","skak","seeki","resh","las","esi","kor","sh")
|
||||||
|
|
||||||
/datum/language/tajaran
|
/datum/language/tajaran
|
||||||
name = "Siik'tajr"
|
name = "Siik'tajr"
|
||||||
@@ -82,6 +114,10 @@
|
|||||||
colour = "tajaran"
|
colour = "tajaran"
|
||||||
key = "j"
|
key = "j"
|
||||||
flags = WHITELISTED
|
flags = WHITELISTED
|
||||||
|
syllables = list("rr","rr","tajr","kir","raj","kii","mir","kra","ahk","nal","vah","khaz","jri","ran","darr", \
|
||||||
|
"mi","jri","dynh","manq","rhe","zar","rrhaz","kal","chur","eech","thaa","dra","jurl","mah","sanu","dra","ii'r", \
|
||||||
|
"ka","aasi","far","wa","baq","ara","qara","zir","sam","mak","hrar","nja","rir","khan","jun","dar","rik","kah", \
|
||||||
|
"hal","ket","jurl","mah","tul","cresh","azu","ragh")
|
||||||
|
|
||||||
/datum/language/skrell
|
/datum/language/skrell
|
||||||
name = "Skrellian"
|
name = "Skrellian"
|
||||||
@@ -92,6 +128,7 @@
|
|||||||
colour = "skrell"
|
colour = "skrell"
|
||||||
key = "k"
|
key = "k"
|
||||||
flags = WHITELISTED
|
flags = WHITELISTED
|
||||||
|
syllables = list("wub","wub","wub","wub","wub","wub","wub","WUB","vwwwworp","SO-LET-THE-BEAT-DROP")
|
||||||
|
|
||||||
/datum/language/vox
|
/datum/language/vox
|
||||||
name = "Vox-pidgin"
|
name = "Vox-pidgin"
|
||||||
@@ -102,6 +139,8 @@
|
|||||||
colour = "vox"
|
colour = "vox"
|
||||||
key = "5"
|
key = "5"
|
||||||
flags = RESTRICTED
|
flags = RESTRICTED
|
||||||
|
syllables = list("ti","ti","ti","hi","hi","ki","ki","ki","ki","ya","ta","ha","ka","ya","chi","cha","kah", \
|
||||||
|
"SKRE","AHK","EHK","RAWK","KRA","AAA","EEE","KI","II","KRI","KA")
|
||||||
|
|
||||||
/datum/language/diona
|
/datum/language/diona
|
||||||
name = "Rootspeak"
|
name = "Rootspeak"
|
||||||
@@ -112,6 +151,7 @@
|
|||||||
colour = "soghun"
|
colour = "soghun"
|
||||||
key = "q"
|
key = "q"
|
||||||
flags = RESTRICTED
|
flags = RESTRICTED
|
||||||
|
syllables = list("hs","zt","kr","st","sh")
|
||||||
|
|
||||||
/datum/language/common
|
/datum/language/common
|
||||||
name = "Galactic Common"
|
name = "Galactic Common"
|
||||||
@@ -120,6 +160,7 @@
|
|||||||
whisper_verb = "whispers"
|
whisper_verb = "whispers"
|
||||||
key = "0"
|
key = "0"
|
||||||
flags = RESTRICTED
|
flags = RESTRICTED
|
||||||
|
syllables = list("blah","blah","blah","bleh","meh","neh","nah","wah")
|
||||||
|
|
||||||
//TODO flag certain languages to use the mob-type specific say_quote and then get rid of these.
|
//TODO flag certain languages to use the mob-type specific say_quote and then get rid of these.
|
||||||
/datum/language/common/get_spoken_verb(var/msg_end)
|
/datum/language/common/get_spoken_verb(var/msg_end)
|
||||||
@@ -154,6 +195,8 @@
|
|||||||
speech_verb = "enunciates"
|
speech_verb = "enunciates"
|
||||||
colour = "say_quote"
|
colour = "say_quote"
|
||||||
key = "2"
|
key = "2"
|
||||||
|
space_chance = 70
|
||||||
|
syllables = list("bu","chu","fu","dru","po","cha","lu","du","du","lo","shu","nu","he","gu")
|
||||||
|
|
||||||
/datum/language/gutter
|
/datum/language/gutter
|
||||||
name = "Gutter"
|
name = "Gutter"
|
||||||
@@ -161,6 +204,7 @@
|
|||||||
speech_verb = "growls"
|
speech_verb = "growls"
|
||||||
colour = "rough"
|
colour = "rough"
|
||||||
key = "3"
|
key = "3"
|
||||||
|
syllables = list ("gra","ba","ba","breh","bra","rah","dur","ra","ro","gro","go","ber","bar","geh","heh", "gra")
|
||||||
|
|
||||||
/datum/language/xenocommon
|
/datum/language/xenocommon
|
||||||
name = "Xenomorph"
|
name = "Xenomorph"
|
||||||
|
|||||||
Reference in New Issue
Block a user