"
dat += "| Job | Slots | Open job | Close job | Prioritize |
"
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 += ""
@@ -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 += ""
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"
|