mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 23:53:47 +01:00
added hear_message, like hear_talk but for audible emotes, voice analyzer & newscaster support
This commit is contained in:
@@ -85,6 +85,9 @@
|
||||
if(bombassembly)
|
||||
bombassembly.hear_talk(M, msg)
|
||||
|
||||
/obj/item/device/onetankbomb/hear_message(mob/living/M as mob, msg)
|
||||
if(bombassembly)
|
||||
bombassembly.hear_message(M, msg)
|
||||
|
||||
// ---------- Procs below are for tanks that are used exclusively in 1-tank bombs ----------
|
||||
|
||||
|
||||
@@ -100,6 +100,12 @@
|
||||
a_left.hear_talk(M, msg)
|
||||
if(a_right)
|
||||
a_right.hear_talk(M, msg)
|
||||
|
||||
hear_message(mob/living/M as mob, msg)
|
||||
if(a_left)
|
||||
a_left.hear_message(M, msg)
|
||||
if(a_right)
|
||||
a_right.hear_message(M, msg)
|
||||
|
||||
proc/process_movement() // infrared beams and prox sensors
|
||||
if(a_left && a_right)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
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"
|
||||
|
||||
@@ -16,15 +17,22 @@
|
||||
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("\icon[src] beeps, \"Activation message is '[recorded]'.\"")
|
||||
T.visible_message("\icon[src] beeps, \"Activation message is [type ? "the sound when one [recorded]" : "'[recorded]'."]\"")
|
||||
else
|
||||
if(findtext(msg, recorded))
|
||||
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("\icon[src] \red beeps!")
|
||||
|
||||
Reference in New Issue
Block a user