diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm
index de9fae7f3a0..ab38089a38b 100644
--- a/code/game/machinery/_machinery.dm
+++ b/code/game/machinery/_machinery.dm
@@ -115,11 +115,6 @@ Class Procs:
var/atom/movable/occupant = null
var/speed_process = FALSE // Process as fast as possible?
var/obj/item/circuitboard/circuit // Circuit to be created and inserted when the machinery is created
- var/obj/item/card/id/inserted_scan_id
- var/obj/item/card/id/inserted_modify_id
- var/list/region_access = null // For the identification console (card.dm)
- var/list/head_subordinates = null // For the identification console (card.dm)
- var/authenticated = 0 // For the identification console (card.dm)
var/interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_SET_MACHINE
var/fair_market_price = 69
@@ -508,8 +503,6 @@ Class Procs:
. += "It's falling apart!"
if(user.research_scanner && component_parts)
. += display_parts(user, TRUE)
- if(inserted_scan_id || inserted_modify_id)
- . += "Alt-click to eject the ID card."
//called on machinery construction (i.e from frame to machinery) but not on initialization
/obj/machinery/proc/on_construction()
@@ -543,72 +536,3 @@ Class Procs:
. = . % 9
AM.pixel_x = -8 + ((.%3)*8)
AM.pixel_y = -8 + (round( . / 3)*8)
-
-/obj/machinery/proc/id_insert_scan(mob/user, obj/item/card/id/I)
- I = user.get_active_held_item()
- if(istype(I))
- if(inserted_scan_id)
- to_chat(user, "There's already an ID card in the console!")
- return
- if(!user.transferItemToLoc(I, src))
- return
- inserted_scan_id = I
- user.visible_message("[user] inserts an ID card into the console.", \
- "You insert the ID card into the console.")
- playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
- updateUsrDialog()
-
-/obj/machinery/proc/id_eject_scan(mob/user)
- if(!inserted_scan_id)
- to_chat(user, "There's no ID card in the console!")
- return
- if(inserted_scan_id)
- inserted_scan_id.forceMove(drop_location())
- if(!issilicon(user) && Adjacent(user))
- user.put_in_hands(inserted_scan_id)
- inserted_scan_id = null
- user.visible_message("[user] gets an ID card from the console.", \
- "You get the ID card from the console.")
- playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
- updateUsrDialog()
-
-/obj/machinery/proc/id_eject_modify(mob/user)
- if(inserted_modify_id)
- GLOB.data_core.manifest_modify(inserted_modify_id.registered_name, inserted_modify_id.assignment)
- inserted_modify_id.update_label()
- inserted_modify_id.forceMove(drop_location())
- if(!issilicon(user) && Adjacent(user))
- user.put_in_hands(inserted_modify_id)
- user.visible_message("[user] gets an ID card from the console.", \
- "You get the ID card from the console.")
- playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
- inserted_modify_id = null
- region_access = null
- head_subordinates = null
- updateUsrDialog()
-
-/obj/machinery/proc/id_insert_modify(mob/user)
- var/obj/item/card/id/I = user.get_active_held_item()
- if(istype(I))
- if(inserted_modify_id)
- to_chat(user, "There's already an ID card in the console!")
- return
- if(!user.transferItemToLoc(I, src))
- return
- inserted_modify_id = I
- user.visible_message("[user] inserts an ID card into the console.", \
- "You insert the ID card into the console.")
- playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
- updateUsrDialog()
-
-/obj/machinery/AltClick(mob/user)
- if(!user.canUseTopic(src, !issilicon(user)) || !is_operational())
- return
- if(inserted_modify_id)
- id_eject_modify(user)
- authenticated = FALSE
- return
- if(inserted_scan_id)
- id_eject_scan(user)
- authenticated = FALSE
- return
diff --git a/code/game/machinery/computer/_computer.dm b/code/game/machinery/computer/_computer.dm
index 85f8201c324..cef37e5f344 100644
--- a/code/game/machinery/computer/_computer.dm
+++ b/code/game/machinery/computer/_computer.dm
@@ -14,6 +14,7 @@
var/icon_screen = "generic"
var/clockwork = FALSE
var/time_to_screwdrive = 20
+ var/authenticated = 0
/obj/machinery/computer/Initialize(mapload, obj/item/circuitboard/C)
. = ..()
diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm
index a5513363a24..a0ae40a76ea 100644
--- a/code/game/machinery/computer/card.dm
+++ b/code/game/machinery/computer/card.dm
@@ -41,7 +41,11 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
//This is used to keep track of opened positions for jobs to allow instant closing
//Assoc array: "JobName" = (int)
- var/list/opened_positions = list();
+ var/list/opened_positions = list()
+ var/obj/item/card/id/inserted_scan_id
+ var/obj/item/card/id/inserted_modify_id
+ var/list/region_access = null
+ var/list/head_subordinates = null
light_color = LIGHT_COLOR_BLUE
@@ -55,13 +59,20 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
. = ..()
change_position_cooldown = CONFIG_GET(number/id_console_jobslot_delay)
+/obj/machinery/computer/card/examine(mob/user)
+ . = ..()
+ if(inserted_scan_id || inserted_modify_id)
+ . += "Alt-click to eject the ID card."
+
/obj/machinery/computer/card/attackby(obj/I, mob/user, params)
if(istype(I, /obj/item/card/id))
if(!inserted_scan_id)
- id_insert_scan(user)
+ if(id_insert(user, I, inserted_scan_id))
+ inserted_scan_id = I
return
if(!inserted_modify_id)
- id_insert_modify(user)
+ if(id_insert(user, I, inserted_modify_id))
+ inserted_modify_id = I
return
else
to_chat(user, "There's already an ID card in the console!")
@@ -122,10 +133,50 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
return JOB_MAX_POSITIONS
return JOB_DENIED
+/obj/machinery/computer/card/proc/id_insert(mob/user, obj/item/card/id/I, target)
+ if(istype(I))
+ if(target)
+ to_chat(user, "There's already an ID card in the console!")
+ return FALSE
+ if(!user.transferItemToLoc(I, src))
+ return FALSE
+ user.visible_message("[user] inserts an ID card into the console.", \
+ "You insert the ID card into the console.")
+ playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
+ updateUsrDialog()
+ return TRUE
+
+/obj/machinery/computer/card/proc/id_eject(mob/user, obj/target)
+ if(!target)
+ to_chat(user, "There's no ID card in the console!")
+ return FALSE
+ else
+ target.forceMove(drop_location())
+ if(!issilicon(user) && Adjacent(user))
+ user.put_in_hands(target)
+ user.visible_message("[user] gets an ID card from the console.", \
+ "You get the ID card from the console.")
+ playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE)
+ updateUsrDialog()
+ return TRUE
+
+/obj/machinery/computer/card/AltClick(mob/user)
+ ..()
+ if(!user.canUseTopic(src, !issilicon(user)) || !is_operational())
+ return
+ if(inserted_modify_id)
+ if(id_eject(user, inserted_modify_id))
+ inserted_modify_id = null
+ authenticated = FALSE
+ return
+ if(inserted_scan_id)
+ if(id_eject(user, inserted_scan_id))
+ inserted_scan_id = null
+ authenticated = FALSE
+ return
+
/obj/machinery/computer/card/ui_interact(mob/user)
. = ..()
-
- playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE)
var/list/dat = list()
if (mode == 1) // accessing crew manifest
dat += "Crew Manifest:
Please use security record computer to modify entries.
"
@@ -315,14 +366,22 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
switch(href_list["choice"])
if ("inserted_modify_id")
if (inserted_modify_id)
- id_eject_modify(usr)
+ if(id_eject(usr, inserted_modify_id))
+ inserted_modify_id = null
else
- id_insert_modify(usr)
+ var/mob/M = usr
+ var/obj/item/card/id/I = M.get_idcard(TRUE)
+ if(id_insert(usr, I, inserted_modify_id))
+ inserted_modify_id = I
if ("inserted_scan_id")
if (inserted_scan_id)
- id_eject_scan(usr)
+ if(id_eject(usr, inserted_scan_id))
+ inserted_scan_id = null
else
- id_insert_scan(usr)
+ var/mob/M = usr
+ var/obj/item/card/id/I = M.get_idcard(TRUE)
+ if(id_insert(usr, I, inserted_scan_id))
+ inserted_scan_id = I
if ("auth")
if ((!( authenticated ) && (inserted_scan_id || issilicon(usr)) && (inserted_modify_id || mode)))
if (check_access(inserted_scan_id))
diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm
index 85bf31d0def..f0e7e82af68 100644
--- a/code/game/machinery/computer/medical.dm
+++ b/code/game/machinery/computer/medical.dm
@@ -22,12 +22,6 @@
/obj/machinery/computer/med_data/syndie
icon_keyboard = "syndie_key"
-/obj/machinery/computer/med_data/attackby(obj/item/I, mob/user, params)
- if(istype(I, /obj/item/card/id))
- id_insert_scan(user)
- else
- return ..()
-
/obj/machinery/computer/med_data/ui_interact(mob/user)
. = ..()
if(isliving(user))
diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm
index 00fb27e2844..5f10546de83 100644
--- a/code/game/machinery/computer/security.dm
+++ b/code/game/machinery/computer/security.dm
@@ -36,7 +36,8 @@
//Someone needs to break down the dat += into chunks instead of long ass lines.
/obj/machinery/computer/secure_data/ui_interact(mob/user)
. = ..()
- playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE)
+ if(isliving(user))
+ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE)
if(src.z > 6)
to_chat(user, "Unable to establish a connection: \black You're too far away from the station!")
return
diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm
index 1959b008e7f..e8be7f97172 100644
--- a/code/modules/mining/machine_redemption.dm
+++ b/code/modules/mining/machine_redemption.dm
@@ -318,7 +318,9 @@
return
var/alloy_id = params["id"]
var/datum/design/alloy = stored_research.isDesignResearchedID(alloy_id)
- if((check_access(inserted_scan_id) || allowed(usr)) && alloy)
+ var/mob/M = usr
+ var/obj/item/card/id/I = M.get_idcard(TRUE)
+ if((check_access(I) || allowed(usr)) && alloy)
var/smelt_amount = can_smelt_alloy(alloy)
var/desired = 0
if (params["sheets"])