diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 319eb0a61b5..d4b776daf54 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -115,6 +115,9 @@ 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/obj/item/card/id/prisoner/inserted_prisoner_id var/damage_deflection = 0 var/interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_SET_MACHINE @@ -149,6 +152,9 @@ Class Procs: else STOP_PROCESSING(SSfastprocess, src) dropContents() + inserted_scan_id = null + inserted_modify_id = null + inserted_prisoner_id = null if(length(component_parts)) for(var/atom/A in component_parts) qdel(A) @@ -509,6 +515,8 @@ Class Procs: . += "It's falling apart!" if(user.research_scanner && component_parts) . += display_parts(user, TRUE) + if(inserted_prisoner_id || 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() @@ -542,3 +550,47 @@ Class Procs: . = . % 9 AM.pixel_x = -8 + ((.%3)*8) AM.pixel_y = -8 + (round( . / 3)*8) + +/obj/machinery/proc/id_insert(mob/user, obj/item/card/id/I, obj/item/card/id/target_id) + if(target_id) + to_chat(user, "There's already an ID card in the console!") + return + if(istype(I)) + if(!user.transferItemToLoc(I, src)) + return + 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) + else + to_chat(user, "No valid ID.") + updateUsrDialog() + +/obj/machinery/proc/id_eject(mob/user, obj/item/card/id/target_id) + if(target_id) + target_id.forceMove(drop_location()) + if(!issilicon(user) && Adjacent(user)) + user.put_in_hands(target_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) + updateUsrDialog() + return + else + to_chat(user, "There's no ID card in the console!") + +/obj/machinery/AltClick(mob/user) + if(!user.canUseTopic(src, !issilicon(user)) || !is_operational()) + return + if(inserted_scan_id) + id_eject(user, inserted_scan_id) + inserted_scan_id = null + return + if(inserted_modify_id) + id_eject(user, inserted_modify_id) + inserted_modify_id = null + return + if(inserted_prisoner_id) + id_eject(user, inserted_prisoner_id) + inserted_prisoner_id = null + return + to_chat(user, "There's no ID card in the console!") diff --git a/code/game/machinery/computer/_computer.dm b/code/game/machinery/computer/_computer.dm index 7b3d986928d..cef37e5f344 100644 --- a/code/game/machinery/computer/_computer.dm +++ b/code/game/machinery/computer/_computer.dm @@ -13,7 +13,8 @@ var/icon_keyboard = "generic_key" var/icon_screen = "generic" var/clockwork = FALSE - var/time_to_scewdrive = 20 + var/time_to_screwdrive = 20 + var/authenticated = 0 /obj/machinery/computer/Initialize(mapload, obj/item/circuitboard/C) . = ..() @@ -78,11 +79,10 @@ return TRUE if(circuit && !(flags_1&NODECONSTRUCT_1)) to_chat(user, "You start to disconnect the monitor...") - if(I.use_tool(src, user, time_to_scewdrive, volume=50)) + if(I.use_tool(src, user, time_to_screwdrive, volume=50)) deconstruct(TRUE, user) return TRUE - /obj/machinery/computer/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0) switch(damage_type) if(BRUTE) @@ -137,5 +137,9 @@ circuit = null for(var/obj/C in src) C.forceMove(loc) - qdel(src) + +/obj/machinery/computer/AltClick(mob/user) + . = ..() + if(!user.canUseTopic(src, !issilicon(user)) || !is_operational()) + return diff --git a/code/game/machinery/computer/apc_control.dm b/code/game/machinery/computer/apc_control.dm index 36393fb2e6b..ee72d447c0c 100644 --- a/code/game/machinery/computer/apc_control.dm +++ b/code/game/machinery/computer/apc_control.dm @@ -11,7 +11,6 @@ var/list/result_filters //For sorting the results var/checking_logs = 0 var/list/logs - var/authenticated = 0 var/auth_id = "\[NULL\]" /obj/machinery/computer/apc_control/Initialize() @@ -99,8 +98,10 @@ authenticated = TRUE auth_id = "[ID.registered_name] ([ID.assignment])" log_activity("logged in") + playsound(src, 'sound/machines/terminal_on.ogg', 50, 0) if(href_list["log_out"]) log_activity("logged out") + playsound(src, 'sound/machines/terminal_off.ogg', 50, 0) authenticated = FALSE auth_id = "\[NULL\]" if(href_list["restore_logging"]) diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index f90756f0e81..bc68d45b1f8 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -16,14 +16,11 @@ 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/authenticated = 0 var/mode = 0 var/printing = null - var/list/region_access = null - var/list/head_subordinates = null var/target_dept = 0 //Which department this computer has access to. 0=all departments + var/list/region_access + var/list/head_subordinates //Cooldown for closing positions in seconds //if set to -1: No cooldown... probably a bad idea @@ -56,70 +53,46 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) /obj/machinery/computer/card/centcom/get_jobs() return get_all_centcom_jobs() -/obj/machinery/computer/card/examine(mob/user) - . = ..() - if(scan || modify) - . += "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) + id_insert(user, I, inserted_scan_id) + inserted_scan_id = I + return + if(!inserted_modify_id) + 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 - 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) return (jobtitle in blacklisted) - //Logic check for Topic() if you can open the job /obj/machinery/computer/card/proc/can_open_job(datum/job/job) if(job) @@ -147,6 +120,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) /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.

