mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-21 09:16:33 +01:00
36 lines
1.1 KiB
Plaintext
36 lines
1.1 KiB
Plaintext
/obj/item/assembly/voice
|
|
name = "voice analyzer"
|
|
desc = "A small electronic device able to record a voice sample, and send a signal when that sample is repeated."
|
|
icon_state = "voice"
|
|
atom_flags = ATOM_HEAR
|
|
origin_tech = list(TECH_MAGNET = 1)
|
|
materials_base = list(MAT_STEEL = 500, MAT_GLASS = 50)
|
|
var/listening = 0
|
|
var/recorded //the activation message
|
|
|
|
/obj/item/assembly/voice/hear_talk(mob/living/M as mob, msg)
|
|
if(listening)
|
|
recorded = msg
|
|
listening = 0
|
|
var/turf/T = get_turf(src) //otherwise it won't work in hand
|
|
T.visible_message("[icon2html(thing = src, target = world)] beeps, \"Activation message is '[recorded]'.\"")
|
|
else
|
|
if(findtext(msg, recorded))
|
|
pulse(0)
|
|
|
|
/obj/item/assembly/voice/activate()
|
|
if(secured)
|
|
if(!holder)
|
|
listening = !listening
|
|
var/turf/T = get_turf(src)
|
|
T.visible_message("[icon2html(thing = src, target = world)] beeps, \"[listening ? "Now" : "No longer"] recording input.\"")
|
|
|
|
|
|
/obj/item/assembly/voice/attack_self(mob/user, datum/event_args/actor/actor)
|
|
activate()
|
|
return TRUE
|
|
|
|
/obj/item/assembly/voice/toggle_secure()
|
|
. = ..()
|
|
listening = 0
|