From c5ce541e96438b6d0a329764e50744a98bc734c3 Mon Sep 17 00:00:00 2001 From: dumpdavidson Date: Tue, 4 Jun 2013 02:24:36 +0200 Subject: [PATCH 1/3] Makes radios more vulnerable to EMP: Department channels that are turned off now cannot be broadcasted into. EMPs will now shift the frequency of a radio a bit. This is supposed to make EMP a viable option for a traitors or nuke agents that are looking to take someone out without the entire station knowing about it. Signed-off-by: dumpdavidson --- code/game/objects/items/devices/radio/radio.dm | 7 +++++-- html/changelog.html | 8 ++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 8d08d67dcc5..8d1b88c9f67 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -116,8 +116,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use /obj/item/device/radio/proc/text_sec_channel(var/chan_name, var/chan_stat) var/list = !!(chan_stat&FREQ_LISTENING)!=0 return {" - [chan_name]
- Speaker: [list ? "Engaged" : "Disengaged"]
+ [chan_name]: [list ? "Engaged" : "Disengaged"]
"} /obj/item/device/radio/Topic(href, href_list) @@ -223,6 +222,8 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use //world << "DEBUG: channel=\"[channel]\" switching to \"[channels[1]]\"" channel = channels[1] connection = secure_radio_connections[channel] + if (!channels[channel]) // if the channel is turned off, don't broadcast + return else connection = radio_connection channel = null @@ -664,6 +665,8 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use /obj/item/device/radio/emp_act(severity) 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 ..() diff --git a/html/changelog.html b/html/changelog.html index ead9bb503ce..91e220b48fb 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -52,6 +52,14 @@ should be listed in the changelog upon commit tho. Thanks. --> +
+

4 June 2013

+

Dumpdavidson updated:

+
    +
  • EMPs can now be used to cut off communication:
    Headsets can no longer broadcast into a channel that is disabled. EMPs will now shift the frequency of a radio.
  • +
+
+

25 May 2013

Ikarrus updated:

From 9ed31bf0d97aebcfa1822cff06e93930127e1d75 Mon Sep 17 00:00:00 2001 From: dumpdavidson Date: Tue, 4 Jun 2013 13:28:49 +0200 Subject: [PATCH 2/3] - If they are turned on, radios inform the person they are on if they overload due to an EMP. --- code/game/objects/items/devices/radio/radio.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 8d1b88c9f67..0855958b6e1 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -663,6 +663,8 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use else return /obj/item/device/radio/emp_act(severity) + if (listening && ismob(loc)) // if the radio is turned on and on someone's person they notice + loc << "\The [src] overloads." broadcasting = 0 listening = 0 frequency += pick(-1,1)*2*rand(1,5) // shift the frequency a bit From 9fffa15f8fabf34acdad2277d60fe8bad191f969 Mon Sep 17 00:00:00 2001 From: dumpdavidson Date: Fri, 7 Jun 2013 16:30:03 +0200 Subject: [PATCH 3/3] - 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. --- .../objects/items/devices/radio/headset.dm | 5 +++++ .../objects/items/devices/radio/intercom.dm | 2 +- .../game/objects/items/devices/radio/radio.dm | 22 ++++++++++++++----- html/changelog.html | 2 +- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index c1d3aecb021..b352cb09ccd 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -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 diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index c3c811e82eb..01eb03a4a17 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -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 diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 0855958b6e1..97ed76e4f90 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -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 += "Microphone: [broadcasting ? "Engaged" : "Disengaged"]
" - - dat += {" + if(!istype(src, /obj/item/device/radio/headset)) + dat += {" + Microphone: [broadcasting ? "Engaged" : "Disengaged"]
Speaker: [listening ? "Engaged" : "Disengaged"]
+ "} + else //Headsets dont get a mic button, speaker controls both + dat += "Power: [listening ? "Engaged" : "Disengaged"]
" + dat += {" Frequency: - - @@ -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 << "\The [src] overloads." 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 ..() /////////////////////////////// diff --git a/html/changelog.html b/html/changelog.html index 91e220b48fb..664042a33ff 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -56,7 +56,7 @@ should be listed in the changelog upon commit tho. Thanks. -->

4 June 2013

Dumpdavidson updated:

    -
  • EMPs can now be used to cut off communication:
    Headsets can no longer broadcast into a channel that is disabled. EMPs will now shift the frequency of a radio.
  • +
  • Headsets can no longer broadcast into a channel that is disabled.
    Headsets now have a button to turn off the power instead of the speaker. This button disables all communication functions.
    EMPs now force affected radios off for about 20 seconds.