" @@ -158,11 +132,11 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) // JOB MANAGEMENT dat += {"Return || Confirm Identity: - [(scan ? html_encode(scan.name) : "--------")] + [(inserted_scan_id ? html_encode(inserted_scan_id.name) : "--------")] "} 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,29 +195,27 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) else var/list/header = list() - var/scan_name = scan ? html_encode(scan.name) : "--------" - var/target_name = modify ? html_encode(modify.name) : "--------" - var/target_owner = (modify && modify.registered_name) ? html_encode(modify.registered_name) : "--------" - var/target_rank = (modify && modify.assignment) ? html_encode(modify.assignment) : "Unassigned" - + var/scan_name = inserted_scan_id ? html_encode(inserted_scan_id.name) : "--------" + var/target_name = inserted_modify_id ? html_encode(inserted_modify_id.name) : "--------" + var/target_owner = (inserted_modify_id && inserted_modify_id.registered_name) ? html_encode(inserted_modify_id.registered_name) : "--------" + var/target_rank = (inserted_modify_id && inserted_modify_id.assignment) ? html_encode(inserted_modify_id.assignment) : "Unassigned" if(!authenticated) header += {"
Please insert the cards into the slots
- Target: [target_name]
- Confirm Identity: [scan_name]
"} + Target: [target_name]
+ Confirm Identity: [scan_name]
"} else header += {"

