diff --git a/baystation12.dme b/baystation12.dme index e4a837aa09..a3572bee58 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -3506,6 +3506,7 @@ #include "infinity\code\game\objects\items\toys.dm" #include "infinity\code\game\objects\items\devices\blackout.dm" #include "infinity\code\game\objects\items\devices\constrictor_harness.dm" +#include "infinity\code\game\objects\items\devices\datajack.dm" #include "infinity\code\game\objects\items\devices\devices.dm" #include "infinity\code\game\objects\items\devices\flashlight.dm" #include "infinity\code\game\objects\items\devices\hacktool.dm" diff --git a/infinity/code/game/objects/items/devices/datajack.dm b/infinity/code/game/objects/items/devices/datajack.dm new file mode 100644 index 0000000000..94d9a4f760 --- /dev/null +++ b/infinity/code/game/objects/items/devices/datajack.dm @@ -0,0 +1,90 @@ +//datajack by Sad Ninja Sid, modified from multimeter +/obj/item/device/multitool/multimeter/datajack + name = "data jack" + desc = "Кабель для мультизадачного подключения к различным устройствам посредством электронных устройств и продвинутой диагностики." + icon = 'infinity/icons/obj/items.dmi' + icon_state = "datajack" + w_class = ITEM_SIZE_TINY + mode = METER_CHECKING // Mode + slot_flags = null + var/obj/item/modular_computer/holder + +/obj/item/device/multitool/multimeter/datajack/New(var/obj/item/modular_computer/P) + ..() + holder = P + +/obj/item/device/multitool/multimeter/datajack/attack_self(mob/user) + ..() + +/obj/item/modular_computer + var/obj/item/device/multitool/multimeter/datajack/datajack + +/obj/item/modular_computer/Initialize() + ..() + datajack = new(src) + datajack.forceMove(src) + +/obj/item/modular_computer/attackby(obj/item/W, mob/user, var/click_params) + ..() + if(datajack == W) + insert_datajack() + return + +/obj/item/device/multitool/multimeter/datajack/Process() + if(!holder) + qdel_self() + return PROCESS_KILL + if(!Adjacent(holder)) + holder.insert_datajack() + return PROCESS_KILL + +/obj/item/modular_computer/proc/eject_datajack(mob/living/carbon/human/user) + if(!datajack || datajack.loc != src) + return + + if(!user.put_in_hands(datajack)) + to_chat(user, SPAN_WARNING("Datajack cannot be deployed in your hands, dropping it on the ground")) + START_PROCESSING(SSobj, datajack) + return + + START_PROCESSING(SSobj, datajack) + visible_message( + SPAN_WARNING("Datajack ejects from device."), + SPAN_WARNING("You hear coil reeling out something.") + ) + +/obj/item/modular_computer/proc/insert_datajack() + if(!datajack) + return + + STOP_PROCESSING(SSobj, datajack) + + if(istype(datajack.loc, /mob/living/carbon/human)) + + var/mob/living/carbon/human/H = datajack.loc + H.remove_from_mob(datajack, src) + visible_message( + SPAN_WARNING("Datajack moves into portable device."), + SPAN_WARNING("You hear coil reeling back in place") + ) + return + visible_message( + SPAN_WARNING("Datajack moves into portable device."), + SPAN_WARNING("You hear coil reeling back in place") + ) + datajack.forceMove(src) + +/datum/terminal_command/datajack + name = "datajack" + man_entry = list("Format: datajack", "Works only on mobile devices. Ejects a datajack for checking wiring and pulsing any of those.") + pattern = "^datajack$" + skill_needed = SKILL_EXPERT + +/datum/terminal_command/datajack/proper_input_entered(text, mob/user, var/datum/terminal/terminal) + var/datum/extension/interactive/ntos/C = terminal.computer + if(!(C.get_hardware_flag() & (PROGRAM_PDA | PROGRAM_TABLET))) + return SPAN_WARNING("This command cant be executed on this device.") + + var/obj/item/modular_computer/comp = terminal.computer.get_physical_host() + comp.eject_datajack(user) + return SPAN_WARNING("Datajack tried to eject further.") diff --git a/infinity/icons/obj/items.dmi b/infinity/icons/obj/items.dmi index d58154378f..75d03671fd 100644 Binary files a/infinity/icons/obj/items.dmi and b/infinity/icons/obj/items.dmi differ