mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
-Borgs can now have 1 key installed into their radio, and can handle channels just like any other headset
-As a result, they also have a button that toggles their headset between station-bounced and subspace transmission. While they are transmitting over subspace, they will be using TComms and have access to department channels. While transmitting over the station-bounced system, they cannot access department channels. Simple -Changed binary chat for silicon mobs to be ':b' for both consistency and to make the security channel useable for borgs. -To insert/remove keys, you need to have the cover open and the cell in place, use a key to insert and use a screwdriver to remove keys (Having the cell out will expose the wires when a screwdriver is used) -Cleaned up mech_fabricator.dm a bit git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4277 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -40,7 +40,6 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
var/const/FREQ_LISTENING = 1
|
||||
//FREQ_BROADCASTING = 2
|
||||
|
||||
|
||||
/obj/item/device/radio
|
||||
var/datum/radio_frequency/radio_connection
|
||||
var/list/datum/radio_frequency/secure_radio_connections = new
|
||||
@@ -50,8 +49,6 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT)
|
||||
|
||||
|
||||
|
||||
/obj/item/device/radio/New()
|
||||
..()
|
||||
if(radio_controller)
|
||||
@@ -706,3 +703,114 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
for (var/ch_name in channels)
|
||||
channels[ch_name] = 0
|
||||
..()
|
||||
|
||||
///////////////////////////////
|
||||
//////////Borg Radios//////////
|
||||
///////////////////////////////
|
||||
//Giving borgs their own radio to have some more room to work with -Sieve
|
||||
|
||||
/obj/item/device/radio/borg
|
||||
var/obj/item/device/encryptionkey/keyslot = null//Borg radios can handle a single encryption key
|
||||
|
||||
/obj/item/device/radio/borg/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
// ..()
|
||||
user.machine = src
|
||||
if (!( istype(W, /obj/item/weapon/screwdriver) || (istype(W, /obj/item/device/encryptionkey/ ))))
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if(keyslot)
|
||||
|
||||
|
||||
for(var/ch_name in channels)
|
||||
radio_controller.remove_object(src, radiochannels[ch_name])
|
||||
secure_radio_connections[ch_name] = null
|
||||
|
||||
|
||||
if(keyslot)
|
||||
var/turf/T = get_turf(user)
|
||||
if(T)
|
||||
keyslot.loc = T
|
||||
keyslot = null
|
||||
|
||||
recalculateChannels()
|
||||
user << "You pop out the encryption key in the radio!"
|
||||
|
||||
else
|
||||
user << "This radio doesn't have any encryption keys!"
|
||||
|
||||
if(istype(W, /obj/item/device/encryptionkey/))
|
||||
if(keyslot)
|
||||
user << "The radio can't hold another key!"
|
||||
return
|
||||
|
||||
if(!keyslot)
|
||||
user.drop_item()
|
||||
W.loc = src
|
||||
keyslot = W
|
||||
|
||||
recalculateChannels()
|
||||
|
||||
return
|
||||
|
||||
/obj/item/device/radio/borg/proc/recalculateChannels()
|
||||
src.channels = list()
|
||||
src.syndie = 0
|
||||
|
||||
if(keyslot)
|
||||
for(var/ch_name in keyslot.channels)
|
||||
if(ch_name in src.channels)
|
||||
continue
|
||||
src.channels += ch_name
|
||||
src.channels[ch_name] = keyslot.channels[ch_name]
|
||||
|
||||
if(keyslot.syndie)
|
||||
src.syndie = 1
|
||||
|
||||
|
||||
for (var/ch_name in channels)
|
||||
if(!radio_controller)
|
||||
sleep(30) // Waiting for the radio_controller to be created.
|
||||
if(!radio_controller)
|
||||
src.name = "broken radio"
|
||||
return
|
||||
|
||||
secure_radio_connections[ch_name] = radio_controller.add_object(src, radiochannels[ch_name], RADIO_CHAT)
|
||||
|
||||
return
|
||||
|
||||
/obj/item/device/radio/borg/Topic(href, href_list)
|
||||
if(usr.stat || !on)
|
||||
return
|
||||
if (href_list["mode"])
|
||||
subspace_transmission = !subspace_transmission
|
||||
if(!subspace_transmission)//Simple as fuck, clears the channel list to prevent talking/listening over them if subspace transmission is disabled
|
||||
channels = list()
|
||||
else
|
||||
recalculateChannels()
|
||||
usr << "Subspace Transmission is [(subspace_transmission) ? "enabled" : "disabled"]"
|
||||
..()
|
||||
|
||||
/obj/item/device/radio/borg/interact(mob/user as mob)
|
||||
if(!on)
|
||||
return
|
||||
|
||||
var/dat = "<html><head><title>[src]</title></head><body><TT>"
|
||||
dat += {"
|
||||
Speaker: [listening ? "<A href='byond://?src=\ref[src];listen=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];listen=1'>Disengaged</A>"]<BR>
|
||||
Frequency:
|
||||
<A href='byond://?src=\ref[src];freq=-10'>-</A>
|
||||
<A href='byond://?src=\ref[src];freq=-2'>-</A>
|
||||
[format_frequency(frequency)]
|
||||
<A href='byond://?src=\ref[src];freq=2'>+</A>
|
||||
<A href='byond://?src=\ref[src];freq=10'>+</A><BR>
|
||||
<A href='byond://?src=\ref[src];mode=1'>Toggle Broadcast Mode</A><BR>
|
||||
"}
|
||||
|
||||
if(subspace_transmission)//Don't even bother if subspace isn't turned on
|
||||
for (var/ch_name in channels)
|
||||
dat+=text_sec_channel(ch_name, channels[ch_name])
|
||||
dat+={"[text_wires()]</TT></body></html>"}
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
Reference in New Issue
Block a user