/* * Card -- the identification computer * * Used to alter the settings of an ID card * Also provides a crew manifest * */ obj/machinery/computer/card name = "Identification Computer" icon = 'stationobjs.dmi' icon_state = "id_computer" var obj/item/weapon/card/id/scan = null // The ID card used to authenticate // Must be assigned to Captain or Head of Personnel obj/item/weapon/card/id/modify = null // The ID card to modify authenticated = 0 // true if Capt/HoP card is authenticated mode = 0 // 0 = show card edit, 1 = show crew manifest printing = null // true if printing the crew manifest // Attack with object same as interact attackby(obj/I, mob/user) src.attack_hand(user) // Monkey interact same as human attack_paw(mob/user) return src.attack_hand(user) // AI interact attack_ai(mob/user) return src.attack_hand(user) // Human interact. // Show interaction window attack_hand(mob/user) if(stat & (NOPOWER|BROKEN) ) return user.machine = src var/dat if (!( ticker )) return if (src.mode) var/d2 = "Confirm Identity: [(src.scan ? text("[]", src.scan.name) : "----------")]\n[(src.authenticated ? "You are logged in!" :"{Log in}")]" var/d1 = "Please use security Records to modify entries.
" for(var/datum/data/record/t in data_core.general) d1 += "[t.fields["name"]] - [t.fields["rank"]]
" dat = "[d2]
\n
\nCrew Manifest:
\n[d1]\n
\nPrint
\n
\nAccess ID modification console.
\n
" else var/d1 = "{Log in}" if ((src.authenticated && src.modify)) var/vo = null var/va = null var/vl = null var/ve = null switch(src.modify.access_level) if(1.0) vo = "0 1 2 3 4 5" if(2.0) vo = "0 1 2 3 4 5" if(3.0) vo = "0 1 2 3 4 5" if(4.0) vo = "0 1 2 3 4 5" if(5.0) vo = "0 1 2 3 4 5" else vo = "0 1 2 3 4 5" switch(src.modify.lab_access) if(1.0) vl = "0 1 2 3 4 5" if(2.0) vl = "0 1 2 3 4 5" if(3.0) vl = "0 1 2 3 4 5" if(4.0) vl = "0 1 2 3 4 5" if(5.0) vl = "0 1 2 3 4 5" else vl = "0 1 2 3 4 5" switch(src.modify.engine_access) if(1.0) ve = "0 1 2 3 4 5" if(2.0) ve = "0 1 2 3 4 5" if(3.0) ve = "0 1 2 3 4 5" if(4.0) ve = "0 1 2 3 4 5" if(5.0) ve = "0 1 2 3 4 5" else ve = "0 1 2 3 4 5" switch(src.modify.air_access) if(1.0) va = "0 1 2 3 4 5" if(2.0) va = "0 1 2 3 4 5" if(3.0) va = "0 1 2 3 4 5" if(4.0) va = "0 1 2 3 4 5" if(5.0) va = "0 1 2 3 4 5" else va = "0 1 2 3 4 5" var/list/L = list( "Research Assistant", "Staff Assistant", "Medical Assistant", "Technical Assistant", "Engineer", "Forensic Technician", "Research Technician", "Medical Doctor", "Captain", "Security Officer", "Medical Researcher", "Toxin Researcher", "Head of Research", "Head of Personnel", "Station Technician", "Atmospheric Technician", "Unassigned", "Systems", "Custom" ) var/assign = "" if (istype(user, /mob/human) || istype(user, /mob/ai)) var/counter = 1 for(var/t in L) assign += "[t] " counter++ if (counter >= 3) assign += "
" counter = 1 d1 = "[src.modify.name] :
\nGeneral Access Level: [vo]
\nLaboratory Access: [vl]
\nReactor/Engine Access: [ve]
\nMain Systems Access: [va]
\nRegistered: [src.modify.registered ? "[src.modify.registered]" : "{None: Click to modify}"]
\nAssignment: [src.modify.assignment ? "[src.modify.assignment]" : "None"]
\n[assign]
" else var/counter = 1 for(var/t in L) assign += "[stars(t)] " counter++ if (counter >= 4) assign += "
" counter = 1 d1 = "[stars(modify.name)] :
\n[stars("General Access Level:")] [vo]
\n[stars("Laboratory Access:")] [vl]
\n[stars("Reactor/Engine Access:")] [ve]
\n[stars("Main Systems Access:")] [va]
\n[stars("Registered:")] [src.modify.registered ? stars(src.modify.registered) : stars("{None: Click to modify}")]
\n[stars("Assignment:")] [src.modify.assignment ? "[stars(src.modify.assignment)]" : "None"]
\n[assign]
" if (istype(user, /mob/human) || istype(user, /mob/ai)) dat = text("Identification Card Modifier
\nPlease Insert the cards into the slots
\nTarget: []
\nConfirm Identity: []
\n-----------------
\n[]
\n
\n
\nAccess Crew Manifest
\n
", src, (src.modify ? text("[]", src.modify.name) : "----------"), src, (src.scan ? text("[]", src.scan.name) : "----------"), d1, src) else dat = text("[]
\n[]
\n[] []
\n[] []
\n-----------------
\n[]
\n
\n
\n[]
\n
", stars("Identification Card Modifier"), stars("Please Insert the cards into the slots"), stars("Target:"), src, (src.modify ? text("[]", stars(src.modify.name)) : "----------"), stars("Confirm Identity:"), src, (src.scan ? text("[]", stars(src.scan.name)) : "----------"), d1, src, stars("Access Crew Manifest")) user.client_mob() << browse(dat, "window=id_com;size=400x500") // Handle topic links from interaction window Topic(href, href_list) ..() if(stat & (NOPOWER|BROKEN)) usr.client_mob() << browse(null, "window=id_com") return if(usr.restrained() || usr.lying) if (!istype(usr, /mob/ai)) return if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) if (!istype(usr, /mob/ai)) usr.client_mob() << "\red You don't have the dexterity to do this!" return if ((usr.stat || usr.restrained())) if (!istype(usr, /mob/ai)) return if ((get_dist(src, usr) <= 1 && istype(src.loc, /turf)) || (istype(usr, /mob/ai))) usr.machine = src if (href_list["modify"]) if (src.modify) src.modify.name = "[src.modify.registered]'s ID Card ([src.modify.access_level]>[src.modify.lab_access]-[src.modify.engine_access]-[src.modify.air_access])" src.modify.loc = src.loc src.modify = null else var/obj/item/I = usr.equipped() if (istype(I, /obj/item/weapon/card/id)) usr.drop_item() I.loc = src src.modify = I src.authenticated = 0 if (href_list["scan"]) if (src.scan) src.scan.loc = src.loc src.scan = null else var/obj/item/I = usr.equipped() if (istype(I, /obj/item/weapon/card/id)) usr.drop_item() I.loc = src src.scan = I src.authenticated = 0 if (href_list["auth"]) if ((!( src.authenticated ) && (src.scan || (istype(usr, /mob/ai))) && (src.modify || src.mode))) if (istype(usr, /mob/ai)) src.authenticated = 1 else if ((src.scan.assignment == "Captain" || src.scan.assignment == "Head of Personnel")) src.authenticated = 1 else if (!href_list["print"]) if ((!( src.authenticated ) && (istype(usr, /mob/ai))) && (!src.modify)) usr.client_mob() << "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 (href_list["vo"]) if (src.authenticated) var/t1 = text2num(href_list["vo"]) if (t1 == -1.0) t1 = 0 src.modify.access_level = t1 if (href_list["vl"]) if (src.authenticated) var/t1 = text2num(href_list["vl"]) if (t1 == -1.0) t1 = 0 src.modify.lab_access = t1 if (href_list["ve"]) if (src.authenticated) var/t1 = text2num(href_list["ve"]) if (t1 == -1.0) t1 = 0 src.modify.engine_access = t1 if (href_list["va"]) if (src.authenticated) var/t1 = text2num(href_list["va"]) if (t1 == -1.0) t1 = 0 src.modify.air_access = t1 if (href_list["assign"]) if (src.authenticated) var/t1 = href_list["assign"] if(t1 == "Custom") t1 = input("Enter a custom job assignment.","Assignment") src.modify.assignment = t1 if (href_list["reg"]) if (src.authenticated) var/t2 = src.modify var/t1 = input(usr, "What name?", "ID computer", null) as text if ((src.authenticated && src.modify == t2 && get_dist(src, usr) <= 1 && istype(src.loc, /turf))) src.modify.registered = t1 if (href_list["mode"]) src.mode = text2num(href_list["mode"]) if (href_list["print"]) if (!( src.printing )) src.printing = 1 sleep(50) var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( src.loc ) var/t1 = "Crew Manifest:
" for(var/datum/data/record/t in data_core.general) t1 += "[t.fields["name"]] - [t.fields["rank"]]
" P.info = "[t1]" P.name = "paper- 'Crew Manifest'" src.printing = null if (href_list["mode"]) src.authenticated = 0 src.mode = text2num(href_list["mode"]) if (src.modify) src.modify.name = "[src.modify.registered]'s ID Card ([src.modify.access_level]>[src.modify.lab_access]-[src.modify.engine_access]-[src.modify.air_access])" src.updateDialog() src.add_fingerprint(usr) else usr.client_mob() << browse(null, "window=id_com") // Called when area power state changes // Update machione stat and icon_state power_change() if(stat & BROKEN) icon_state = "broken" else if( powered() ) icon_state = initial(icon_state) stat &= ~NOPOWER else spawn(rand(0, 15)) src.icon_state = "id_unpowered" stat |= NOPOWER