mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Merge pull request #12902 from Heroman3003/echosong
Adds Echo Song language
This commit is contained in:
@@ -111,6 +111,7 @@
|
||||
#define NO_TALK_MSG 128 // Do not show the "\The [speaker] talks into \the [radio]" message
|
||||
#define NO_STUTTER 256 // No stuttering, slurring, or other speech problems
|
||||
#define ALT_TRANSMIT 512 // Language is not based on vision or sound (Todo: add this into the say code and use it for the rootspeak languages)
|
||||
#define INAUDIBLE 1024 // Language is not audible (similar to nonverbal) but is still using hearing-based recognition
|
||||
|
||||
#define SKIN_NORMAL 0
|
||||
#define SKIN_THREAT 1
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#define LANGUAGE_SPACER "Spacer"
|
||||
#define LANGUAGE_CLOWNISH "Coulrian"
|
||||
#define LANGUAGE_TAVAN "Tavan"
|
||||
#define LANGUAGE_ECHOSONG "Echo Song"
|
||||
|
||||
#define LANGUAGE_CHIMPANZEE "Chimpanzee"
|
||||
#define LANGUAGE_NEAERA "Neaera"
|
||||
|
||||
@@ -27,11 +27,14 @@
|
||||
if(always_stars)
|
||||
piece = stars(piece)
|
||||
else if(!say_understands(speaker, SP.speaking))
|
||||
piece = saypiece_scramble(SP)
|
||||
if(isliving(speaker))
|
||||
var/mob/living/S = speaker
|
||||
if(istype(S.say_list) && length(S.say_list.speak))
|
||||
piece = pick(S.say_list.speak)
|
||||
if(SP.speaking.flags & INAUDIBLE)
|
||||
piece = ""
|
||||
else
|
||||
piece = saypiece_scramble(SP)
|
||||
if(isliving(speaker))
|
||||
var/mob/living/S = speaker
|
||||
if(istype(S.say_list) && length(S.say_list.speak))
|
||||
piece = pick(S.say_list.speak)
|
||||
|
||||
raw_msg += (piece + " ")
|
||||
|
||||
@@ -226,13 +229,13 @@
|
||||
final_message = "[time][final_message]"
|
||||
to_chat(src, final_message)
|
||||
|
||||
/mob/proc/hear_signlang(var/message, var/verb = "gestures", var/datum/language/language, var/mob/speaker = null)
|
||||
/mob/proc/hear_signlang(var/message, var/verb = "gestures", var/verb_understood = "gestures", var/datum/language/language, var/mob/speaker = null, var/speech_type = 1)
|
||||
if(!client)
|
||||
return
|
||||
|
||||
if(say_understands(speaker, language))
|
||||
message = "<B>[speaker]</B> [verb], \"[message]\""
|
||||
else
|
||||
message = "<B>[speaker]</B> [verb_understood], \"[message]\""
|
||||
else if(!(language.ignore_adverb))
|
||||
var/adverb
|
||||
var/length = length(message) * pick(0.8, 0.9, 1.0, 1.1, 1.2) //Adds a little bit of fuzziness
|
||||
switch(length)
|
||||
@@ -242,8 +245,10 @@
|
||||
if(48 to 90) adverb = " a lengthy message"
|
||||
else adverb = " a very lengthy message"
|
||||
message = "<B>[speaker]</B> [verb][adverb]."
|
||||
else
|
||||
message = "<B>[speaker]</B> [verb]."
|
||||
|
||||
show_message(message, type = 1) // Type 1 is visual message
|
||||
show_message(message, type = speech_type) // Type 1 is visual message
|
||||
|
||||
/mob/proc/hear_sleep(var/message)
|
||||
var/heard = ""
|
||||
|
||||
@@ -145,8 +145,9 @@
|
||||
// which is exactly what sign language does.
|
||||
/datum/language/sign/broadcast(var/mob/living/speaker, var/message, var/speaker_mask)
|
||||
log_say("(SIGN) [message]", speaker)
|
||||
speaker.say_signlang(message, pick(signlang_verb), src)
|
||||
|
||||
var/verb_to_use = pick(signlang_verb)
|
||||
speaker.say_signlang(message, verb_to_use, verb_to_use, src)
|
||||
|
||||
|
||||
// Silly language for those times when you try to talk a languague you normally can't
|
||||
/datum/language/gibberish
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
var/exclaim_verb = "exclaims" // Used when sentence ends in a !
|
||||
var/whisper_verb // Optional. When not specified speech_verb + quietly/softly is used instead.
|
||||
var/signlang_verb = list("signs", "gestures") // list of emotes that might be displayed if this language has NONVERBAL or SIGNLANG flags
|
||||
var/signlang_verb_understood = list("signs") // snowflake bs, used only for echo
|
||||
var/colour = "body" // CSS style to use for strings in this language.
|
||||
var/key = "x" // Character used to speak in language eg. :o for Unathi.
|
||||
var/flags = 0 // Various language flags.
|
||||
@@ -20,6 +21,7 @@
|
||||
var/list/space_chance = 55 // Likelihood of getting a space in the random scramble string
|
||||
var/machine_understands = 1 // Whether machines can parse and understand this language
|
||||
var/list/partial_understanding // List of languages that can /somehwat/ understand it, format is: name = chance of understanding a word
|
||||
var/ignore_adverb = FALSE // For inaudible languages that we dont want adverb for
|
||||
|
||||
/datum/language/proc/get_random_name(var/gender, name_count=2, syllable_count=4, syllable_divisor=2)
|
||||
if(!syllables || !syllables.len)
|
||||
@@ -235,7 +237,7 @@
|
||||
//TBD
|
||||
/mob/proc/check_lang_data()
|
||||
. = ""
|
||||
|
||||
|
||||
for(var/datum/language/L in languages)
|
||||
if(!(L.flags & NONGLOBAL))
|
||||
. += "<b>[L.name] ([get_language_prefix()][L.key])</b><br/>[L.desc]<br/><br/>"
|
||||
|
||||
@@ -96,7 +96,8 @@
|
||||
|
||||
/datum/language/tajsign/broadcast(var/mob/living/speaker, var/message, var/speaker_mask)
|
||||
log_say("(SIGN) [message]", speaker)
|
||||
speaker.say_signlang(message, pick(signlang_verb), src)
|
||||
var/verb_to_use = pick(signlang_verb)
|
||||
speaker.say_signlang(message, verb_to_use, verb_to_use, src)
|
||||
|
||||
/datum/language/tajsign/can_speak_special(var/mob/speaker) // TODO: If ever we make external organs assist languages, convert this over to the new format
|
||||
var/list/allowed_species = list(SPECIES_TAJ, SPECIES_TESHARI) // Need a tail and ears and such to use this.
|
||||
|
||||
@@ -167,7 +167,24 @@
|
||||
exclaim_verb = "squeaks loudly"
|
||||
syllables = list ("sque", "uik", "squeak", "squee", "eak", "eek", "uek", "squik",
|
||||
"squeek", "sq", "squee", "ee", "ek", "ak", "ueak", "squea")
|
||||
colour = "tavan"
|
||||
colour = "tavan"
|
||||
|
||||
/datum/language/echosong
|
||||
name = LANGUAGE_ECHOSONG
|
||||
desc = "An ultrasound-based language, inaudible to those unable to understand it."
|
||||
key = "U"
|
||||
signlang_verb = list("opens their mouth soundlessly", "mouthes something silently")
|
||||
signlang_verb_understood = list("squeaks")
|
||||
colour = "echosong"
|
||||
flags = INAUDIBLE
|
||||
ignore_adverb = TRUE
|
||||
|
||||
/datum/language/echosong/scramble(var/input, var/list/known_languages)
|
||||
return stars(input)
|
||||
|
||||
/datum/language/echosong/broadcast(var/mob/living/speaker, var/message, var/speaker_mask)
|
||||
log_say("(INAUDIBLE) [message]", speaker)
|
||||
speaker.say_signlang(format_message(message), pick(signlang_verb), pick(signlang_verb_understood), src, 2)
|
||||
|
||||
/datum/language/unathi
|
||||
flags = 0
|
||||
|
||||
@@ -300,7 +300,7 @@ var/list/channel_to_radio_key = new
|
||||
|
||||
//Handle nonverbal languages here
|
||||
for(var/datum/multilingual_say_piece/S in message_pieces)
|
||||
if(S.speaking.flags & NONVERBAL)
|
||||
if((S.speaking.flags & NONVERBAL) || (S.speaking.flags & INAUDIBLE))
|
||||
custom_emote(1, "[pick(S.speaking.signlang_verb)].")
|
||||
|
||||
//These will contain the main receivers of the message
|
||||
@@ -407,21 +407,33 @@ var/list/channel_to_radio_key = new
|
||||
log_say(message, src)
|
||||
return 1
|
||||
|
||||
/mob/living/proc/say_signlang(var/message, var/verb="gestures", var/datum/language/language)
|
||||
/mob/living/proc/say_signlang(var/message, var/verb="gestures", var/verb_understood="gestures", var/datum/language/language, var/type = 1)
|
||||
var/turf/T = get_turf(src)
|
||||
//We're in something, gesture to people inside the same thing
|
||||
if(loc != T)
|
||||
for(var/mob/M in loc)
|
||||
M.hear_signlang(message, verb, language, src)
|
||||
M.hear_signlang(message, verb, verb_understood, language, src, type)
|
||||
|
||||
//We're on a turf, gesture to visible as if we were a normal language
|
||||
else
|
||||
var/low_range = FALSE
|
||||
if(T && type == 2) // type 2 is audible signlang. yes. sue me.
|
||||
//Air is too thin to carry sound at all, contact speech only
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
var/pressure = environment ? environment.return_pressure() : 0
|
||||
if(pressure < SOUND_MINIMUM_PRESSURE)
|
||||
low_range = TRUE
|
||||
|
||||
var/list/potentials = get_mobs_and_objs_in_view_fast(T, world.view)
|
||||
var/list/mobs = potentials["mobs"]
|
||||
for(var/mob/M as anything in mobs)
|
||||
M.hear_signlang(message, verb, language, src)
|
||||
if(low_range && !(M in range(1, src)))
|
||||
continue
|
||||
M.hear_signlang(message, verb, verb_understood, language, src, type)
|
||||
var/list/objs = potentials["objs"]
|
||||
for(var/obj/O as anything in objs)
|
||||
if(low_range && !(O in range(1, src)))
|
||||
continue
|
||||
O.hear_signlang(message, verb, language, src)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@
|
||||
|
||||
// There are a few things that will make us want to ignore all other languages in - namely, HIVEMIND languages.
|
||||
var/datum/language/L = current[1]
|
||||
if(L && (L.flags & HIVEMIND || L.flags & SIGNLANG))
|
||||
if(L && (L.flags & HIVEMIND || L.flags & SIGNLANG || L.flags & INAUDIBLE))
|
||||
return new /datum/multilingual_say_piece(L, trim(sanitize(strip_prefixes(message))))
|
||||
|
||||
if(i + 1 > length(prefix_locations)) // We are out of lookaheads, that means the rest of the message is in cur lang
|
||||
|
||||
@@ -105,6 +105,7 @@ h1.alert, h2.alert {color: #000000;}
|
||||
.sergal {color: #0077FF;}
|
||||
.birdsongc {color: #CC9900;}
|
||||
.vulpkanin {color: #B97A57;}
|
||||
.echosong {color: #826D8C;}
|
||||
.enochian {color: #848A33; letter-spacing:-1pt; word-spacing:4pt; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;}
|
||||
.daemon {color: #5E339E; letter-spacing:-1pt; word-spacing:0pt; font-family: "Courier New", Courier, monospace;}
|
||||
.bug {color: #9e9e39;}
|
||||
|
||||
Reference in New Issue
Block a user