diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index e453d748428..5e7fb5d0bd3 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -42,4 +42,4 @@ var/global/list/global_radios = list() //list of all radios, across all z-lev var/global/list/meteor_list = list() //list of all meteors var/global/list/poi_list = list() //list of points of interest for observe/follow - +var/global/list/active_jammers = list() // List of active radio jammers diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index ef3b4a4e278..eb9b8d8472f 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -1116,6 +1116,13 @@ var/list/uplink_items = list() cost = 1 surplus = 0 +/datum/uplink_item/device_tools/jammer + name = "Radio Jammer" + desc = "This device will disrupt any nearby outgoing radio communication when activated." + reference = "RJ" + item = /obj/item/device/jammer + cost = 5 + /datum/uplink_item/device_tools/teleporter name = "Teleporter Circuit Board" desc = "A printed circuit board that completes the teleporter onboard the mothership. Advise you test fire the teleporter before entering it, as malfunctions can occur." diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 3c9c0211663..e7e210125f9 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -332,6 +332,12 @@ var/global/list/default_medbay_channels = list( var/datum/radio_frequency/connection = message_mode var/turf/position = get_turf(src) + var/jammed = FALSE + for(var/obj/item/device/jammer/jammer in active_jammers) + if(get_dist(position, get_turf(jammer)) < jammer.range) + jammed = TRUE + break + //#### Tagging the signal with all appropriate identity values ####// // ||-- The mob's name identity --|| @@ -345,6 +351,9 @@ var/global/list/default_medbay_channels = list( var/jobname // the mob's "job" + if(jammed) + message = Gibberish(message, 100) + // --- Human: use their actual job --- if(ishuman(M)) var/mob/living/carbon/human/H = M diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index 5f140f05d03..267632c2e24 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -146,3 +146,22 @@ effective or pretty fucking useless. attack_self(usr) add_fingerprint(usr) return + +/obj/item/device/jammer + name = "radio jammer" + desc = "Device used to disrupt nearby radio communication." + icon_state = "jammer" + var/active = FALSE + var/range = 12 + +/obj/item/device/jammer/Destroy() + active_jammers -= src + return ..() + +/obj/item/device/jammer/attack_self(mob/user) + to_chat(user,"You [active ? "deactivate" : "activate"] the [src]") + active = !active + if(active) + active_jammers |= src + else + active_jammers -= src \ No newline at end of file diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index f8b8f7c84d7..c558f0e6424 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -242,7 +242,7 @@ proc/slur(phrase, var/list/slurletters = ("'"))//use a different list as an inpu return sanitize(copytext(t,1,MAX_MESSAGE_LEN)) -proc/Gibberish(t, p)//t is the inputted message, and any value higher than 70 for p will cause letters to be replaced instead of added +/proc/Gibberish(t, p)//t is the inputted message, and any value higher than 70 for p will cause letters to be replaced instead of added /* Turn text into complete gibberish! */ var/returntext = "" for(var/i = 1, i <= length(t), i++) diff --git a/icons/obj/device.dmi b/icons/obj/device.dmi index afa4f586504..0a142ca7874 100644 Binary files a/icons/obj/device.dmi and b/icons/obj/device.dmi differ