Files
MrMelbertandGitHub 4962a86b95 CSL / Mutual understanding changes (#96774)
## About The Pull Request

1. Redid the formula for calculating mutual language understanding 

Old: `base + (10 * (1 - (min(commonness, 1250) / 500)))`, or in other
words `base + 10% to -15%`
New: `base + max(20 - (commonness / 1000) * 20, -5)`, or in other words
`base + 20% to -5%`

2. CSL strength preference has been changed 

Old: `"90%", "75%", "50%", "33%", "25%", "10%"`
New: `"75%", "50%", "25%"`

3. If you understand a language partially, the icon in chat is
differentiated slightly

<img width="414" height="30" alt="image"
src="https://github.com/user-attachments/assets/16af293a-698e-4ab8-9638-580920a38543"
/>

(Icon subject to change, it's just a `?` spliced with the icon rn)

4. CSL can now be taken by humans, doing so grants you gal-uncommon

5. Fixed a bug where contractions, due to being encoded, would be
treated as lower frequency / rarer and thus be more likely to be
translated

## Why It's Good For The Game

1. The current formula was a bit too harsh and resulted in more words
being translated than you'd expect. The altered formula should make it
less persistent.

2. These values were tweaked according to the new formula. If I left the
90% value it'd mean like every word would get translated and that
defeats the point.

3. Makes things a bit clearer when it comes to partial understanding. 

4. Requested, sounds like fun so why not.

5. Bugfix.


## Changelog

🆑 Melbert
fix: Fixed a bug where contractions were treated as rarer words than
they should be for the sake of partial language understanding
balance: Tweaked the formula of partial language understanding: Less
common words are penalized less, more common words are rewarded more. In
other words more words will be understood on average.
balance: Common Second Language numbers were tweaked according to the
new formula. Now "75%", "50%", "25%".
balance: Humans can now take Common Second Language. Doing so also
grants Galactic Uncommon.
add: Partially understood sentences now get an altered language icon in
chat and runechat, indicating that only some of the words were
translated.
/🆑
2026-07-11 16:52:28 +01:00

28 lines
857 B
Plaintext

/datum/language/codespeak
name = "Codespeak"
desc = "Syndicate operatives can use a series of codewords to convey complex information, while sounding like random concepts and drinks to anyone listening in."
key = "t"
default_priority = 0
flags = LANGUAGE_TONGUELESS_SPEECH | LANGUAGE_HIDE_ICON_IF_NOT_UNDERSTOOD
icon_state = "codespeak"
always_use_default_namelist = TRUE // No syllables anyways
/datum/language/codespeak/scramble_sentence(input, list/mutual_languages)
var/sentence = read_word_cache(input)
if(sentence)
return sentence
sentence = ""
var/list/words = list()
while(length_char(sentence) < length_char(input))
words += generate_code_phrase(return_list=TRUE)
sentence = jointext(words, ", ")
sentence = capitalize(sentence)
sentence += find_last_punctuation(input)
write_word_cache(input, sentence)
return sentence