- Remove [target_name] || - Remove [scan_name]
+ Remove [target_name] || + Remove [scan_name]
Access Crew Manifest
Log Out
"} header += "
" - var/body - if (authenticated && modify) + if (authenticated && inserted_modify_id) var/list/carddesc = list() var/list/jobs = list() if (authenticated == 2) @@ -286,7 +258,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) if(istype(src, /obj/machinery/computer/card/centcom)) // REE 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), " ", " ")] " @@ -304,7 +276,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) continue accesses += "
JobSlots Open 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), " ", " ")] " @@ -336,50 +308,60 @@ 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) + GLOB.data_core.manifest_modify(inserted_modify_id.registered_name, inserted_modify_id.assignment) + inserted_modify_id.update_label() + region_access = null + head_subordinates = null + id_eject(usr, inserted_modify_id) + inserted_modify_id = null + authenticated = FALSE + if ("inserted_scan_id") + if (inserted_scan_id) + id_eject(usr, inserted_scan_id) + inserted_scan_id = null + authenticated = FALSE 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 region_access |= 6 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(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"]) @@ -387,20 +369,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 @@ -414,30 +396,30 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) to_chat(usr, "No log exists for this job.") updateUsrDialog() return - if(modify.registered_account) - modify.registered_account.account_job = jobdatum // this is a terrible idea and people will grief but sure whatever + if(inserted_modify_id.registered_account) + inserted_modify_id.registered_account.account_job = jobdatum // this is a terrible idea and people will grief but sure whatever - 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) - modify.update_label() + 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) + inserted_modify_id.update_label() if ("demote") - if(modify.assignment in head_subordinates || modify.assignment == "Assistant") - modify.assignment = "Unassigned" - playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) - modify.update_label() + 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) + inserted_modify_id.update_label() 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) - modify.update_label() + inserted_modify_id.registered_name = newName + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) + inserted_modify_id.update_label() else to_chat(usr, "Invalid name entered.") updateUsrDialog() @@ -452,7 +434,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) 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) @@ -465,11 +447,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) @@ -483,11 +465,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) @@ -504,7 +486,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 )) @@ -517,56 +499,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) - 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.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/communications.dm b/code/game/machinery/computer/communications.dm index a428115c695..b87a24f2073 100755 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -6,7 +6,6 @@ icon_keyboard = "tech_key" req_access = list(ACCESS_HEADS) circuit = /obj/item/circuitboard/computer/communications - var/authenticated = 0 var/auth_id = "Unknown" //Who is currently logged in? var/list/datum/comm_message/messages = list() var/datum/comm_message/currmsg diff --git a/code/game/machinery/computer/gulag_teleporter.dm b/code/game/machinery/computer/gulag_teleporter.dm index ca72f9bdd19..c8599071214 100644 --- a/code/game/machinery/computer/gulag_teleporter.dm +++ b/code/game/machinery/computer/gulag_teleporter.dm @@ -7,7 +7,6 @@ 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 @@ -20,21 +19,17 @@ scan_machinery() /obj/machinery/computer/gulag_teleporter_computer/Destroy() - if(id) - id.forceMove(get_turf(src)) + if(inserted_prisoner_id) + inserted_prisoner_id.forceMove(get_turf(src)) + inserted_prisoner_id = null 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/attackby(obj/item/I, mob/user) + if(istype(I, /obj/item/card/id)) + id_insert(user, I, inserted_prisoner_id) + inserted_prisoner_id = I + else + 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) @@ -52,7 +47,7 @@ if(teleporter && (teleporter.occupant && ishuman(teleporter.occupant))) prisoner = teleporter.occupant prisoner_list["name"] = prisoner.real_name - if(id) + if(inserted_prisoner_id) can_teleport = TRUE if(!isnull(GLOB.data_core.general)) for(var/r in GLOB.data_core.security) @@ -71,15 +66,16 @@ 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 + if(inserted_prisoner_id) + data["id"] = inserted_prisoner_id + data["id_name"] = inserted_prisoner_id.registered_name + data["goal"] = inserted_prisoner_id.goal data["can_teleport"] = can_teleport return data /obj/machinery/computer/gulag_teleporter_computer/ui_act(action, list/params) + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) if(..()) return if(!allowed(usr)) @@ -91,24 +87,18 @@ 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(inserted_prisoner_id) + id_eject(usr, inserted_prisoner_id) + inserted_prisoner_id = null if("set_goal") - var/new_goal = input("Set the amount of points:", "Points", id.goal) as num|null + var/new_goal = input("Set the amount of points:", "Points", inserted_prisoner_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 + inserted_prisoner_id.goal = CLAMP(new_goal, 0, 1000) //maximum 1000 points if("toggle_open") if(teleporter.locked) to_chat(usr, "The teleporter is locked") @@ -140,16 +130,16 @@ 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. + if(!inserted_prisoner_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) + if(!inserted_prisoner_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) + inserted_prisoner_id.goal = default_goal + say("[inserted_prisoner_id]'s ID card goal defaulting to [inserted_prisoner_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 ":""][inserted_prisoner_id.goal] points.") + teleporter.handle_prisoner(inserted_prisoner_id, temporary_record) playsound(src, 'sound/weapons/emitter.ogg', 50, 1) prisoner.forceMove(get_turf(beacon)) prisoner.Paralyze(40) // small travel dizziness @@ -159,5 +149,5 @@ if(teleporter.locked) teleporter.locked = FALSE teleporter.toggle_open() - id = null + inserted_prisoner_id = null temporary_record = null diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index ea93fe27a1a..3b1740fb639 100644 --- a/code/game/machinery/computer/law.dm +++ b/code/game/machinery/computer/law.dm @@ -5,7 +5,7 @@ icon_screen = "command" var/obj/item/gps/internal/ai_upload/embedded_gps var/obj/item/gps/internal/ai_upload/embedded_gps_type = /obj/item/gps/internal/ai_upload - time_to_scewdrive = 60 + time_to_screwdrive = 60 /obj/item/gps/internal/ai_upload icon_state = null diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index aea8961c732..bf2b7a81a4b 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -7,8 +7,6 @@ icon_keyboard = "med_key" req_one_access = list(ACCESS_MEDICAL, ACCESS_FORENSICS_LOCKERS) circuit = /obj/item/circuitboard/computer/med_data - var/obj/item/card/id/scan = null - var/authenticated = null var/rank = null var/screen = null var/datum/data/record/active1 @@ -25,22 +23,14 @@ /obj/machinery/computer/med_data/syndie icon_keyboard = "syndie_key" -/obj/machinery/computer/med_data/attackby(obj/item/O, mob/user, params) - if(istype(O, /obj/item/card/id) && !scan) - if(!user.transferItemToLoc(O, src)) - return - scan = O - to_chat(user, "You insert [O].") - else - return ..() - /obj/machinery/computer/med_data/ui_interact(mob/user) . = ..() + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) var/dat if(temp) dat = text("[temp]

