mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-31 09:00:25 +01:00
Adds the ability to partially understand other languages and a bit more (#4625)
Ports the feature added in Baystation12/Baystation12#19868, it allows people that knows a certain language to understand some words from another language, without needing to have it. It is used in all tajaran and unathi languages for now, Already consulted the lore team and it seems this is all they want so far. Also, it adds Delvahhi, a zhan language.
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#define LANGUAGE_SIIK_TAJR "Siik'tajr"
|
||||
#define LANGUAGE_SIGN_TAJARA "Nal'rasan"
|
||||
#define LANGUAGE_YA_SSA "Ya'ssa"
|
||||
#define LANGUAGE_DELVAHII "Delvahhi"
|
||||
#define LANGUAGE_SKRELLIAN "Nral'Malic"
|
||||
#define LANGUAGE_RESOMI "Resomi"
|
||||
#define LANGUAGE_ROOTSONG "Rootsong"
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
message = pick(S.speak)
|
||||
else
|
||||
if(language)
|
||||
message = language.scramble(message)
|
||||
message = language.scramble(message, languages)
|
||||
else
|
||||
message = stars(message)
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
return
|
||||
else
|
||||
if(language)
|
||||
message = language.scramble(message)
|
||||
message = language.scramble(message, languages)
|
||||
else
|
||||
message = stars(message)
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
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
|
||||
var/list/partial_understanding // List of languages that can /somehwat/ understand it, format is: name = chance of understanding a word
|
||||
|
||||
/datum/language/proc/get_random_name(var/gender, name_count=2, syllable_count=4, syllable_divisor=2)
|
||||
if(!syllables || !syllables.len)
|
||||
@@ -40,8 +41,41 @@
|
||||
/datum/language
|
||||
var/list/scramble_cache = list()
|
||||
|
||||
/datum/language/proc/scramble(var/input)
|
||||
/datum/language/proc/scramble(var/input, var/list/known_languages)
|
||||
|
||||
var/understand_chance = 0
|
||||
for(var/datum/language/L in known_languages)
|
||||
if(partial_understanding && partial_understanding[L.name])
|
||||
understand_chance += partial_understanding[L.name]
|
||||
if(L.partial_understanding && L.partial_understanding[name])
|
||||
understand_chance += L.partial_understanding[name] * 0.5
|
||||
|
||||
var/scrambled_text = ""
|
||||
var/list/words = splittext(input, " ")
|
||||
for(var/w in words)
|
||||
if(prob(understand_chance))
|
||||
scrambled_text += " [w] "
|
||||
else
|
||||
var/nword = scramble_word(w)
|
||||
var/ending = copytext(scrambled_text, length(scrambled_text)-1)
|
||||
if(findtext(ending,"."))
|
||||
nword = capitalize(nword)
|
||||
scrambled_text += nword
|
||||
scrambled_text = replacetext(scrambled_text," "," ")
|
||||
|
||||
scrambled_text = capitalize(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, length(input))
|
||||
if(input_ending in list("!","?","."))
|
||||
scrambled_text += input_ending
|
||||
|
||||
return scrambled_text
|
||||
|
||||
/datum/language/proc/scramble_word(var/input)
|
||||
if(!syllables || !syllables.len)
|
||||
return stars(input)
|
||||
|
||||
@@ -54,7 +88,7 @@
|
||||
|
||||
var/input_size = length(input)
|
||||
var/scrambled_text = ""
|
||||
var/capitalize = 1
|
||||
var/capitalize = 0
|
||||
|
||||
while(length(scrambled_text) < input_size)
|
||||
var/next = pick(syllables)
|
||||
@@ -69,14 +103,6 @@
|
||||
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)
|
||||
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)
|
||||
|
||||
@@ -39,11 +39,12 @@
|
||||
"ra", "ar", "re", "er", "ri", "ir", "ro", "or", "ru", "ur", "rs", "sr",
|
||||
"a", "a", "e", "e", "i", "i", "o", "o", "u", "u", "s", "s"
|
||||
)
|
||||
partial_understanding = list(LANGUAGE_AZAZIBA = 25)
|
||||
|
||||
// tajaran languages
|
||||
/datum/language/tajaran
|
||||
name = LANGUAGE_SIIK_MAAS
|
||||
desc = "The traditionally employed tongue of Adhomai, composed of expressive yowls and chirps. Native to the Tajaran."
|
||||
desc = "The traditionally employed tongue of Adhomai, composed of expressive yowls and chirps. Native to the Tajara."
|
||||
speech_verb = "mrowls"
|
||||
ask_verb = "mrowls"
|
||||
exclaim_verb = "yowls"
|
||||
@@ -54,6 +55,7 @@
|
||||
"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","mro","mra","mrro","mrra")
|
||||
partial_understanding = list(LANGUAGE_SIIK_TAJR = 50, LANGUAGE_YA_SSA = 25, LANGUAGE_DELVAHII = 50)
|
||||
|
||||
/datum/language/tajaran/get_random_name(var/gender)
|
||||
|
||||
@@ -74,6 +76,7 @@
|
||||
colour = "i"
|
||||
key = "i"
|
||||
flags = NO_STUTTER | SIGNLANG | WHITELISTED
|
||||
partial_understanding = list(LANGUAGE_SIIK_TAJR = 50)
|
||||
|
||||
/datum/language/siik_tajr
|
||||
name = LANGUAGE_SIIK_TAJR
|
||||
@@ -89,6 +92,7 @@
|
||||
"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","mro","mra","mrro","mrra")
|
||||
partial_understanding = list(LANGUAGE_SIIK_MAAS = 50, LANGUAGE_SIGN_TAJARA = 25)
|
||||
|
||||
/datum/language/yassa
|
||||
name = LANGUAGE_YA_SSA
|
||||
@@ -103,6 +107,22 @@
|
||||
"mi","jhri","dynher","manqi","rhas","shar","drhaz","kalh","shur","echi","tha","draer","jurl","maher","sanii","dra","ii'r",
|
||||
"kan","aesi","fare","we","bash","arha","quara","zhir","sem","make","hrer","nja","rir","can","jhun","dar","rik","kah",
|
||||
"hal","kete","juril","mah","tul","cresh","azu","ragh","miro","mara","mrero","mrara")
|
||||
partial_understanding = list(LANGUAGE_SIIK_MAAS = 50)
|
||||
|
||||
/datum/language/delvahhi
|
||||
name = LANGUAGE_DELVAHII
|
||||
desc = "A dialect developed by the Zhan-Khazan communities, commonly used in religious ceremonies dedicated to the Snow God and amongst settlements comprised mostly of Zhan-Khazan."
|
||||
speech_verb = "mrowls"
|
||||
ask_verb = "mrowls"
|
||||
exclaim_verb = "yowls"
|
||||
colour = "delvahhi"
|
||||
key = "n"
|
||||
flags = WHITELISTED
|
||||
syllables = list("hrr","rhr","tarj","khir","rajh","kir","mier","kre","ahek","nlhal","veh","khaz","dri","rhan","darrer",
|
||||
"mi","jhri","dynher","manqi","rhas","shar","drhaz","kalh","shur","echi","tha","draer","jurl","maher","sanii","dra","ii'r",
|
||||
"kan","aesi","fare","we","bash","arha","quara","zhir","sem","make","hrer","nja","rir","can","jhun","dar","rik","kah",
|
||||
"hal","kete","juril","mah","tul","cresh","azu","ragh","miro","mara","mrero","mrara")
|
||||
partial_understanding = list(LANGUAGE_SIIK_MAAS = 50)
|
||||
|
||||
/datum/language/skrell
|
||||
name = LANGUAGE_SKRELLIAN
|
||||
@@ -259,6 +279,7 @@
|
||||
key = "p"
|
||||
flags = WHITELISTED | NONVERBAL
|
||||
syllables = list("azs","zis","zau","azua","skiu","zuakz","izo","aei","ki","kut","zo")
|
||||
partial_understanding = list(LANGUAGE_UNATHI = 50)
|
||||
|
||||
//Syllable Lists
|
||||
/*
|
||||
|
||||
@@ -62,7 +62,8 @@
|
||||
LANGUAGE_SIIK_MAAS,
|
||||
LANGUAGE_SIIK_TAJR,
|
||||
LANGUAGE_SIGN_TAJARA,
|
||||
LANGUAGE_YA_SSA
|
||||
LANGUAGE_YA_SSA,
|
||||
LANGUAGE_DELVAHII
|
||||
)
|
||||
|
||||
/datum/species/bug
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
from their fellow Tajara who cite their lackluster test scores, even among Tajara, and their higher \
|
||||
crime rates."
|
||||
|
||||
secondary_langs = list(LANGUAGE_SIIK_MAAS, LANGUAGE_SIIK_TAJR)
|
||||
secondary_langs = list(LANGUAGE_SIIK_MAAS, LANGUAGE_SIIK_TAJR, LANGUAGE_DELVAHII)
|
||||
|
||||
slowdown = -0.8 //As opposed to -1 for Base tajara
|
||||
sprint_speed_factor = 0.55 // As opposed to 0.65
|
||||
|
||||
@@ -98,6 +98,7 @@ h1.alert, h2.alert {color: #000000;}
|
||||
.rough {font-family: "Trebuchet MS", cursive, sans-serif;}
|
||||
.say_quote {font-family: Georgia, Verdana, sans-serif;}
|
||||
.yassa {color: #400987;}
|
||||
.delvahhi {color: #5E2612; font-weight: bold;}
|
||||
|
||||
.interface {color: #330033;}
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
author: Alberyk
|
||||
delete-after: True
|
||||
|
||||
changes:
|
||||
- rscadd: "Added partial understanding to some languages, it allows you to understand some words from a certain language without knowing it."
|
||||
- rscadd: "Added new tajara language, Delvahhi, available to the Zhan-Khazan."
|
||||
Reference in New Issue
Block a user