diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm index 95dfb1e214da9..fa39d528fdb0d 100644 --- a/code/game/objects/items/weapons/storage/belt.dm +++ b/code/game/objects/items/weapons/storage/belt.dm @@ -29,8 +29,8 @@ /obj/item/stack/cable_coil, /obj/item/device/t_scanner, /obj/item/device/analyzer, - /obj/item/weapon/extinguisher/mini - /obj/item/device/integrated_electronics/wirer, + /obj/item/weapon/extinguisher/mini, + /obj/item/device/integrated_electronics/wirer ) /obj/item/weapon/storage/belt/utility/full/New() diff --git a/code/modules/integrated_electronics/_defines.dm b/code/modules/integrated_electronics/_defines.dm index 737b1914614b3..ed4be623c7bf7 100644 --- a/code/modules/integrated_electronics/_defines.dm +++ b/code/modules/integrated_electronics/_defines.dm @@ -19,7 +19,7 @@ var/list/activator_names = list() var/last_used = 0 //Uses world.time var/complexity = 1 //This acts as a limitation on building machines, more resource-intensive components cost more 'space'. - var/power_required = 5 //w + var/cooldown_per_use = 1 SECONDS /obj/item/integrated_circuit/examine(mob/user) ..() @@ -72,6 +72,9 @@ A.name = "[activator_names[i]]" i++ +/obj/item/integrated_circuit/proc/on_data_written() //Override this for special behaviour when new data gets pushed to the circuit. + return + /obj/item/integrated_circuit/Destroy() for(var/datum/integrated_io/I in inputs) qdel(I) @@ -92,7 +95,10 @@ var/mob/M = usr - var/input = sanitize_text(input("What do you want to name the circuit?", ,"")) + if(!M.canmove || M.stat || M.restrained()) + return + + var/input = sanitize_text(input("What do you want to name the circuit?","Rename", src.name), MAX_NAME_LEN) if(src && input) M << "The circuit '[src.name]' is now labeled '[input]'." @@ -156,13 +162,14 @@ words += "\[[linked.name]\] \ @ [linked.holder]
" if(outputs.len > inputs.len) - height = Floor(outputs.len / inputs.len) - //world << "I wrote [words] at ([i],[j])." + // height = Floor(outputs.len / inputs.len) + height = 1 // Because of bugs, if there's more outputs than inputs, it causes the output side to be hidden. + //world << "I wrote [words] at ([i],[j]). Height = [height]." if(2) if(i == 1) words = "[src.name]

