Native languages for tongues (#61352)

If a mob (human one) speaks with a language their tongue tracks as native (for their language's anatomy), the message's text will not be changed with default language's text replaces.
Basicly, if a lizard (or other human mob) with lizard tongue speaks with draconic, their speech will be without accent changes

It looks a bit strange when races speak at their own language with difficult without real reasons for it. The changes remove that part.
This commit is contained in:
Kush1Push1
2021-09-14 18:03:59 -07:00
committed by GitHub
parent 38c21c9acf
commit d542b0d264
2 changed files with 20 additions and 11 deletions
+18 -9
View File
@@ -7,6 +7,7 @@
attack_verb_continuous = list("licks", "slobbers", "slaps", "frenches", "tongues")
attack_verb_simple = list("lick", "slobber", "slap", "french", "tongue")
var/list/languages_possible
var/list/languages_native //human mobs can speak with this languages without the accent (letters replaces)
var/say_mod = null
/// Whether the owner of this tongue can taste anything. Being set to FALSE will mean no taste feedback will be provided.
@@ -37,6 +38,12 @@
/obj/item/organ/tongue/proc/handle_speech(datum/source, list/speech_args)
SIGNAL_HANDLER
if(speech_args[SPEECH_LANGUAGE] in languages_native)
return FALSE //no changes
modify_speech(source, speech_args)
/obj/item/organ/tongue/proc/modify_speech(datum/source, list/speech_args)
return speech_args[SPEECH_MESSAGE]
/obj/item/organ/tongue/Insert(mob/living/carbon/tongue_owner, special = 0)
..()
@@ -75,8 +82,9 @@
say_mod = "hisses"
taste_sensitivity = 10 // combined nose + tongue, extra sensitive
modifies_speech = TRUE
languages_native = list(/datum/language/draconic)
/obj/item/organ/tongue/lizard/handle_speech(datum/source, list/speech_args)
/obj/item/organ/tongue/lizard/modify_speech(datum/source, list/speech_args)
var/static/regex/lizard_hiss = new("s+", "g")
var/static/regex/lizard_hiSS = new("S+", "g")
var/static/regex/lizard_kss = new(@"(\w)x", "g")
@@ -180,6 +188,7 @@
say_mod = "buzzes"
taste_sensitivity = 25 // you eat vomit, this is a mercy
modifies_speech = TRUE
languages_native = list(/datum/language/buzzwords)
var/static/list/languages_possible_fly = typecacheof(list(
/datum/language/common,
/datum/language/draconic,
@@ -197,7 +206,7 @@
/datum/language/buzzwords
))
/obj/item/organ/tongue/fly/handle_speech(datum/source, list/speech_args)
/obj/item/organ/tongue/fly/modify_speech(datum/source, list/speech_args)
var/static/regex/fly_buzz = new("z+", "g")
var/static/regex/fly_buZZ = new("Z+", "g")
var/message = speech_args[SPEECH_MESSAGE]
@@ -246,7 +255,7 @@
else
. += span_notice("It is attuned to [mothership].")
/obj/item/organ/tongue/abductor/handle_speech(datum/source, list/speech_args)
/obj/item/organ/tongue/abductor/modify_speech(datum/source, list/speech_args)
//Hacks
var/message = speech_args[SPEECH_MESSAGE]
var/mob/living/carbon/human/user = source
@@ -273,7 +282,7 @@
modifies_speech = TRUE
taste_sensitivity = 32
/obj/item/organ/tongue/zombie/handle_speech(datum/source, list/speech_args)
/obj/item/organ/tongue/zombie/modify_speech(datum/source, list/speech_args)
var/list/message_list = splittext(speech_args[SPEECH_MESSAGE], " ")
var/maxchanges = max(round(message_list.len / 1.5), 2)
@@ -306,7 +315,7 @@
. = ..()
languages_possible = languages_possible_alien
/obj/item/organ/tongue/alien/handle_speech(datum/source, list/speech_args)
/obj/item/organ/tongue/alien/modify_speech(datum/source, list/speech_args)
playsound(owner, "hiss", 25, TRUE, TRUE)
/obj/item/organ/tongue/bone
@@ -343,7 +352,7 @@
phomeme_type = pick(phomeme_types)
languages_possible = languages_possible_skeleton
/obj/item/organ/tongue/bone/handle_speech(datum/source, list/speech_args)
/obj/item/organ/tongue/bone/modify_speech(datum/source, list/speech_args)
if (chattering)
chatter(speech_args[SPEECH_MESSAGE], phomeme_type, source)
switch(phomeme_type)
@@ -373,7 +382,7 @@
/obj/item/organ/tongue/robot/can_speak_language(language)
return TRUE // THE MAGIC OF ELECTRONICS
/obj/item/organ/tongue/robot/handle_speech(datum/source, list/speech_args)
/obj/item/organ/tongue/robot/modify_speech(datum/source, list/speech_args)
speech_args[SPEECH_SPANS] |= SPAN_ROBOT
/obj/item/organ/tongue/snail
@@ -382,7 +391,7 @@
desc = "A minutely toothed, chitious ribbon, which as a side effect, makes all snails talk IINNCCRREEDDIIBBLLYY SSLLOOWWLLYY."
modifies_speech = TRUE
/obj/item/organ/tongue/snail/handle_speech(datum/source, list/speech_args)
/obj/item/organ/tongue/snail/modify_speech(datum/source, list/speech_args)
var/new_message
var/message = speech_args[SPEECH_MESSAGE]
for(var/i in 1 to length(message))
@@ -451,7 +460,7 @@
//Thank you Jwapplephobia for helping me with the literal hellcode below
/obj/item/organ/tongue/tied/handle_speech(datum/source, list/speech_args)
/obj/item/organ/tongue/tied/modify_speech(datum/source, list/speech_args)
var/new_message
var/message = speech_args[SPEECH_MESSAGE]
var/exclamation_found = findtext(message, "!")