Clear Screen") else - dat = text("Confirm Identity: []
", (src.scan ? text("[]", src.scan.name) : "----------")) + dat = text("Confirm Identity: []
", (src.inserted_scan_id ? text("[]", src.inserted_scan_id.name) : "----------")) if(src.authenticated) switch(src.screen) if(1) @@ -205,21 +195,16 @@ usr.set_machine(src) if(href_list["temp"]) src.temp = null - if(href_list["scan"]) - if(src.scan) - usr.put_in_hands(scan) - scan = null - else - var/obj/item/I = usr.is_holding_item_of_type(/obj/item/card/id) - if(I) - if(!usr.transferItemToLoc(I, src)) - return - src.scan = I + if(href_list["inserted_scan_id"]) + if(inserted_scan_id) + id_eject(usr, inserted_scan_id) + inserted_scan_id = null else if(href_list["logout"]) src.authenticated = null src.screen = null src.active1 = null src.active2 = null + playsound(src, 'sound/machines/terminal_off.ogg', 50, FALSE) else if(href_list["choice"]) // SORTING! if(href_list["choice"] == "Sorting") @@ -246,13 +231,16 @@ src.authenticated = 1 src.rank = "Central Command" src.screen = 1 - else if(istype(src.scan, /obj/item/card/id)) + else if(istype(src.inserted_scan_id, /obj/item/card/id)) src.active1 = null src.active2 = null - if(src.check_access(src.scan)) - src.authenticated = src.scan.registered_name - src.rank = src.scan.assignment + if(src.check_access(src.inserted_scan_id)) + src.authenticated = src.inserted_scan_id.registered_name + src.rank = src.inserted_scan_id.assignment src.screen = 1 + else + to_chat(usr, "Unauthorized access.") + playsound(src, 'sound/machines/terminal_on.ogg', 50, FALSE) if(src.authenticated) if(href_list["screen"]) diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index 798b0e4c650..e09de45fdb5 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -10,22 +10,22 @@ var/timeleft = 60 var/stop = 0 var/screen = 0 // 0 - No Access Denied, 1 - Access allowed - var/obj/item/card/id/prisoner/inserted_id circuit = /obj/item/circuitboard/computer/prisoner light_color = LIGHT_COLOR_RED /obj/machinery/computer/prisoner/ui_interact(mob/user) . = ..() + playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, FALSE) var/dat = "" if(screen == 0) - dat += "
Unlock Console" + dat += "
{Log In}" else if(screen == 1) dat += "

Prisoner ID Management

" - if(inserted_id) - dat += text("[inserted_id]
") - dat += text("Collected Points: [inserted_id.points]. Reset.
") - dat += text("Card goal: [inserted_id.goal]. Set
") + if(inserted_prisoner_id) + dat += text("[inserted_prisoner_id]
") + dat += text("Collected Points: [inserted_prisoner_id.points]. Reset.
") + dat += text("Card goal: [inserted_prisoner_id.goal]. Set
") dat += text("Space Law recommends quotas of 100 points per minute they would normally serve in the brig.
") else dat += text("Insert Prisoner ID.
") @@ -61,7 +61,7 @@ dat += "ID: [T.imp_in.name] | Location: [loc_display]
" dat += "(Message Holder) |
" dat += "********************************
" - dat += "
Lock Console" + dat += "
{Log Out}" var/datum/browser/popup = new(user, "computer", "Prisoner Management Console", 400, 500) popup.set_content(dat) popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) @@ -70,7 +70,11 @@ /obj/machinery/computer/prisoner/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/card/id)) - return attack_hand(user) + if(screen) + id_insert(user, I, inserted_prisoner_id) + inserted_prisoner_id = I + else + to_chat(user, "Unauthorized access.") else return ..() @@ -79,7 +83,6 @@ src.updateDialog() return - /obj/machinery/computer/prisoner/Topic(href, href_list) if(..()) return @@ -87,27 +90,25 @@ usr.set_machine(src) if(href_list["id"]) - if(href_list["id"] =="insert" && !inserted_id) + if(href_list["id"] =="insert" && !inserted_prisoner_id) var/obj/item/card/id/prisoner/I = usr.is_holding_item_of_type(/obj/item/card/id/prisoner) if(I) - if(!usr.transferItemToLoc(I, src)) - return - inserted_id = I + id_insert(usr, I, inserted_prisoner_id) + inserted_prisoner_id = I else to_chat(usr, "No valid ID.") - else if(inserted_id) + else if(inserted_prisoner_id) switch(href_list["id"]) if("eject") - inserted_id.forceMove(drop_location()) - inserted_id.verb_pickup() - inserted_id = null + id_eject(usr, inserted_prisoner_id) + inserted_prisoner_id = null if("reset") - inserted_id.points = 0 + inserted_prisoner_id.points = 0 if("setgoal") var/num = round(input(usr, "Choose prisoner's goal:", "Input an Integer", null) as num|null) if(num >= 0) num = min(num,1000) //Cap the quota to the equivilent of 10 minutes. - inserted_id.goal = num + inserted_prisoner_id.goal = num else if(href_list["inject1"]) var/obj/item/implant/I = locate(href_list["inject1"]) in GLOB.tracked_chem_implants if(I && istype(I)) @@ -116,7 +117,6 @@ var/obj/item/implant/I = locate(href_list["inject5"]) in GLOB.tracked_chem_implants if(I && istype(I)) I.activate(5) - else if(href_list["inject10"]) var/obj/item/implant/I = locate(href_list["inject10"]) in GLOB.tracked_chem_implants if(I && istype(I)) @@ -125,8 +125,9 @@ else if(href_list["lock"]) if(src.allowed(usr)) screen = !screen + playsound(src, 'sound/machines/terminal_on.ogg', 50, FALSE) else - to_chat(usr, "Unauthorized Access.") + to_chat(usr, "Unauthorized access.") else if(href_list["warn"]) var/warning = copytext(sanitize(input(usr,"Message:","Enter your message here!","")),1,MAX_MESSAGE_LEN) diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 5532ce3a1fe..f63f9be671e 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -5,8 +5,6 @@ icon_keyboard = "security_key" req_one_access = list(ACCESS_SECURITY, ACCESS_FORENSICS_LOCKERS) circuit = /obj/item/circuitboard/computer/secure_data - var/obj/item/card/id/scan = null - var/authenticated = null var/rank = null var/screen = null var/datum/data/record/active1 = null @@ -24,11 +22,6 @@ light_color = LIGHT_COLOR_RED -/obj/machinery/computer/secure_data/examine(mob/user) - . = ..() - if(scan) - . += "Alt-click to eject the ID card." - /obj/machinery/computer/secure_data/syndie icon_keyboard = "syndie_key" @@ -41,23 +34,17 @@ clockwork = TRUE //it'd look weird pass_flags = PASSTABLE -/obj/machinery/computer/secure_data/attackby(obj/item/O, mob/user, params) - if(istype(O, /obj/item/card/id)) - if(!scan) - if(!user.transferItemToLoc(O, src)) - return - scan = O - to_chat(user, "You insert [O].") - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) - updateUsrDialog() - else - to_chat(user, "There's already an ID card in the console.") +/obj/machinery/computer/secure_data/attackby(obj/item/I, mob/user, params) + if(istype(I, /obj/item/card/id)) + id_insert(user, I, inserted_scan_id) + inserted_scan_id = I else return ..() //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(src.z > 6) to_chat(user, "Unable to establish a connection: \black You're too far away from the station!") return @@ -66,7 +53,7 @@ if(temp) dat = text("[]

