diff --git a/_maps/map_files/BoxStation/BoxStation.dmm b/_maps/map_files/BoxStation/BoxStation.dmm index a0d765e3..3ffb1606 100644 --- a/_maps/map_files/BoxStation/BoxStation.dmm +++ b/_maps/map_files/BoxStation/BoxStation.dmm @@ -62592,6 +62592,7 @@ /obj/effect/turf_decal/tile/brown{ dir = 1 }, +/obj/machinery/computer/card/minor/qm, /turf/open/floor/plasteel/dark, /area/quartermaster/qm) "tDj" = ( diff --git a/_maps/map_files/Deltastation/DeltaStation2.dmm b/_maps/map_files/Deltastation/DeltaStation2.dmm index cd8b6140..d04c2394 100644 --- a/_maps/map_files/Deltastation/DeltaStation2.dmm +++ b/_maps/map_files/Deltastation/DeltaStation2.dmm @@ -27550,7 +27550,6 @@ /turf/open/floor/plasteel, /area/quartermaster/qm) "aZh" = ( -/obj/structure/table/reinforced, /obj/machinery/light{ dir = 4 }, @@ -27561,6 +27560,9 @@ /obj/effect/turf_decal/tile/brown{ dir = 8 }, +/obj/machinery/computer/card/minor/qm{ + dir = 8 + }, /turf/open/floor/plasteel, /area/quartermaster/qm) "aZi" = ( diff --git a/_maps/map_files/PubbyStation/PubbyStation.dmm b/_maps/map_files/PubbyStation/PubbyStation.dmm index 18c4c646..c15ca5ac 100644 --- a/_maps/map_files/PubbyStation/PubbyStation.dmm +++ b/_maps/map_files/PubbyStation/PubbyStation.dmm @@ -687,7 +687,7 @@ "ank" = (/obj/machinery/computer/card/minor/hos{dir = 8},/turf/open/floor/carpet,/area/crew_quarters/heads/hos) "anl" = (/obj/structure/transit_tube/diagonal,/turf/open/space/basic,/area/space/nearstation) "anm" = (/obj/machinery/door/airlock/maintenance/abandoned{name = "Pete's Speakeasy"; req_access_txt = "0"},/turf/open/floor/plating,/area/maintenance/department/crew_quarters/dorms) -"ann" = (/obj/structure/table,/obj/machinery/requests_console{department = "Cargo Bay"; departmentType = 2; pixel_x = -30},/obj/item/paper_bin{layer = 2.9},/obj/item/pen,/obj/effect/turf_decal/tile/brown{dir = 1},/obj/effect/turf_decal/tile/brown,/obj/effect/turf_decal/tile/brown{dir = 8},/obj/item/book/lorebooks/welcome_to_kinaris,/turf/open/floor/plasteel,/area/quartermaster/qm) +"ann" = (/obj/structure/table,/obj/machinery/requests_console{department = "Cargo Bay"; departmentType = 2; pixel_x = -30},/obj/effect/turf_decal/tile/brown{dir = 1},/obj/effect/turf_decal/tile/brown,/obj/effect/turf_decal/tile/brown{dir = 8},/obj/machinery/computer/card/minor/qm{dir = 1},/turf/open/floor/plasteel,/area/quartermaster/qm) "ano" = (/obj/machinery/button/door{desc = "A remote control-switch for the engineering security doors."; id = "Engineering"; name = "Engineering Lockdown"; pixel_x = -24; pixel_y = -10; req_access_txt = "10"},/obj/machinery/button/door{desc = "A remote control-switch for secure storage."; id = "Secure Storage"; name = "Engineering Secure Storage"; pixel_x = -24; req_access_txt = "11"},/obj/machinery/button/door{id = "atmos"; name = "Atmospherics Lockdown"; pixel_x = -24; pixel_y = 10; req_access_txt = "24"},/obj/structure/table/reinforced,/obj/item/folder/yellow,/obj/item/paper/monitorkey,/obj/item/pen,/obj/effect/turf_decal/tile/yellow{dir = 1},/obj/effect/turf_decal/tile/yellow{dir = 8},/obj/item/book/lorebooks/welcome_to_kinaris,/mob/living/simple_animal/parrot/Poly,/turf/open/floor/plasteel,/area/crew_quarters/heads/chief) "anp" = (/obj/structure/closet/secure_closet/personal,/obj/item/toy/poolnoodle/red,/obj/item/toy/poolnoodle/yellow,/obj/item/toy/poolnoodle/blue,/obj/effect/turf_decal/tile/neutral{dir = 4},/obj/effect/turf_decal/tile/neutral{dir = 1},/turf/open/floor/plasteel,/area/crew_quarters/fitness/pool) "anq" = (/obj/structure/grille/broken,/turf/open/floor/plating,/area/maintenance/department/security/brig) @@ -2943,7 +2943,7 @@ "beG" = (/obj/structure/disposalpipe/segment{dir = 4},/obj/machinery/camera{c_tag = "Bar Starboard"; dir = 1},/obj/machinery/light{light_color = "#c9d3e8"},/turf/open/floor/plasteel/dark,/area/crew_quarters/bar) "beH" = (/obj/machinery/disposal/bin,/obj/structure/disposalpipe/trunk{dir = 8},/obj/effect/turf_decal/tile/neutral{dir = 1},/obj/effect/turf_decal/tile/neutral,/obj/effect/turf_decal/tile/neutral{dir = 4},/obj/effect/turf_decal/tile/neutral{dir = 8},/turf/open/floor/plasteel/dark,/area/crew_quarters/bar) "beI" = (/turf/closed/wall,/area/science/robotics/mechbay) -"beJ" = (/obj/structure/filingcabinet,/obj/effect/turf_decal/tile/brown{dir = 1},/obj/effect/turf_decal/tile/brown{dir = 8},/obj/machinery/keycard_auth{pixel_x = -23; pixel_y = 0},/turf/open/floor/plasteel,/area/quartermaster/qm) +"beJ" = (/obj/effect/turf_decal/tile/brown{dir = 1},/obj/effect/turf_decal/tile/brown{dir = 8},/obj/machinery/keycard_auth{pixel_x = -23; pixel_y = 0},/turf/open/floor/plasteel,/area/quartermaster/qm) "beK" = (/obj/structure/chair/office/dark{dir = 4},/obj/effect/landmark/start/quartermaster,/turf/open/floor/plasteel,/area/quartermaster/qm) "beL" = (/obj/machinery/computer/cargo{dir = 8},/obj/effect/turf_decal/tile/brown,/obj/effect/turf_decal/tile/brown{dir = 4},/turf/open/floor/plasteel,/area/quartermaster/qm) "beM" = (/obj/machinery/mineral/equipment_vendor,/obj/effect/turf_decal/tile/brown{dir = 1},/turf/open/floor/plasteel,/area/quartermaster/miningdock) @@ -2988,7 +2988,7 @@ "bfz" = (/turf/open/floor/plasteel/dark,/area/science/robotics/mechbay) "bfA" = (/obj/machinery/computer/mech_bay_power_console,/obj/structure/cable{icon_state = "0-2"},/turf/open/floor/plasteel/dark,/area/science/robotics/mechbay) "bfB" = (/obj/effect/turf_decal/tile/red{dir = 8},/obj/effect/turf_decal/tile/red{dir = 1},/obj/effect/turf_decal/tile/red,/turf/open/floor/plasteel,/area/security/range) -"bfC" = (/obj/structure/table,/obj/item/clipboard,/obj/machinery/light,/obj/machinery/camera{c_tag = "Cargo Quartermaster's Office"; dir = 1},/obj/machinery/light_switch{pixel_y = -24},/obj/item/cartridge/quartermaster{pixel_x = 6; pixel_y = 5},/obj/item/cartridge/quartermaster,/obj/item/cartridge/quartermaster{pixel_x = -4; pixel_y = 7},/obj/item/coin/silver,/obj/item/stamp/qm,/obj/effect/turf_decal/tile/brown,/obj/effect/turf_decal/tile/brown{dir = 8},/turf/open/floor/plasteel,/area/quartermaster/qm) +"bfC" = (/obj/structure/table,/obj/item/clipboard,/obj/machinery/light,/obj/machinery/camera{c_tag = "Cargo Quartermaster's Office"; dir = 1},/obj/machinery/light_switch{pixel_y = -24},/obj/item/cartridge/quartermaster{pixel_x = 6; pixel_y = 5},/obj/item/cartridge/quartermaster,/obj/item/cartridge/quartermaster{pixel_x = -4; pixel_y = 7},/obj/item/coin/silver,/obj/item/stamp/qm,/obj/effect/turf_decal/tile/brown,/obj/effect/turf_decal/tile/brown{dir = 8},/obj/item/paper_bin{layer = 2.9},/obj/item/pen,/turf/open/floor/plasteel,/area/quartermaster/qm) "bfD" = (/obj/item/radio/intercom{name = "Station Intercom (General)"; pixel_y = -35},/obj/machinery/computer/security/qm{dir = 8},/obj/effect/turf_decal/tile/brown,/obj/effect/turf_decal/tile/brown{dir = 4},/obj/effect/turf_decal/tile/brown{dir = 8},/turf/open/floor/plasteel,/area/quartermaster/qm) "bfE" = (/obj/structure/rack,/obj/item/storage/toolbox/mechanical{pixel_x = -2; pixel_y = -1},/obj/item/pickaxe{pixel_x = 5},/obj/item/shovel{pixel_x = -5},/obj/machinery/camera{c_tag = "Cargo Mining Dock"; dir = 4},/obj/effect/turf_decal/tile/brown{dir = 1},/turf/open/floor/plasteel,/area/quartermaster/miningdock) "bfF" = (/obj/structure/cable{icon_state = "1-2"},/obj/effect/landmark/start/shaft_miner,/obj/structure/disposalpipe/segment,/obj/machinery/atmospherics/pipe/manifold/supply/hidden{dir = 8},/turf/open/floor/plasteel,/area/quartermaster/miningdock) diff --git a/code/__DEFINES/access.dm b/code/__DEFINES/access.dm index c9d545fc..d9eb48d7 100644 --- a/code/__DEFINES/access.dm +++ b/code/__DEFINES/access.dm @@ -64,6 +64,8 @@ #define ACCESS_WEAPONS 66 //Weapon authorization for secbots #define ACCESS_NETWORK 67 //NTnet diagnostics/monitoring software #define ACCESS_CLONING 68 //Cloning room and clone pod ejection +#define ACCESS_ENTER_GENPOP 69 +#define ACCESS_LEAVE_GENPOP 70 //BEGIN CENTCOM ACCESS /*Should leave plenty of room if we need to add more access levels. diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index 2dbc63aa..5f5903e2 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -221,6 +221,8 @@ GLOBAL_LIST_INIT(heavyfootmob, typecacheof(list( #define isitem(A) (istype(A, /obj/item)) +#define isidcard(I) (istype(I, /obj/item/card/id)) + #define isstructure(A) (istype(A, /obj/structure)) #define ismachinery(A) (istype(A, /obj/machinery)) diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 938a4d92..ddb12dd4 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -113,11 +113,6 @@ Class Procs: var/atom/movable/occupant = null var/speed_process = FALSE // Process as fast as possible? var/obj/item/circuitboard/circuit // Circuit to be created and inserted when the machinery is created - var/obj/item/card/id/inserted_scan_id - var/obj/item/card/id/inserted_modify_id - var/list/region_access = null // For the identification console (card.dm) - var/list/head_subordinates = null // For the identification console (card.dm) - var/authenticated = 0 // For the identification console (card.dm) var/interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_SET_MACHINE @@ -472,8 +467,6 @@ Class Procs: . += "It's falling apart!" if(user.research_scanner && component_parts) . += display_parts(user, TRUE) - if(inserted_scan_id || inserted_modify_id) - . += "Alt-click to eject the ID card." //called on machinery construction (i.e from frame to machinery) but not on initialization /obj/machinery/proc/on_construction() @@ -507,77 +500,3 @@ Class Procs: . = . % 9 AM.pixel_x = -8 + ((.%3)*8) AM.pixel_y = -8 + (round( . / 3)*8) - -/obj/machinery/CanPass(atom/movable/mover, turf/target) - . = ..() - if(istype(mover) && (mover.pass_flags & PASSMACHINES)) - return TRUE -/obj/machinery/proc/id_insert_scan(mob/user, obj/item/card/id/I) - I = user.get_active_held_item() - if(istype(I)) - if(inserted_scan_id) - to_chat(user, "There's already an ID card in the console!") - return - if(!user.transferItemToLoc(I, src)) - return - inserted_scan_id = I - user.visible_message("[user] inserts an ID card into the console.", \ - "You insert the ID card into the console.") - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE) - updateUsrDialog() - -/obj/machinery/proc/id_eject_scan(mob/user) - if(!inserted_scan_id) - to_chat(user, "There's no ID card in the console!") - return - if(inserted_scan_id) - inserted_scan_id.forceMove(drop_location()) - if(!issilicon(user) && Adjacent(user)) - user.put_in_hands(inserted_scan_id) - inserted_scan_id = null - user.visible_message("[user] gets an ID card from the console.", \ - "You get the ID card from the console.") - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE) - updateUsrDialog() - -/obj/machinery/proc/id_eject_modify(mob/user) - if(inserted_modify_id) - GLOB.data_core.manifest_modify(inserted_modify_id.registered_name, inserted_modify_id.assignment) - inserted_modify_id.update_label() - inserted_modify_id.forceMove(drop_location()) - if(!issilicon(user) && Adjacent(user)) - user.put_in_hands(inserted_modify_id) - user.visible_message("[user] gets an ID card from the console.", \ - "You get the ID card from the console.") - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE) - inserted_modify_id = null - region_access = null - head_subordinates = null - updateUsrDialog() - -/obj/machinery/proc/id_insert_modify(mob/user) - var/obj/item/card/id/I = user.get_active_held_item() - if(istype(I)) - if(inserted_modify_id) - to_chat(user, "There's already an ID card in the console!") - return - if(!user.transferItemToLoc(I, src)) - return - inserted_modify_id = I - user.visible_message("[user] inserts an ID card into the console.", \ - "You insert the ID card into the console.") - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE) - updateUsrDialog() - -/obj/machinery/AltClick(mob/user) - . = ..() - if(!user.canUseTopic(src, !issilicon(user)) || !is_operational()) - return - if(inserted_modify_id) - id_eject_modify(user) - authenticated = FALSE - return - if(inserted_scan_id) - id_eject_scan(user) - authenticated = FALSE - return diff --git a/code/game/machinery/computer/_computer.dm b/code/game/machinery/computer/_computer.dm index 3c3f0e7f..24824dbb 100644 --- a/code/game/machinery/computer/_computer.dm +++ b/code/game/machinery/computer/_computer.dm @@ -13,6 +13,7 @@ var/icon_keyboard = "generic_key" var/icon_screen = "generic" var/clockwork = FALSE + var/authenticated = FALSE /obj/machinery/computer/Initialize(mapload, obj/item/circuitboard/C) . = ..() diff --git a/code/game/machinery/computer/apc_control.dm b/code/game/machinery/computer/apc_control.dm index d433c557..1101034c 100644 --- a/code/game/machinery/computer/apc_control.dm +++ b/code/game/machinery/computer/apc_control.dm @@ -92,9 +92,7 @@ if(!usr || !usr.canUseTopic(src) || stat || QDELETED(src)) return if(href_list["authenticate"]) - var/obj/item/card/id/ID = usr.get_active_held_item() - if(!istype(ID)) - ID = usr.get_idcard() + var/obj/item/card/id/ID = usr.get_idcard(TRUE) if(ID && istype(ID)) if(check_access(ID)) authenticated = TRUE diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index d008219c..eaecc9a9 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -4,6 +4,11 @@ //increase the slots of many jobs. GLOBAL_VAR_INIT(time_last_changed_position, 0) +#define JOB_ALLOWED 1 +#define JOB_COOLDOWN -2 +#define JOB_MAX_POSITIONS -1 // Trying to reduce the number of slots below that of current holders of that job, or trying to open more slots than allowed +#define JOB_DENIED 0 + /obj/machinery/computer/card name = "identification console" desc = "You can use this to manage jobs and ID access." @@ -11,8 +16,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 @@ -31,75 +34,74 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) "Head of Security", "Chief Engineer", "Research Director", - "Chief Medical Officer") + "Chief Medical Officer", + "Quartermaster") //The scaling factor of max total positions in relation to the total amount of people on board the station in % var/max_relative_positions = 30 //30%: Seems reasonable, limit of 6 @ 20 players //This is used to keep track of opened positions for jobs to allow instant closing //Assoc array: "JobName" = (int) - var/list/opened_positions = list(); + var/list/opened_positions = list() + var/obj/item/card/id/inserted_scan_id + var/obj/item/card/id/inserted_modify_id + var/list/region_access = null + var/list/head_subordinates = null light_color = LIGHT_COLOR_BLUE -/obj/machinery/computer/card/examine(mob/user) - . = ..() - if(scan || modify) - . += "Alt-click to eject the ID card." +/obj/machinery/computer/card/proc/get_jobs() + return get_all_jobs() + +/obj/machinery/computer/card/centcom/get_jobs() + return get_all_centcom_jobs() /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) - else - if(!modify) - if (!user.transferItemToLoc(idcard,src)) - return - modify = idcard - playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, 0) - updateUsrDialog() +/obj/machinery/computer/card/examine(mob/user) + . = ..() + if(inserted_scan_id || inserted_modify_id) + . += "Alt-click to eject the ID card." + +/obj/machinery/computer/card/attackby(obj/I, mob/user, params) + if(isidcard(I)) + if(check_access(I) && !inserted_scan_id) + if(id_insert(user, I, inserted_scan_id)) + inserted_scan_id = I + updateUsrDialog() + else if(id_insert(user, I, inserted_modify_id)) + inserted_modify_id = I + updateUsrDialog() 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) @@ -113,10 +115,10 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) if((job.total_positions <= GLOB.player_list.len * (max_relative_positions / 100))) var/delta = (world.time / 10) - GLOB.time_last_changed_position if((change_position_cooldown < delta) || (opened_positions[job.title] < 0)) - return 1 - return -2 - return -1 - return 0 + return JOB_ALLOWED + return JOB_COOLDOWN + return JOB_MAX_POSITIONS + return JOB_DENIED //Logic check for Topic() if you can close the job /obj/machinery/computer/card/proc/can_close_job(datum/job/job) @@ -125,84 +127,117 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) if(job.total_positions > job.current_positions) var/delta = (world.time / 10) - GLOB.time_last_changed_position if((change_position_cooldown < delta) || (opened_positions[job.title] > 0)) - return 1 - return -2 - return -1 - return 0 + return JOB_ALLOWED + return JOB_COOLDOWN + return JOB_MAX_POSITIONS + return JOB_DENIED + +/obj/machinery/computer/card/proc/id_insert(mob/user, obj/item/inserting_item, obj/item/target) + var/obj/item/card/id/card_to_insert = inserting_item + var/holder_item = FALSE + + if(!isidcard(card_to_insert)) + card_to_insert = inserting_item.RemoveID() + holder_item = TRUE + + if(!card_to_insert || !user.transferItemToLoc(card_to_insert, src)) + return FALSE + + if(target) + if(holder_item && inserting_item.InsertID(target)) + playsound(src, 'sound/machines/terminal_insert_disc.ogg', 50, FALSE) + else + id_eject(user, target) + + user.visible_message("[user] inserts \the [card_to_insert] into \the [src].", + "You insert \the [card_to_insert] into \the [src].") + 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, "That slot is empty!") + return FALSE + else + target.forceMove(drop_location()) + if(!issilicon(user) && Adjacent(user)) + user.put_in_hands(target) + user.visible_message("[user] gets \the [target] from \the [src].", \ + "You get \the [target] from \the [src].") + 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 + updateUsrDialog() + return + if(inserted_scan_id) + if(id_eject(user, inserted_scan_id)) + inserted_scan_id = null + updateUsrDialog() + return /obj/machinery/computer/card/ui_interact(mob/user) . = ..() - - var/dat - if(!SSticker) - return + var/list/dat = list() if (mode == 1) // accessing crew manifest - var/crew = "" + dat += "Crew Manifest:
Please use security record computer to modify entries.

" for(var/datum/data/record/t in sortRecord(GLOB.data_core.general)) - crew += t.fields["name"] + " - " + t.fields["rank"] + "
" - dat = "Crew Manifest:
Please use security record computer to modify entries.

[crew]Print

Access ID modification console.
" + dat += {"[t.fields["name"]] - [t.fields["rank"]]
"} + dat += "Print

Access ID modification console.
" else if(mode == 2) // JOB MANAGEMENT - dat = "Return" - dat += " || Confirm Identity: " - var/S - if(scan) - S = html_encode(scan.name) - else - S = "--------" - dat += "[S]" - dat += "" - dat += "" - var/ID - if(scan && (ACCESS_CHANGE_IDS in scan.access) && !target_dept) - ID = 1 - else - ID = 0 + dat += {"Return +
JobSlotsOpen jobClose jobPrioritize
+ "} for(var/datum/job/job in SSjob.occupations) dat += "" if(job.title in blacklisted) continue - dat += "" - dat += "" - dat += " + + " dat += "
JobSlotsOpen jobClose jobPrioritize
[job.title][job.current_positions]/[job.total_positions]" + dat += {"[job.title][job.current_positions]/[job.total_positions]"} switch(can_open_job(job)) - if(1) - if(ID) + if(JOB_ALLOWED) + if(authenticated == 2) dat += "Open Position
" else dat += "Open Position" - if(-1) - dat += "Denied" - if(-2) + if(JOB_COOLDOWN) var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - GLOB.time_last_changed_position), 1) var/mins = round(time_to_wait / 60) var/seconds = time_to_wait - (60*mins) dat += "Cooldown ongoing: [mins]:[(seconds < 10) ? "0[seconds]" : "[seconds]"]" - if(0) + else dat += "Denied" dat += "
" switch(can_close_job(job)) - if(1) - if(ID) + if(JOB_ALLOWED) + if(authenticated == 2) dat += "Close Position" else dat += "Close Position" - if(-1) - dat += "Denied" - if(-2) + if(JOB_COOLDOWN) var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - GLOB.time_last_changed_position), 1) var/mins = round(time_to_wait / 60) var/seconds = time_to_wait - (60*mins) dat += "Cooldown ongoing: [mins]:[(seconds < 10) ? "0[seconds]" : "[seconds]"]" - if(0) + else dat += "Denied" dat += "" switch(job.total_positions) if(0) dat += "Denied" else - if(ID) + if(authenticated == 2) if(job in SSjob.prioritized_jobs) dat += "Deprioritize" else @@ -216,57 +251,35 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) dat += "
" else - var/header = "" - - var/target_name - var/target_owner - var/target_rank - if(modify) - target_name = html_encode(modify.name) - else - target_name = "--------" - if(modify && modify.registered_name) - target_owner = html_encode(modify.registered_name) - else - target_owner = "--------" - if(modify && modify.assignment) - target_rank = html_encode(modify.assignment) - else - target_rank = "Unassigned" - - var/scan_name - if(scan) - scan_name = html_encode(scan.name) - else - scan_name = "--------" + var/list/header = list() + 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
" - header += "Target: [target_name]
" - header += "Confirm Identity: [scan_name]
" + header += {"
Please insert the cards into the slots
+ Target: [target_name]
+ Confirm Identity: [scan_name]
"} else - header += "

" - header += "Remove [target_name] || " - header += "Remove [scan_name]
" - header += "Access Crew Manifest
" - header += "Log Out
" + header += {"

+ Target: Remove [target_name] || + Confirm Identity: Remove [scan_name]
+ Access Crew Manifest
+ [!target_dept ? "Job Management
" : ""] + Log Out
"} header += "
" - var/jobs_all = "" - var/list/alljobs = list("Unassigned") - alljobs += (istype(src, /obj/machinery/computer/card/centcom)? get_all_centcom_jobs() : get_all_jobs()) + "Custom" - for(var/job in alljobs) - jobs_all += "[replacetext(job, " ", " ")] " //make sure there isn't a line break in the middle of a job - - var/body - if (authenticated && modify) - - var/carddesc = text("") - var/jobs = text("") - if( authenticated == 2) + if (authenticated && inserted_modify_id) + var/list/carddesc = list() + var/list/jobs = list() + if (authenticated == 2) + var/list/jobs_all = list() + for(var/job in (list("Unassigned") + get_jobs() + "Custom")) + jobs_all += "[replacetext(job, " ", " ")] " //make sure there isn't a line break in the middle of a job carddesc += {""} - carddesc += "
" - carddesc += "" - carddesc += "" - carddesc += "registered name: " - carddesc += "" - carddesc += "
" - carddesc += "Assignment: " + carddesc += {"
+ + + registered name: + +
+ Assignment: "} jobs += "[target_rank]" //CHECK THIS @@ -299,18 +312,18 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) carddesc += "registered_name: [target_owner]" jobs += "Assignment: [target_rank] (Demote)" - var/accesses = "" - if(istype(src, /obj/machinery/computer/card/centcom)) + var/list/accesses = list() + 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) - accesses += "[replacetext(get_centcom_access_desc(A), " ", " ")] " + if(A in inserted_modify_id.access) + accesses += "[replacetext(get_centcom_access_desc(A), " ", " ")] " else accesses += "[replacetext(get_centcom_access_desc(A), " ", " ")] " else - accesses += "
Access
" - accesses += "" - accesses += "" + accesses += {"
Access
+
+ "} for(var/i = 1; i <= 7; i++) if(authenticated == 1 && !(i in region_access)) continue @@ -321,24 +334,24 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) continue accesses += "" accesses += "
" for(var/A in get_region_accesses(i)) - if(A in modify.access) - accesses += "[replacetext(get_access_desc(A), " ", " ")] " + if(A in inserted_modify_id.access) + accesses += "[replacetext(get_access_desc(A), " ", " ")] " else accesses += "[replacetext(get_access_desc(A), " ", " ")] " accesses += "
" accesses += "
" - body = "[carddesc]
[jobs]

[accesses]" //CHECK THIS + body = "[carddesc.Join()]
[jobs.Join()]

[accesses.Join()]
" //CHECK THIS - else - body = "{Log in}

" - body += "Access Crew Manifest" + else if (!authenticated) + body = {"Log In

+ Access Crew Manifest

"} if(!target_dept) - body += "

Job Management" + body += "Job Management
" - dat = "[header][body]

" + dat = list("", header.Join(), body, "
") var/datum/browser/popup = new(user, "id_com", src.name, 900, 620) - popup.set_content(dat) + popup.set_content(dat.Join()) popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) popup.open() @@ -353,50 +366,72 @@ 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 && !usr.get_active_held_item()) + if(id_eject(usr, inserted_modify_id)) + inserted_modify_id = null + updateUsrDialog() + return + if(usr.get_id_in_hand()) + var/obj/item/held_item = usr.get_active_held_item() + var/obj/item/card/id/id_to_insert = held_item.GetID() + if(id_insert(usr, held_item, inserted_modify_id)) + inserted_modify_id = id_to_insert + updateUsrDialog() + if ("inserted_scan_id") + if(inserted_scan_id && !usr.get_active_held_item()) + if(id_eject(usr, inserted_scan_id)) + inserted_scan_id = null + updateUsrDialog() + return + if(usr.get_id_in_hand()) + var/obj/item/held_item = usr.get_active_held_item() + var/obj/item/card/id/id_to_insert = held_item.GetID() + if(id_insert(usr, held_item, inserted_scan_id)) + inserted_scan_id = id_to_insert + updateUsrDialog() if ("auth") - if ((!( authenticated ) && (scan || issilicon(usr)) && (modify || mode))) - if (check_access(scan)) + if ((!( authenticated ) && (inserted_scan_id || issilicon(usr)) || 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((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"]) @@ -404,20 +439,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 @@ -428,30 +463,30 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) updateUsrDialog() break if(!jobdatum) - to_chat(usr, "No log exists for this job.") + to_chat(usr, "No log exists for this job.") 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.") + 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.") + to_chat(usr, "Invalid name entered.") updateUsrDialog() return if ("mode") @@ -460,11 +495,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(authenticated && !target_dept) var/edit_job_target = href_list["job"] var/datum/job/j = SSjob.GetJob(edit_job_target) if(!j) @@ -477,11 +512,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(authenticated && !target_dept) var/edit_job_target = href_list["job"] var/datum/job/j = SSjob.GetJob(edit_job_target) if(!j) @@ -495,11 +530,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(authenticated && !target_dept) var/priority_target = href_list["job"] var/datum/job/j = SSjob.GetJob(priority_target) if(!j) @@ -515,8 +550,8 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) return 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) + 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, FALSE) if ("print") if (!( printing )) @@ -529,59 +564,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) @@ -607,7 +592,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) typed_circuit.target_dept = target_dept else target_dept = typed_circuit.target_dept - var/list/dept_list = list("general","security","medical","science","engineering") + var/list/dept_list = list("civilian","security","medical","science","engineering","cargo") name = "[dept_list[target_dept]] department console" /obj/machinery/computer/card/minor/hos @@ -631,3 +616,14 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) icon_screen = "idce" light_color = LIGHT_COLOR_YELLOW + +/obj/machinery/computer/card/minor/qm + target_dept = 6 + icon_screen = "idqm" + + light_color = LIGHT_COLOR_ORANGE + +#undef JOB_ALLOWED +#undef JOB_COOLDOWN +#undef JOB_MAX_POSITIONS +#undef JOB_DENIED diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 2c3d7f63..bfa9a87c 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -70,9 +70,7 @@ if("login") var/mob/M = usr - var/obj/item/card/id/I = M.get_active_held_item() - if(!istype(I)) - I = M.get_idcard() + var/obj/item/card/id/I = M.get_idcard(TRUE) if(I && istype(I)) if(check_access(I)) @@ -431,6 +429,7 @@ return ..() /obj/machinery/computer/communications/emag_act(mob/user) + . = ..() if(obj_flags & EMAGGED) return obj_flags |= EMAGGED @@ -439,6 +438,7 @@ authenticated = 2 to_chat(user, "You scramble the communication routing circuits!") playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0) + return TRUE /obj/machinery/computer/communications/ui_interact(mob/user) . = ..() 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/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index ef47445c..9422a979 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -80,6 +80,7 @@ righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi' item_flags = NO_MAT_REDEMPTION | NOBLUDGEON var/prox_check = TRUE //If the emag requires you to be in range + var/uses = 10 /obj/item/card/emag/bluespace name = "bluespace cryptographic sequencer" @@ -93,39 +94,55 @@ /obj/item/card/emag/afterattack(atom/target, mob/user, proximity) . = ..() var/atom/A = target - if(!proximity && prox_check) + if(!proximity && prox_check || !(isobj(A) || issilicon(A) || isbot(A) || isdrone(A))) + return + if(istype(A, /obj/item/storage) && !(istype(A, /obj/item/storage/lockbox) || istype(A, /obj/item/storage/pod))) return - //Citadel changes: modular code misfiring, so we're bypassing into main code. if(!uses) user.visible_message("[src] emits a weak spark. It's burnt out!") playsound(src, 'sound/effects/light_flicker.ogg', 100, 1) return else if(uses <= 3) playsound(src, 'sound/effects/light_flicker.ogg', 30, 1) //Tiiiiiiny warning sound to let ya know your emag's almost dead - - if(isturf(A)) + if(!A.emag_act(user)) return - if(istype(A,/obj/item/storage/lockbox) || istype(A, /obj/item/storage/pod)) - A.emag_act(user) - uses = max(uses - 1, 0) - if(!uses) - user.visible_message("[src] fizzles and sparks. It seems like it's out of charges.") - playsound(src, 'sound/effects/light_flicker.ogg', 100, 1) - if(istype(A,/obj/item/storage)) - return - if(!(isobj(A) || issilicon(A) || isbot(A) || isdrone(A))) - return - else - A.emag_act(user) - uses = max(uses - 1, 0) - if(!uses) - user.visible_message("[src] fizzles and sparks. It seems like it's out of charges.") - playsound(src, 'sound/effects/light_flicker.ogg', 100, 1) + uses = max(uses - 1, 0) + if(!uses) + user.visible_message("[src] fizzles and sparks. It seems like it's out of charges.") + playsound(src, 'sound/effects/light_flicker.ogg', 100, 1) /obj/item/card/emag/examine(mob/user) . = ..() . += "It has [uses ? uses : "no"] charges left." +/obj/item/card/emag/attackby(obj/item/W, mob/user, params) + if(istype(W, /obj/item/emagrecharge)) + var/obj/item/emagrecharge/ER = W + if(ER.uses) + uses += ER.uses + to_chat(user, "You have added [ER.uses] charges to [src]. It now has [uses] charges.") + playsound(src, "sparks", 100, 1) + ER.uses = 0 + else + to_chat(user, "[ER] has no charges left.") + return + . = ..() + +/obj/item/emagrecharge + name = "electromagnet charging device" + desc = "A small cell with two prongs lazily jabbed into it. It looks like it's made for charging the small batteries found in electromagnetic devices, sadly this can't be recharged like a normal cell." + icon = 'icons/obj/module.dmi' + icon_state = "cell_mini" + item_flags = NOBLUDGEON + var/uses = 5 //Dictates how many charges the device adds to compatible items + +/obj/item/emagrecharge/examine(mob/user) + . = ..() + if(uses) + . += "It can add up to [uses] charges to compatible devices" + else + . += "It has a small, red, blinking light coming from inside of it. It's spent." + /obj/item/card/emagfake desc = "It's a card with a magnetic strip attached to some circuitry. Closer inspection shows that this card is a poorly made replica, with a \"DonkCo\" logo stamped on the back." name = "cryptographic sequencer" @@ -186,6 +203,9 @@ /obj/item/card/id/GetID() return src +/obj/item/card/id/RemoveID() + return src + /* Usage: update_label() @@ -357,12 +377,41 @@ update_label("John Doe", "Clowny") lefthand_file = 'icons/mob/inhands/equipment/idcards_lefthand.dmi' righthand_file = 'icons/mob/inhands/equipment/idcards_righthand.dmi' assignment = "Prisoner" - registered_name = "Scum" + access = list(ACCESS_ENTER_GENPOP) + + //Lavaland labor camp var/goal = 0 //How far from freedom? var/points = 0 + //Genpop + var/sentence = 0 //When world.time is greater than this number, the card will have its ACCESS_ENTER_GENPOP access replaced with ACCESS_LEAVE_GENPOP the next time it's checked, unless this value is 0/null + var/crime= "\[REDACTED\]" -/obj/item/card/id/prisoner/attack_self(mob/user) - to_chat(usr, "You have accumulated [points] out of the [goal] points you need for freedom.") +/obj/item/card/id/prisoner/GetAccess() + if((sentence && world.time >= sentence) || (goal && points >= goal)) + access = list(ACCESS_LEAVE_GENPOP) + return ..() + +/obj/item/card/id/prisoner/process() + if(!sentence) + STOP_PROCESSING(SSobj, src) + return + if(world.time >= sentence) + playsound(loc, 'sound/machines/ping.ogg', 50, 1) + if(isliving(loc)) + to_chat(loc, "[src] buzzes: You have served your sentence! You may now exit prison through the turnstiles and collect your belongings.") + STOP_PROCESSING(SSobj, src) + return + +/obj/item/card/id/prisoner/examine(mob/user) + . = ..() + if(sentence && world.time < sentence) + . += "You're currently serving a sentence for [crime]. [DisplayTimeText(sentence - world.time)] left." + else if(goal) + . += "You have accumulated [points] out of the [goal] points you need for freedom." + else if(!sentence) + . += "You are currently serving a permanent sentence for [crime]." + else + . += "Your sentence is up! You're free!" /obj/item/card/id/prisoner/one name = "Prisoner #13-001" @@ -438,10 +487,60 @@ update_label("John Doe", "Clowny") desc = "A special ID card that allows access to APC terminals." access = list(ACCESS_ENGINE_EQUIP) -/obj/item/card/id/away/snowdin - name = "a perfectly generic identification card" - desc = "A perfectly generic identification card. Looks like it could use some flavor." - icon_state = "centcom" +//Polychromatic Knight Badge + +/obj/item/card/id/knight + var/id_color = "#00FF00" //defaults to green + name = "knight badge" + icon_state = "knight" + desc = "A badge denoting the owner as a knight! It has a strip for swiping like an ID" + +/obj/item/card/id/knight/update_label(newname, newjob) + if(newname || newjob) + name = "[(!newname) ? "knight badge" : "[newname]'s Knight Badge"][(!newjob) ? "" : " ([newjob])"]" + return + + name = "[(!registered_name) ? "knight badge" : "[registered_name]'s Knight Badge"][(!assignment) ? "" : " ([assignment])"]" + +/obj/item/card/id/knight/update_icon() + var/mutable_appearance/id_overlay = mutable_appearance(icon, "knight_overlay") + + if(id_color) + id_overlay.color = id_color + cut_overlays() + + add_overlay(id_overlay) + +/obj/item/card/id/knight/AltClick(mob/living/user) + . = ..() + if(!in_range(src, user)) //Basic checks to prevent abuse + return + if(user.incapacitated() || !istype(user)) + to_chat(user, "You can't do that right now!") + return + if(alert("Are you sure you want to recolor your id?", "Confirm Repaint", "Yes", "No") == "Yes") + var/energy_color_input = input(usr,"","Choose Energy Color",id_color) as color|null + if(!in_range(src, user) || !energy_color_input) + return + if(user.incapacitated() || !istype(user)) + to_chat(user, "You can't do that right now!") + return + id_color = sanitize_hexcolor(energy_color_input, desired_format=6, include_crunch=1) + update_icon() + +/obj/item/card/id/knight/Initialize() + . = ..() + update_icon() + +/obj/item/card/id/knight/examine(mob/user) + . = ..() + . += "Alt-click to recolor it." + +/obj/item/card/id/knight/blue + id_color = "#0000FF" + +/obj/item/card/id/knight/captain + id_color = "#FFD700" /obj/item/card/id/away/snowdin/eng name = "Arctic Station Engineer's ID card" diff --git a/code/game/objects/items/circuitboards/computer_circuitboards.dm b/code/game/objects/items/circuitboards/computer_circuitboards.dm index 335f1da7..832dae31 100644 --- a/code/game/objects/items/circuitboards/computer_circuitboards.dm +++ b/code/game/objects/items/circuitboards/computer_circuitboards.dm @@ -63,7 +63,7 @@ name = "Department Management Console (Computer Board)" build_path = /obj/machinery/computer/card/minor var/target_dept = 1 - var/list/dept_list = list("General","Security","Medical","Science","Engineering") + var/list/dept_list = list("Civilian","Security","Medical","Science","Engineering","Cargo") /obj/item/circuitboard/computer/card/minor/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/screwdriver)) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index c4b86f04..37b8e3ff 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -139,7 +139,7 @@ GLOBAL_LIST_EMPTY(PDAs) var/choice = input(M, "Choose the a reskin for [src]","Reskin Object") as null|anything in GLOB.pda_reskins var/new_icon = GLOB.pda_reskins[choice] - if(QDELETED(src) || isnull(new_icon) || new_icon == icon || M.incapacitated() || !in_range(M,src)) + if(QDELETED(src) || isnull(new_icon) || new_icon == icon || !M.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return icon = new_icon update_icon(FALSE, TRUE) @@ -199,6 +199,18 @@ GLOBAL_LIST_EMPTY(PDAs) /obj/item/pda/GetID() return id +/obj/item/pda/RemoveID() + return do_remove_id() + +/obj/item/pda/InsertID(obj/item/inserting_item) + var/obj/item/card/inserting_id = inserting_item.RemoveID() + if(!inserting_id) + return + insert_id(inserting_id) + if(id == inserting_id) + return TRUE + return FALSE + /obj/item/pda/update_icon(alert = FALSE, new_overlays = FALSE) if(new_overlays) set_new_overlays() @@ -273,7 +285,7 @@ GLOBAL_LIST_EMPTY(PDAs) dat += text("
[id ? "Update PDA Info" : ""]

