|
|
|
@@ -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,68 @@ 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)<Opened Positions>
|
|
|
|
|
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)
|
|
|
|
|
to_chat(user, "<span class='notice'>Alt-click to eject the ID card.</span>")
|
|
|
|
|
|
|
|
|
|
/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/examine(mob/user)
|
|
|
|
|
. = ..()
|
|
|
|
|
if(inserted_scan_id || inserted_modify_id)
|
|
|
|
|
to_chat(user, "<span class='notice'>Alt-click to eject the ID card.</span>")
|
|
|
|
|
|
|
|
|
|
/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, "<span class='warning'>There's already an ID card in the console!</span>")
|
|
|
|
|
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 +128,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, "<span class='warning'>There's already an ID card in the console!</span>")
|
|
|
|
|
return FALSE
|
|
|
|
|
if(!user.transferItemToLoc(I, src))
|
|
|
|
|
return FALSE
|
|
|
|
|
user.visible_message("<span class='notice'>[user] inserts an ID card into the console.</span>", \
|
|
|
|
|
"<span class='notice'>You insert the ID card into the console.</span>")
|
|
|
|
|
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, "<span class='warning'>There's no ID card in the console!</span>")
|
|
|
|
|
return FALSE
|
|
|
|
|
else
|
|
|
|
|
target.forceMove(drop_location())
|
|
|
|
|
if(!issilicon(user) && Adjacent(user))
|
|
|
|
|
user.put_in_hands(target)
|
|
|
|
|
user.visible_message("<span class='notice'>[user] gets an ID card from the console.</span>", \
|
|
|
|
|
"<span class='notice'>You get the ID card from the console.</span>")
|
|
|
|
|
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 +186,15 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
|
|
|
|
|
dat = "<a href='?src=[REF(src)];choice=return'>Return</a>"
|
|
|
|
|
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 += "<a href='?src=[REF(src)];choice=scan'>[S]</a>"
|
|
|
|
|
dat += "<a href='?src=[REF(src)];choice=inserted_scan_id'>[S]</a>"
|
|
|
|
|
dat += "<table>"
|
|
|
|
|
dat += "<tr><td style='width:25%'><b>Job</b></td><td style='width:25%'><b>Slots</b></td><td style='width:25%'><b>Open job</b></td><td style='width:25%'><b>Close job</b><td style='width:25%'><b>Prioritize</b></td></td></tr>"
|
|
|
|
|
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 +260,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 += "<br><i>Please insert the cards into the slots</i><br>"
|
|
|
|
|
header += "Target: <a href='?src=[REF(src)];choice=modify'>[target_name]</a><br>"
|
|
|
|
|
header += "Confirm Identity: <a href='?src=[REF(src)];choice=scan'>[scan_name]</a><br>"
|
|
|
|
|
header += "Target: <a href='?src=[REF(src)];choice=inserted_modify_id'>[target_name]</a><br>"
|
|
|
|
|
header += "Confirm Identity: <a href='?src=[REF(src)];choice=inserted_scan_id'>[scan_name]</a><br>"
|
|
|
|
|
else
|
|
|
|
|
header += "<div align='center'><br>"
|
|
|
|
|
header += "<a href='?src=[REF(src)];choice=modify'>Remove [target_name]</a> || "
|
|
|
|
|
header += "<a href='?src=[REF(src)];choice=scan'>Remove [scan_name]</a> <br> "
|
|
|
|
|
header += "<a href='?src=[REF(src)];choice=inserted_modify_id'>Remove [target_name]</a> || "
|
|
|
|
|
header += "<a href='?src=[REF(src)];choice=inserted_scan_id'>Remove [scan_name]</a> <br> "
|
|
|
|
|
header += "<a href='?src=[REF(src)];choice=mode;mode_target=1'>Access Crew Manifest</a> <br> "
|
|
|
|
|
header += "<a href='?src=[REF(src)];choice=logout'>Log Out</a></div>"
|
|
|
|
|
|
|
|
|
@@ -262,7 +301,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 +342,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
|
|
|
|
|
if(istype(src, /obj/machinery/computer/card/centcom))
|
|
|
|
|
accesses += "<h5>Central Command:</h5>"
|
|
|
|
|
for(var/A in get_all_centcom_access())
|
|
|
|
|
if(A in modify.access)
|
|
|
|
|
if(A in inserted_modify_id.access)
|
|
|
|
|
accesses += "<a href='?src=[REF(src)];choice=access;access_target=[A];allowed=0'><font color=\"red\">[replacetext(get_centcom_access_desc(A), " ", " ")]</font></a> "
|
|
|
|
|
else
|
|
|
|
|
accesses += "<a href='?src=[REF(src)];choice=access;access_target=[A];allowed=1'>[replacetext(get_centcom_access_desc(A), " ", " ")]</a> "
|
|
|
|
@@ -321,7 +360,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
|
|
|
|
|
continue
|
|
|
|
|
accesses += "<td style='width:14%' valign='top'>"
|
|
|
|
|
for(var/A in get_region_accesses(i))
|
|
|
|
|
if(A in modify.access)
|
|
|
|
|
if(A in inserted_modify_id.access)
|
|
|
|
|
accesses += "<a href='?src=[REF(src)];choice=access;access_target=[A];allowed=0'><font color=\"red\">[replacetext(get_access_desc(A), " ", " ")]</font></a> "
|
|
|
|
|
else
|
|
|
|
|
accesses += "<a href='?src=[REF(src)];choice=access;access_target=[A];allowed=1'>[replacetext(get_access_desc(A), " ", " ")]</a> "
|
|
|
|
@@ -353,52 +392,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, "<span class='warning'>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.</span>")
|
|
|
|
|
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 +459,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 +487,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, "<span class='error'>You are not authorized to demote this position.</span>")
|
|
|
|
|
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, "<span class='error'>Invalid name entered.</span>")
|
|
|
|
|
updateUsrDialog()
|
|
|
|
@@ -462,11 +515,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 +532,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 +550,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 +571,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
|
|
|
|
|
else
|
|
|
|
|
SSjob.prioritized_jobs += j
|
|
|
|
|
to_chat(usr, "<span class='notice'>[j.title] has been successfully [priority ? "prioritized" : "unprioritized"]. Potential employees will notice your request.</span>")
|
|
|
|
|
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 +584,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)
|
|
|
|
|