Skip to content

Commit

Permalink
Merge branch 'master220' into IPC-shackles
Browse files Browse the repository at this point in the history
  • Loading branch information
Lexanx authored Feb 25, 2024
2 parents 34956e4 + 42ca380 commit e4da780
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
1 change: 1 addition & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
90 changes: 90 additions & 0 deletions infinity/code/game/objects/items/devices/datajack.dm
Original file line number Diff line number Diff line change
@@ -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.")
Binary file modified infinity/icons/obj/items.dmi
Binary file not shown.

0 comments on commit e4da780

Please sign in to comment.