[src.desc]" height = row_height - //world << "I wrote the center piece because i was equal to 1, at ([i],[j])." + //world << "I wrote the center piece because i was equal to 1, at ([i],[j]). Height = [height]." else continue if(3) @@ -179,8 +186,9 @@ words += "\[[linked.name]\] \ @ [linked.holder]
" if(inputs.len > outputs.len) - height = Floor(inputs.len / outputs.len) - //world << "I wrote [words] at ([i],[j])." + // height = Floor(inputs.len / outputs.len) + height = 1 // See above. + //world << "I wrote [words] at ([i],[j]). Height = [height]." HTML += "[words]" //HTML += "[words]" //world << "Writing to ([i],[j])." @@ -209,11 +217,15 @@ HTML += "" HTML += "" + HTML += "
Complexity: [complexity]" HTML += "
[extended_desc]" HTML += "" user << browse(HTML, "window=circuit-\ref[src];size=600x350;border=1;can_resize=1;can_close=1;can_minimize=1") + //user << sanitize_text(HTML, "window=debug;size=400x400;border=1;can_resize=1;can_close=1;can_minimize=1") + //world << sanitize_text(HTML) + user.set_machine(src) onclose(user, "circuit-\ref[src]") @@ -224,17 +236,31 @@ if(!user || !user.Adjacent(get_turf(src)) ) return 1 + if(!user.canmove || user.stat || user.restrained()) + return + if(href_list["wire"]) if(ishuman(user) && Adjacent(user)) var/mob/living/carbon/human/H = user - var/obj/item/device/integrated_electronics/wirer/wirer = null - if(istype(H.r_hand, /obj/item/device/integrated_electronics/wirer)) - wirer = H.r_hand - else if(istype(H.l_hand, /obj/item/device/integrated_electronics/wirer)) - wirer = H.l_hand - - if(wirer && pin) - wirer.wire(pin, user) + var/obj/held_item = H.get_active_hand() + + if(istype(held_item, /obj/item/device/integrated_electronics/wirer)) + var/obj/item/device/integrated_electronics/wirer/wirer = held_item + if(pin) + wirer.wire(pin, user) + + else if(istype(held_item, /obj/item/device/integrated_electronics/debugger)) + var/obj/item/device/integrated_electronics/debugger/debugger = held_item + if(pin) + debugger.write_data(pin, user) + + // if(istype(H.r_hand, /obj/item/device/integrated_electronics/wirer)) + // wirer = H.r_hand + // else if(istype(H.l_hand, /obj/item/device/integrated_electronics/wirer)) + // wirer = H.l_hand + + // if(wirer && pin) + // wirer.wire(pin, user) else user << "You can't do a whole lot without tools." @@ -265,7 +291,7 @@ ..() /datum/integrated_io/proc/display_data() - if(!data) + if(isnull(data)) return "(null)" // Empty data means nothing to show. if(istext(data)) return "(\"[data]\")" // Wraps the 'string' in escaped quotes, so that people know it's a 'string'. @@ -281,18 +307,23 @@ if(isnull(data)) return if(isnum(data)) - data = rand(-10000, 10000) + write_data_to_pin(rand(-10000, 10000)) if(istext(data)) - data = "ERROR" + write_data_to_pin("ERROR") push_data() /datum/integrated_io/activate/scramble() push_data() +/datum/integrated_io/proc/write_data_to_pin(var/new_data) + if(isnull(new_data) || isnum(new_data) || istext(new_data) || istype(new_data, /atom/) ) // Anything else is a type we don't want. + data = new_data + holder.on_data_written() + /datum/integrated_io/proc/push_data() if(linked.len) for(var/datum/integrated_io/io in linked) - io.data = data + io.write_data_to_pin(data) /datum/integrated_io/activate/push_data() if(linked.len) @@ -302,7 +333,7 @@ /datum/integrated_io/proc/pull_data() if(linked.len) for(var/datum/integrated_io/io in linked) - data = io.data + write_data_to_pin(io.data) /datum/integrated_io/proc/get_linked_to_desc() if(linked.len) @@ -341,8 +372,8 @@ for(var/datum/integrated_io/input/I in inputs) I.push_data() -/obj/item/integrated_circuit/proc/work() - if(last_used + 2 SECONDS > world.time) // All intergrated circuits have an internal cooldown of two seconds to protect from spam. +/obj/item/integrated_circuit/proc/work(var/datum/integrated_io/io) + if(last_used + cooldown_per_use > world.time) // All intergrated circuits have an internal cooldown, to protect from spam. return 0 last_used = world.time return 1 diff --git a/code/modules/integrated_electronics/arithmetic.dm b/code/modules/integrated_electronics/arithmetic.dm index 5f5a4f1d2e6ae..3fc60c64f9cd3 100644 --- a/code/modules/integrated_electronics/arithmetic.dm +++ b/code/modules/integrated_electronics/arithmetic.dm @@ -154,4 +154,30 @@ if(..()) var/datum/integrated_io/output/O = outputs[1] O.data = 3.14159 - O.push_data() \ No newline at end of file + O.push_data() + +// Random // +/obj/item/integrated_circuit/arithmetic/random + name = "random number generator circuit" + desc = "This gives a random (integer) number between values A and B inclusive." + icon_state = "random" + number_of_inputs = 2 + number_of_outputs = 1 + number_of_activators = 1 + input_names = list( + "L", + "H" + ) + +/obj/item/integrated_circuit/arithmetic/random/work() + if(..()) + var/result = 0 + var/datum/integrated_io/L = inputs[1] + var/datum/integrated_io/H = inputs[2] + + if(isnum(L.data) && isnum(H.data)) + result = rand(L.data, H.data) + + for(var/datum/integrated_io/output/O in outputs) + O.data = result + O.push_data() \ No newline at end of file diff --git a/code/modules/integrated_electronics/assemblies.dm b/code/modules/integrated_electronics/assemblies.dm index 97690b977f880..e727f4c3d8131 100644 --- a/code/modules/integrated_electronics/assemblies.dm +++ b/code/modules/integrated_electronics/assemblies.dm @@ -3,19 +3,21 @@ desc = "It's a case, for building electronics with." w_class = 2 icon = 'icons/obj/electronic_assemblies.dmi' - icon_state = "setup" + icon_state = "setup_small" var/max_components = 10 var/max_complexity = 30 var/opened = 0 /obj/item/device/electronic_assembly/medium name = "electronic mechanism" + icon_state = "setup_medium" w_class = 3 max_components = 20 max_complexity = 50 /obj/item/device/electronic_assembly/large name = "electronic machine" + icon_state = "setup" w_class = 4 max_components = 30 max_complexity = 60 @@ -35,16 +37,23 @@ IC.work() */ +/obj/item/device/electronic_assembly/update_icon() + if(opened) + icon_state = initial(icon_state) + "-open" + else + icon_state = initial(icon_state) + /obj/item/device/electronic_assembly/examine(mob/user) ..() - if(!opened) - for(var/obj/item/integrated_circuit/output/screen/S in contents) - if(S.stuff_to_display) - user << "There's a little screen labeled '[S.name]', which displays '[S.stuff_to_display]'." - else - var/obj/item/integrated_circuit/IC = input(user, "Which circuit do you want to examine?", "Examination") as null|anything in contents - if(IC) - IC.examine(user) + if(user.Adjacent(src)) + if(!opened) + for(var/obj/item/integrated_circuit/output/screen/S in contents) + if(S.stuff_to_display) + user << "There's a little screen labeled '[S.name]', which displays '[S.stuff_to_display]'." + else + var/obj/item/integrated_circuit/IC = input(user, "Which circuit do you want to examine?", "Examination") as null|anything in contents + if(IC) + IC.examine(user) /obj/item/device/electronic_assembly/attackby(var/obj/item/I, var/mob/user) if(istype(I, /obj/item/integrated_circuit)) @@ -86,6 +95,7 @@ playsound(src.loc, 'sound/items/Crowbar.ogg', 50, 1) opened = !opened user << "You [opened ? "opened" : "closed"] \the [src]." + update_icon() if(istype(I, /obj/item/device/integrated_electronics/wirer)) if(opened) var/obj/item/integrated_circuit/IC = input(user, "Which circuit do you want to examine?", "Examination") as null|anything in contents @@ -98,7 +108,8 @@ /obj/item/device/electronic_assembly/attack_self(mob/user) var/list/available_inputs = list() for(var/obj/item/integrated_circuit/input/input in contents) - available_inputs.Add(input) + if(input.can_be_asked_input) + available_inputs.Add(input) var/obj/item/integrated_circuit/input/choice = input(user, "What do you want to interact with?", "Interaction") as null|anything in available_inputs if(choice) choice.ask_for_input(user) diff --git a/code/modules/integrated_electronics/converters.dm b/code/modules/integrated_electronics/converters.dm index 0bd2166419528..7a837abbfa3af 100644 --- a/code/modules/integrated_electronics/converters.dm +++ b/code/modules/integrated_electronics/converters.dm @@ -17,7 +17,7 @@ /obj/item/integrated_circuit/converter/num2text name = "number to string" desc = "This circuit can convert a number variable into a string." - icon_state = "addition" + icon_state = "num-string" /obj/item/integrated_circuit/converter/num2text/work() if(..()) @@ -33,7 +33,7 @@ /obj/item/integrated_circuit/converter/text2num name = "string to number" desc = "This circuit can convert a string variable into a number." - icon_state = "addition" + icon_state = "string-num" /obj/item/integrated_circuit/converter/text2num/work() if(..()) @@ -49,7 +49,7 @@ /obj/item/integrated_circuit/converter/ref2text name = "reference to string" desc = "This circuit can convert a reference to something else to a string, specifically the name of that reference." - icon_state = "addition" + icon_state = "ref-string" /obj/item/integrated_circuit/converter/ref2text/work() if(..()) @@ -66,7 +66,7 @@ /obj/item/integrated_circuit/converter/lowercase name = "lowercase string converter" desc = "this will cause a string to come out in all lowercase." - icon_state = "addition" + icon_state = "lowercase" /obj/item/integrated_circuit/converter/lowercase/work() if(..()) @@ -82,7 +82,7 @@ /obj/item/integrated_circuit/converter/uppercase name = "uppercase string converter" desc = "THIS WILL CAUSE A STRING TO COME OUT IN ALL UPPERCASE." - icon_state = "addition" + icon_state = "uppercase" /obj/item/integrated_circuit/converter/uppercase/work() if(..()) @@ -92,5 +92,42 @@ if(incoming.data && istext(incoming.data)) result = uppertext(incoming.data) + outgoing.data = result + outgoing.push_data() + +/obj/item/integrated_circuit/converter/concatenatior + name = "concatenatior" + desc = "This joins many strings together to get one big string." + complexity = 4 + number_of_inputs = 8 + number_of_outputs = 1 + number_of_activators = 1 + input_names = list( + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H" + ) + output_names = list( + "result" + ) + activator_names = list( + "concatenate" + ) + + +/obj/item/integrated_circuit/converter/concatenatior/work() + if(..()) + var/result = null + for(var/datum/integrated_io/input/I in inputs) + I.pull_data() + if(istext(I.data)) + result = result + I.data + + var/datum/integrated_io/outgoing = outputs[1] outgoing.data = result outgoing.push_data() \ No newline at end of file diff --git a/code/modules/integrated_electronics/coordinate.dm b/code/modules/integrated_electronics/coordinate.dm index 04409907ac85c..f70df7425901b 100644 --- a/code/modules/integrated_electronics/coordinate.dm +++ b/code/modules/integrated_electronics/coordinate.dm @@ -2,6 +2,7 @@ /obj/item/integrated_circuit/gps name = "global positioning system" desc = "This allows you to easily know the position of a machine containing this device." + icon_state = "gps" complexity = 4 number_of_inputs = 0 number_of_outputs = 2 diff --git a/code/modules/integrated_electronics/input_output.dm b/code/modules/integrated_electronics/input_output.dm index 8f9c2cac0409e..42da3406547d1 100644 --- a/code/modules/integrated_electronics/input_output.dm +++ b/code/modules/integrated_electronics/input_output.dm @@ -1,3 +1,6 @@ +/obj/item/integrated_circuit/input + var/can_be_asked_input = 0 + /obj/item/integrated_circuit/input/proc/ask_for_input(mob/user) return @@ -9,6 +12,7 @@ number_of_outputs = 0 number_of_activators = 1 complexity = 1 + can_be_asked_input = 1 activator_names = list( "on pressed" ) @@ -28,6 +32,7 @@ number_of_outputs = 1 number_of_activators = 1 complexity = 2 + can_be_asked_input = 1 output_names = list( "number entered" ) @@ -36,23 +41,23 @@ ) /obj/item/integrated_circuit/input/numberpad/ask_for_input(mob/user) - var/new_input = input(user, "Enter a number, please.","Number pad") as num - if(new_input && isnum(new_input)) + var/new_input = input(user, "Enter a number, please.","Number pad") as null|num + if(isnum(new_input)) var/datum/integrated_io/O = outputs[1] O.data = new_input O.push_data() var/datum/integrated_io/A = activators[1] - if(A.linked) - A.holder.work() + A.push_data() /obj/item/integrated_circuit/input/textpad name = "text pad" desc = "This small text pad allows someone to input a string into the system." - icon_state = "numberpad" + icon_state = "textpad" number_of_inputs = 0 number_of_outputs = 1 number_of_activators = 1 complexity = 2 + can_be_asked_input = 1 output_names = list( "string entered" ) @@ -61,14 +66,284 @@ ) /obj/item/integrated_circuit/input/textpad/ask_for_input(mob/user) - var/new_input = input(user, "Enter some words, please.","Number pad") as text + var/new_input = input(user, "Enter some words, please.","Number pad") as null|text if(new_input && istext(new_input)) var/datum/integrated_io/O = outputs[1] O.data = new_input O.push_data() var/datum/integrated_io/A = activators[1] - if(A.linked) - A.holder.work() + A.push_data() + +/obj/item/integrated_circuit/input/med_scanner + name = "integrated medical analyser" + desc = "A very small version of the common medical analyser. This allows the machine to know how healthy someone is." + icon_state = "medscan" + number_of_inputs = 1 + number_of_outputs = 2 + number_of_activators = 1 + complexity = 4 + input_names = list( + "target ref" + ) + output_names = list( + "total health %", + "total missing health" + ) + activator_names = list( + "scan" + ) + +/obj/item/integrated_circuit/input/med_scanner/work() + if(..()) + var/datum/integrated_io/I = inputs[1] + if(!I.data || !ishuman(I.data)) //Invalid input + return + var/mob/living/carbon/human/H = I.data + if(H.Adjacent(get_turf(src))) // Like normal analysers, it can't be used at range. + var/total_health = round(H.health/H.maxHealth, 0.1)*100 + var/missing_health = H.maxHealth - H.health + + var/datum/integrated_io/total = outputs[1] + var/datum/integrated_io/missing = outputs[2] + + total.data = total_health + missing.data = missing_health + + for(var/datum/integrated_io/output/O in outputs) + O.push_data() + +/obj/item/integrated_circuit/input/adv_med_scanner + name = "integrated advanced medical analyser" + desc = "A very small version of the common medical analyser. This allows the machine to know how healthy someone is. \ + This type is much more precise, allowing the machine to know much more about the target than a normal analyzer." + icon_state = "medscan_adv" + number_of_inputs = 1 + number_of_outputs = 7 + number_of_activators = 1 + complexity = 12 + input_names = list( + "target ref" + ) + output_names = list( + "total health %", + "total missing health", + "brute damage", + "burn damage", + "tox damage", + "oxy damage", + "clone damage" + ) + activator_names = list( + "scan" + ) + +/obj/item/integrated_circuit/input/adv_med_scanner/work() + if(..()) + var/datum/integrated_io/I = inputs[1] + if(!I.data || !ishuman(I.data)) //Invalid input + return + var/mob/living/carbon/human/H = I.data + if(H.Adjacent(get_turf(src))) // Like normal analysers, it can't be used at range. + var/total_health = round(H.health/H.maxHealth, 0.1)*100 + var/missing_health = H.maxHealth - H.health + + var/datum/integrated_io/total = outputs[1] + var/datum/integrated_io/missing = outputs[2] + var/datum/integrated_io/brute = outputs[3] + var/datum/integrated_io/burn = outputs[4] + var/datum/integrated_io/tox = outputs[5] + var/datum/integrated_io/oxy = outputs[6] + var/datum/integrated_io/clone = outputs[7] + + total.data = total_health + missing.data = missing_health + brute.data = H.getBruteLoss() + burn.data = H.getFireLoss() + tox.data = H.getToxLoss() + oxy.data = H.getOxyLoss() + clone.data = H.getCloneLoss() + + for(var/datum/integrated_io/output/O in outputs) + O.push_data() + +/obj/item/integrated_circuit/input/local_locator + name = "local locator" + desc = "This is needed for certain devices that demand a reference for a target to act upon. This type only locates something \ + that is holding the machine containing it." + number_of_inputs = 0 + number_of_outputs = 1 + number_of_activators = 1 + complexity = 4 + output_names = list( + "located ref" + ) + activator_names = list( + "locate" + ) + +/obj/item/integrated_circuit/input/local_locator/work() + if(..()) + var/mob/living/L = null + var/datum/integrated_io/O = outputs[1] + O.data = null + if(istype(src.loc, /obj/item/device/electronic_assembly)) // Check to make sure we're actually in a machine. + var/obj/item/device/electronic_assembly/assembly = src.loc + if(istype(assembly.loc, /mob/living)) // Now check if someone's holding us. + L = assembly.loc + + if(L) + O.data = L + + O.push_data() + +/obj/item/integrated_circuit/input/signaler + name = "integrated signaler" + desc = "Signals from a signaler can be received with this, allowing for remote control. Additionally, it can send signals as well." + extended_desc = "When a signal is received from another signaler, the 'on signal received' activator pin will be pulsed. \ + The two input pins are to configure the integrated signaler's settings. Note that the frequency should not have a decimal in it. \ + Meaning the default frequency is expressed as 1457, not 145.7. To send a signal, pulse the 'send signal' activator pin." + icon_state = "signal" + number_of_inputs = 2 + number_of_outputs = 0 + number_of_activators = 2 + complexity = 4 + input_names = list( + "frequency", + "code" + ) + activator_names = list( + "send signal", + "on signal received" + ) + var/frequency = 1457 + var/code = 30 + var/datum/radio_frequency/radio_connection + +/obj/item/integrated_circuit/input/signaler/New() + ..() + spawn(4 SECONDS) + set_frequency(frequency) + var/datum/integrated_io/new_freq = inputs[1] + var/datum/integrated_io/new_code = inputs[2] + // Set the pins so when someone sees them, they won't show as null + new_freq.data = frequency + new_code.data = code + +/obj/item/integrated_circuit/input/signaler/Destroy() + if(radio_controller) + radio_controller.remove_object(src,frequency) + frequency = 0 + ..() + +/obj/item/integrated_circuit/input/signaler/on_data_written() + var/datum/integrated_io/new_freq = inputs[1] + var/datum/integrated_io/new_code = inputs[2] + if(isnum(new_freq.data)) + set_frequency(new_freq.data) + if(isnum(new_code.data)) + code = new_code.data + + +/obj/item/integrated_circuit/input/signaler/work() // Sends a signal. + if(..()) + if(!radio_connection) + return + + var/datum/signal/signal = new() + signal.source = src + signal.encryption = code + signal.data["message"] = "ACTIVATE" + radio_connection.post_signal(src, signal) + +/obj/item/integrated_circuit/input/signaler/proc/set_frequency(new_frequency) + if(!frequency) + return + if(!radio_controller) + sleep(20) + if(!radio_controller) + return + radio_controller.remove_object(src, frequency) + frequency = new_frequency + radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT) + +/obj/item/integrated_circuit/input/signaler/receive_signal(datum/signal/signal) + var/datum/integrated_io/new_code = inputs[2] + var/code = 0 + + if(isnum(new_code.data)) + code = new_code.data + if(!signal) + return 0 + if(signal.encryption != code) + return 0 + if(signal.source == src) // Don't trigger ourselves. + return 0 + + var/datum/integrated_io/A = activators[2] + A.push_data() + + for(var/mob/O in hearers(1, src.loc)) + O.show_message(text("\icon[] *beep* *beep*", src), 3, "*beep* *beep*", 2) + + +/obj/item/integrated_circuit/input/EPv2 + name = "\improper EPv2 circuit" + desc = "Enables the sending and receiving of messages on the Exonet with the EPv2 protocol." + extended_desc = "An EPv2 address is a string with the format of XXXX:XXXX:XXXX:XXXX. Data can be send or received using the \ + second pin on each side, with additonal data reserved for the third pin. When a message is received, the second activaiton pin \ + will pulse whatever's connected to it. Pulsing the first activation pin will send a message." + icon_state = "signal" + number_of_inputs = 3 + number_of_outputs = 3 + number_of_activators = 2 + complexity = 4 + input_names = list( + "target EPv2 address", + "data to send", + "secondary text" + ) + output_names = list( + "address received", + "data received", + "secondary text received" + ) + activator_names = list( + "send data", + "on data received" + ) + var/datum/exonet_protocol/exonet = null + +/obj/item/integrated_circuit/input/EPv2/New() + ..() + exonet = new(src) + exonet.make_address("EPv2_circuit-\ref[src]") + desc += "This circuit's EPv2 address is: [exonet.address]." + +/obj/item/integrated_circuit/input/EPv2/Destroy() + if(exonet) + exonet.remove_address() + qdel(exonet) + ..() + +/obj/item/integrated_circuit/input/EPv2/work() + if(..()) + var/datum/integrated_io/target_address = inputs[1] + var/datum/integrated_io/message = inputs[2] + var/datum/integrated_io/text = inputs[3] + if(istext(target_address.data)) + exonet.send_message(target_address.data, message.data, text.data) + +/obj/item/integrated_circuit/input/receive_exonet_message(var/atom/origin_atom, var/origin_address, var/message, var/text) + var/datum/integrated_io/message_received = outputs[1] + var/datum/integrated_io/data_received = outputs[2] + var/datum/integrated_io/text_received = outputs[3] + + var/datum/integrated_io/A = activators[2] + A.push_data() + + message_received.write_data_to_pin(origin_address) + data_received.write_data_to_pin(message) + text_received.write_data_to_pin(text) /obj/item/integrated_circuit/output/screen name = "screen" @@ -88,4 +363,132 @@ /obj/item/integrated_circuit/output/screen/work() var/datum/integrated_io/I = inputs[1] - stuff_to_display = I.data \ No newline at end of file + stuff_to_display = I.data + +/obj/item/integrated_circuit/output/light + name = "light" + desc = "This light can turn on and off on command." + icon_state = "light_adv" +// icon_state = "light" + complexity = 4 + number_of_inputs = 0 + number_of_outputs = 0 + number_of_activators = 1 + activator_names = list( + "toggle light" + ) + var/light_toggled = 0 + var/light_brightness = 3 + var/light_rgb = "#FFFFFF" + +/obj/item/integrated_circuit/output/light/work() + if(..()) + light_toggled = !light_toggled + update_lighting() + +/obj/item/integrated_circuit/output/light/proc/update_lighting() + if(light_toggled) + set_light(l_range = light_brightness, l_power = light_brightness, l_color = light_rgb) + else + set_light(0) + +/obj/item/integrated_circuit/output/light/advanced/update_lighting() + var/datum/integrated_io/R = inputs[1] + var/datum/integrated_io/G = inputs[2] + var/datum/integrated_io/B = inputs[3] + var/datum/integrated_io/brightness = inputs[4] + + if(isnum(R.data) && isnum(G.data) && isnum(B.data) && isnum(brightness.data)) + R.data = Clamp(R.data, 0, 255) + G.data = Clamp(G.data, 0, 255) + B.data = Clamp(B.data, 0, 255) + brightness.data = Clamp(brightness.data, 0, 6) + light_rgb = rgb(R.data, G.data, B.data) + light_brightness = brightness.data + + ..() + +/obj/item/integrated_circuit/output/light/advanced + name = "advanced light" + desc = "This light can turn on and off on command, in any color, and in various brightness levels." + icon_state = "light_adv" + complexity = 8 + number_of_inputs = 4 + number_of_outputs = 0 + number_of_activators = 1 + input_names = list( + "R", + "G", + "B", + "Brightness" + ) + +/obj/item/integrated_circuit/output/light/advanced/on_data_written() + update_lighting() + +/obj/item/integrated_circuit/output/sound + name = "speaker circuit" + desc = "A miniature speaker is attached to this component." + icon_state = "speaker" + complexity = 8 + cooldown_per_use = 4 SECONDS + number_of_inputs = 3 + number_of_outputs = 0 + number_of_activators = 1 + input_names = list( + "sound ID", + "volume", + "frequency" + ) + activator_names = list( + "play sound" + ) + var/list/sounds = list() + +/obj/item/integrated_circuit/output/sound/work() + if(..()) + var/datum/integrated_io/ID = inputs[1] + var/datum/integrated_io/vol = inputs[2] + var/datum/integrated_io/frequency = inputs[3] + if(istext(ID.data) && isnum(vol.data) && isnum(frequency.data)) + var/selected_sound = sounds[ID.data] + vol.data = Clamp(vol.data, 0, 1) + frequency.data = Clamp(frequency.data, 0, 100) + playsound(get_turf(src), selected_sound, vol.data, frequency.data, -1) + +/obj/item/integrated_circuit/output/sound/beeper + name = "beeper circuit" + desc = "A miniature speaker is attached to this component. This is often used in the construction of motherboards, which use \ + the speaker to tell the user if something goes very wrong when booting up. It can also do other similar synthetic sounds such \ + as buzzing, pinging, chiming, and more." + extended_desc = "The first input pin determines what sound is used. The choices are; beep, chime, buzz sigh, buzz twice, ping, \ + synth yes, synth no, warning buzz. The second pin determines the volume of sound that is played, and the third determines if \ + the frequency of the sound will vary with each activation." + sounds = list( + "beep" = 'sound/machines/twobeep.ogg', + "chime" = 'sound/machines/chime.ogg', + "buzz sigh" = 'sound/machines/buzz-sigh.ogg', + "buzz twice" = 'sound/machines/buzz-two.ogg', + "ping" = 'sound/machines/ping.ogg', + "synth yes" = 'sound/machines/synth_yes.ogg', + "synth no" = 'sound/machines/synth_no.ogg', + "warning buzz" = 'sound/machines/warning-buzzer.ogg' + ) + +/obj/item/integrated_circuit/output/sound/beepsky + name = "securitron sound circuit" + desc = "A miniature speaker is attached to this component. Considered by some to be the essential component for a securitron." + extended_desc = "The first input pin determines what sound is used. The choices are; creep, criminal, freeze, god, \ + i am the law, insult, radio, secure day. The second pin determines the volume of sound that is played, and the \ + third determines if the frequency of the sound will vary with each activation." + sounds = list( + "creep" = 'sound/voice/bcreep.ogg', + "criminal" = 'sound/voice/bcriminal.ogg', + "freeze" = 'sound/voice/bfreeze.ogg', + "god" = 'sound/voice/bgod.ogg', + "i am the law" = 'sound/voice/biamthelaw.ogg', + "insult" = 'sound/voice/binsult.ogg', + "radio" = 'sound/voice/bradio.ogg', + "secure day" = 'sound/voice/bsecureday.ogg', + ) + diff --git a/code/modules/integrated_electronics/manipulation.dm b/code/modules/integrated_electronics/manipulation.dm index 2b4d4248b3aa0..05fdc1f23f034 100644 --- a/code/modules/integrated_electronics/manipulation.dm +++ b/code/modules/integrated_electronics/manipulation.dm @@ -47,50 +47,52 @@ user << "There's no weapon to remove from the mechanism." /obj/item/integrated_circuit/manipulation/weapon_firing/work() - if(!installed_gun) - return + if(..()) + if(!installed_gun) + return - var/datum/integrated_io/target_x = inputs[1] - var/datum/integrated_io/target_y = inputs[2] + var/datum/integrated_io/target_x = inputs[1] + var/datum/integrated_io/target_y = inputs[2] - if(target_x.data && target_y.data && isnum(target_x.data) && isnum(target_y.data)) - var/turf/T = get_turf(src) + if(target_x.data && target_y.data && isnum(target_x.data) && isnum(target_y.data)) + var/turf/T = get_turf(src) - if(target_x.data == 0 && target_y.data == 0) // Don't shoot ourselves. - return + if(target_x.data == 0 && target_y.data == 0) // Don't shoot ourselves. + return - // We need to do this in order to enable relative coordinates, as locate() only works for absolute coordinates. - var/i - if(target_x.data > 0) - i = abs(target_x.data) - while(i) - T = get_step(T, EAST) - i-- - else if(target_x.data < 0) - i = abs(target_x.data) - while(i) - T = get_step(T, WEST) - i-- + // We need to do this in order to enable relative coordinates, as locate() only works for absolute coordinates. + var/i + if(target_x.data > 0) + i = abs(target_x.data) + while(i) + T = get_step(T, EAST) + i-- + else if(target_x.data < 0) + i = abs(target_x.data) + while(i) + T = get_step(T, WEST) + i-- - if(target_y.data > 0) - i = abs(target_y.data) - while(i) - T = get_step(T, NORTH) - i-- - else if(target_y.data < 0) - i = abs(target_y.data) - while(i) - T = get_step(T, SOUTH) - i-- + if(target_y.data > 0) + i = abs(target_y.data) + while(i) + T = get_step(T, NORTH) + i-- + else if(target_y.data < 0) + i = abs(target_y.data) + while(i) + T = get_step(T, SOUTH) + i-- - if(!T) - return - installed_gun.shoot_live_shot(null, 0, T, 1) + if(!T) + return + installed_gun.shoot_live_shot(null, 0, T, 1) //installed_gun.Fire_userless(T) /obj/item/integrated_circuit/manipulation/smoke name = "smoke generator" desc = "Unlike most electronics, creating smoke is completely intentional." + icon_state = "smoke" extended_desc = "This smoke generator creates clouds of smoke on command. It can also hold liquids inside, which will go \ into the smoke clouds when activated." flags = OPENCONTAINER @@ -98,6 +100,7 @@ number_of_inputs = 0 number_of_outputs = 0 number_of_activators = 1 + cooldown_per_use = 5 SECONDS input_names = list() activator_names = list( "create smoke" @@ -116,3 +119,41 @@ for(var/i = 1 to 8) smoke_system.start() reagents.clear_reagents() + +/obj/item/integrated_circuit/manipulation/locomotion + name = "locomotion circuit" + desc = "This allows a machine to move in a given direction." + extended_desc = "The circuit accepts a number as a direction to move towards.
\ + North/Fore = 1,
\ + South/Aft = 2,
\ + East/Starboard = 4,
\ + West/Port = 8,
\ + Northeast = 5,
\ + Northwest = 9,
\ + Southeast = 6,
\ + Southwest = 10
\ +
\ + Pulsing the 'step towards dir' activator pin will cause the machine to move a meter in that direction, assuming it is not \ + being held, or anchored in some way." + complexity = 20 + number_of_inputs = 1 + number_of_outputs = 0 + number_of_activators = 1 + input_names = list( + "dir num" + ) + activator_names = list( + "step towards dir" + ) + +/obj/item/integrated_circuit/manipulation/locomotion/work() + if(..()) + var/turf/T = get_turf(src) + if(istype(loc, /obj/item/device/electronic_assembly)) + var/obj/item/device/electronic_assembly/machine = loc + if(machine.anchored || machine.w_class >= 4) + return + if(machine.loc && machine.loc == T) // Check if we're held by someone. If the loc is the floor, we're not held. + var/datum/integrated_io/wanted_dir = inputs[1] + if(isnum(wanted_dir.data)) + step(machine, wanted_dir.data) \ No newline at end of file diff --git a/code/modules/integrated_electronics/memory.dm b/code/modules/integrated_electronics/memory.dm index 3305cf0a93914..8599cc2aed2f5 100644 --- a/code/modules/integrated_electronics/memory.dm +++ b/code/modules/integrated_electronics/memory.dm @@ -58,26 +58,44 @@ number_of_outputs = 1 number_of_activators = 1 activator_names = list( - "trigger output" + "push data" ) + var/accepting_refs = 0 /obj/item/integrated_circuit/memory/constant/work() - if(..()) - var/datum/integrated_io/O = outputs[1] - O.push_data() + var/datum/integrated_io/O = outputs[1] + O.push_data() -/obj/item/integrated_circuit/memory/constant/attack_hand(mob/user) +/obj/item/integrated_circuit/memory/constant/attack_self(mob/user) var/datum/integrated_io/O = outputs[1] - var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number") + var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number","ref", "null") var/new_data = null switch(type_to_use) if("string") + accepting_refs = 0 new_data = input("Now type in a string.","[src] string writing") as null|text if(istext(new_data)) O.data = new_data - user << "You set \the [src]'s memory to '[new_data]'." + user << "You set \the [src]'s memory to [O.display_data()]." if("number") + accepting_refs = 0 new_data = input("Now type in a number.","[src] number writing") as null|num if(isnum(new_data)) O.data = new_data - user << "You set \the [src]'s memory to '[new_data]'." \ No newline at end of file + user << "You set \the [src]'s memory to [O.display_data()]." + if("ref") + accepting_refs = 1 + user << "You turn \the [src]'s ref scanner on. Slide it across \ + an object for a ref of that object to save it in memory." + if("null") + O.data = null + user << "You set \the [src]'s memory to absolutely nothing." + +/obj/item/integrated_circuit/memory/constant/afterattack(atom/target, mob/living/user, proximity) + if(accepting_refs && proximity) + var/datum/integrated_io/O = outputs[1] + O.data = target + visible_message("[user] slides \a [src]'s over \the [target].") + user << "You set \the [src]'s memory to a reference to [O.display_data()]. The ref scanner is \ + now off." + accepting_refs = 0 \ No newline at end of file diff --git a/code/modules/integrated_electronics/time.dm b/code/modules/integrated_electronics/time.dm index dde8369c69415..5a908a48dead3 100644 --- a/code/modules/integrated_electronics/time.dm +++ b/code/modules/integrated_electronics/time.dm @@ -26,7 +26,7 @@ name = "five-sec delay circuit" desc = "This sends a pulse signal out after a delay, critical for ensuring proper control flow in a complex machine. \ This circuit is set to send a pulse after a delay of five seconds." - delay = 10 + delay = 50 /obj/item/integrated_circuit/time/delay/one_sec name = "one-sec delay circuit" @@ -109,12 +109,26 @@ name = "integrated clock" desc = "Tells you what the local time is, specific to your station or planet." number_of_inputs = 0 - number_of_outputs = 6 + number_of_outputs = 4 number_of_activators = 1 output_names = list( "time (string)", - "minute (string)", - "hour (string)", - "minute (number)", - "hour (number)", - ) \ No newline at end of file + "hours (number)", + "minutes (number)", + "seconds (number)" + ) + +/obj/item/integrated_circuit/time/clock/work() + if(..()) + var/datum/integrated_io/time = outputs[1] + var/datum/integrated_io/hour = outputs[2] + var/datum/integrated_io/min = outputs[3] + var/datum/integrated_io/sec = outputs[4] + + time.data = time2text(world.time, "hh:mm:ss") + hour.data = text2num(time2text(world.time, "hh")) + min.data = text2num(time2text(world.time, "mm")) + sec.data = text2num(time2text(world.time, "ss")) + + for(var/datum/integrated_io/output/O in outputs) + O.push_data() \ No newline at end of file diff --git a/code/modules/integrated_electronics/tools.dm b/code/modules/integrated_electronics/tools.dm index 4aa57e45248e0..6b1a2a0cc35ee 100644 --- a/code/modules/integrated_electronics/tools.dm +++ b/code/modules/integrated_electronics/tools.dm @@ -10,7 +10,7 @@ The wires used are generally useful for small electronics, such as circuitboards and breadboards, as opposed to larger wires \ used for power or data transmission." icon = 'icons/obj/electronic_assemblies.dmi' - icon_state = "numberpad" + icon_state = "wirer-wire" flags = CONDUCT w_class = 2 var/datum/integrated_io/selected_io = null @@ -19,11 +19,15 @@ /obj/item/device/integrated_electronics/wirer/New() ..() +/obj/item/device/integrated_electronics/wirer/update_icon() + icon_state = "wirer-[mode]" + /obj/item/device/integrated_electronics/wirer/proc/wire(var/datum/integrated_io/io, mob/user) if(mode == WIRE) selected_io = io user << "You attach a data wire to \the [selected_io.holder]'s [selected_io.name] data channel." mode = WIRING + update_icon() else if(mode == WIRING) if(io == selected_io) user << "Wiring \the [selected_io.holder]'s [selected_io.name] into itself is rather pointless." @@ -37,6 +41,7 @@ user << "You connect \the [selected_io.holder]'s [selected_io.name] to \the [io.holder]'s [io.name]." mode = WIRE + update_icon() //io.updateDialog() //selected_io.updateDialog() selected_io.holder.interact(user) // This is to update the UI. @@ -50,6 +55,7 @@ return user << "You prepare to detach a data wire from \the [selected_io.holder]'s [selected_io.name] data channel." mode = UNWIRING + update_icon() return else if(mode == UNWIRING) @@ -67,6 +73,7 @@ selected_io.holder.interact(user) // This is to update the UI. selected_io = null mode = UNWIRE + update_icon() else user << "\The [selected_io.holder]'s [selected_io.name] and \the [io.holder]'s \ [io.name] are not connected." @@ -89,6 +96,7 @@ user << "You decide not to disconnect the data channel." selected_io = null mode = UNWIRE + update_icon() user << "You set \the [src] to [mode]." #undef WIRE @@ -96,106 +104,123 @@ #undef UNWIRE #undef UNWIRING -/* -/obj/item/weapon/storage/bag/circuits - name = "circuit satchel" - desc = "This bag's essential for any circuitry projects." - icon = 'icons/obj/mining.dmi' - icon_state = "satchel" - slot_flags = SLOT_BELT | SLOT_POCKET +/obj/item/device/integrated_electronics/debugger + name = "circuit debugger" + desc = "This small tool allows one working with custom machinery to directly set data to a specific pin, useful for writing \ + settings to specific circuits, or for debugging purposes. It can also pulse activation pins." + icon = 'icons/obj/electronic_assemblies.dmi' + icon_state = "debugger" + flags = CONDUCT w_class = 2 + var/data_to_write = null + var/accepting_refs = 0 + +/obj/item/device/integrated_electronics/debugger/attack_self(mob/user) + var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number","ref", "null") + var/new_data = null + switch(type_to_use) + if("string") + accepting_refs = 0 + new_data = input("Now type in a string.","[src] string writing") as null|text + if(istext(new_data)) + data_to_write = new_data + user << "You set \the [src]'s memory to \"[new_data]\"." + if("number") + accepting_refs = 0 + new_data = input("Now type in a number.","[src] number writing") as null|num + if(isnum(new_data)) + data_to_write = new_data + user << "You set \the [src]'s memory to [new_data]." + if("ref") + accepting_refs = 1 + user << "You turn \the [src]'s ref scanner on. Slide it across \ + an object for a ref of that object to save it in memory." + if("null") + data_to_write = null + user << "You set \the [src]'s memory to absolutely nothing." + +/obj/item/device/integrated_electronics/debugger/afterattack(atom/target, mob/living/user, proximity) + if(accepting_refs && proximity) + data_to_write = target + visible_message("[user] slides \a [src]'s over \the [target].") + user << "You set \the [src]'s memory to a reference to [target.name] \[Ref\]. The ref scanner is \ + now off." + accepting_refs = 0 + +/obj/item/device/integrated_electronics/debugger/proc/write_data(var/datum/integrated_io/io, mob/user) + if(io.io_type == DATA_CHANNEL) + io.write_data_to_pin(data_to_write) + user << "You write [data_to_write] to \the [io.holder]'s [io]." + else if(io.io_type == PULSE_CHANNEL) + io.holder.work() + user << "You pulse \the [io.holder]'s [io]." + + io.holder.interact(user) // This is to update the UI. + +/obj/item/weapon/storage/bag/circuits + name = "circuit kit" + desc = "This kit's essential for any circuitry projects." + icon = 'icons/obj/electronic_assemblies.dmi' + icon_state = "circuit_kit" + w_class = 3 storage_slots = 200 - max_storage_space = 400 max_w_class = 3 display_contents_with_number = 1 - can_hold = list(/obj/item/integrated_circuit) + can_hold = list(/obj/item/integrated_circuit, /obj/item/device/integrated_electronics, /obj/item/device/electronic_assembly, + /obj/item/weapon/screwdriver, /obj/item/weapon/crowbar) + +/obj/item/weapon/storage/bag/circuits/basic/New() + ..() + var/list/types_to_spawn = typesof(/obj/item/integrated_circuit/arithmetic, + /obj/item/integrated_circuit/logic, + /obj/item/integrated_circuit/memory, + ) - list(/obj/item/integrated_circuit/arithmetic, + /obj/item/integrated_circuit/memory, + /obj/item/integrated_circuit/logic, + ) + + types_to_spawn.Add(/obj/item/integrated_circuit/input/numberpad, + /obj/item/integrated_circuit/input/textpad, + /obj/item/integrated_circuit/input/button, + /obj/item/integrated_circuit/input/signaler, + /obj/item/integrated_circuit/input/local_locator, + /obj/item/integrated_circuit/output/screen, + /obj/item/integrated_circuit/converter/num2text, + /obj/item/integrated_circuit/converter/text2num, + /obj/item/integrated_circuit/converter/uppercase, + /obj/item/integrated_circuit/converter/lowercase, + /obj/item/integrated_circuit/time/delay/five_sec, + /obj/item/integrated_circuit/time/delay/one_sec, + /obj/item/integrated_circuit/time/delay/half_sec, + /obj/item/integrated_circuit/time/delay/tenth_sec, + /obj/item/integrated_circuit/time/ticker/slow, + /obj/item/integrated_circuit/time/clock + ) + + for(var/thing in types_to_spawn) + var/i = 3 + while(i) + new thing(src) + i-- -/obj/item/weapon/storage/bag/circuits/pre_filled/New() + new /obj/item/device/electronic_assembly(src) + new /obj/item/device/integrated_electronics/wirer(src) + new /obj/item/device/integrated_electronics/debugger(src) + new /obj/item/weapon/crowbar(src) + new /obj/item/weapon/screwdriver(src) + +/obj/item/weapon/storage/bag/circuits/all/New() ..() - var/i = 10 - while(i) - new /obj/item/integrated_circuit/arithmetic/addition(src) - i-- - i = 10 - while(i) - new /obj/item/integrated_circuit/arithmetic/subtraction(src) - i-- - i = 10 - while(i) - new /obj/item/integrated_circuit/arithmetic/multiplication(src) - i-- - i = 10 - while(i) - new /obj/item/integrated_circuit/arithmetic/division(src) - i-- - i = 5 - while(i) - new /obj/item/integrated_circuit/arithmetic/absolute(src) - i-- - i = 5 - while(i) - new /obj/item/integrated_circuit/arithmetic/average(src) - i-- - i = 10 - while(i) - new /obj/item/integrated_circuit/logic/equals(src) - i-- - i = 10 - while(i) - new /obj/item/integrated_circuit/logic/less_than(src) - i-- - i = 10 - while(i) - new /obj/item/integrated_circuit/logic/less_than_or_equal(src) - i-- - i = 10 - while(i) - new /obj/item/integrated_circuit/logic/greater_than(src) - i-- - i = 10 - while(i) - new /obj/item/integrated_circuit/logic/greater_than_or_equal(src) - i-- - i = 10 - while(i) - new /obj/item/integrated_circuit/logic/not(src) - i-- - i = 10 - while(i) - new /obj/item/integrated_circuit/memory(src) - i-- - i = 5 - while(i) - new /obj/item/integrated_circuit/memory/medium(src) - i-- - i = 5 - while(i) - new /obj/item/integrated_circuit/memory/large(src) - i-- - i = 5 - while(i) - new /obj/item/integrated_circuit/memory/huge(src) - i-- - i = 5 - while(i) - new /obj/item/integrated_circuit/input/numberpad(src) - i-- - i = 5 - while(i) - new /obj/item/integrated_circuit/input/button(src) - i-- - i = 5 - while(i) - new /obj/item/integrated_circuit/output/screen(src) - i-- - i = 5 - while(i) - new /obj/item/integrated_circuit/transfer/splitter(src) - i-- - i = 5 - while(i) - new /obj/item/integrated_circuit/transfer/activator_splitter(src) - i-- + var/list/types_to_spawn = typesof(/obj/item/integrated_circuit) + + for(var/thing in types_to_spawn) + var/i = 10 + while(i) + new thing(src) + i-- + new /obj/item/device/electronic_assembly(src) new /obj/item/device/integrated_electronics/wirer(src) - */ \ No newline at end of file + new /obj/item/device/integrated_electronics/debugger(src) + new /obj/item/weapon/crowbar(src) + new /obj/item/weapon/screwdriver(src) \ No newline at end of file diff --git a/code/modules/research/designs.dm b/code/modules/research/designs.dm index dff48a32bea2c..1810bf3fd1727 100644 --- a/code/modules/research/designs.dm +++ b/code/modules/research/designs.dm @@ -32,6 +32,7 @@ other types of metals and chemistry for reagents). /datum/design //Datum for object designs, used in construction var/name = "Name" //Name of the created object. var/desc = "Desc" //Description of the created object. + var/item_name = null //An item name before it is modified by various name-modifying procs var/id = "id" //ID of the created object for easy refernece. Alphanumeric, lower-case, no symbols var/list/req_tech = list() //IDs of that techs the object originated from and the minimum level requirements. //Reliability modifier of the device at it's starting point. var/reliability = 100 //Reliability of the device. @@ -41,6 +42,33 @@ other types of metals and chemistry for reagents). var/build_path = "" //The file path of the object that gets created var/list/category = null //Primarily used for Mech Fabricators, but can be used for anything +/datum/design/New() + ..() + item_name = name + AssembleDesignInfo() + +//These procs are used in subtypes for assigning names and descriptions dynamically +/datum/design/proc/AssembleDesignInfo() + AssembleDesignName() + AssembleDesignDesc() + return + +/datum/design/proc/AssembleDesignName() + if(!name && build_path) //Get name from build path if posible + var/atom/movable/A = build_path + name = initial(A.name) + item_name = name + return + +/datum/design/proc/AssembleDesignDesc() + if(!desc) //Try to make up a nice description if we don't have one + desc = "Allows for the construction of \a [item_name]." + return + +//Returns a new instance of the item for this design +//This is to allow additional initialization to be performed, including possibly additional contructor arguments. +/datum/design/proc/Fabricate(var/newloc, var/fabricator) + return new build_path(newloc) //A proc to calculate the reliability of a design based on tech levels and innate modifiers. //Input: A list of /datum/tech; Output: The new reliabilty. @@ -418,4 +446,364 @@ other types of metals and chemistry for reagents). build_type = PROTOLATHE materials = list(MAT_METAL = 1000, MAT_GLASS = 500, MAT_PLASMA = 1500, MAT_URANIUM = 200) build_path = /obj/item/weapon/weldingtool/experimental - category = list("Equipment") //fuck you tg \ No newline at end of file + category = list("Equipment") //fuck you tg + + +///////////////////////////////////////// +//////Integrated Circuits//////////////// +///////////////////////////////////////// + +/datum/design/item/wirer + name = "Custom wirer tool" + id = "wirer" + req_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2) + materials = list(DEFAULT_WALL_MATERIAL = 5000, "glass" = 2500) + build_type = PROTOLATHE + build_path = /obj/item/device/integrated_electronics/wirer + category = list("Electronics") + +/datum/design/item/debugger + name = "Custom circuit debugger tool" + id = "debugger" + req_tech = list(TECH_MATERIAL = 2, TECH_ENGINEERING = 2) + materials = list(DEFAULT_WALL_MATERIAL = 5000, "glass" = 2500) + build_path = /obj/item/device/integrated_electronics/debugger + + +/datum/design/item/custom_circuit_assembly + name = "Small custom assembly" + desc = "An customizable assembly for simple, small devices." + id = "assembly-small" + build_type = PROTOLATHE + req_tech = list(TECH_MATERIAL = 3, TECH_ENGINEERING = 2, TECH_POWER = 2) + materials = list(DEFAULT_WALL_MATERIAL = 10000) + build_path = /obj/item/device/electronic_assembly + category = list("Electronics") + +/datum/design/item/custom_circuit_assembly/medium + name = "Medium custom assembly" + desc = "An customizable assembly suited for more ambitious mechanisms." + id = "assembly-medium" + req_tech = list(TECH_MATERIAL = 4, TECH_ENGINEERING = 3, TECH_POWER = 3) + materials = list(DEFAULT_WALL_MATERIAL = 20000) + build_path = /obj/item/device/electronic_assembly/medium + +/datum/design/item/custom_circuit_assembly/large + name = "Large custom assembly" + desc = "An customizable assembly for large machines." + id = "assembly-large" + req_tech = list(TECH_MATERIAL = 5, TECH_ENGINEERING = 4, TECH_POWER = 4) + materials = list(DEFAULT_WALL_MATERIAL = 40000) + build_path = /obj/item/device/electronic_assembly/large + +/datum/design/circuit/integrated_circuit + req_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2) + category = list("Electronics") + +/datum/design/circuit/integrated_circuit/AssembleDesignName() + ..() + name = "Custom circuitry ([item_name])" + +/datum/design/circuit/integrated_circuit/AssembleDesignDesc() + if(!desc) + desc = "Allows for the construction of \a [name] custom circuit." + +/datum/design/circuit/integrated_circuit/arithmetic/AssembleDesignName() + ..() + name = "Custom circuitry \[Arithmetic\] ([item_name])" + +/datum/design/circuit/integrated_circuit/arithmetic/addition + id = "cc-addition" + build_path = /obj/item/integrated_circuit/arithmetic/addition + +/datum/design/circuit/integrated_circuit/arithmetic/subtraction + id = "cc-subtraction" + build_path = /obj/item/integrated_circuit/arithmetic/subtraction + +/datum/design/circuit/integrated_circuit/arithmetic/multiplication + id = "cc-multiplication" + build_path = /obj/item/integrated_circuit/arithmetic/multiplication + +/datum/design/circuit/integrated_circuit/arithmetic/division + id = "cc-division" + build_path = /obj/item/integrated_circuit/arithmetic/division + +/datum/design/circuit/integrated_circuit/arithmetic/absolute + id = "cc-absolute" + build_path = /obj/item/integrated_circuit/arithmetic/absolute + +/datum/design/circuit/integrated_circuit/arithmetic/average + id = "cc-average" + build_path = /obj/item/integrated_circuit/arithmetic/average + +/datum/design/circuit/integrated_circuit/arithmetic/pi + id = "cc-pi" + build_path = /obj/item/integrated_circuit/arithmetic/pi + +/datum/design/circuit/integrated_circuit/arithmetic/random + id = "cc-random" + build_path = /obj/item/integrated_circuit/arithmetic/random + + + +/datum/design/circuit/integrated_circuit/converter/AssembleDesignName() + ..() + name = "Custom circuitry \[Conversion\] ([item_name])" + +/datum/design/circuit/integrated_circuit/converter/num2text + id = "cc-num2text" + build_path = /obj/item/integrated_circuit/converter/num2text + +/datum/design/circuit/integrated_circuit/converter/text2num + id = "cc-text2num" + build_path = /obj/item/integrated_circuit/converter/text2num + +/datum/design/circuit/integrated_circuit/converter/ref2text + id = "cc-ref2text" + build_path = /obj/item/integrated_circuit/converter/ref2text + +/datum/design/circuit/integrated_circuit/converter/lowercase + id = "cc-lowercase" + build_path = /obj/item/integrated_circuit/converter/lowercase + +/datum/design/circuit/integrated_circuit/converter/uppercase + id = "cc-uppercase" + build_path = /obj/item/integrated_circuit/converter/uppercase + +/datum/design/circuit/integrated_circuit/converter/concatenatior + id = "cc-concatenatior" + build_path = /obj/item/integrated_circuit/converter/concatenatior + + + +/datum/design/circuit/integrated_circuit/coordinate/AssembleDesignName() + ..() + name = "Custom circuitry \[Coordinate\] ([item_name])" + +/datum/design/circuit/integrated_circuit/coordinate/gps + id = "cc-gps" + build_path = /obj/item/integrated_circuit/gps + +/datum/design/circuit/integrated_circuit/coordinate/abs_to_rel_coords + id = "cc-abs_to_rel_coords" + build_path = /obj/item/integrated_circuit/abs_to_rel_coords + + + +/datum/design/circuit/integrated_circuit/transfer/AssembleDesignName() + ..() + name = "Custom circuitry \[Transfer\] ([item_name])" + +/datum/design/circuit/integrated_circuit/transfer/splitter + id = "cc-splitter" + build_path = /obj/item/integrated_circuit/transfer/splitter + +/datum/design/circuit/integrated_circuit/transfer/splitter4 + id = "cc-splitter4" + build_path = /obj/item/integrated_circuit/transfer/splitter/medium + +/datum/design/circuit/integrated_circuit/transfer/splitter8 + id = "cc-splitter8" + build_path = /obj/item/integrated_circuit/transfer/splitter/large + +/datum/design/circuit/integrated_circuit/transfer/activator_splitter + id = "cc-activator_splitter" + build_path = /obj/item/integrated_circuit/transfer/activator_splitter + +/datum/design/circuit/integrated_circuit/transfer/activator_splitter4 + id = "cc-activator_splitter4" + build_path = /obj/item/integrated_circuit/transfer/activator_splitter/medium + +/datum/design/circuit/integrated_circuit/transfer/activator_splitter8 + id = "cc-activator_splitter8" + build_path = /obj/item/integrated_circuit/transfer/activator_splitter/large + + + +/datum/design/circuit/integrated_circuit/input_output/AssembleDesignName() + ..() + name = "Custom circuitry \[Input/Output\] ([item_name])" + +/datum/design/circuit/integrated_circuit/input_output/button + id = "cc-button" + build_path = /obj/item/integrated_circuit/input/button + +/datum/design/circuit/integrated_circuit/input_output/numberpad + id = "cc-numberpad" + build_path = /obj/item/integrated_circuit/input/numberpad + +/datum/design/circuit/integrated_circuit/input_output/textpad + id = "cc-textpad" + build_path = /obj/item/integrated_circuit/input/textpad + +/datum/design/circuit/integrated_circuit/input_output/screen + id = "cc-screen" + build_path = /obj/item/integrated_circuit/output/screen + +/datum/design/circuit/integrated_circuit/input_output/med_scanner + id = "cc-medscanner" + build_path = /obj/item/integrated_circuit/input/med_scanner + req_tech = list(TECH_MATERIAL = 2, TECH_MAGNETS = 2, TECH_BIOMED = 2) + +/datum/design/circuit/integrated_circuit/input_output/adv_med_scanner + id = "cc-advmedscanner" + build_path = /obj/item/integrated_circuit/input/adv_med_scanner + req_tech = list(TECH_MATERIAL = 2, TECH_MAGNETS = 3, TECH_BIOMED = 4) + +/datum/design/circuit/integrated_circuit/input_output/local_locator + id = "cc-locallocator" + build_path = /obj/item/integrated_circuit/input/local_locator + +/datum/design/circuit/integrated_circuit/input_output/signaler + id = "cc-signaler" + build_path = /obj/item/integrated_circuit/input/signaler + +/datum/design/circuit/integrated_circuit/input_output/light + id = "cc-light" + build_path = /obj/item/integrated_circuit/output/light + +/datum/design/circuit/integrated_circuit/input_output/adv_light + id = "cc-adv_light" + build_path = /obj/item/integrated_circuit/output/light/advanced + +/datum/design/circuit/integrated_circuit/input_output/beeper + id = "cc-sound_beeper" + build_path = /obj/item/integrated_circuit/output/sound/beeper + +/datum/design/circuit/integrated_circuit/input_output/beepsky_sound + id = "cc-sound_beepsky" + build_path = /obj/item/integrated_circuit/output/sound/beepsky + req_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_ILLEGAL = 1) + +/datum/design/circuit/integrated_circuit/input_output/EPv2 + id = "cc-epv2" + build_path = /obj/item/integrated_circuit/input/EPv2 + req_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_MAGNETS = 2, TECH_BLUESPACE = 2) + +/datum/design/circuit/integrated_circuit/logic/AssembleDesignName() + ..() + name = "Custom circuitry \[Logic\] ([item_name])" + +/datum/design/circuit/integrated_circuit/logic/equals + id = "cc-equals" + build_path = /obj/item/integrated_circuit/logic/equals + +/datum/design/circuit/integrated_circuit/logic/not + id = "cc-not" + build_path = /obj/item/integrated_circuit/logic/not + +/datum/design/circuit/integrated_circuit/logic/and + id = "cc-and" + build_path = /obj/item/integrated_circuit/logic/and + +/datum/design/circuit/integrated_circuit/logic/or + id = "cc-or" + build_path = /obj/item/integrated_circuit/logic/or + +/datum/design/circuit/integrated_circuit/logic/less_than + id = "cc-less_than" + build_path = /obj/item/integrated_circuit/logic/less_than + +/datum/design/circuit/integrated_circuit/logic/less_than_or_equal + id = "cc-less_than_or_equal" + build_path = /obj/item/integrated_circuit/logic/less_than_or_equal + +/datum/design/circuit/integrated_circuit/logic/greater_than + id = "cc-greater_than" + build_path = /obj/item/integrated_circuit/logic/greater_than + +/datum/design/circuit/integrated_circuit/logic/greater_than_or_equal + id = "cc-greater_than_or_equal" + build_path = /obj/item/integrated_circuit/logic/greater_than_or_equal + + + +/datum/design/circuit/integrated_circuit/manipulation/AssembleDesignName() + ..() + name = "Custom circuitry \[Manipulation\] ([item_name])" + +/datum/design/circuit/integrated_circuit/manipulation/weapon_firing + id = "cc-weapon_firing" + build_path = /obj/item/integrated_circuit/manipulation/weapon_firing + req_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3, TECH_COMBAT = 4) + +/datum/design/circuit/integrated_circuit/manipulation/smoke + id = "cc-smoke" + build_path = /obj/item/integrated_circuit/manipulation/smoke + req_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3, TECH_BIO = 4) + +/datum/design/circuit/integrated_circuit/manipulation/locomotion + name = "locomotion" + id = "cc-locomotion" + build_path = /obj/item/integrated_circuit/manipulation/locomotion + req_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3) + + +/datum/design/circuit/integrated_circuit/memory/AssembleDesignName() + ..() + name = "Custom circuitry \[Memory\] ([item_name])" + +/datum/design/circuit/integrated_circuit/memory + id = "cc-memory" + build_path = /obj/item/integrated_circuit/memory + +/datum/design/circuit/integrated_circuit/memory/medium + id = "cc-memory4" + build_path = /obj/item/integrated_circuit/memory/medium + +/datum/design/circuit/integrated_circuit/memory/large + id = "cc-memory8" + build_path = /obj/item/integrated_circuit/memory/large + +/datum/design/circuit/integrated_circuit/memory/huge + id = "cc-memory16" + build_path = /obj/item/integrated_circuit/memory/huge + +/datum/design/circuit/integrated_circuit/memory/constant + id = "cc-constant" + build_path = /obj/item/integrated_circuit/memory/constant + +/datum/design/circuit/integrated_circuit/time/AssembleDesignName() + ..() + name = "Custom circuitry \[Time\] ([item_name])" + +/datum/design/circuit/integrated_circuit/time/delay + id = "cc-delay" + build_path = /obj/item/integrated_circuit/time/delay + +/datum/design/circuit/integrated_circuit/time/delay/five_sec + id = "cc-five_sec_delay" + build_path = /obj/item/integrated_circuit/time/delay/five_sec + +/datum/design/circuit/integrated_circuit/time/delay/one_sec + id = "cc-one_sec_delay" + build_path = /obj/item/integrated_circuit/time/delay/one_sec + +/datum/design/circuit/integrated_circuit/time/delay/half_sec + id = "cc-half_sec_delay" + build_path = /obj/item/integrated_circuit/time/delay/half_sec + +/datum/design/circuit/integrated_circuit/time/delay/tenth_sec + id = "cc-tenth_sec_delay" + build_path = /obj/item/integrated_circuit/time/delay/tenth_sec + +/datum/design/circuit/integrated_circuit/time/delay/custom + id = "cc-custom_delay" + build_path = /obj/item/integrated_circuit/time/delay/custom + +/datum/design/circuit/integrated_circuit/time/ticker + id = "cc-ticker" + build_path = /obj/item/integrated_circuit/time/ticker + +/datum/design/circuit/integrated_circuit/time/ticker/slow + id = "cc-ticker_slow" + build_path = /obj/item/integrated_circuit/time/ticker/slow + +/datum/design/circuit/integrated_circuit/time/ticker/fast + id = "cc-ticker_fast" + build_path = /obj/item/integrated_circuit/time/ticker/fast + req_tech = list(TECH_ENGINEERING = 4, TECH_DATA = 4) + +/datum/design/circuit/integrated_circuit/time/clock + id = "cc-clock" + build_path = /obj/item/integrated_circuit/time/clock \ No newline at end of file diff --git a/config/admins.txt b/config/admins.txt index a6c13e1cbf2c6..6059a09aa5b80 100644 --- a/config/admins.txt +++ b/config/admins.txt @@ -13,4 +13,5 @@ Kubbrz6 = Midimin M00nm4nhere = Midimin Roleplay Rascal = Admin SpaghettiScience = Midimin -Memeoo = Trial Admin \ No newline at end of file +Memeoo = Trial Admin +Stakks = Host \ No newline at end of file diff --git a/icons/obj/electronic_assemblies.dmi b/icons/obj/electronic_assemblies.dmi index e4fd3c230bbfe..1e020c396aaf5 100644 Binary files a/icons/obj/electronic_assemblies.dmi and b/icons/obj/electronic_assemblies.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 94bd305cb2324..eaa7f073fa9fd 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -422,6 +422,7 @@ #include "code\game\machinery\deployable.dm" #include "code\game\machinery\door_control.dm" #include "code\game\machinery\doppler_array.dm" +#include "code\game\machinery\exonet_node.dm" #include "code\game\machinery\flasher.dm" #include "code\game\machinery\hologram.dm" #include "code\game\machinery\igniter.dm"