radio-emp

This commit is contained in:
Alexshreds
2017-05-31 23:51:15 -05:00
committed by Chakirski
1986 changed files with 79586 additions and 52439 deletions
@@ -21,7 +21,7 @@
if(!emagged)
emagged = 1
syndicate = 1
to_chat(user, "\blue The This beacon now only be locked on to by emagged teleporters!")
to_chat(user, "<span class='notice'>The This beacon now only be locked on to by emagged teleporters!</span>")
/obj/item/device/radio/beacon/hear_talk()
return
@@ -58,7 +58,7 @@
/obj/item/device/radio/beacon/syndicate/attack_self(mob/user as mob)
if(user)
to_chat(user, "\blue Locked In")
to_chat(user, "<span class='notice'>Locked In</span>")
new /obj/machinery/power/singularity_beacon/syndicate( user.loc )
playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
qdel(src)
@@ -71,7 +71,7 @@
/obj/item/device/radio/beacon/syndicate/bomb/attack_self(mob/user as mob)
if(user)
to_chat(user, "\blue Locked In")
to_chat(user, "<span class='notice'>Locked In</span>")
new /obj/machinery/syndicatebomb( user.loc )
playsound(src, 'sound/effects/pop.ogg', 100, 1, 1)
qdel(src)
@@ -6,7 +6,7 @@
frequency = 1449
flags = CONDUCT
slot_flags = SLOT_BACK
w_class = 5
w_class = WEIGHT_CLASS_HUGE
materials = list(MAT_METAL=10000, MAT_GLASS=2500)
var/code = 2
@@ -5,6 +5,7 @@
icon = 'icons/obj/radio.dmi'
icon_state = "cypherkey"
item_state = ""
w_class = WEIGHT_CLASS_TINY
var/translate_binary = 0
var/translate_hive = 0
var/syndie = 0
@@ -147,4 +148,4 @@
name = "AI Integrated Encryption Key"
desc = "Integrated encryption key"
icon_state = "cap_cypherkey"
channels = list("Command" = 1, "Security" = 1, "Engineering" = 1, "Science" = 1, "Medical" = 1, "Supply" = 1, "Service" = 1, "AI Private" = 1)
channels = list("Command" = 1, "Security" = 1, "Engineering" = 1, "Science" = 1, "Medical" = 1, "Supply" = 1, "Service" = 1, "AI Private" = 1)
@@ -32,12 +32,8 @@
recalculateChannels(1)
/obj/item/device/radio/headset/Destroy()
if(keyslot1)
qdel(keyslot1)
if(keyslot2)
qdel(keyslot2)
keyslot1 = null
keyslot2 = null
QDEL_NULL(keyslot1)
QDEL_NULL(keyslot2)
return ..()
/obj/item/device/radio/headset/list_channels(var/mob/user)
@@ -64,17 +60,15 @@
return ..()
/obj/item/device/radio/headset/receive_range(freq, level, aiOverride = 0)
if(aiOverride)
return ..(freq, level)
/obj/item/device/radio/headset/is_listening()
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
if(H.l_ear == src || H.r_ear == src)
return ..(freq, level)
else if(isanimal(loc))
// frankly, all the ones with inventory are small enough to not warrant snowflaking the slot check somehow
return ..(freq, level)
return -1
return ..()
else if(isanimal(loc) || isAI(loc))
return ..()
return FALSE
/obj/item/device/radio/headset/alt
name = "bowman headset"
@@ -304,10 +298,10 @@
var/myAi = null // Atlantis: Reference back to the AI which has this radio.
var/disabledAi = 0 // Atlantis: Used to manually disable AI's integrated radio via intellicard menu.
/obj/item/device/radio/headset/heads/ai_integrated/receive_range(freq, level)
/obj/item/device/radio/headset/heads/ai_integrated/is_listening()
if(disabledAi)
return -1 //Transciever Disabled.
return ..(freq, level, 1)
return FALSE
return ..()
/obj/item/device/radio/headset/attackby(obj/item/weapon/W as obj, mob/user as mob)
user.set_machine(src)
@@ -3,7 +3,7 @@
desc = "Talk through this."
icon_state = "intercom"
anchored = 1
w_class = 4
w_class = WEIGHT_CLASS_BULKY
canhear_range = 2
flags = CONDUCT
var/number = 0
@@ -120,15 +120,13 @@
attack_self(user)
/obj/item/device/radio/intercom/receive_range(freq, level)
if(!on)
if(!is_listening())
return -1
if(!(0 in level))
var/turf/position = get_turf(src)
// TODO: Integrate radio with the space manager
if(isnull(position) || !(position.z in level))
return -1
if(!src.listening)
return -1
if(freq in ANTAG_FREQS)
if(!(src.syndie))
return -1//Prevents broadcast of messages over devices lacking the encryption
@@ -140,8 +138,8 @@
if(3)
if(iswirecutter(W) && b_stat && wires.IsAllCut())
to_chat(user, "<span class='notice'>You cut out the intercoms wiring and disconnect its electronics.</span>")
playsound(get_turf(src), 'sound/items/Wirecutter.ogg', 50, 1)
if(do_after(user, 10, target = src))
playsound(get_turf(src), W.usesound, 50, 1)
if(do_after(user, 10 * W.toolspeed, target = src))
if(buildstage != 3)
return
new /obj/item/stack/cable_coil(get_turf(src),5)
@@ -154,8 +152,8 @@
else return ..()
if(2)
if(isscrewdriver(W))
playsound(get_turf(src), 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 10, target = src))
playsound(get_turf(src), W.usesound, 50, 1)
if(do_after(user, 10 * W.toolspeed, target = src))
update_icon()
on = 1
b_stat = 0
@@ -172,15 +170,15 @@
if(coil.amount < 5)
to_chat(user, "<span class='warning'>You need more cable for this!</span>")
return
if(do_after(user, 10, target = src))
if(do_after(user, 10 * coil.toolspeed, target = src))
coil.use(5)
to_chat(user, "<span class='notice'>You wire \the [src]!</span>")
buildstage = 2
return 1
if(iscrowbar(W))
to_chat(user, "<span class='notice'>You begin removing the electronics...</span>")
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 10, target = src))
playsound(get_turf(src), W.usesound, 50, 1)
if(do_after(user, 10 * W.toolspeed, target = src))
if(buildstage != 1)
return
new /obj/item/weapon/intercom_electronics(get_turf(src))
@@ -189,19 +187,19 @@
return 1
if(0)
if(istype(W,/obj/item/weapon/intercom_electronics))
playsound(get_turf(src), 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 10, target = src))
playsound(get_turf(src), W.usesound, 50, 1)
if(do_after(user, 10 * W.toolspeed, target = src))
qdel(W)
to_chat(user, "<span class='notice'>You insert \the [W] into \the [src]!</span>")
buildstage = 1
return 1
if(iswelder(W))
var/obj/item/weapon/weldingtool/WT=W
playsound(get_turf(src), 'sound/items/Welder.ogg', 50, 1)
playsound(get_turf(src), WT.usesound, 50, 1)
if(!WT.remove_fuel(3, user))
to_chat(user, "<span class='warning'>You're out of welding fuel.</span>")
return 1
if(do_after(user, 10, target = src))
if(do_after(user, 10 * WT.toolspeed, target = src))
to_chat(user, "<span class='notice'>You cut the intercom frame from the wall!</span>")
new /obj/item/mounted/frame/intercom(get_turf(src))
qdel(src)
@@ -233,8 +231,10 @@
icon = 'icons/obj/doors/door_assembly.dmi'
icon_state = "door_electronics"
desc = "Looks like a circuit. Probably is."
w_class = 2
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=50, MAT_GLASS=50)
toolspeed = 1
usesound = 'sound/items/Deconstruct.ogg'
/obj/item/device/radio/intercom/locked
var/locked_frequency
+47 -34
View File
@@ -30,7 +30,6 @@ var/global/list/default_medbay_channels = list(
var/frequency = PUB_FREQ //common chat
var/traitor_frequency = 0 //tune to frequency to unlock traitor supplies
var/canhear_range = 3 // the range which mobs can hear this radio from
var/obj/item/device/radio/patch_link = null
var/datum/wires/radio/wires = null
var/b_stat = 0
var/broadcasting = 0
@@ -45,7 +44,7 @@ var/global/list/default_medbay_channels = list(
slot_flags = SLOT_BELT
throw_speed = 2
throw_range = 9
w_class = 2
w_class = WEIGHT_CLASS_SMALL
materials = list(MAT_METAL=75)
@@ -54,32 +53,31 @@ var/global/list/default_medbay_channels = list(
var/list/internal_channels
/obj/item/device/radio
var/datum/radio_frequency/radio_connection
var/list/datum/radio_frequency/secure_radio_connections = new
proc/set_frequency(new_frequency)
radio_controller.remove_object(src, frequency)
frequency = new_frequency
radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT)
/obj/item/device/radio/proc/set_frequency(new_frequency)
radio_controller.remove_object(src, frequency)
frequency = new_frequency
radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT)
/obj/item/device/radio/New()
..()
wires = new(src)
if(radio_controller)
initialize()
internal_channels = default_internal_channels.Copy()
global_radios |= src
/obj/item/device/radio/Destroy()
qdel(wires)
wires = null
QDEL_NULL(wires)
if(radio_controller)
radio_controller.remove_object(src, frequency)
for(var/ch_name in channels)
radio_controller.remove_object(src, radiochannels[ch_name])
patch_link = null
global_radios -= src
follow_target = null
return ..()
@@ -92,7 +90,7 @@ var/global/list/default_medbay_channels = list(
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
/obj/item/device/radio/attack_ghost(mob/user)
return ui_interact(user)
return interact(user)
/obj/item/device/radio/attack_self(mob/user as mob)
user.set_machine(src)
@@ -178,11 +176,6 @@ var/global/list/default_medbay_channels = list(
/mob/dead/observer/has_internal_radio_channel_access(var/mob/user, var/list/req_one_accesses)
return can_admin_interact()
/obj/item/device/radio/proc/text_wires()
if(b_stat)
return wires.GetInteractWindow()
return
/obj/item/device/radio/proc/ToggleBroadcast()
broadcasting = !broadcasting && !(wires.IsIndexCut(WIRE_TRANSMIT) || wires.IsIndexCut(WIRE_SIGNAL))
@@ -240,7 +233,6 @@ var/global/list/default_medbay_channels = list(
var/datum/radio_frequency/connection = null
if(channel && channels && channels.len > 0)
if(channel == "department")
// to_chat(world, "DEBUG: channel=\"[channel]\" switching to \"[channels[1]]\"")
channel = channels[1]
connection = secure_radio_connections[channel]
else
@@ -257,9 +249,8 @@ var/global/list/default_medbay_channels = list(
Broadcast_Message(connection, A,
0, "*garbled automated announcement*", src,
message, from, "Automated Announcement", from, "synthesized voice",
4, 0, zlevel, connection.frequency, follow_target=follow_target)
4, 0, zlevel, connection.frequency, follow_target = follow_target)
qdel(A)
return
// Just a dummy mob used for making announcements, so we don't create AIs to do this
// I'm not sure who thought that was a good idea. -- Crazylemon
@@ -276,7 +267,8 @@ var/global/list/default_medbay_channels = list(
/mob/living/automatedannouncer/Destroy()
if(lifetime_timer)
deltimer(lifetime_timer)
..()
lifetime_timer = null
return ..()
/mob/living/automatedannouncer/proc/autocleanup()
log_runtime(EXCEPTION("An announcer somehow managed to outlive the radio! Deleting!"), src, list("Message: '[message]'"))
@@ -320,7 +312,7 @@ var/global/list/default_medbay_channels = list(
actually transmit large mass. Headsets are the only radio devices capable
of sending subspace transmissions to the Communications Satellite.
A headset sends a signal to a subspace listener/reciever elsewhere in space,
A headset sends a signal to a subspace listener/receiver elsewhere in space,
the signal gets processed and logged, and an audible transmission gets sent
to each individual headset.
*/
@@ -401,6 +393,7 @@ var/global/list/default_medbay_channels = list(
// Identity-associated tags:
"mob" = M, // store a reference to the mob
"mobtype" = M.type, // the mob's type
"race" = signal.get_race(M),
"realname" = real_name, // the mob's real name
"name" = displayname, // the mob's display name
"job" = jobname, // the mob's job
@@ -462,6 +455,7 @@ var/global/list/default_medbay_channels = list(
"mob" = M, // store a reference to the mob
"mobtype" = M.type, // the mob's type
"race" = signal.get_race(M), // text to show next to mob in comms log console
"realname" = real_name, // the mob's real name
"name" = displayname, // the mob's display name
"job" = jobname, // the mob's job
@@ -532,19 +526,15 @@ var/global/list/default_medbay_channels = list(
// what the range is in which mobs will hear the radio
// returns: -1 if can't receive, range otherwise
if(!wires || wires.IsIndexCut(WIRE_RECEIVE))
return -1
if(!listening)
if(!is_listening())
return -1
if(!(0 in level))
var/turf/position = get_turf(src)
if(!position || !(position.z in level))
return -1
if(freq in ANTAG_FREQS)
if(!(src.syndie))//Checks to see if it's allowed on that frequency, based on the encryption keys
if(!(syndie))//Checks to see if it's allowed on that frequency, based on the encryption keys
return -1
if(!on)
return -1
if(!freq) //recieved on main frequency
if(!listening)
return -1
@@ -561,19 +551,34 @@ var/global/list/default_medbay_channels = list(
return canhear_range
/obj/item/device/radio/proc/send_hear(freq, level)
var/range = receive_range(freq, level)
if(range > -1)
return get_mobs_in_view(canhear_range, src)
/obj/item/device/radio/proc/is_listening()
var/is_listening = TRUE
if(!on)
is_listening = FALSE
if(!wires || wires.IsIndexCut(WIRE_RECEIVE))
is_listening = FALSE
if(!listening)
is_listening = FALSE
return is_listening
/obj/item/device/radio/proc/send_announcement()
if(is_listening())
return get_mobs_in_view(canhear_range, src)
return null
/obj/item/device/radio/examine(mob/user, var/distance = -1)
. = ..(user, distance)
if((in_range(src, user) || loc == user))
if(b_stat)
user.show_message("\blue \the [src] can be attached and modified!")
user.show_message("<span class='notice'>\the [src] can be attached and modified!</span>")
else
user.show_message("\blue \the [src] can not be modified or attached!")
user.show_message("<span class='notice'>\the [src] can not be modified or attached!</span>")
return .
/obj/item/device/radio/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
@@ -584,9 +589,9 @@ var/global/list/default_medbay_channels = list(
b_stat = !( b_stat )
if(!istype(src, /obj/item/device/radio/beacon))
if(b_stat)
user.show_message("\blue The radio can now be attached and modified!")
user.show_message("<span class='notice'>The radio can now be attached and modified!</span>")
else
user.show_message("\blue The radio can no longer be modified or attached!")
user.show_message("<span class='notice'>The radio can no longer be modified or attached!</span>")
updateDialog()
//Foreach goto(83)
add_fingerprint(user)
@@ -594,12 +599,20 @@ var/global/list/default_medbay_channels = list(
else return
/obj/item/device/radio/emp_act(severity)
frequency = get_random_freq()
if(listening == 1)
visible_message("<span class='warning'>\The [src] screeches violently!</span>")
broadcasting = 0
listening = 0
for(var/ch_name in channels)
channels[ch_name] = 0
..()
/obj/item/device/radio/proc/get_random_freq()
var/rand_freq = round(rand(1440, 1480), 10) + pick(1, 3, 5, 9)
return rand_freq
///////////////////////////////
//////////Borg Radios//////////
///////////////////////////////