diff --git a/code/modules/research/designs/wiremod_designs.dm b/code/modules/research/designs/wiremod_designs.dm index 08fc5bfba68..35aa401eda1 100644 --- a/code/modules/research/designs/wiremod_designs.dm +++ b/code/modules/research/designs/wiremod_designs.dm @@ -462,3 +462,12 @@ build_path = /obj/item/circuitboard/machine/bci_implanter build_type = IMPRINTER | COMPONENT_PRINTER category = list("Circuitry", "Core") + +/datum/design/assembly_shell + name = "Assembly Shell" + desc = "An assembly shell that can be attached to wires and other assemblies." + id = "assembly_shell" + materials = list(/datum/material/glass = 2000, /datum/material/iron = 5000) + build_path = /obj/item/assembly/wiremod + build_type = PROTOLATHE | COMPONENT_PRINTER + category = list("Circuitry", "Shells") diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index c27b40cfea1..0b9f2a92989 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -678,6 +678,7 @@ description = "Grants access to more complicated shell designs." prereq_ids = list("basic_circuitry", "engineering") design_ids = list( + "assembly_shell", "bot_shell", "controller_shell", "dispenser_shell", diff --git a/code/modules/wiremod/shell/assembly.dm b/code/modules/wiremod/shell/assembly.dm new file mode 100644 index 00000000000..5418b74905d --- /dev/null +++ b/code/modules/wiremod/shell/assembly.dm @@ -0,0 +1,66 @@ +/** + * # Assembly Shell + * + * An assembly that triggers and can be triggered by wires. + */ +/obj/item/assembly/wiremod + name = "circuit assembly" + desc = "A small electronic device that can house an integrated circuit." + icon_state = "wiremod" + +/obj/item/assembly/wiremod/Initialize(mapload) + . = ..() + AddComponent(/datum/component/shell, list( + new /obj/item/circuit_component/assembly_input(), + new /obj/item/circuit_component/assembly_output(), + ), SHELL_CAPACITY_SMALL) + +/obj/item/assembly/wiremod/examine(mob/user) + . = ..() + . += span_notice("You can also [secured && "un"]secure [src] by right-clicking it with a screwdriver, even if an integrated circuit is attached.") + +// This is to bypass removing the circuit with a screwdriver left-click +/obj/item/assembly/wiremod/screwdriver_act_secondary(mob/living/user, obj/item/tool) + screwdriver_act(user, tool) + +/obj/item/circuit_component/assembly_input + display_name = "Assembly Input" + desc = "Triggers when pulsed by an attached wire or assembly." + + var/datum/port/output/signal + +/obj/item/circuit_component/assembly_input/populate_ports() + signal = add_output_port("Signal", PORT_TYPE_SIGNAL) + +/obj/item/circuit_component/assembly_input/register_shell(atom/movable/shell) + RegisterSignal(shell, list(COMSIG_ASSEMBLY_PULSED, COMSIG_ITEM_ATTACK_SELF), .proc/on_pulsed) + +/obj/item/circuit_component/assembly_input/unregister_shell(atom/movable/shell) + UnregisterSignal(shell, list(COMSIG_ASSEMBLY_PULSED, COMSIG_ITEM_ATTACK_SELF)) + +/obj/item/circuit_component/assembly_input/proc/on_pulsed() + SIGNAL_HANDLER + signal.set_output(COMPONENT_SIGNAL) + +/obj/item/circuit_component/assembly_output + display_name = "Assembly Output" + desc = "Pulses an attached wire or assembly when triggered." + + var/obj/item/assembly/attached_assembly + + var/datum/port/input/signal + +/obj/item/circuit_component/assembly_output/populate_ports() + signal = add_input_port("Signal", PORT_TYPE_SIGNAL) + +/obj/item/circuit_component/assembly_output/register_shell(atom/movable/shell) + . = ..() + if(istype(shell, /obj/item/assembly)) + attached_assembly = shell + +/obj/item/circuit_component/assembly_output/unregister_shell(atom/movable/shell) + attached_assembly = null + return ..() + +/obj/item/circuit_component/assembly_output/input_received(datum/port/input/port, list/return_values) + attached_assembly.pulse(FALSE) diff --git a/icons/obj/assemblies/new_assemblies.dmi b/icons/obj/assemblies/new_assemblies.dmi index 469d4d16d57..689fa3f201f 100644 Binary files a/icons/obj/assemblies/new_assemblies.dmi and b/icons/obj/assemblies/new_assemblies.dmi differ diff --git a/tgstation.dme b/tgstation.dme index fd9091ad39b..16b89d3885b 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3963,6 +3963,7 @@ #include "code\modules\wiremod\preset\hello_world.dm" #include "code\modules\wiremod\preset\speech_relay.dm" #include "code\modules\wiremod\shell\airlock.dm" +#include "code\modules\wiremod\shell\assembly.dm" #include "code\modules\wiremod\shell\bot.dm" #include "code\modules\wiremod\shell\brain_computer_interface.dm" #include "code\modules\wiremod\shell\compact_remote.dm"