From c59c9e88aed78377b31baf9ff50c780fed4932d0 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Sun, 10 Nov 2019 11:43:41 -0700 Subject: [PATCH] Merge pull request #9746 from Ghommie/Ghommie-cit328 Ports "Cleans up the new alt clicking functionality" from /tg/ --- code/game/machinery/_machinery.dm | 81 ----- code/game/machinery/computer/_computer.dm | 1 + code/game/machinery/computer/card.dm | 302 +++++++++--------- .../machinery/computer/gulag_teleporter.dm | 163 ---------- code/game/machinery/computer/medical.dm | 6 - code/game/machinery/computer/security.dm | 3 +- code/modules/mining/machine_redemption.dm | 4 +- tgstation.dme | 1 - 8 files changed, 156 insertions(+), 405 deletions(-) delete mode 100644 code/game/machinery/computer/gulag_teleporter.dm diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 938a4d92..ddb12dd4 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -113,11 +113,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 @@ -472,8 +467,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() @@ -507,77 +500,3 @@ Class Procs: . = . % 9 AM.pixel_x = -8 + ((.%3)*8) AM.pixel_y = -8 + (round( . / 3)*8) - -/obj/machinery/CanPass(atom/movable/mover, turf/target) - . = ..() - if(istype(mover) && (mover.pass_flags & PASSMACHINES)) - return TRUE -/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 3c3f0e7f..24824dbb 100644 --- a/code/game/machinery/computer/_computer.dm +++ b/code/game/machinery/computer/_computer.dm @@ -13,6 +13,7 @@ var/icon_keyboard = "generic_key" var/icon_screen = "generic" var/clockwork = FALSE + var/authenticated = FALSE /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 d45c3506..acca6633 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -11,8 +11,6 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) icon_keyboard = "id_key" req_one_access = list(ACCESS_HEADS, ACCESS_CHANGE_IDS) circuit = /obj/item/circuitboard/computer/card - var/obj/item/card/id/scan = null - var/obj/item/card/id/modify = null var/mode = 0 var/printing = null var/target_dept = 0 //Which department this computer has access to. 0=all departments @@ -38,68 +36,63 @@ 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 /obj/machinery/computer/card/examine(mob/user) . = ..() - if(scan || modify) + if(inserted_scan_id || inserted_modify_id) . += "Alt-click to eject the ID card." /obj/machinery/computer/card/Initialize() . = ..() change_position_cooldown = CONFIG_GET(number/id_console_jobslot_delay) -/obj/machinery/computer/card/attackby(obj/O, mob/user, params)//TODO:SANITY - if(istype(O, /obj/item/card/id)) - var/obj/item/card/id/idcard = O - if(check_access(idcard)) - if(!scan) - if (!user.transferItemToLoc(idcard,src)) - return - scan = idcard - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) - else if(!modify) - if (!user.transferItemToLoc(idcard,src)) - return - modify = idcard - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) +/obj/machinery/computer/card/attackby(obj/I, mob/user, params) + if(istype(I, /obj/item/card/id)) + if(!inserted_scan_id) + if(id_insert(user, I, inserted_scan_id)) + inserted_scan_id = I + return + if(!inserted_modify_id) + if(id_insert(user, I, inserted_modify_id)) + inserted_modify_id = I + return else - if(!modify) - if (!user.transferItemToLoc(idcard,src)) - return - modify = idcard - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) - updateUsrDialog() + to_chat(user, "There's already an ID card in the console!") else return ..() /obj/machinery/computer/card/Destroy() - if(scan) - qdel(scan) - scan = null - if(modify) - qdel(modify) - modify = null + if(inserted_scan_id) + qdel(inserted_scan_id) + inserted_scan_id = null + if(inserted_modify_id) + qdel(inserted_modify_id) + inserted_modify_id = null return ..() /obj/machinery/computer/card/handle_atom_del(atom/A) ..() - if(A == scan) - scan = null + if(A == inserted_scan_id) + inserted_scan_id = null updateUsrDialog() - if(A == modify) - modify = null + if(A == inserted_modify_id) + inserted_modify_id = null updateUsrDialog() /obj/machinery/computer/card/on_deconstruction() - if(scan) - scan.forceMove(drop_location()) - scan = null - if(modify) - modify.forceMove(drop_location()) - modify = null + if(inserted_scan_id) + inserted_scan_id.forceMove(drop_location()) + inserted_scan_id = null + if(inserted_modify_id) + inserted_modify_id.forceMove(drop_location()) + inserted_modify_id = null //Check if you can't open a new position for a certain job /obj/machinery/computer/card/proc/job_blacklisted(jobtitle) @@ -130,9 +123,50 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) return -1 return 0 +/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) . = ..() - var/dat if(!SSticker) return @@ -147,15 +181,15 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) dat = "Return" dat += " || Confirm Identity: " var/S - if(scan) - S = html_encode(scan.name) + if(inserted_scan_id) + S = html_encode(inserted_scan_id.name) else S = "--------" - dat += "[S]" + dat += "[S]" dat += "" dat += "" var/ID - if(scan && (ACCESS_CHANGE_IDS in scan.access) && !target_dept) + if(inserted_scan_id && (ACCESS_CHANGE_IDS in inserted_scan_id.access) && !target_dept) ID = 1 else ID = 0 @@ -221,33 +255,33 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) var/target_name var/target_owner var/target_rank - if(modify) - target_name = html_encode(modify.name) + if(inserted_modify_id) + target_name = html_encode(inserted_modify_id.name) else target_name = "--------" - if(modify && modify.registered_name) - target_owner = html_encode(modify.registered_name) + if(inserted_modify_id && inserted_modify_id.registered_name) + target_owner = html_encode(inserted_modify_id.registered_name) else target_owner = "--------" - if(modify && modify.assignment) - target_rank = html_encode(modify.assignment) + if(inserted_modify_id && inserted_modify_id.assignment) + target_rank = html_encode(inserted_modify_id.assignment) else target_rank = "Unassigned" var/scan_name - if(scan) - scan_name = html_encode(scan.name) + if(inserted_scan_id) + scan_name = html_encode(inserted_scan_id.name) else scan_name = "--------" if(!authenticated) header += "
Please insert the cards into the slots
" - header += "Target: [target_name]
" - header += "Confirm Identity: [scan_name]
" + header += "Target: [target_name]
" + header += "Confirm Identity: [scan_name]
" else header += "