") dat += "[STATION_TIME_TIMESTAMP("hh:mm:ss")]
" //:[world.time / 100 % 6][world.time / 100 % 10]" - dat += "[time2text(world.realtime, "MMM DD")] [GLOB.year_integer+540]" + dat += "[time2text(world.realtime, "MMM DD")] [GLOB.year_integer]" dat += "

" @@ -687,15 +699,27 @@ GLOBAL_LIST_EMPTY(PDAs) return /obj/item/pda/proc/remove_id() - if(issilicon(usr) || !usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return + do_remove_id(usr) - if (id) - usr.put_in_hands(id) - to_chat(usr, "You remove the ID from the [name].") - id = null - update_icon() +/obj/item/pda/proc/do_remove_id(mob/user) + if(!id) + return + if(user) + user.put_in_hands(id) + to_chat(user, "You remove the ID from the [name].") + else + id.forceMove(get_turf(src)) + + . = id + id = null + update_icon() + + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + if(H.wear_id == src) + H.sec_hud_set_ID() /obj/item/pda/proc/msg_input(mob/living/U = usr) var/t = stripped_input(U, "Please enter message", name) @@ -877,17 +901,27 @@ GLOBAL_LIST_EMPTY(PDAs) if(istype(C)) I = C - if(I && I.registered_name) + if(I?.registered_name) if(!user.transferItemToLoc(I, src)) return FALSE - var/obj/old_id = id - id = I - if(old_id) - user.put_in_hands(old_id) + insert_id(I, user) update_icon() playsound(src, 'sound/machines/button.ogg', 50, 1) return TRUE +/obj/item/pda/proc/insert_id(obj/item/card/id/inserting_id, mob/user) + var/obj/old_id = id + id = inserting_id + if(ishuman(loc)) + var/mob/living/carbon/human/human_wearer = loc + if(human_wearer.wear_id == src) + human_wearer.sec_hud_set_ID() + if(old_id) + if(user) + user.put_in_hands(old_id) + else + old_id.forceMove(get_turf(src)) + // access to status display signals /obj/item/pda/attackby(obj/item/C, mob/user, params) if(istype(C, /obj/item/cartridge) && !cartridge) diff --git a/code/game/objects/items/storage/wallets.dm b/code/game/objects/items/storage/wallets.dm index 0adf4604..0b026e99 100644 --- a/code/game/objects/items/storage/wallets.dm +++ b/code/game/objects/items/storage/wallets.dm @@ -67,6 +67,21 @@ /obj/item/storage/wallet/GetID() return front_id +/obj/item/storage/wallet/RemoveID() + if(!front_id) + return + . = front_id + front_id.forceMove(get_turf(src)) + +/obj/item/storage/wallet/InsertID(obj/item/inserting_item) + var/obj/item/card/inserting_id = inserting_item.RemoveID() + if(!inserting_id) + return FALSE + attackby(inserting_id) + if(inserting_id in contents) + return TRUE + return FALSE + /obj/item/storage/wallet/GetAccess() if(LAZYLEN(combined_access)) return combined_access diff --git a/code/modules/cargo/bounty_console.dm b/code/modules/cargo/bounty_console.dm index 39465df7..e0f97c7c 100644 --- a/code/modules/cargo/bounty_console.dm +++ b/code/modules/cargo/bounty_console.dm @@ -1,5 +1,7 @@ #define PRINTER_TIMEOUT 10 + + /obj/machinery/computer/bounty name = "Kinaris.Co bounty console" desc = "Used to check and claim bounties offered by Kinaris" @@ -24,9 +26,9 @@ for(var/datum/bounty/B in GLOB.bounties_list) if(B.claimed) continue - info += "

