diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 520d5cb58b..61005069da 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -173,6 +173,9 @@ */ return +/obj/proc/hear_signlang(mob/M as mob, text, verb, datum/language/speaking) // Saycode gets worse every day. + return FALSE + /obj/proc/see_emote(mob/M as mob, text, var/emote_type) return diff --git a/code/modules/integrated_electronics/subtypes/input.dm b/code/modules/integrated_electronics/subtypes/input.dm index c11c7e963a..e3fcb5d985 100644 --- a/code/modules/integrated_electronics/subtypes/input.dm +++ b/code/modules/integrated_electronics/subtypes/input.dm @@ -540,7 +540,57 @@ if(translated) activate_pin(2) +/obj/item/integrated_circuit/input/microphone/sign + name = "sign-language translator" + desc = "Useful for spying on people or for sign activated machines." + extended_desc = "This will automatically translate galactic standard sign language it sees to Galactic Common. \ + The first activation pin is always pulsed when the circuit sees someone speak sign, while the second one \ + is only triggered if it sees someone speaking a language other than sign language, which it will attempt to \ + lip-read." + icon_state = "video_camera" + complexity = 12 + inputs = list() + outputs = list( + "speaker" = IC_PINTYPE_STRING, + "message" = IC_PINTYPE_STRING + ) + activators = list("on message received" = IC_PINTYPE_PULSE_OUT, "on translation" = IC_PINTYPE_PULSE_OUT) + spawn_flags = IC_SPAWN_RESEARCH + power_draw_per_use = 30 + var/list/my_langs = list() + var/list/readable_langs = list( + LANGUAGE_GALCOM, + LANGUAGE_SOL_COMMON, + LANGUAGE_TRADEBAND, + LANGUAGE_GUTTER, + LANGUAGE_TERMINUS + ) + +/obj/item/integrated_circuit/input/microphone/sign/Initialize() + ..() + for(var/lang in readable_langs) + var/datum/language/newlang = all_languages[lang] + my_langs |= newlang + +/obj/item/integrated_circuit/input/microphone/sign/hear_talk(mob/living/M, msg, var/verb="says", datum/language/speaking=null) + var/translated = FALSE + if(M && msg) + if(speaking) + if(!((speaking.flags & NONVERBAL) || (speaking.flags & SIGNLANG))) + translated = TRUE + msg = speaking.scramble(msg, my_langs) + set_pin_data(IC_OUTPUT, 1, M.GetVoice()) + set_pin_data(IC_OUTPUT, 2, msg) + + push_data() + activate_pin(1) + if(translated) + activate_pin(2) + +/obj/item/integrated_circuit/input/microphone/sign/hear_signlang(text, verb, datum/language/speaking, mob/M as mob) + hear_talk(M, text, verb, speaking) + return /obj/item/integrated_circuit/input/sensor name = "sensor" diff --git a/code/modules/integrated_electronics/subtypes/output.dm b/code/modules/integrated_electronics/subtypes/output.dm index 358d8bea4d..61fcae72f9 100644 --- a/code/modules/integrated_electronics/subtypes/output.dm +++ b/code/modules/integrated_electronics/subtypes/output.dm @@ -136,6 +136,33 @@ var/obj/O = assembly ? loc : assembly audible_message("\icon[O] \The [O.name] states, \"[text]\"") +/obj/item/integrated_circuit/output/text_to_speech/advanced + name = "advanced text-to-speech circuit" + desc = "A miniature speaker is attached to this component. It is able to transpose any valid text to speech, matching a scanned target's voice." + complexity = 15 + cooldown_per_use = 6 SECONDS + inputs = list("text" = IC_PINTYPE_STRING, "mimic target" = IC_PINTYPE_REF) + power_draw_per_use = 100 + + spawn_flags = IC_SPAWN_RESEARCH + origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 4, TECH_ILLEGAL = 1) + + var/mob/living/voice/my_voice + +/obj/item/integrated_circuit/output/text_to_speech/advanced/Initialize() + ..() + my_voice = new (src) + my_voice.name = "TTS Circuit" + +/obj/item/integrated_circuit/output/text_to_speech/advanced/do_work() + text = get_pin_data(IC_INPUT, 1) + var/mob/living/target_mob = get_pin_data(IC_INPUT, 2) + my_voice.transfer_identity(target_mob) + if(!isnull(text) && !isnull(my_voice) && !isnull(my_voice.name)) + my_voice.forceMove(get_turf(src)) + my_voice.say("[text]") + my_voice.forceMove(src) + /obj/item/integrated_circuit/output/sound name = "speaker circuit" desc = "A miniature speaker is attached to this component." diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 9031bc39ea..3e794fd3e9 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -396,6 +396,10 @@ proc/get_radio_key_from_channel(var/channel) for(var/hearer in mobs) var/mob/M = hearer M.hear_signlang(message, verb, language, src) + var/list/objs = potentials["objs"] + for(var/hearer in objs) + var/obj/O = hearer + O.hear_signlang(message, verb, language, src) return 1 /obj/effect/speech_bubble diff --git a/html/changelogs/Mechoid - TTSandSign.yml b/html/changelogs/Mechoid - TTSandSign.yml new file mode 100644 index 0000000000..1d0b36ac69 --- /dev/null +++ b/html/changelogs/Mechoid - TTSandSign.yml @@ -0,0 +1,36 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Mechoid + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Adds two new integrated circuit components. An advanced Text to Speech, and a Sign-Language reading camera."