" - header += "Remove [target_name] || " - header += "Remove [scan_name]
" + header += "Remove [target_name] || " + header += "Remove [scan_name]
" header += "Access Crew Manifest
" header += "Log Out
" @@ -262,7 +296,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) var/body - if (authenticated && modify) + if (authenticated && inserted_modify_id) var/carddesc = text("") var/jobs = text("") @@ -303,7 +337,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) if(istype(src, /obj/machinery/computer/card/centcom)) accesses += "
Central Command:
" for(var/A in get_all_centcom_access()) - if(A in modify.access) + if(A in inserted_modify_id.access) accesses += "[replacetext(get_centcom_access_desc(A), " ", " ")] " else accesses += "[replacetext(get_centcom_access_desc(A), " ", " ")] " @@ -321,7 +355,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) continue accesses += "
JobSlotsOpen jobClose jobPrioritize
" for(var/A in get_region_accesses(i)) - if(A in modify.access) + if(A in inserted_modify_id.access) accesses += "[replacetext(get_access_desc(A), " ", " ")] " else accesses += "[replacetext(get_access_desc(A), " ", " ")] " @@ -353,52 +387,66 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) usr.set_machine(src) switch(href_list["choice"]) - if ("modify") - eject_id_modify(usr) - if ("scan") - eject_id_scan(usr) + if ("inserted_modify_id") + if (inserted_modify_id) + if(id_eject(usr, inserted_modify_id)) + inserted_modify_id = null + else + 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) + if(id_eject(usr, inserted_scan_id)) + inserted_scan_id = null + else + 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 ) && (scan || issilicon(usr)) && (modify || mode))) - if (check_access(scan)) + if ((!( authenticated ) && (inserted_scan_id || issilicon(usr)) && (inserted_modify_id || mode))) + if (check_access(inserted_scan_id)) region_access = list() head_subordinates = list() - if(ACCESS_CHANGE_IDS in scan.access) + if(ACCESS_CHANGE_IDS in inserted_scan_id.access) if(target_dept) head_subordinates = get_all_jobs() region_access |= target_dept authenticated = 1 else authenticated = 2 - playsound(src, 'sound/machines/terminal_on.ogg', 50, 0) + playsound(src, 'sound/machines/terminal_on.ogg', 50, FALSE) else - if((ACCESS_HOP in scan.access) && ((target_dept==1) || !target_dept)) + if((ACCESS_HOP in inserted_scan_id.access) && ((target_dept==1) || !target_dept)) region_access |= 1 get_subordinates("Head of Personnel") - if((ACCESS_HOS in scan.access) && ((target_dept==2) || !target_dept)) + if((ACCESS_HOS in inserted_scan_id.access) && ((target_dept==2) || !target_dept)) region_access |= 2 get_subordinates("Head of Security") - if((ACCESS_CMO in scan.access) && ((target_dept==3) || !target_dept)) + if((ACCESS_CMO in inserted_scan_id.access) && ((target_dept==3) || !target_dept)) region_access |= 3 get_subordinates("Chief Medical Officer") - if((ACCESS_RD in scan.access) && ((target_dept==4) || !target_dept)) + if((ACCESS_RD in inserted_scan_id.access) && ((target_dept==4) || !target_dept)) region_access |= 4 get_subordinates("Research Director") - if((ACCESS_CE in scan.access) && ((target_dept==5) || !target_dept)) + if((ACCESS_CE in inserted_scan_id.access) && ((target_dept==5) || !target_dept)) region_access |= 5 get_subordinates("Chief Engineer") - if((ACCESS_QM in scan.access) && ((target_dept==6) || !target_dept)) + if((ACCESS_QM in inserted_scan_id.access) && ((target_dept==6) || !target_dept)) region_access |= 6 get_subordinates("Quartermaster") if(region_access) authenticated = 1 - else if ((!( authenticated ) && issilicon(usr)) && (!modify)) + else if ((!( authenticated ) && issilicon(usr)) && (!inserted_modify_id)) to_chat(usr, "You can't modify an ID without an ID inserted to modify! Once one is in the modify slot on the computer, you can log in.") if ("logout") region_access = null head_subordinates = null authenticated = 0 - playsound(src, 'sound/machines/terminal_off.ogg', 50, 0) + playsound(src, 'sound/machines/terminal_off.ogg', 50, FALSE) if("access") if(href_list["allowed"]) @@ -406,20 +454,20 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) var/access_type = text2num(href_list["access_target"]) var/access_allowed = text2num(href_list["allowed"]) if(access_type in (istype(src, /obj/machinery/computer/card/centcom)?get_all_centcom_access() : get_all_accesses())) - modify.access -= access_type + inserted_modify_id.access -= access_type if(access_allowed == 1) - modify.access += access_type - playsound(src, "terminal_type", 50, 0) + inserted_modify_id.access += access_type + playsound(src, "terminal_type", 50, FALSE) if ("assign") if (authenticated == 2) var/t1 = href_list["assign_target"] if(t1 == "Custom") - var/newJob = reject_bad_text(input("Enter a custom job assignment.", "Assignment", modify ? modify.assignment : "Unassigned"), MAX_NAME_LEN) + var/newJob = reject_bad_text(input("Enter a custom job assignment.", "Assignment", inserted_modify_id ? inserted_modify_id.assignment : "Unassigned"), MAX_NAME_LEN) if(newJob) t1 = newJob else if(t1 == "Unassigned") - modify.access -= get_all_accesses() + inserted_modify_id.access -= get_all_accesses() else var/datum/job/jobdatum @@ -434,24 +482,24 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) updateUsrDialog() return - modify.access = ( istype(src, /obj/machinery/computer/card/centcom) ? get_centcom_access(t1) : jobdatum.get_access() ) - if (modify) - modify.assignment = t1 - playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + inserted_modify_id.access = ( istype(src, /obj/machinery/computer/card/centcom) ? get_centcom_access(t1) : jobdatum.get_access() ) + if (inserted_modify_id) + inserted_modify_id.assignment = t1 + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) if ("demote") - if(modify.assignment in head_subordinates || modify.assignment == "Assistant") - modify.assignment = "Unassigned" - playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + if(inserted_modify_id.assignment in head_subordinates || inserted_modify_id.assignment == "Assistant") + inserted_modify_id.assignment = "Unassigned" + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) else to_chat(usr, "You are not authorized to demote this position.") if ("reg") if (authenticated) - var/t2 = modify - if ((authenticated && modify == t2 && (in_range(src, usr) || issilicon(usr)) && isturf(loc))) + var/t2 = inserted_modify_id + if ((authenticated && inserted_modify_id == t2 && (in_range(src, usr) || issilicon(usr)) && isturf(loc))) var/newName = reject_bad_name(href_list["reg"]) if(newName) - modify.registered_name = newName - playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + inserted_modify_id.registered_name = newName + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) else to_chat(usr, "Invalid name entered.") updateUsrDialog() @@ -462,11 +510,11 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) if("return") //DISPLAY MAIN MENU mode = 3; - playsound(src, "terminal_type", 25, 0) + playsound(src, "terminal_type", 25, FALSE) if("make_job_available") // MAKE ANOTHER JOB POSITION AVAILABLE FOR LATE JOINERS - if(scan && (ACCESS_CHANGE_IDS in scan.access) && !target_dept) + if(inserted_scan_id && (ACCESS_CHANGE_IDS in inserted_scan_id.access) && !target_dept) var/edit_job_target = href_list["job"] var/datum/job/j = SSjob.GetJob(edit_job_target) if(!j) @@ -479,11 +527,11 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) GLOB.time_last_changed_position = world.time / 10 j.total_positions++ opened_positions[edit_job_target]++ - playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) if("make_job_unavailable") // MAKE JOB POSITION UNAVAILABLE FOR LATE JOINERS - if(scan && (ACCESS_CHANGE_IDS in scan.access) && !target_dept) + if(inserted_scan_id && (ACCESS_CHANGE_IDS in inserted_scan_id.access) && !target_dept) var/edit_job_target = href_list["job"] var/datum/job/j = SSjob.GetJob(edit_job_target) if(!j) @@ -497,11 +545,11 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) GLOB.time_last_changed_position = world.time / 10 j.total_positions-- opened_positions[edit_job_target]-- - playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) + playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, FALSE) if ("prioritize_job") // TOGGLE WHETHER JOB APPEARS AS PRIORITIZED IN THE LOBBY - if(scan && (ACCESS_CHANGE_IDS in scan.access) && !target_dept) + if(inserted_scan_id && (ACCESS_CHANGE_IDS in inserted_scan_id.access) && !target_dept) var/priority_target = href_list["job"] var/datum/job/j = SSjob.GetJob(priority_target) if(!j) @@ -518,7 +566,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) else SSjob.prioritized_jobs += j to_chat(usr, "[j.title] has been successfully [priority ? "prioritized" : "unprioritized"]. Potential employees will notice your request.") - playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) if ("print") if (!( printing )) @@ -531,59 +579,9 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) P.info = t1 P.name = "paper- 'Crew Manifest'" printing = null - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) - if (modify) - modify.update_label() - updateUsrDialog() - -/obj/machinery/computer/card/AltClick(mob/user) - if(!user.canUseTopic(src, !issilicon(user)) || !is_operational()) - return - if(scan) - eject_id_scan(user) - if(modify) - eject_id_modify(user) - -/obj/machinery/computer/card/proc/eject_id_scan(mob/user) - if(scan) - scan.forceMove(drop_location()) - if(!issilicon(user) && Adjacent(user)) - user.put_in_hands(scan) - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) - scan = null - else //switching the ID with the one you're holding - if(issilicon(user) || !Adjacent(user)) - return - var/obj/item/I = user.get_active_held_item() - if(istype(I, /obj/item/card/id)) - if(!user.transferItemToLoc(I,src)) - return - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) - scan = I - authenticated = FALSE - updateUsrDialog() - -/obj/machinery/computer/card/proc/eject_id_modify(mob/user) - if(modify) - GLOB.data_core.manifest_modify(modify.registered_name, modify.assignment) - modify.update_label() - modify.forceMove(drop_location()) - if(!issilicon(user) && Adjacent(user)) - user.put_in_hands(modify) - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) - modify = null - region_access = null - head_subordinates = null - else //switching the ID with the one you're holding - if(issilicon(user) || !Adjacent(user)) - return - var/obj/item/I = user.get_active_held_item() - if(istype(I, /obj/item/card/id)) - if (!user.transferItemToLoc(I,src)) - return - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) - modify = I - authenticated = FALSE + playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE) + if (inserted_modify_id) + inserted_modify_id.update_label() updateUsrDialog() /obj/machinery/computer/card/proc/get_subordinates(rank) diff --git a/code/game/machinery/computer/gulag_teleporter.dm b/code/game/machinery/computer/gulag_teleporter.dm deleted file mode 100644 index 68cbf03f..00000000 --- a/code/game/machinery/computer/gulag_teleporter.dm +++ /dev/null @@ -1,163 +0,0 @@ -//computer that handle the points and teleports the prisoner -/obj/machinery/computer/gulag_teleporter_computer - name = "labor camp teleporter console" - desc = "Used to send criminals to the Labor Camp." - icon_screen = "explosive" - icon_keyboard = "security_key" - req_access = list(ACCESS_ARMORY) - circuit = /obj/item/circuitboard/computer/gulag_teleporter_console - var/default_goal = 200 - var/obj/item/card/id/prisoner/id = null - var/obj/machinery/gulag_teleporter/teleporter = null - var/obj/structure/gulag_beacon/beacon = null - var/mob/living/carbon/human/prisoner = null - var/datum/data/record/temporary_record = null - - light_color = LIGHT_COLOR_RED - -/obj/machinery/computer/gulag_teleporter_computer/Initialize() - . = ..() - scan_machinery() - -/obj/machinery/computer/gulag_teleporter_computer/Destroy() - if(id) - id.forceMove(get_turf(src)) - return ..() - -/obj/machinery/computer/gulag_teleporter_computer/attackby(obj/item/W, mob/user) - if(istype(W, /obj/item/card/id/prisoner)) - if(!id) - if (!user.transferItemToLoc(W,src)) - return - id = W - to_chat(user, "You insert [W].") - return - else - to_chat(user, "There's an ID inserted already.") - return ..() - -/obj/machinery/computer/gulag_teleporter_computer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \ - datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) - ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) - if(!ui) - ui = new(user, src, ui_key, "gulag_console", name, 455, 440, master_ui, state) - ui.open() - -/obj/machinery/computer/gulag_teleporter_computer/ui_data(mob/user) - var/list/data = list() - - var/list/prisoner_list = list() - var/can_teleport = FALSE - - if(teleporter && (teleporter.occupant && ishuman(teleporter.occupant))) - prisoner = teleporter.occupant - prisoner_list["name"] = prisoner.real_name - if(id) - can_teleport = TRUE - if(!isnull(GLOB.data_core.general)) - for(var/r in GLOB.data_core.security) - var/datum/data/record/R = r - if(R.fields["name"] == prisoner_list["name"]) - temporary_record = R - prisoner_list["crimstat"] = temporary_record.fields["criminal"] - - data["prisoner"] = prisoner_list - - if(teleporter) - data["teleporter"] = teleporter - data["teleporter_location"] = "([teleporter.x], [teleporter.y], [teleporter.z])" - data["teleporter_lock"] = teleporter.locked - data["teleporter_state_open"] = teleporter.state_open - if(beacon) - data["beacon"] = beacon - data["beacon_location"] = "([beacon.x], [beacon.y], [beacon.z])" - if(id) - data["id"] = id - data["id_name"] = id.registered_name - data["goal"] = id.goal - data["can_teleport"] = can_teleport - - return data - -/obj/machinery/computer/gulag_teleporter_computer/ui_act(action, list/params) - if(..()) - return - if(!allowed(usr)) - to_chat(usr, "Access denied.") - return - switch(action) - if("scan_teleporter") - teleporter = findteleporter() - if("scan_beacon") - beacon = findbeacon() - if("handle_id") - if(id) - usr.put_in_hands(id) - id = null - else - var/obj/item/I = usr.is_holding_item_of_type(/obj/item/card/id/prisoner) - if(I) - if(!usr.transferItemToLoc(I, src)) - return - id = I - if("set_goal") - var/new_goal = input("Set the amount of points:", "Points", id.goal) as num|null - if(!isnum(new_goal)) - return - if(!new_goal) - new_goal = default_goal - if (new_goal > 1000) - to_chat(usr, "The entered amount of points is too large. Points have instead been set to the maximum allowed amount.") - id.goal = CLAMP(new_goal, 0, 1000) //maximum 1000 points - if("toggle_open") - if(teleporter.locked) - to_chat(usr, "The teleporter is locked") - return - teleporter.toggle_open() - if("teleporter_lock") - if(teleporter.state_open) - to_chat(usr, "Close the teleporter before locking!") - return - teleporter.locked = !teleporter.locked - if("teleport") - if(!teleporter || !beacon) - return - addtimer(CALLBACK(src, .proc/teleport, usr), 5) - -/obj/machinery/computer/gulag_teleporter_computer/proc/scan_machinery() - teleporter = findteleporter() - beacon = findbeacon() - -/obj/machinery/computer/gulag_teleporter_computer/proc/findteleporter() - var/obj/machinery/gulag_teleporter/teleporterf = null - - for(var/direction in GLOB.cardinals) - teleporterf = locate(/obj/machinery/gulag_teleporter, get_step(src, direction)) - if(teleporterf && teleporterf.is_operational()) - return teleporterf - -/obj/machinery/computer/gulag_teleporter_computer/proc/findbeacon() - return locate(/obj/structure/gulag_beacon) - -/obj/machinery/computer/gulag_teleporter_computer/proc/teleport(mob/user) - if(!id) //incase the ID was removed after the transfer timer was set. - say("Warning: Unable to transfer prisoner without a valid Prisoner ID inserted!") - return - var/id_goal_not_set - if(!id.goal) - id_goal_not_set = TRUE - id.goal = default_goal - say("[id]'s ID card goal defaulting to [id.goal] points.") - log_game("[key_name(user)] teleported [key_name(prisoner)] to the Labor Camp [COORD(beacon)] for [id_goal_not_set ? "default goal of ":""][id.goal] points.") - teleporter.handle_prisoner(id, temporary_record) - playsound(src, 'sound/weapons/emitter.ogg', 50, 1) - prisoner.forceMove(get_turf(beacon)) - prisoner.Knockdown(40) // small travel dizziness - to_chat(prisoner, "The teleportation makes you a little dizzy.") - new /obj/effect/particle_effect/sparks(get_turf(prisoner)) - playsound(src, "sparks", 50, 1) - if(teleporter.locked) - teleporter.locked = FALSE - teleporter.toggle_open() - id = null - temporary_record = null diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index e4af7acd..ff7311c8 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) . = ..() var/dat diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 2e80aab6..705f4673 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -35,7 +35,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 6c1a00b0..c13408b2 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -304,7 +304,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"]) diff --git a/tgstation.dme b/tgstation.dme index 77cbdddc..a6158571 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -665,7 +665,6 @@ #include "code\game\machinery\computer\communications.dm" #include "code\game\machinery\computer\crew.dm" #include "code\game\machinery\computer\dna_console.dm" -#include "code\game\machinery\computer\gulag_teleporter.dm" #include "code\game\machinery\computer\launchpad_control.dm" #include "code\game\machinery\computer\law.dm" #include "code\game\machinery\computer\medical.dm"