[B.name]

" - info += "" + info += {"

[B.name]

+ "} /obj/machinery/computer/bounty/ui_interact(mob/user) . = ..() @@ -34,39 +36,36 @@ if(!GLOB.bounties_list.len) setup_bounties() - var/dat = "" - dat += "Refresh" - dat += "Print Paper" - dat += "

Credits: [SSshuttle.points]

" - dat += {""} - dat += "" + var/list/dat = list({"Refresh + Print Paper +

Credits: [SSshuttle.points]

+
NameDescriptionRewardCompletionStatus
+ "}) for(var/datum/bounty/B in GLOB.bounties_list) - var/background - if(B.can_claim()) - background = "'background-color:#4F7529;'" - else if(B.claimed) - background = "'background-color:#294675;'" + if(B.claimed) + dat += "" + else if(B.can_claim()) + dat += "" else - background = "'background-color:#990000;'" - dat += "" + dat += "" if(B.high_priority) - dat += text("", B.name) - dat += text("", B.description) - dat += text("", B.reward_string()) + dat += {" + + "} else - dat += text("", B.name) - dat += text("", B.description) - dat += text("", B.reward_string()) - dat += text("", B.completion_string()) - if(B.can_claim()) - dat += text("") - else if(B.claimed) - dat += text("") + dat += {" + + "} + dat += "" + if(B.claimed) + dat += "" + else if(B.can_claim()) + dat += "" else - dat += text("") + dat += "" dat += "" dat += "
NameDescriptionRewardCompletionStatus
[]High Priority: [][][B.name]High Priority: [B.description][B.reward_string()][][][][]ClaimClaimed[B.name][B.description][B.reward_string()][B.completion_string()]ClaimedClaimUnclaimedUnclaimed
" - + dat = dat.Join() var/datum/browser/popup = new(user, "bounties", "Kinaris Bounties", 700, 600) popup.set_content(dat) popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state)) @@ -91,4 +90,3 @@ playsound(src, "terminal_type", 25, 0) updateUsrDialog() - diff --git a/code/modules/cargo/console.dm b/code/modules/cargo/console.dm index 1ad0d569..526062d0 100644 --- a/code/modules/cargo/console.dm +++ b/code/modules/cargo/console.dm @@ -3,6 +3,7 @@ desc = "Used to order supplies, approve requests, and control the shuttle." icon_screen = "supply" circuit = /obj/item/circuitboard/computer/cargo + req_access = list(ACCESS_CARGO) var/requestonly = FALSE var/contraband = FALSE var/safety_warning = "For safety reasons, the automated supply shuttle \ @@ -17,6 +18,7 @@ desc = "Used to request supplies from cargo." icon_screen = "request" circuit = /obj/item/circuitboard/computer/cargo/request + req_access = list() requestonly = TRUE /obj/machinery/computer/cargo/Initialize() @@ -36,6 +38,7 @@ . |= EXPORT_EMAG /obj/machinery/computer/cargo/emag_act(mob/user) + . = ..() if(obj_flags & EMAGGED) return user.visible_message("[user] swipes a suspicious card through [src]!", @@ -48,6 +51,8 @@ var/obj/item/circuitboard/computer/cargo/board = circuit board.contraband = TRUE board.obj_flags |= EMAGGED + req_access = list() + return TRUE /obj/machinery/computer/cargo/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) @@ -111,6 +116,9 @@ /obj/machinery/computer/cargo/ui_act(action, params, datum/tgui/ui) if(..()) return + if(!allowed(usr)) + to_chat(usr, "Access denied.") + return if(action != "add" && requestonly) return switch(action) @@ -159,7 +167,7 @@ if(ishuman(usr)) var/mob/living/carbon/human/H = usr name = H.get_authentification_name() - rank = H.get_assignment() + rank = H.get_assignment(hand_first = TRUE) else if(issilicon(usr)) name = usr.real_name rank = "Silicon" diff --git a/code/modules/cargo/expressconsole.dm b/code/modules/cargo/expressconsole.dm index 186b55a6..049ba8c8 100644 --- a/code/modules/cargo/expressconsole.dm +++ b/code/modules/cargo/expressconsole.dm @@ -54,6 +54,7 @@ ..() /obj/machinery/computer/cargo/express/emag_act(mob/living/user) + . = SEND_SIGNAL(src, COMSIG_ATOM_EMAG_ACT) if(obj_flags & EMAGGED) return user.visible_message("[user] swipes a suspicious card through [src]!", @@ -63,6 +64,8 @@ var/obj/item/circuitboard/computer/cargo/board = circuit board.obj_flags |= EMAGGED packin_up() + req_access = list() + return TRUE /obj/machinery/computer/cargo/express/proc/packin_up() // oh shit, I'm sorry meme_pack_data = list() // sorry for what? @@ -153,7 +156,7 @@ if(ishuman(usr)) var/mob/living/carbon/human/H = usr name = H.get_authentification_name() - rank = H.get_assignment() + rank = H.get_assignment(hand_first = TRUE) else if(issilicon(usr)) name = usr.real_name rank = "Silicon" diff --git a/code/modules/jobs/access.dm b/code/modules/jobs/access.dm index b3e9ef2c..29234a2b 100644 --- a/code/modules/jobs/access.dm +++ b/code/modules/jobs/access.dm @@ -35,6 +35,12 @@ /obj/item/proc/GetID() return null +/obj/item/proc/RemoveID() + return null + +/obj/item/proc/InsertID() + return FALSE + /obj/proc/text2access(access_text) . = list() if(!access_text) @@ -121,7 +127,7 @@ return list(ACCESS_CENT_GENERAL, ACCESS_CENT_LIVING, ACCESS_CENT_BAR) /proc/get_all_accesses() - return list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_FORENSICS_LOCKERS, ACCESS_COURT, + return list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_FORENSICS_LOCKERS, ACCESS_COURT, ACCESS_ENTER_GENPOP, ACCESS_LEAVE_GENPOP, ACCESS_MEDICAL, ACCESS_GENETICS, ACCESS_MORGUE, ACCESS_RD, ACCESS_TOX, ACCESS_TOX_STORAGE, ACCESS_CHEMISTRY, ACCESS_ENGINE, ACCESS_ENGINE_EQUIP, ACCESS_MAINT_TUNNELS, ACCESS_EXTERNAL_AIRLOCKS, ACCESS_CHANGE_IDS, ACCESS_AI_UPLOAD, @@ -157,7 +163,7 @@ if(1) //station general return list(ACCESS_KITCHEN,ACCESS_BAR, ACCESS_HYDROPONICS, ACCESS_JANITOR, ACCESS_CHAPEL_OFFICE, ACCESS_CREMATORIUM, ACCESS_LIBRARY, ACCESS_THEATRE, ACCESS_LAWYER) if(2) //security - return list(ACCESS_SEC_DOORS, ACCESS_WEAPONS, ACCESS_SECURITY, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_FORENSICS_LOCKERS, ACCESS_COURT, ACCESS_HOS) + return list(ACCESS_SEC_DOORS, ACCESS_WEAPONS, ACCESS_SECURITY, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_FORENSICS_LOCKERS, ACCESS_COURT, ACCESS_HOS, ACCESS_ENTER_GENPOP, ACCESS_LEAVE_GENPOP) if(3) //medbay return list(ACCESS_MEDICAL, ACCESS_GENETICS, ACCESS_CLONING, ACCESS_MORGUE, ACCESS_CHEMISTRY, ACCESS_VIROLOGY, ACCESS_SURGERY, ACCESS_CMO) if(4) //research @@ -312,6 +318,10 @@ return "Gateway" if(ACCESS_SEC_DOORS) return "Brig" + if(ACCESS_ENTER_GENPOP) + return "Prison Turnstile Entrance" + if(ACCESS_LEAVE_GENPOP) + return "Prison Turnstile Exit" if(ACCESS_MINERAL_STOREROOM) return "Mineral Storage" if(ACCESS_MINISAT) diff --git a/code/modules/jobs/job_types/security.dm b/code/modules/jobs/job_types/security.dm index b2b0271f..4600fce9 100644 --- a/code/modules/jobs/job_types/security.dm +++ b/code/modules/jobs/job_types/security.dm @@ -26,11 +26,11 @@ Head of Security outfit = /datum/outfit/job/hos - access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_COURT, ACCESS_WEAPONS, + access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_COURT, ACCESS_WEAPONS, ACCESS_ENTER_GENPOP, ACCESS_LEAVE_GENPOP, ACCESS_FORENSICS_LOCKERS, ACCESS_MORGUE, ACCESS_MAINT_TUNNELS, ACCESS_ALL_PERSONAL_LOCKERS, ACCESS_RESEARCH, ACCESS_ENGINE, ACCESS_MINING, ACCESS_MEDICAL, ACCESS_CONSTRUCTION, ACCESS_MAILSORTING, ACCESS_HEADS, ACCESS_HOS, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_GATEWAY, ACCESS_MAINT_TUNNELS, ACCESS_MINERAL_STOREROOM) - minimal_access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_COURT, ACCESS_WEAPONS, + minimal_access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_COURT, ACCESS_WEAPONS, ACCESS_ENTER_GENPOP, ACCESS_LEAVE_GENPOP, ACCESS_FORENSICS_LOCKERS, ACCESS_MORGUE, ACCESS_MAINT_TUNNELS, ACCESS_ALL_PERSONAL_LOCKERS, ACCESS_RESEARCH, ACCESS_ENGINE, ACCESS_MINING, ACCESS_MEDICAL, ACCESS_CONSTRUCTION, ACCESS_MAILSORTING, ACCESS_HEADS, ACCESS_HOS, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_GATEWAY, ACCESS_MAINT_TUNNELS, ACCESS_MINERAL_STOREROOM) @@ -94,8 +94,8 @@ Warden outfit = /datum/outfit/job/warden - access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_COURT, ACCESS_MAINT_TUNNELS, ACCESS_MORGUE, ACCESS_WEAPONS, ACCESS_FORENSICS_LOCKERS, ACCESS_MINERAL_STOREROOM) - minimal_access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_COURT, ACCESS_WEAPONS, ACCESS_MINERAL_STOREROOM) //SEE /DATUM/JOB/WARDEN/GET_ACCESS() + access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_COURT, ACCESS_MAINT_TUNNELS, ACCESS_MORGUE, ACCESS_WEAPONS, ACCESS_ENTER_GENPOP, ACCESS_LEAVE_GENPOP, ACCESS_FORENSICS_LOCKERS, ACCESS_MINERAL_STOREROOM) + minimal_access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_COURT, ACCESS_WEAPONS, ACCESS_ENTER_GENPOP, ACCESS_LEAVE_GENPOP, ACCESS_MINERAL_STOREROOM) //SEE /DATUM/JOB/WARDEN/GET_ACCESS() mind_traits = list(TRAIT_LAW_ENFORCEMENT_METABOLISM) blacklisted_quirks = list(/datum/quirk/mute, /datum/quirk/nonviolent, /datum/quirk/paraplegic) @@ -210,8 +210,8 @@ Security Officer outfit = /datum/outfit/job/security - access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_COURT, ACCESS_MAINT_TUNNELS, ACCESS_MORGUE, ACCESS_WEAPONS, ACCESS_FORENSICS_LOCKERS, ACCESS_MINERAL_STOREROOM) - minimal_access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_COURT, ACCESS_WEAPONS, ACCESS_MINERAL_STOREROOM) //BUT SEE /DATUM/JOB/WARDEN/GET_ACCESS() + access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_COURT, ACCESS_MAINT_TUNNELS, ACCESS_MORGUE, ACCESS_WEAPONS, ACCESS_ENTER_GENPOP, ACCESS_LEAVE_GENPOP, ACCESS_FORENSICS_LOCKERS, ACCESS_MINERAL_STOREROOM) + minimal_access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_COURT, ACCESS_WEAPONS, ACCESS_ENTER_GENPOP, ACCESS_LEAVE_GENPOP, ACCESS_MINERAL_STOREROOM) //BUT SEE /DATUM/JOB/WARDEN/GET_ACCESS() mind_traits = list(TRAIT_LAW_ENFORCEMENT_METABOLISM) blacklisted_quirks = list(/datum/quirk/mute, /datum/quirk/nonviolent, /datum/quirk/paraplegic) 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/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 89765081..1f993f38 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -584,7 +584,7 @@ return threatcount //Check for ID - var/obj/item/card/id/idcard = get_idcard() + var/obj/item/card/id/idcard = get_idcard(FALSE) if( (judgement_criteria & JUDGE_IDCHECK) && !idcard && name=="Unknown") threatcount += 4 diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index d489c2e3..6bb9dd6e 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -11,8 +11,8 @@ //gets assignment from ID or ID inside PDA or PDA itself //Useful when player do something with computers -/mob/living/carbon/human/proc/get_assignment(if_no_id = "No id", if_no_job = "No job") - var/obj/item/card/id/id = get_idcard() +/mob/living/carbon/human/proc/get_assignment(if_no_id = "No id", if_no_job = "No job", hand_first = TRUE) + var/obj/item/card/id/id = get_idcard(hand_first) if(id) . = id.assignment else @@ -27,7 +27,7 @@ //gets name from ID or ID inside PDA or PDA itself //Useful when player do something with computers /mob/living/carbon/human/proc/get_authentification_name(if_no_id = "Unknown") - var/obj/item/card/id/id = get_idcard() + var/obj/item/card/id/id = get_idcard(FALSE) if(id) return id.registered_name var/obj/item/pda/pda = wear_id @@ -86,10 +86,15 @@ return //gets ID card object from special clothes slot or null. -/mob/living/carbon/human/get_idcard() - if(wear_id) - return wear_id.GetID() - +/mob/living/carbon/human/get_idcard(hand_first = TRUE) + . = ..() + if(. && hand_first) + return + //Check inventory slots + var/obj/item/card/id/id_card = wear_id?.GetID() + if(!id_card) + id_card = belt?.GetID() + return id_card || . /mob/living/carbon/human/IsAdvancedToolUser() if(HAS_TRAIT(src, TRAIT_MONKEYLIKE)) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 689cb51f..36041b02 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -462,8 +462,8 @@ return sync_lighting_plane_alpha() -/mob/living/simple_animal/get_idcard() - return access_card +/mob/living/simple_animal/get_idcard(hand_first = TRUE) + return ..() || access_card /mob/living/simple_animal/OpenCraftingMenu() if(dextrous) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 1d14e084..4918e378 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -942,10 +942,6 @@ /mob/proc/can_hold_items() return FALSE -/mob/proc/get_idcard() - return - - /mob/vv_get_dropdown() . = ..() . += "---" diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 04a0aa40..80f999f8 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -506,3 +506,17 @@ It's fairly easy to fix if dealing with single letters but not so much with comp . = BLOOD_COLOR_BUG //add more stuff to the switch if you have more blood colors for different types // the defines are in _DEFINES/misc.dm + +//gets ID card object from special clothes slot or null. +/mob/proc/get_idcard(hand_first = TRUE) + var/obj/item/held_item = get_active_held_item() + . = held_item?.GetID() + if(!.) //If so, then check the inactive hand + held_item = get_inactive_held_item() + . = held_item?.GetID() + +/mob/proc/get_id_in_hand() + var/obj/item/held_item = get_active_held_item() + if(!held_item) + return + return held_item.GetID() diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index daaf8a9e..8a8dbbc0 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -157,6 +157,21 @@ return card_slot.GetID() return ..() +/obj/item/modular_computer/RemoveID() + var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD] + if(!card_slot) + return + return card_slot.RemoveID() + +/obj/item/modular_computer/InsertID(obj/item/inserting_item) + var/obj/item/computer_hardware/card_slot/card_slot = all_components[MC_CARD] + if(!card_slot) + return FALSE + var/obj/item/card/inserting_id = inserting_item.RemoveID() + if(!inserting_id) + return FALSE + return card_slot.try_insert(inserting_id) + /obj/item/modular_computer/MouseDrop(obj/over_object, src_location, over_location) var/mob/M = usr if((!istype(over_object, /obj/screen)) && usr.canUseTopic(src)) diff --git a/code/modules/modular_computers/file_system/program.dm b/code/modules/modular_computers/file_system/program.dm index 051b12ea..f74b53dd 100644 --- a/code/modules/modular_computers/file_system/program.dm +++ b/code/modules/modular_computers/file_system/program.dm @@ -97,14 +97,8 @@ card_slot = computer.all_components[MC_CARD] D = card_slot.GetID() var/mob/living/carbon/human/h = user - var/obj/item/card/id/I = h.get_idcard() - var/obj/item/card/id/C = h.get_active_held_item() - if(C) - C = C.GetID() - if(!(C && istype(C))) - C = null - - if(!I && !C && !D) + var/obj/item/card/id/I = h.get_idcard(TRUE) + if(!I && !D) if(loud) to_chat(user, "\The [computer] flashes an \"RFID Error - Unable to scan ID\" warning.") return 0 @@ -112,9 +106,6 @@ if(I) if(access_to_check in I.GetAccess()) return 1 - else if(C) - if(access_to_check in C.GetAccess()) - return 1 else if(D) if(access_to_check in D.GetAccess()) return 1 diff --git a/code/modules/modular_computers/file_system/programs/card.dm b/code/modules/modular_computers/file_system/programs/card.dm index f8372dd2..243ae89d 100644 --- a/code/modules/modular_computers/file_system/programs/card.dm +++ b/code/modules/modular_computers/file_system/programs/card.dm @@ -117,7 +117,7 @@ else if(ishuman(user)) var/mob/living/carbon/human/h = user - user_id_card = h.get_idcard() + user_id_card = h.get_idcard(TRUE) switch(action) if("PRG_switchm") diff --git a/code/modules/modular_computers/hardware/card_slot.dm b/code/modules/modular_computers/hardware/card_slot.dm index 7eef8eb1..c68e1ad1 100644 --- a/code/modules/modular_computers/hardware/card_slot.dm +++ b/code/modules/modular_computers/hardware/card_slot.dm @@ -29,6 +29,17 @@ return stored_card2 return ..() +/obj/item/computer_hardware/card_slot/RemoveID() + if(stored_card) + . = stored_card + if(!try_eject(1)) + return null + return + if(stored_card2) + . = stored_card2 + if(!try_eject(2)) + return null + /obj/item/computer_hardware/card_slot/on_install(obj/item/modular_computer/M, mob/living/user = null) M.add_verb(device_type) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 020b4b29..435db75f 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -57,7 +57,7 @@ var/mob/user = usr . = FALSE - var/obj/item/card/id/ID = user.get_idcard() + var/obj/item/card/id/ID = user.get_idcard(TRUE) if(!ID) to_chat(user, "You don't have an ID.") @@ -93,7 +93,7 @@ minor_announce("Early launch authorization revoked, [remaining] authorizations needed") /obj/machinery/computer/emergency_shuttle/proc/authorize(mob/user, source) - var/obj/item/card/id/ID = user.get_idcard() + var/obj/item/card/id/ID = user.get_idcard(TRUE) if(ID in authorized) return FALSE diff --git a/code/modules/shuttle/special.dm b/code/modules/shuttle/special.dm index 4b3cabd9..4ee94c05 100644 --- a/code/modules/shuttle/special.dm +++ b/code/modules/shuttle/special.dm @@ -199,7 +199,7 @@ if(H.mind && H.mind.assigned_role == "Bartender") return TRUE - var/obj/item/card/id/ID = user.get_idcard() + var/obj/item/card/id/ID = user.get_idcard(FALSE) if(ID && (ACCESS_CENT_BAR in ID.access)) return TRUE diff --git a/icons/obj/computer.dmi b/icons/obj/computer.dmi index c3374e9c..1307f063 100644 Binary files a/icons/obj/computer.dmi and b/icons/obj/computer.dmi differ diff --git a/modular_citadel/code/game/machinery/computer/card.dm b/modular_citadel/code/game/machinery/computer/card.dm deleted file mode 100644 index b9dd049d..00000000 --- a/modular_citadel/code/game/machinery/computer/card.dm +++ /dev/null @@ -1,3 +0,0 @@ -/obj/machinery/computer/card - list/blacklisted = list( - "Quartermaster") diff --git a/modular_citadel/code/game/objects/ids.dm b/modular_citadel/code/game/objects/ids.dm deleted file mode 100644 index 76469547..00000000 --- a/modular_citadel/code/game/objects/ids.dm +++ /dev/null @@ -1,83 +0,0 @@ - -//Polychromatic Knight Badge - -/obj/item/card/id/knight - var/id_color = "#00FF00" //defaults to green - name = "knight badge" - icon = 'modular_citadel/icons/obj/id.dmi' - icon_state = "knight" - desc = "A badge denoting the owner as a knight! It has a strip for swiping like an ID" - -/obj/item/card/id/knight/update_label(newname, newjob) - . = ..() - if(newname || newjob) - name = "[(!newname) ? "identification card" : "[newname]'s Knight Badge"][(!newjob) ? "" : " ([newjob])"]" - return - - name = "[(!registered_name) ? "identification card" : "[registered_name]'s Knight Badge"][(!assignment) ? "" : " ([assignment])"]" - -/obj/item/card/id/knight/update_icon() - var/mutable_appearance/id_overlay = mutable_appearance('modular_citadel/icons/obj/id.dmi', "knight_overlay") - - if(id_color) - id_overlay.color = id_color - cut_overlays() - - add_overlay(id_overlay) - -/obj/item/card/id/knight/AltClick(mob/living/user) - if(!in_range(src, user)) //Basic checks to prevent abuse - return - if(user.incapacitated() || !istype(user)) - to_chat(user, "You can't do that right now!") - return - if(alert("Are you sure you want to recolor your id?", "Confirm Repaint", "Yes", "No") == "Yes") - var/energy_color_input = input(usr,"","Choose Energy Color",id_color) as color|null - if(energy_color_input) - id_color = sanitize_hexcolor(energy_color_input, desired_format=6, include_crunch=1) - update_icon() - -/obj/item/card/id/knight/Initialize() - . = ..() - update_icon() - -/obj/item/card/id/knight/examine(mob/user) - . = ..() - . += "Alt-click to recolor it." - -//================================================= - -/obj/item/emagrecharge - name = "electromagnet charging device" - desc = "A small cell with two prongs lazily jabbed into it. It looks like it's made for charging the small batteries found in electromagnetic devices." - icon = 'icons/obj/module.dmi' - icon_state = "cell_mini" - item_flags = NOBLUDGEON - var/uses = 5 //Dictates how many charges the device adds to compatible items - -/obj/item/emagrecharge/examine(mob/user) - . = ..() - if(uses) - to_chat(user, "It can add up to [uses] charges to compatible devices") - else - to_chat(user, "It has a small, red, blinking light coming from inside of it. It's spent.") - -/obj/item/card/emag - var/uses = 10 - -/obj/item/card/emag/examine(mob/user) - . = ..() - to_chat(user, "It has [uses ? uses : "no"] charges left.") - -/obj/item/card/emag/attackby(obj/item/W, mob/user, params) - if(istype(W, /obj/item/emagrecharge)) - var/obj/item/emagrecharge/ER = W - if(ER.uses) - uses += ER.uses - to_chat(user, "You have added [ER.uses] charges to [src]. It now has [uses] charges.") - playsound(src, "sparks", 100, 1) - ER.uses = 0 - else - to_chat(user, "[ER] has no charges left.") - return - . = ..() diff --git a/tgstation.dme b/tgstation.dme index 77cbdddc..0984a6d5 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" @@ -3065,11 +3064,9 @@ #include "modular_citadel\code\game\machinery\toylathe.dm" #include "modular_citadel\code\game\machinery\vending.dm" #include "modular_citadel\code\game\machinery\wishgranter.dm" -#include "modular_citadel\code\game\machinery\computer\card.dm" #include "modular_citadel\code\game\machinery\doors\airlock.dm" #include "modular_citadel\code\game\machinery\doors\airlock_types.dm" #include "modular_citadel\code\game\objects\cit_screenshake.dm" -#include "modular_citadel\code\game\objects\ids.dm" #include "modular_citadel\code\game\objects\items.dm" #include "modular_citadel\code\game\objects\tools.dm" #include "modular_citadel\code\game\objects\effects\spawner\spawners.dm"