diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 0db275ec1e1..10a587a4d53 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -1354,6 +1354,15 @@ /// Called in /obj/structure/moneybot/add_money(). (to_add) #define COMSIG_MONEYBOT_ADD_MONEY "moneybot_add_money" +/// Called when somebody passes through a scanner gate and it triggers +#define COMSIG_SCANGATE_PASS_TRIGGER "scangate_pass_trigger" + +/// Called when somebody passes through a scanner gate and it does not trigger +#define COMSIG_SCANGATE_PASS_NO_TRIGGER "scangate_pass_no_trigger" + +/// Called when something passes through a scanner gate shell +#define COMSIG_SCANGATE_SHELL_PASS "scangate_shell_pass" + // Merger datum signals /// Called on the object being added to a merger group: (datum/merger/new_merger) #define COMSIG_MERGER_ADDING "comsig_merger_adding" diff --git a/code/game/machinery/scan_gate.dm b/code/game/machinery/scan_gate.dm index c052f69fe77..d5d0fb01b96 100644 --- a/code/game/machinery/scan_gate.dm +++ b/code/game/machinery/scan_gate.dm @@ -101,7 +101,7 @@ else to_chat(user, span_warning("You try to lock [src] with [W], but nothing happens.")) else - if(!locked && default_deconstruction_screwdriver(user, "scangate_open", "scangate", W)) + if(!locked && default_deconstruction_screwdriver(user, "[initial(icon_state)]_open", initial(icon_state), W)) return if(panel_open && is_wire_tool(W)) wires.interact(user) @@ -181,11 +181,13 @@ beep = !beep if(beep) alarm_beep() + SEND_SIGNAL(src, COMSIG_SCANGATE_PASS_TRIGGER, M) if(!ignore_signals) color = wires.get_color_of_wire(WIRE_ACCEPT) var/obj/item/assembly/assembly = wires.get_attached(color) assembly?.activate() else + SEND_SIGNAL(src, COMSIG_SCANGATE_PASS_NO_TRIGGER, M) if(!ignore_signals) color = wires.get_color_of_wire(WIRE_DENY) var/obj/item/assembly/assembly = wires.get_attached(color) diff --git a/code/modules/research/designs/wiremod_designs.dm b/code/modules/research/designs/wiremod_designs.dm index cd44e891f7e..15b87d807f7 100644 --- a/code/modules/research/designs/wiremod_designs.dm +++ b/code/modules/research/designs/wiremod_designs.dm @@ -376,6 +376,18 @@ build_type = PROTOLATHE | COMPONENT_PRINTER category = list("Circuitry", "Shells") +/datum/design/scanner_gate_shell + name = "Scanner Gate Shell" + desc = "A scanner gate shell that performs mid-depth scans on people when they pass through it." + id = "scanner_gate_shell" + materials = list( + /datum/material/glass = 4000, + /datum/material/iron = 12000, + ) + build_path = /obj/item/shell/scanner_gate + build_type = PROTOLATHE | COMPONENT_PRINTER + category = list("Circuitry", "Shells") + /datum/design/board/bci_implanter name = "Brain-Computer Interface Manipulation Chamber" desc = "A machine that, when given a brain-computer interface, will implant it into an occupant. Otherwise, will remove any brain-computer interfaces they already have." diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index bc78d52e744..63c18592d5b 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -664,6 +664,7 @@ "door_shell", "controller_shell", "money_bot_shell", + "scanner_gate_shell", "scanner_shell", ) research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) diff --git a/code/modules/wiremod/shell/scanner_gate.dm b/code/modules/wiremod/shell/scanner_gate.dm new file mode 100644 index 00000000000..312c690bd82 --- /dev/null +++ b/code/modules/wiremod/shell/scanner_gate.dm @@ -0,0 +1,66 @@ +/obj/structure/scanner_gate_shell + name = "circuit scanner gate" + desc = "A gate able to perform mid-depth scans on any organisms who pass under it." + icon = 'icons/obj/machines/scangate.dmi' + icon_state = "scangate_black" + var/scanline_timer + +/obj/structure/scanner_gate_shell/Initialize() + . = ..() + set_scanline("passive") + var/static/list/loc_connections = list( + COMSIG_ATOM_ENTERED = .proc/on_entered, + ) + AddElement(/datum/element/connect_loc, loc_connections) + + AddComponent(/datum/component/shell, list( + new /obj/item/circuit_component/scanner_gate() + ), SHELL_CAPACITY_LARGE, SHELL_FLAG_REQUIRE_ANCHOR) + +/obj/structure/scanner_gate_shell/wrench_act(mob/living/user, obj/item/tool) + set_anchored(!anchored) + tool.play_tool_sound(src) + balloon_alert(user, "You [anchored?"secure":"unsecure"] [src].") + return TRUE + +/obj/structure/scanner_gate_shell/proc/on_entered(datum/source, atom/movable/AM) + SIGNAL_HANDLER + set_scanline("scanning", 10) + SEND_SIGNAL(src, COMSIG_SCANGATE_SHELL_PASS, AM) + +/obj/structure/scanner_gate_shell/proc/set_scanline(type, duration) + cut_overlays() + deltimer(scanline_timer) + add_overlay(type) + if(duration) + scanline_timer = addtimer(CALLBACK(src, .proc/set_scanline, "passive"), duration, TIMER_STOPPABLE) + +/obj/item/circuit_component/scanner_gate + display_name = "Scanner Gate" + desc = "A gate able to perform mid-depth scans on any object that pass through it." + + circuit_flags = CIRCUIT_FLAG_OUTPUT_SIGNAL + + var/datum/port/output/scanned + + var/obj/structure/scanner_gate_shell/attached_gate + +/obj/item/circuit_component/scanner_gate/Initialize() + . = ..() + scanned = add_output_port("Scanned Object", PORT_TYPE_ATOM) + +/obj/item/circuit_component/scanner_gate/register_shell(atom/movable/shell) + . = ..() + if(istype(shell, /obj/structure/scanner_gate_shell)) + attached_gate = shell + RegisterSignal(attached_gate, COMSIG_SCANGATE_SHELL_PASS, .proc/on_trigger) + +/obj/item/circuit_component/scanner_gate/unregister_shell(atom/movable/shell) + UnregisterSignal(attached_gate, COMSIG_SCANGATE_SHELL_PASS) + attached_gate = null + return ..() + +/obj/item/circuit_component/scanner_gate/proc/on_trigger(datum/source, atom/movable/passed) + SIGNAL_HANDLER + scanned.set_output(passed) + trigger_output.set_output(COMPONENT_SIGNAL) diff --git a/code/modules/wiremod/shell/shell_items.dm b/code/modules/wiremod/shell/shell_items.dm index 95e70d28ea0..4e6673e7c86 100644 --- a/code/modules/wiremod/shell/shell_items.dm +++ b/code/modules/wiremod/shell/shell_items.dm @@ -57,3 +57,9 @@ name = "brain-computer interface assembly" icon_state = "bci-open" shell_to_spawn = /obj/item/organ/cyberimp/bci + +/obj/item/shell/scanner_gate + name = "scanner gate assembly" + icon = 'icons/obj/machines/scangate.dmi' + icon_state = "scangate_black_open" + shell_to_spawn = /obj/structure/scanner_gate_shell diff --git a/icons/obj/machines/scangate.dmi b/icons/obj/machines/scangate.dmi index 08bc7a12847..6af8750414a 100644 Binary files a/icons/obj/machines/scangate.dmi and b/icons/obj/machines/scangate.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 37d774f9851..2ac00307e3b 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3761,6 +3761,7 @@ #include "code\modules\wiremod\shell\drone.dm" #include "code\modules\wiremod\shell\moneybot.dm" #include "code\modules\wiremod\shell\scanner.dm" +#include "code\modules\wiremod\shell\scanner_gate.dm" #include "code\modules\wiremod\shell\server.dm" #include "code\modules\wiremod\shell\shell_items.dm" #include "code\modules\zombie\items.dm"