mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-09 16:14:13 +00: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:
@@ -307,34 +307,8 @@
|
||||
return output
|
||||
|
||||
/obj/machinery/mecha_part_fabricator/proc/output_part_info(var/obj/item/part)
|
||||
//Be SURE to add any new equipment to this switch, but don't be suprised if it spits out children objects
|
||||
if(istype(part,/obj/item/robot_parts))
|
||||
var/obj/item/robot_parts/P = part
|
||||
var/output = "[P.name] (Cost: [output_part_cost(P)]) [get_construction_time_w_coeff(P)/10]sec"
|
||||
return output
|
||||
else if(istype(part,/obj/item/mecha_parts))
|
||||
var/obj/item/mecha_parts/P = part
|
||||
var/output = "[P.name] (Cost: [output_part_cost(P)]) [get_construction_time_w_coeff(P)/10]sec"
|
||||
return output
|
||||
else if(istype(part,/obj/item/borg/upgrade))
|
||||
var/obj/item/borg/upgrade/P = part
|
||||
var/output = "[P.name] (Cost: [output_part_cost(P)]) [get_construction_time_w_coeff(P)/10]sec"
|
||||
return output
|
||||
else if(istype(part,/obj/item/device/mmi))
|
||||
var/obj/item/device/mmi/P = part
|
||||
var/output = "[P.name] (Cost: [output_part_cost(P)]) [get_construction_time_w_coeff(P)/10]sec"
|
||||
return output
|
||||
else if(istype(part,/obj/item/device/flash/synthetic))
|
||||
var/obj/item/device/flash/synthetic/P = part
|
||||
var/output = "[P.name] (Cost: [output_part_cost(P)]) [get_construction_time_w_coeff(P)/10]sec"
|
||||
return output
|
||||
else if(istype(part,/obj/item/weapon/cell))
|
||||
var/obj/item/weapon/cell/P = part
|
||||
var/output = "[P.name] (Cost: [output_part_cost(P)]) [get_construction_time_w_coeff(P)/10]sec"
|
||||
return output
|
||||
else
|
||||
return 0
|
||||
|
||||
var/output = "[part.name] (Cost: [output_part_cost(part)]) [get_construction_time_w_coeff(part)/10]sec"
|
||||
return output
|
||||
|
||||
/obj/machinery/mecha_part_fabricator/proc/output_part_cost(var/obj/item/part)
|
||||
var/i = 0
|
||||
|
||||
@@ -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
|
||||
@@ -133,9 +133,10 @@ var/list/department_radio_keys = list(
|
||||
//world << "channel_prefix=[channel_prefix]; message_mode=[message_mode]"
|
||||
if (message_mode)
|
||||
message = trim(copytext(message, 3))
|
||||
if (!(ishuman(src) || isanimal(src) && (message_mode=="department" || (message_mode in radiochannels))))
|
||||
if (!(ishuman(src) || isanimal(src) || isrobot(src) && (message_mode=="department" || (message_mode in radiochannels))))
|
||||
message_mode = null //only humans can use headsets
|
||||
// Check removed so parrots can use headsets!
|
||||
// And borgs -Sieve
|
||||
|
||||
if (!message)
|
||||
return
|
||||
@@ -236,6 +237,7 @@ var/list/department_radio_keys = list(
|
||||
used_radios += src:ears
|
||||
message_range = 1
|
||||
italics = 1
|
||||
|
||||
if ("pAI")
|
||||
if (src:radio)
|
||||
src:radio.talk_into(src, message)
|
||||
@@ -253,9 +255,15 @@ var/list/department_radio_keys = list(
|
||||
else
|
||||
//world << "SPECIAL HEADSETS"
|
||||
if (message_mode in radiochannels)
|
||||
if (src:ears)
|
||||
src:ears.talk_into(src, message, message_mode)
|
||||
used_radios += src:ears
|
||||
if(isrobot(src))//Seperates robots to prevent runtimes from the ear stuff
|
||||
var/mob/living/silicon/robot/R = src
|
||||
if(R.radio)//Sanityyyy
|
||||
R.radio.talk_into(src, message, message_mode)
|
||||
used_radios += R.radio
|
||||
else
|
||||
if (src:ears)
|
||||
src:ears.talk_into(src, message, message_mode)
|
||||
used_radios += src:ears
|
||||
message_range = 1
|
||||
italics = 1
|
||||
/////SPECIAL HEADSETS END
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
icon_state = "secborg"
|
||||
modtype = "Synd"
|
||||
|
||||
radio = new /obj/item/device/radio(src)
|
||||
radio = new /obj/item/device/radio/borg(src)
|
||||
if(!scrambledcodes)
|
||||
camera = new /obj/machinery/camera(src)
|
||||
camera.c_tag = real_name
|
||||
@@ -432,11 +432,24 @@
|
||||
else
|
||||
user << "You can't reach the wiring."
|
||||
|
||||
else if (istype(W, /obj/item/weapon/screwdriver) && opened) // haxing
|
||||
else if(istype(W, /obj/item/weapon/screwdriver) && opened && !cell) // haxing
|
||||
wiresexposed = !wiresexposed
|
||||
user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]"
|
||||
updateicon()
|
||||
|
||||
else if(istype(W, /obj/item/weapon/screwdriver) && opened && cell) // radio
|
||||
if(radio)
|
||||
radio.attackby(W,user)//Push it to the radio to let it handle everything
|
||||
else
|
||||
user << "Unable to locate a radio."
|
||||
updateicon()
|
||||
|
||||
else if(istype(W, /obj/item/device/encryptionkey/) && opened)
|
||||
if(radio)//sanityyyyyy
|
||||
radio.attackby(W,user)//GTFO, you have your own procs
|
||||
else
|
||||
user << "Unable to locate a radio."
|
||||
|
||||
else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) // trying to unlock the interface with an ID card
|
||||
if(emagged)//still allow them to open the cover
|
||||
user << "The interface seems slightly damaged"
|
||||
@@ -855,21 +868,7 @@
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/proc/radio_menu()
|
||||
var/dat = {"
|
||||
<TT>
|
||||
Microphone: [radio.broadcasting ? "<A href='byond://?src=\ref[radio];talk=0'>Engaged</A>" : "<A href='byond://?src=\ref[radio];talk=1'>Disengaged</A>"]<BR>
|
||||
Speaker: [radio.listening ? "<A href='byond://?src=\ref[radio];listen=0'>Engaged</A>" : "<A href='byond://?src=\ref[radio];listen=1'>Disengaged</A>"]<BR>
|
||||
Frequency:
|
||||
<A href='byond://?src=\ref[radio];freq=-10'>-</A>
|
||||
<A href='byond://?src=\ref[radio];freq=-2'>-</A>
|
||||
[format_frequency(radio.frequency)]
|
||||
<A href='byond://?src=\ref[radio];freq=2'>+</A>
|
||||
<A href='byond://?src=\ref[radio];freq=10'>+</A><BR>
|
||||
-------
|
||||
</TT>"}
|
||||
src << browse(dat, "window=radio")
|
||||
onclose(src, "radio")
|
||||
return
|
||||
radio.interact(src)//Just use the radio's Topic() instead of bullshit special-snowflake code
|
||||
|
||||
|
||||
/mob/living/silicon/robot/Move(a, b, flag)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
return
|
||||
|
||||
if (length(message) >= 2)
|
||||
if ((copytext(message, 1, 3) == ":s") || (copytext(message, 1, 3) == ":S"))
|
||||
if ((copytext(message, 1, 3) == ":b") || (copytext(message, 1, 3) == ":B"))
|
||||
if(istype(src, /mob/living/silicon/pai))
|
||||
return ..(message)
|
||||
message = copytext(message, 3)
|
||||
|
||||
@@ -47,6 +47,16 @@ should be listed in the changelog upon commit tho. Thanks. -->
|
||||
|
||||
<!-- To take advantage of the pretty new format (well it was new when I wrote this anyway), open the "add-to-changelog.html" file in any browser and add the stuff and then generate the html code and paste it here -->
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">August 1, 2012</h2>
|
||||
<h3 class="author">Sieve updated:</h3>
|
||||
<ul class="changes bgimages16">
|
||||
<li class="rscadd">Borgs can now have an encryption key installed into their internal radios. Simply ID, open the panel, and use the key to insert it (Screwdriver to remove)</li>
|
||||
<li class="rscadd">Due to that as well, borgs have a 'Toggle Broadcast Mode' button for their radios, which changes the broadcast type between station-bounced (Non-reliant on TComms), and subspace (Required for department channels)</li>
|
||||
<li class="tweak">Also changed the binary chat for consistency, now for the prefix is ':b' for everyone, not just one for humans and one for borgs/AIs/pAIs</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">01-August-2012</h2>
|
||||
<h3 class="author">Carn updated:</h3>
|
||||
|
||||
Reference in New Issue
Block a user