From 2252db76f6ee99e71a4928ab3aeef50ad076f9cb Mon Sep 17 00:00:00 2001 From: "sieve32@gmail.com" Date: Thu, 2 Aug 2012 03:02:43 +0000 Subject: [PATCH] -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 --- code/game/mecha/mech_fabricator.dm | 30 +---- code/game/objects/radio/radio.dm | 114 +++++++++++++++++- code/modules/mob/living/say.dm | 16 ++- .../modules/mob/living/silicon/robot/robot.dm | 33 +++-- code/modules/mob/living/silicon/say.dm | 2 +- html/changelog.html | 10 ++ 6 files changed, 152 insertions(+), 53 deletions(-) diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index c6797be4670..dae186de4a6 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -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 diff --git a/code/game/objects/radio/radio.dm b/code/game/objects/radio/radio.dm index b08fc71ed7a..4e4d82096e4 100644 --- a/code/game/objects/radio/radio.dm +++ b/code/game/objects/radio/radio.dm @@ -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 = "[src]" + dat += {" + Speaker: [listening ? "Engaged" : "Disengaged"]
+ Frequency: + - + - + [format_frequency(frequency)] + + + +
+ Toggle Broadcast Mode
+ "} + + 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()]
"} + user << browse(dat, "window=radio") + onclose(user, "radio") + return \ No newline at end of file diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 25b7f0f2059..d19f0140090 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -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 diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 6357b569684..1525c79d3eb 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -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 = {" - -Microphone: [radio.broadcasting ? "Engaged" : "Disengaged"]
-Speaker: [radio.listening ? "Engaged" : "Disengaged"]
-Frequency: -- -- -[format_frequency(radio.frequency)] -+ -+
-------- -
"} - 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) diff --git a/code/modules/mob/living/silicon/say.dm b/code/modules/mob/living/silicon/say.dm index 83d821f5afc..30222c1dd40 100644 --- a/code/modules/mob/living/silicon/say.dm +++ b/code/modules/mob/living/silicon/say.dm @@ -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) diff --git a/html/changelog.html b/html/changelog.html index 35f4aa7c88b..6d92f179cc3 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -47,6 +47,16 @@ should be listed in the changelog upon commit tho. Thanks. --> +
+

August 1, 2012

+

Sieve updated:

+ +
+

01-August-2012

Carn updated: