forked from infinitystation/Baystation12
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master220' into IPC-shackles
- Loading branch information
Showing
3 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.