diff --git a/code/modules/research/designs/wiremod_designs.dm b/code/modules/research/designs/wiremod_designs.dm index e98c663b850..83062de2eeb 100644 --- a/code/modules/research/designs/wiremod_designs.dm +++ b/code/modules/research/designs/wiremod_designs.dm @@ -252,6 +252,15 @@ materials = list(/datum/material/glass = 2000, /datum/material/iron = 7000) category = list("Circuitry", "Shells") +/datum/design/scanner_shell + name = "Scanner Shell" + desc = "A handheld scanner shell that can scan entities." + id = "scanner_shell" + build_path = /obj/item/wiremod_scanner + build_type = PROTOLATHE | COMPONENT_PRINTER + materials = list(/datum/material/glass = 2000, /datum/material/iron = 7000) + category = list("Circuitry", "Shells") + /datum/design/bot_shell name = "Bot Shell" desc = "An immobile shell that can store more components. Has a USB port to be able to connect to computers and machines." diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index 4cbf41979b0..2d6506597a6 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -688,6 +688,7 @@ "door_shell", "controller_shell", "money_bot_shell", + "scanner_shell", ) research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) diff --git a/code/modules/wiremod/shell/scanner.dm b/code/modules/wiremod/shell/scanner.dm new file mode 100644 index 00000000000..a8217f62a2a --- /dev/null +++ b/code/modules/wiremod/shell/scanner.dm @@ -0,0 +1,68 @@ +/** + * # Scanner + * + * A handheld device that lets you flash it over people. + */ +/obj/item/wiremod_scanner + name = "scanner" + icon = 'icons/obj/wiremod.dmi' + icon_state = "setup_small" + inhand_icon_state = "electronic" + worn_icon_state = "electronic" + lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' + righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' + light_system = MOVABLE_LIGHT_DIRECTIONAL + light_on = FALSE + +/obj/item/wiremod_scanner/Initialize() + . = ..() + AddComponent(/datum/component/shell, list( + new /obj/item/circuit_component/wiremod_scanner() + ), SHELL_CAPACITY_SMALL) + +/obj/item/circuit_component/wiremod_scanner + display_name = "Scanner" + display_desc = "Used to receive scanned entities from the scanner." + + /// Called when afterattack is called on the shell. + var/datum/port/output/signal + + /// The attacker + var/datum/port/output/attacker + + /// The entity being attacked + var/datum/port/output/attacking + + + +/obj/item/circuit_component/wiremod_scanner/Initialize() + . = ..() + attacker = add_output_port("Scanner", PORT_TYPE_ATOM) + attacking = add_output_port("Scanned Entity", PORT_TYPE_ATOM) + signal = add_output_port("Scanned", PORT_TYPE_SIGNAL) + +/obj/item/circuit_component/wiremod_scanner/Destroy() + attacker = null + attacking = null + signal = null + return ..() + +/obj/item/circuit_component/wiremod_scanner/register_shell(atom/movable/shell) + RegisterSignal(shell, COMSIG_ITEM_AFTERATTACK, .proc/handle_afterattack) + +/obj/item/circuit_component/wiremod_scanner/unregister_shell(atom/movable/shell) + UnregisterSignal(shell, COMSIG_ITEM_AFTERATTACK) + +/** + * Called when the shell item attacks something + */ +/obj/item/circuit_component/wiremod_scanner/proc/handle_afterattack(atom/source, atom/target, mob/user, proximity_flag) + SIGNAL_HANDLER + if(!proximity_flag) + return + source.balloon_alert(user, "scanned object") + playsound(source, get_sfx("terminal_type"), 25, FALSE) + attacker.set_output(user) + attacking.set_output(target) + signal.set_output(COMPONENT_SIGNAL) + diff --git a/tgstation.dme b/tgstation.dme index d3429726058..c46441e010a 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3668,6 +3668,7 @@ #include "code\modules\wiremod\shell\controller.dm" #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\server.dm" #include "code\modules\wiremod\shell\shell_items.dm" #include "code\modules\zombie\items.dm"