Clear Screen", temp) else - dat = text("Confirm Identity: []
", (scan ? text("[]", scan.name) : "----------")) + dat = text("Confirm Identity: []
", (inserted_scan_id ? text("[]", inserted_scan_id.name) : "----------")) if(authenticated) switch(screen) if(1) @@ -337,13 +324,16 @@ What a mess.*/ active2 = null if("Confirm Identity") - eject_id(usr) - + if(inserted_scan_id) + id_eject(usr, inserted_scan_id) + inserted_scan_id = null + return if("Log Out") authenticated = null screen = null active1 = null active2 = null + playsound(src, 'sound/machines/terminal_off.ogg', 50, FALSE) if("Log In") if(issilicon(usr)) @@ -359,13 +349,17 @@ What a mess.*/ authenticated = usr.client.holder.admin_signature rank = "Central Command" screen = 1 - else if(istype(scan, /obj/item/card/id)) + else if(istype(inserted_scan_id, /obj/item/card/id)) active1 = null active2 = null - if(check_access(scan)) - authenticated = scan.registered_name - rank = scan.assignment + if(check_access(inserted_scan_id)) + authenticated = inserted_scan_id.registered_name + rank = inserted_scan_id.assignment screen = 1 + else + to_chat(usr, "Unauthorized Access.") + playsound(src, 'sound/machines/terminal_on.ogg', 50, FALSE) + //RECORD FUNCTIONS if("Record Maintenance") screen = 2 @@ -922,23 +916,3 @@ What a mess.*/ if(!record2 || record2 == active2) return 1 return 0 - -/obj/machinery/computer/secure_data/AltClick(mob/user) - if(user.canUseTopic(src, !issilicon(user))) - eject_id(user) - -/obj/machinery/computer/secure_data/proc/eject_id(mob/user) - if(scan) - scan.forceMove(drop_location()) - if(!issilicon(user) && Adjacent(user)) - user.put_in_hands(scan) - scan = null - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) - else //switching the ID with the one you're holding - if(issilicon(user) || !Adjacent(user)) - return - var/obj/item/card/id/held_id = user.is_holding_item_of_type(/obj/item/card/id) - if(QDELETED(held_id) || !user.transferItemToLoc(held_id, src)) - return - scan = held_id - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) diff --git a/code/game/machinery/computer/warrant.dm b/code/game/machinery/computer/warrant.dm index bba959788c7..40af4ef0efc 100644 --- a/code/game/machinery/computer/warrant.dm +++ b/code/game/machinery/computer/warrant.dm @@ -5,7 +5,6 @@ icon_keyboard = "security_key" circuit = /obj/item/circuitboard/computer/warrant light_color = LIGHT_COLOR_RED - var/authenticated = null var/screen = null var/datum/data/record/current = null diff --git a/code/game/machinery/gulag_item_reclaimer.dm b/code/game/machinery/gulag_item_reclaimer.dm index 03f9f14531f..4f1ce5d874a 100644 --- a/code/game/machinery/gulag_item_reclaimer.dm +++ b/code/game/machinery/gulag_item_reclaimer.dm @@ -9,7 +9,6 @@ idle_power_usage = 100 active_power_usage = 2500 var/list/stored_items = list() - var/obj/item/card/id/prisoner/inserted_id = null var/obj/machinery/gulag_teleporter/linked_teleporter = null /obj/machinery/gulag_item_reclaimer/Destroy() @@ -18,9 +17,9 @@ I.forceMove(get_turf(src)) if(linked_teleporter) linked_teleporter.linked_reclaimer = null - if(inserted_id) - inserted_id.forceMove(get_turf(src)) - inserted_id = null + if(inserted_prisoner_id) + inserted_prisoner_id.forceMove(get_turf(src)) + inserted_prisoner_id = null return ..() /obj/machinery/gulag_item_reclaimer/emag_act(mob/user) @@ -31,15 +30,10 @@ /obj/machinery/gulag_item_reclaimer/attackby(obj/item/I, mob/user) if(istype(I, /obj/item/card/id)) - if(!inserted_id) - if(!user.transferItemToLoc(I, src)) - return - inserted_id = I - to_chat(user, "You insert [I].") - return - else - to_chat(user, "There's an ID inserted already.") - return ..() + id_insert(user, I, inserted_prisoner_id) + inserted_prisoner_id = I + else + return ..() /obj/machinery/gulag_item_reclaimer/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) @@ -55,10 +49,10 @@ if(allowed(user)) can_reclaim = TRUE - if(inserted_id) - data["id"] = inserted_id - data["id_name"] = inserted_id.registered_name - if(inserted_id.points >= inserted_id.goal) + if(inserted_prisoner_id) + data["id"] = inserted_prisoner_id + data["id_name"] = inserted_prisoner_id.registered_name + if(inserted_prisoner_id.points >= inserted_prisoner_id.goal) can_reclaim = TRUE var/list/mobs = list() @@ -83,19 +77,12 @@ /obj/machinery/gulag_item_reclaimer/ui_act(action, list/params) switch(action) if("handle_id") - if(inserted_id) - usr.put_in_hands(inserted_id) - inserted_id = null - else - var/obj/item/I = usr.is_holding_item_of_type(/obj/item/card/id) - if(I) - if(!usr.transferItemToLoc(I, src)) - return - inserted_id = I - + if(inserted_prisoner_id) + id_eject(usr, inserted_prisoner_id) + inserted_prisoner_id = null if("release_items") var/mob/living/carbon/human/H = locate(params["mobref"]) in stored_items - if ((H == usr || allowed(usr)) && inserted_id) + if ((H == usr || allowed(usr)) && inserted_prisoner_id) var/obj/item/card/id/target_id if (stored_items[H]) idloop: @@ -110,13 +97,13 @@ target_id = potential_id break idloop if (target_id) - target_id.registered_account.adjust_money(inserted_id.points * 0.5) + target_id.registered_account.adjust_money(inserted_prisoner_id.points * 0.5) var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_SEC) if(D) - D.adjust_money(inserted_id.points * 0.5) + D.adjust_money(inserted_prisoner_id.points * 0.5) else - new /obj/item/holochip(drop_location(), inserted_id.points) - to_chat(usr, "An ID with your bank account registration was not located amongst your items, a sum of [inserted_id.points] has been dispensed as holochips.") + new /obj/item/holochip(drop_location(), inserted_prisoner_id.points) + to_chat(usr, "An ID with your bank account registration was not located amongst your items, a sum of [inserted_prisoner_id.points] has been dispensed as holochips.") drop_items(H) else to_chat(usr, "Access denied.") diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm index b3637bb3c1c..c2f3ed3a29f 100644 --- a/code/modules/mining/laborcamp/laborstacker.dm +++ b/code/modules/mining/laborcamp/laborstacker.dm @@ -10,12 +10,10 @@ GLOBAL_LIST(labor_sheet_values) density = FALSE var/obj/machinery/mineral/stacking_machine/laborstacker/stacking_machine = null var/machinedir = SOUTH - var/obj/item/card/id/prisoner/inserted_id var/obj/machinery/door/airlock/release_door var/door_tag = "prisonshuttle" var/obj/item/radio/Radio //needed to send messages to sec radio - /obj/machinery/mineral/labor_claim_console/Initialize() . = ..() Radio = new/obj/item/radio(src) @@ -35,16 +33,11 @@ GLOBAL_LIST(labor_sheet_values) return a["value"] - b["value"] /obj/machinery/mineral/labor_claim_console/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/card/id/prisoner)) - if(!inserted_id) - if(!user.transferItemToLoc(I, src)) - return - inserted_id = I - to_chat(user, "You insert [I].") - return - else - to_chat(user, "There's an ID inserted already.") - return ..() + if(istype(I, /obj/item/card/id)) + id_insert(user, I, inserted_prisoner_id) + inserted_prisoner_id = I + else + return ..() /obj/machinery/mineral/labor_claim_console/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) @@ -58,11 +51,11 @@ GLOBAL_LIST(labor_sheet_values) var/can_go_home = FALSE data["emagged"] = (obj_flags & EMAGGED) ? 1 : 0 - if(inserted_id) - data["id"] = inserted_id - data["id_name"] = inserted_id.registered_name - data["points"] = inserted_id.points - data["goal"] = inserted_id.goal + if(inserted_prisoner_id) + data["id"] = inserted_prisoner_id + data["id_name"] = inserted_prisoner_id.registered_name + data["points"] = inserted_prisoner_id.points + data["goal"] = inserted_prisoner_id.goal if(check_auth()) can_go_home = TRUE @@ -79,21 +72,11 @@ GLOBAL_LIST(labor_sheet_values) return switch(action) if("handle_id") - if(inserted_id) - if(!usr.get_active_held_item()) - usr.put_in_hands(inserted_id) - inserted_id = null - else - inserted_id.forceMove(get_turf(src)) - inserted_id = null - else - var/obj/item/I = usr.get_active_held_item() - if(istype(I, /obj/item/card/id/prisoner)) - if(!usr.transferItemToLoc(I, src)) - return - inserted_id = I + if(inserted_prisoner_id) + id_eject(usr, inserted_prisoner_id) + inserted_prisoner_id = null if("claim_points") - inserted_id.points += stacking_machine.points + inserted_prisoner_id.points += stacking_machine.points stacking_machine.points = 0 to_chat(usr, "Points transferred.") if("move_shuttle") @@ -110,13 +93,13 @@ GLOBAL_LIST(labor_sheet_values) else if(!(obj_flags & EMAGGED)) Radio.set_frequency(FREQ_SECURITY) - Radio.talk_into(src, "[inserted_id.registered_name] has returned to the station. Minerals and Prisoner ID card ready for retrieval.", FREQ_SECURITY) + Radio.talk_into(src, "[inserted_prisoner_id.registered_name] has returned to the station. Minerals and Prisoner ID card ready for retrieval.", FREQ_SECURITY) to_chat(usr, "Shuttle received message and will be sent shortly.") /obj/machinery/mineral/labor_claim_console/proc/check_auth() if(obj_flags & EMAGGED) return 1 //Shuttle is emagged, let any ol' person through - return (istype(inserted_id) && inserted_id.points >= inserted_id.goal) //Otherwise, only let them out if the prisoner's reached his quota. + return (istype(inserted_prisoner_id) && inserted_prisoner_id.points >= inserted_prisoner_id.goal) //Otherwise, only let them out if the prisoner's reached his quota. /obj/machinery/mineral/labor_claim_console/proc/locate_stacking_machine() stacking_machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir)) @@ -130,10 +113,8 @@ GLOBAL_LIST(labor_sheet_values) obj_flags |= EMAGGED to_chat(user, "PZZTTPFFFT") - /**********************Prisoner Collection Unit**************************/ - /obj/machinery/mineral/stacking_machine/laborstacker force_connect = TRUE var/points = 0 //The unclaimed value of ore stacked. @@ -149,6 +130,7 @@ GLOBAL_LIST(labor_sheet_values) return ..() /**********************Point Lookup Console**************************/ + /obj/machinery/mineral/labor_points_checker name = "points checking console" desc = "A console used by prisoners to check the progress on their quotas. Simply swipe a prisoner ID." diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index e774cd50eb5..4a428cb3b3e 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -13,7 +13,6 @@ speed_process = TRUE circuit = /obj/item/circuitboard/machine/ore_redemption layer = BELOW_OBJ_LAYER - var/obj/item/card/id/inserted_id var/points = 0 var/ore_pickup_rate = 15 var/sheet_per_ore = 1 @@ -75,7 +74,7 @@ else var/mats = O.materials & mat_container.materials var/amount = O.amount - var/id = inserted_id && inserted_id.registered_name + var/id = inserted_scan_id && inserted_scan_id.registered_name if (id) id = " (ID: [id])" mat_container.insert_item(O, sheet_per_ore) //insert it @@ -179,11 +178,11 @@ return ..() if(istype(W, /obj/item/card/id)) var/obj/item/card/id/I = user.get_active_held_item() - if(istype(I) && !istype(inserted_id)) - if(!user.transferItemToLoc(I, src)) - return - inserted_id = I + if(istype(I)) + id_insert(user, I, inserted_prisoner_id) + inserted_prisoner_id = I interact(user) + return return if(istype(W, /obj/item/disk/design_disk)) @@ -215,9 +214,9 @@ /obj/machinery/mineral/ore_redemption/ui_data(mob/user) var/list/data = list() data["unclaimedPoints"] = points - if(inserted_id) + if(inserted_scan_id) data["hasID"] = TRUE - if (inserted_id.registered_account) + if (inserted_scan_id.registered_account) data["hasAccount"] = TRUE data["materials"] = list() @@ -259,22 +258,21 @@ var/datum/component/material_container/mat_container = materials.mat_container switch(action) if("Eject") - if(!inserted_id) + if(!inserted_scan_id) return - usr.put_in_hands(inserted_id) - inserted_id = null + id_eject(usr, inserted_prisoner_id) + inserted_prisoner_id = null return TRUE if("Insert") var/obj/item/card/id/I = usr.get_active_held_item() if(istype(I)) - if(!usr.transferItemToLoc(I,src)) - return - inserted_id = I + id_insert(usr, I, inserted_prisoner_id) + inserted_prisoner_id = I else to_chat(usr, "Not a valid ID!") return TRUE if("Claim") - if(inserted_id && inserted_id.registered_account.adjust_money(points)) + if(inserted_scan_id && inserted_scan_id.registered_account.adjust_money(points)) points = 0 return TRUE if("Release") @@ -283,7 +281,7 @@ if(materials.on_hold()) to_chat(usr, "Mineral access is on hold, please contact the quartermaster.") - else if(!check_access(inserted_id) && !allowed(usr)) //Check the ID inside, otherwise check the user + else if(!check_access(inserted_scan_id) && !allowed(usr)) //Check the ID inside, otherwise check the user to_chat(usr, "Required access not found.") else var/datum/material/mat = locate(params["id"]) @@ -304,7 +302,7 @@ desired = input("How many sheets?", "How many sheets would you like to smelt?", 1) as null|num var/sheets_to_remove = round(min(desired,50,stored_amount)) - + var/count = mat_container.retrieve_sheets(sheets_to_remove, mat, get_step(src, output_dir)) var/list/mats = list() mats[mat] = MINERAL_MATERIAL_AMOUNT @@ -338,7 +336,7 @@ return var/alloy_id = params["id"] var/datum/design/alloy = stored_research.isDesignResearchedID(alloy_id) - if((check_access(inserted_id) || allowed(usr)) && alloy) + if((check_access(inserted_scan_id) || allowed(usr)) && alloy) var/smelt_amount = can_smelt_alloy(alloy) var/desired = 0 if (params["sheets"]) diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm index da6a42a5fb2..9ccfed71e74 100644 --- a/code/modules/mining/machine_vending.dm +++ b/code/modules/mining/machine_vending.dm @@ -63,6 +63,11 @@ var/equipment_path = null var/cost = 0 +/obj/machinery/mineral/equipment_vendor/examine(mob/user) + . = ..() + if(inserted_id) + . += "Alt-click to eject the ID card." + /datum/data/mining_equipment/New(name, path, cost) src.equipment_name = name src.equipment_path = path @@ -105,17 +110,21 @@ if(href_list["choice"]) if(istype(inserted_id)) if(href_list["choice"] == "eject") - to_chat(usr, "You eject the ID from [src]'s card slot.") inserted_id.forceMove(loc) inserted_id.verb_pickup() inserted_id = null + usr.visible_message("[usr] 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) else if(href_list["choice"] == "insert") var/obj/item/card/id/I = usr.get_active_held_item() if(istype(I)) if(!usr.transferItemToLoc(I, src)) return inserted_id = I - to_chat(usr, "You insert the ID into [src]'s card slot.") + usr.visible_message("[usr] 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) else to_chat(usr, "Error: No valid ID!") flick(icon_deny, src) @@ -149,13 +158,18 @@ RedeemVoucher(I, user) return if(istype(I, /obj/item/card/id)) - var/obj/item/card/id/C = usr.get_active_held_item() - if(istype(C) && !istype(inserted_id)) - if(!usr.transferItemToLoc(C, src)) - return - inserted_id = C - to_chat(usr, "You insert the ID into [src]'s card slot.") - interact(user) + var/obj/item/card/id/C = user.get_active_held_item() + if(istype(C)) + if(!inserted_id) + if(!user.transferItemToLoc(C, src)) + return + inserted_id = C + 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) + interact(user) + else + to_chat(user, "There's already an ID card in the console!") return if(default_deconstruction_screwdriver(user, "mining-open", "mining", I)) updateUsrDialog() @@ -200,6 +214,21 @@ if(prob(50 / severity) && severity < 3) qdel(src) +/obj/machinery/mineral/equipment_vendor/AltClick(mob/user) + if(!user.canUseTopic(src, issilicon(user))) + return + if(!inserted_id) + to_chat(user, "There's no ID card in the console!") + if(inserted_id) + inserted_id.forceMove(drop_location()) + if(!issilicon(user) && Adjacent(user)) + user.put_in_hands(inserted_id) + inserted_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() + /****************Golem Point Vendor**************************/