mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
Merge upstream
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
var/listening = 0
|
||||
var/recorded = "" //the activation message
|
||||
var/mode = 1
|
||||
var/global/list/modes = list("inclusive",
|
||||
var/static/list/modes = list("inclusive",
|
||||
"exclusive",
|
||||
"recognizer",
|
||||
"voice sensor")
|
||||
@@ -21,35 +21,33 @@
|
||||
..()
|
||||
to_chat(user, "<span class='notice'>Use a multitool to swap between \"inclusive\", \"exclusive\", \"recognizer\", and \"voice sensor\" mode.</span>")
|
||||
|
||||
/obj/item/device/assembly/voice/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans)
|
||||
/obj/item/device/assembly/voice/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans)
|
||||
if(speaker == src)
|
||||
return
|
||||
|
||||
if(listening && !radio_freq)
|
||||
record_speech(speaker, raw_message)
|
||||
record_speech(speaker, raw_message, message_language)
|
||||
else
|
||||
if(check_activation(speaker, raw_message))
|
||||
spawn(10)
|
||||
pulse(0)
|
||||
addtimer(CALLBACK(src, .proc/pulse, 0), 10)
|
||||
|
||||
/obj/item/device/assembly/voice/proc/record_speech(atom/movable/speaker, raw_message)
|
||||
/obj/item/device/assembly/voice/proc/record_speech(atom/movable/speaker, raw_message, datum/language/message_language)
|
||||
switch(mode)
|
||||
if(1)
|
||||
recorded = raw_message
|
||||
listening = 0
|
||||
say("Activation message is '[recorded]'.")
|
||||
say("Activation message is '[recorded]'.", message_language)
|
||||
if(2)
|
||||
recorded = raw_message
|
||||
listening = 0
|
||||
say("Activation message is '[recorded]'.")
|
||||
say("Activation message is '[recorded]'.", message_language)
|
||||
if(3)
|
||||
recorded = speaker.GetVoice()
|
||||
listening = 0
|
||||
say("Your voice pattern is saved.")
|
||||
say("Your voice pattern is saved.", message_language)
|
||||
if(4)
|
||||
if(length(raw_message))
|
||||
spawn(10)
|
||||
pulse(0)
|
||||
addtimer(CALLBACK(src, .proc/pulse, 0), 10)
|
||||
|
||||
/obj/item/device/assembly/voice/proc/check_activation(atom/movable/speaker, raw_message)
|
||||
. = 0
|
||||
|
||||
Reference in New Issue
Block a user