Files
Paradise/code/modules/assembly/voice.dm
tigercat2000 732c3b4ae5 Goonchat (#4744)
* bicon regex run

* Remove all \black

* Goonchat from /vg/ / Goon

Whoo!
Special thanks to @Tastyfish for the macro2html thing so all of our
horrible color macros keep working and don't fail horribly <3

* Fixes and changes n stuff

- Made ping sane again (the fuck PJ)
- Updated chat CSS
- Fixed like one problem with a color macro

* whoops

* Restore /vg/'s pingloop stuff (used to avoid fucking up is_afk)

* Strip problematic tags from tcomm scripts

- <audio>
- <video>
- <iframe>
- <script>

* Fix human examine icon

* Name hotkey elements

* Removed old stylesheet
2016-06-23 16:56:15 -04:00

55 lines
1.6 KiB
Plaintext

/obj/item/device/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"
materials = list(MAT_METAL=500, MAT_GLASS=50)
origin_tech = "magnets=1"
var/listening = 0
var/recorded = null //the activation message
var/recorded_type = 0 // 0 for say, 1 for emote
bomb_name = "voice-activated bomb"
describe()
if(recorded || listening)
return "A meter on [src] flickers with every nearby sound."
else
return "[src] is deactivated."
hear_talk(mob/living/M as mob, msg)
hear_input(M, msg, 0)
hear_message(mob/living/M as mob, msg)
hear_input(M, msg, 1)
proc/hear_input(mob/living/M as mob, msg, type)
if(!istype(M,/mob/living))
return
if(listening)
recorded = msg
recorded_type = type
listening = 0
var/turf/T = get_turf(src) //otherwise it won't work in hand
T.visible_message("[bicon(src)] beeps, \"Activation message is [type ? "the sound when one [recorded]" : "'[recorded]'."]\"")
else
if(findtext(msg, recorded) && type == recorded_type)
pulse(0)
var/turf/T = get_turf(src) //otherwise it won't work in hand
T.visible_message("[bicon(src)] \red beeps!")
activate()
return // previously this toggled listning when not in a holder, that's a little silly. It was only called in attack_self that way.
attack_self(mob/user)
if(!user || !secured) return 0
listening = !listening
var/turf/T = get_turf(src)
T.visible_message("[bicon(src)] beeps, \"[listening ? "Now" : "No longer"] recording input.\"")
return 1
toggle_secure()
. = ..()
listening = 0