- Replaced EMP frequency scrambling with a 20 seconds forced shutoff

- Made headsets have a 'power button' (toggles listening) and disallowed them from broadcasting with listening = 0.
This commit is contained in:
dumpdavidson
2013-06-07 16:30:03 +02:00
parent 9ed31bf0d9
commit 9fffa15f8f
4 changed files with 23 additions and 8 deletions
@@ -20,6 +20,11 @@
keyslot1 = new /obj/item/device/encryptionkey/
recalculateChannels()
/obj/item/device/radio/headset/talk_into(mob/living/M as mob, message, channel)
if (!listening)
return
..()
/obj/item/device/radio/headset/receive_range(freq, level)
if(ishuman(src.loc))
var/mob/living/carbon/human/H = src.loc
@@ -60,7 +60,7 @@
on = 0
else
var/area/A = src.loc.loc
if(!A || !isarea(A) || !A.master)
if(!A || !isarea(A) || !A.master || emped)
on = 0
else
on = A.master.powered(EQUIP) // set "on" to the power status
+16 -6
View File
@@ -24,6 +24,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
var/subspace_transmission = 0
var/syndie = 0//Holder to see if it's a syndicate encrpyed radio
var/maxf = 1499
var/emped = 0 // since radios don't use machinery stat binary flags they get a seperate variable
// "Example" = FREQ_LISTENING|FREQ_BROADCASTING
flags = FPRINT | CONDUCT | TABLEPASS
slot_flags = SLOT_BELT
@@ -83,11 +84,14 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
var/dat = ""
if(!istype(src, /obj/item/device/radio/headset)) //Headsets dont get a mic button
dat += "<b>Microphone:</b> [broadcasting ? "<A href='byond://?src=\ref[src];talk=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];talk=1'>Disengaged</A>"]<BR>"
dat += {"
if(!istype(src, /obj/item/device/radio/headset))
dat += {"
<b>Microphone:</b> [broadcasting ? "<A href='byond://?src=\ref[src];talk=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];talk=1'>Disengaged</A>"]<BR>
<b>Speaker:</b> [listening ? "<A href='byond://?src=\ref[src];listen=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];listen=1'>Disengaged</A>"]<BR>
"}
else //Headsets dont get a mic button, speaker controls both
dat += "<b>Power:</b> [listening ? "<A href='byond://?src=\ref[src];listen=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];listen=1'>Disengaged</A>"]<BR>"
dat += {"
<b>Frequency:</b>
<A href='byond://?src=\ref[src];freq=-10'>-</A>
<A href='byond://?src=\ref[src];freq=-2'>-</A>
@@ -663,14 +667,20 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
else return
/obj/item/device/radio/emp_act(severity)
if (emped == 1) //
return
if (listening && ismob(loc)) // if the radio is turned on and on someone's person they notice
loc << "<span class='warning'>\The [src] overloads.</span>"
broadcasting = 0
listening = 0
frequency += pick(-1,1)*2*rand(1,5) // shift the frequency a bit
set_frequency(sanitize_frequency(frequency))
for (var/ch_name in channels)
channels[ch_name] = 0
on = 0
spawn(200)
emped = 0
if (!istype(src, /obj/item/device/radio/intercom)) // intercoms will turn back on on their own
on = 1
emped = 1
..()
///////////////////////////////