mirror of
https://github.com/KabKebab/GS13.git
synced 2026-02-09 15:17:41 +00:00
Merge pull request #702 from ArchieBeepBoop/idbullshitpart3
Cleaning up ID Console code and other tweaks - The "I want to die" edition
This commit is contained in:
@@ -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" = (
|
||||
|
||||
@@ -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" = (
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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:
|
||||
. += "<span class='warning'>It's falling apart!</span>"
|
||||
if(user.research_scanner && component_parts)
|
||||
. += display_parts(user, TRUE)
|
||||
if(inserted_scan_id || inserted_modify_id)
|
||||
. += "<span class='notice'>Alt-click to eject the ID card.</span>"
|
||||
|
||||
//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, "<span class='warning'>There's already an ID card in the console!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
inserted_scan_id = I
|
||||
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()
|
||||
|
||||
/obj/machinery/proc/id_eject_scan(mob/user)
|
||||
if(!inserted_scan_id)
|
||||
to_chat(user, "<span class='warning'>There's no ID card in the console!</span>")
|
||||
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("<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()
|
||||
|
||||
/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("<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)
|
||||
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, "<span class='warning'>There's already an ID card in the console!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
inserted_modify_id = I
|
||||
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()
|
||||
|
||||
/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
|
||||
|
||||
@@ -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)
|
||||
. = ..()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)<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)
|
||||
. += "<span class='notice'>Alt-click to eject the ID card.</span>"
|
||||
/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)
|
||||
. += "<span class='notice'>Alt-click to eject the ID card.</span>"
|
||||
|
||||
/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("<span class='notice'>[user] inserts \the [card_to_insert] into \the [src].</span>",
|
||||
"<span class='notice'>You insert \the [card_to_insert] into \the [src].</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'>That slot is empty!</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 \the [target] from \the [src].</span>", \
|
||||
"<span class='notice'>You get \the [target] from \the [src].</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
|
||||
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 += "<tt><b>Crew Manifest:</b><br>Please use security record computer to modify entries.<br><br>"
|
||||
for(var/datum/data/record/t in sortRecord(GLOB.data_core.general))
|
||||
crew += t.fields["name"] + " - " + t.fields["rank"] + "<br>"
|
||||
dat = "<tt><b>Crew Manifest:</b><br>Please use security record computer to modify entries.<br><br>[crew]<a href='?src=[REF(src)];choice=print'>Print</a><br><br><a href='?src=[REF(src)];choice=mode;mode_target=0'>Access ID modification console.</a><br></tt>"
|
||||
dat += {"[t.fields["name"]] - [t.fields["rank"]]<br>"}
|
||||
dat += "<a href='?src=[REF(src)];choice=print'>Print</a><br><br><a href='?src=[REF(src)];choice=mode;mode_target=0'>Access ID modification console.</a><br></tt>"
|
||||
|
||||
else if(mode == 2)
|
||||
// JOB MANAGEMENT
|
||||
dat = "<a href='?src=[REF(src)];choice=return'>Return</a>"
|
||||
dat += " || Confirm Identity: "
|
||||
var/S
|
||||
if(scan)
|
||||
S = html_encode(scan.name)
|
||||
else
|
||||
S = "--------"
|
||||
dat += "<a href='?src=[REF(src)];choice=scan'>[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)
|
||||
ID = 1
|
||||
else
|
||||
ID = 0
|
||||
dat += {"<a href='?src=[REF(src)];choice=return'>Return</a>
|
||||
<table><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>"}
|
||||
for(var/datum/job/job in SSjob.occupations)
|
||||
dat += "<tr>"
|
||||
if(job.title in blacklisted)
|
||||
continue
|
||||
dat += "<td>[job.title]</td>"
|
||||
dat += "<td>[job.current_positions]/[job.total_positions]</td>"
|
||||
dat += "<td>"
|
||||
dat += {"<td>[job.title]</td>
|
||||
<td>[job.current_positions]/[job.total_positions]</td>
|
||||
<td>"}
|
||||
switch(can_open_job(job))
|
||||
if(1)
|
||||
if(ID)
|
||||
if(JOB_ALLOWED)
|
||||
if(authenticated == 2)
|
||||
dat += "<a href='?src=[REF(src)];choice=make_job_available;job=[job.title]'>Open Position</a><br>"
|
||||
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 += "</td><td>"
|
||||
switch(can_close_job(job))
|
||||
if(1)
|
||||
if(ID)
|
||||
if(JOB_ALLOWED)
|
||||
if(authenticated == 2)
|
||||
dat += "<a href='?src=[REF(src)];choice=make_job_unavailable;job=[job.title]'>Close Position</a>"
|
||||
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 += "</td><td>"
|
||||
switch(job.total_positions)
|
||||
if(0)
|
||||
dat += "Denied"
|
||||
else
|
||||
if(ID)
|
||||
if(authenticated == 2)
|
||||
if(job in SSjob.prioritized_jobs)
|
||||
dat += "<a href='?src=[REF(src)];choice=prioritize_job;job=[job.title]'>Deprioritize</a>"
|
||||
else
|
||||
@@ -216,57 +251,35 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
|
||||
dat += "</td></tr>"
|
||||
dat += "</table>"
|
||||
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 += "<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 += {"<br><i>Please insert the cards into the slots</i><br>
|
||||
Target: <a href='?src=[REF(src)];choice=inserted_modify_id'>[target_name]</a><br>
|
||||
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=mode;mode_target=1'>Access Crew Manifest</a> <br> "
|
||||
header += "<a href='?src=[REF(src)];choice=logout'>Log Out</a></div>"
|
||||
header += {"<div align='center'><br>
|
||||
Target: <a href='?src=[REF(src)];choice=inserted_modify_id'>Remove [target_name]</a> ||
|
||||
Confirm Identity: <a href='?src=[REF(src)];choice=inserted_scan_id'>Remove [scan_name]</a><br>
|
||||
<a href='?src=[REF(src)];choice=mode;mode_target=1'>Access Crew Manifest</a><br>
|
||||
[!target_dept ? "<a href='?src=[REF(src)];choice=mode;mode_target=2'>Job Management</a><br>" : ""]
|
||||
<a href='?src=[REF(src)];choice=logout'>Log Out</a></div>"}
|
||||
|
||||
header += "<hr>"
|
||||
|
||||
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 += "<a href='?src=[REF(src)];choice=assign;assign_target=[job]'>[replacetext(job, " ", " ")]</a> " //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 += "<a href='?src=[REF(src)];choice=assign;assign_target=[job]'>[replacetext(job, " ", " ")]</a> " //make sure there isn't a line break in the middle of a job
|
||||
carddesc += {"<script type="text/javascript">
|
||||
function markRed(){
|
||||
var nameField = document.getElementById('namefield');
|
||||
@@ -278,20 +291,20 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
|
||||
}
|
||||
function showAll(){
|
||||
var allJobsSlot = document.getElementById('alljobsslot');
|
||||
allJobsSlot.innerHTML = "<a href='#' onclick='hideAll()'>hide</a><br>"+ "[jobs_all]";
|
||||
allJobsSlot.innerHTML = "<a href='#' onclick='hideAll()'>hide</a><br>"+ "[jobs_all.Join()]";
|
||||
}
|
||||
function hideAll(){
|
||||
var allJobsSlot = document.getElementById('alljobsslot');
|
||||
allJobsSlot.innerHTML = "<a href='#' onclick='showAll()'>show</a>";
|
||||
}
|
||||
</script>"}
|
||||
carddesc += "<form name='cardcomp' action='?src=[REF(src)]' method='get'>"
|
||||
carddesc += "<input type='hidden' name='src' value='[REF(src)]'>"
|
||||
carddesc += "<input type='hidden' name='choice' value='reg'>"
|
||||
carddesc += "<b>registered name:</b> <input type='text' id='namefield' name='reg' value='[target_owner]' style='width:250px; background-color:white;' onchange='markRed()'>"
|
||||
carddesc += "<input type='submit' value='Rename' onclick='markGreen()'>"
|
||||
carddesc += "</form>"
|
||||
carddesc += "<b>Assignment:</b> "
|
||||
carddesc += {"<form name='cardcomp' action='?src=[REF(src)]' method='get'>
|
||||
<input type='hidden' name='src' value='[REF(src)]'>
|
||||
<input type='hidden' name='choice' value='reg'>
|
||||
<b>registered name:</b> <input type='text' id='namefield' name='reg' value='[target_owner]' style='width:250px; background-color:white;' onchange='markRed()'>
|
||||
<input type='submit' value='Rename' onclick='markGreen()'>
|
||||
</form>
|
||||
<b>Assignment:</b> "}
|
||||
|
||||
jobs += "<span id='alljobsslot'><a href='#' onclick='showAll()'>[target_rank]</a></span>" //CHECK THIS
|
||||
|
||||
@@ -299,18 +312,18 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
|
||||
carddesc += "<b>registered_name:</b> [target_owner]</span>"
|
||||
jobs += "<b>Assignment:</b> [target_rank] (<a href='?src=[REF(src)];choice=demote'>Demote</a>)</span>"
|
||||
|
||||
var/accesses = ""
|
||||
if(istype(src, /obj/machinery/computer/card/centcom))
|
||||
var/list/accesses = list()
|
||||
if(istype(src, /obj/machinery/computer/card/centcom)) //REE
|
||||
accesses += "<h5>Central Command:</h5>"
|
||||
for(var/A in get_all_centcom_access())
|
||||
if(A in modify.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> "
|
||||
if(A in inserted_modify_id.access)
|
||||
accesses += "<a href='?src=[REF(src)];choice=access;access_target=[A];allowed=0'><font color=\"6bc473\">[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> "
|
||||
else
|
||||
accesses += "<div align='center'><b>Access</b></div>"
|
||||
accesses += "<table style='width:100%'>"
|
||||
accesses += "<tr>"
|
||||
accesses += {"<div align='center'><b>Access</b></div>
|
||||
<table style='width:100%'>
|
||||
<tr>"}
|
||||
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 += "<td style='width:14%' valign='top'>"
|
||||
for(var/A in get_region_accesses(i))
|
||||
if(A in modify.access)
|
||||
accesses += "<a href='?src=[REF(src)];choice=access;access_target=[A];allowed=0'><font color=\"red\">[replacetext(get_access_desc(A), " ", " ")]</font></a> "
|
||||
if(A in inserted_modify_id.access)
|
||||
accesses += "<a href='?src=[REF(src)];choice=access;access_target=[A];allowed=0'><font color=\"6bc473\">[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> "
|
||||
accesses += "<br>"
|
||||
accesses += "</td>"
|
||||
accesses += "</tr></table>"
|
||||
body = "[carddesc]<br>[jobs]<br><br>[accesses]" //CHECK THIS
|
||||
body = "[carddesc.Join()]<br>[jobs.Join()]<br><br>[accesses.Join()]<hr>" //CHECK THIS
|
||||
|
||||
else
|
||||
body = "<a href='?src=[REF(src)];choice=auth'>{Log in}</a> <br><hr>"
|
||||
body += "<a href='?src=[REF(src)];choice=mode;mode_target=1'>Access Crew Manifest</a>"
|
||||
else if (!authenticated)
|
||||
body = {"<a href='?src=[REF(src)];choice=auth'>Log In</a><br><hr>
|
||||
<a href='?src=[REF(src)];choice=mode;mode_target=1'>Access Crew Manifest</a><br><hr>"}
|
||||
if(!target_dept)
|
||||
body += "<br><hr><a href = '?src=[REF(src)];choice=mode;mode_target=2'>Job Management</a>"
|
||||
body += "<a href='?src=[REF(src)];choice=mode;mode_target=2'>Job Management</a><hr>"
|
||||
|
||||
dat = "<tt>[header][body]<hr><br></tt>"
|
||||
dat = list("<tt>", header.Join(), body, "<br></tt>")
|
||||
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, "<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"])
|
||||
@@ -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, "<span class='error'>No log exists for this job.</span>")
|
||||
to_chat(usr, "<span class='alert'>No log exists for this job.</span>")
|
||||
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>")
|
||||
to_chat(usr, "<span class='alert'>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>")
|
||||
to_chat(usr, "<span class='alert'>Invalid name entered.</span>")
|
||||
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, "<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)
|
||||
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, 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
|
||||
|
||||
@@ -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, "<span class='danger'>You scramble the communication routing circuits!</span>")
|
||||
playsound(src, 'sound/machines/terminal_alert.ogg', 50, 0)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/communications/ui_interact(mob/user)
|
||||
. = ..()
|
||||
|
||||
@@ -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, "<span class='notice'>You insert [W].</span>")
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There's an ID inserted already.</span>")
|
||||
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, "<span class='warning'>Access denied.</span>")
|
||||
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, "<span class='warning'>The teleportation makes you a little dizzy.</span>")
|
||||
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
|
||||
@@ -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
|
||||
|
||||
@@ -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, "<span class='boldannounce'>Unable to establish a connection</span>: \black You're too far away from the station!")
|
||||
return
|
||||
|
||||
@@ -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("<span class='warning'>[src] emits a weak spark. It's burnt out!</span>")
|
||||
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("<span class='warning'>[src] fizzles and sparks. It seems like it's out of charges.</span>")
|
||||
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("<span class='warning'>[src] fizzles and sparks. It seems like it's out of charges.</span>")
|
||||
playsound(src, 'sound/effects/light_flicker.ogg', 100, 1)
|
||||
uses = max(uses - 1, 0)
|
||||
if(!uses)
|
||||
user.visible_message("<span class='warning'>[src] fizzles and sparks. It seems like it's out of charges.</span>")
|
||||
playsound(src, 'sound/effects/light_flicker.ogg', 100, 1)
|
||||
|
||||
/obj/item/card/emag/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>It has <b>[uses ? uses : "no"]</b> charges left.</span>"
|
||||
|
||||
/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, "<span class='notice'>You have added [ER.uses] charges to [src]. It now has [uses] charges.</span>")
|
||||
playsound(src, "sparks", 100, 1)
|
||||
ER.uses = 0
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[ER] has no charges left.</span>")
|
||||
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)
|
||||
. += "<span class='notice'>It can add up to [uses] charges to compatible devices</span>"
|
||||
else
|
||||
. += "<span class='warning'>It has a small, red, blinking light coming from inside of it. It's spent.</span>"
|
||||
|
||||
/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, "<span class='notice'>You have accumulated [points] out of the [goal] points you need for freedom.</span>")
|
||||
/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, "<span class='boldnotice'>[src]</span><span class='notice'> buzzes: You have served your sentence! You may now exit prison through the turnstiles and collect your belongings.</span>")
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return
|
||||
|
||||
/obj/item/card/id/prisoner/examine(mob/user)
|
||||
. = ..()
|
||||
if(sentence && world.time < sentence)
|
||||
. += "<span class='notice'>You're currently serving a sentence for [crime]. <b>[DisplayTimeText(sentence - world.time)]</b> left.</span>"
|
||||
else if(goal)
|
||||
. += "<span class='notice'>You have accumulated [points] out of the [goal] points you need for freedom.</span>"
|
||||
else if(!sentence)
|
||||
. += "<span class='warning'>You are currently serving a permanent sentence for [crime].</span>"
|
||||
else
|
||||
. += "<span class='notice'>Your sentence is up! You're free!</span>"
|
||||
|
||||
/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, "<span class='warning'>You can't do that right now!</span>")
|
||||
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, "<span class='warning'>You can't do that right now!</span>")
|
||||
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)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click to recolor it.</span>"
|
||||
|
||||
/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"
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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("<br><a href='?src=[REF(src)];choice=UpdateInfo'>[id ? "Update PDA Info" : ""]</A><br><br>")
|
||||
|
||||
dat += "[STATION_TIME_TIMESTAMP("hh:mm:ss")]<br>" //:[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 += "<br><br>"
|
||||
|
||||
@@ -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, "<span class='notice'>You remove the ID from the [name].</span>")
|
||||
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, "<span class='notice'>You remove the ID from the [name].</span>")
|
||||
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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 += "<h3>[B.name]</h3>"
|
||||
info += "<ul><li>Reward: [B.reward_string()]</li>"
|
||||
info += "<li>Completed: [B.completion_string()]</li></ul>"
|
||||
info += {"<h3>[B.name]</h3>
|
||||
<ul><li>Reward: [B.reward_string()]</li>
|
||||
<li>Completed: [B.completion_string()]</li></ul>"}
|
||||
|
||||
/obj/machinery/computer/bounty/ui_interact(mob/user)
|
||||
. = ..()
|
||||
@@ -34,39 +36,36 @@
|
||||
if(!GLOB.bounties_list.len)
|
||||
setup_bounties()
|
||||
|
||||
var/dat = ""
|
||||
dat += "<a href='?src=[REF(src)];refresh=1'>Refresh</a>"
|
||||
dat += "<a href='?src=[REF(src)];refresh=1;choice=Print'>Print Paper</a>"
|
||||
dat += "<p>Credits: <b>[SSshuttle.points]</b></p>"
|
||||
dat += {"<table style="text-align:center;" border="1" cellspacing="0" width="100%">"}
|
||||
dat += "<tr><th>Name</th><th>Description</th><th>Reward</th><th>Completion</th><th>Status</th></tr>"
|
||||
var/list/dat = list({"<a href='?src=[REF(src)];refresh=1'>Refresh</a>
|
||||
<a href='?src=[REF(src)];refresh=1;choice=Print'>Print Paper</a>
|
||||
<p>Credits: <b>[SSshuttle.points]</b></p>
|
||||
<table style="text-align:center;" border="1" cellspacing="0" width="100%">
|
||||
<tr><th>Name</th><th>Description</th><th>Reward</th><th>Completion</th><th>Status</th></tr>"})
|
||||
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 += "<tr style='background-color:#294675;'>"
|
||||
else if(B.can_claim())
|
||||
dat += "<tr style='background-color:#4F7529;'>"
|
||||
else
|
||||
background = "'background-color:#990000;'"
|
||||
dat += "<tr style=[background]>"
|
||||
dat += "<tr style='background-color:#990000;'>"
|
||||
if(B.high_priority)
|
||||
dat += text("<td><b>[]</b></td>", B.name)
|
||||
dat += text("<td><b>High Priority:</b> []</td>", B.description)
|
||||
dat += text("<td><b>[]</b></td>", B.reward_string())
|
||||
dat += {"<td><b>[B.name]</b></td>
|
||||
<td><b>High Priority:</b> [B.description]</td>
|
||||
<td><b>[B.reward_string()]</b></td>"}
|
||||
else
|
||||
dat += text("<td>[]</td>", B.name)
|
||||
dat += text("<td>[]</td>", B.description)
|
||||
dat += text("<td>[]</td>", B.reward_string())
|
||||
dat += text("<td>[]</td>", B.completion_string())
|
||||
if(B.can_claim())
|
||||
dat += text("<td><A href='?src=[REF(src)];refresh=1;choice=Claim;d_rec=[REF(B)]'>Claim</a></td>")
|
||||
else if(B.claimed)
|
||||
dat += text("<td>Claimed</td>")
|
||||
dat += {"<td>[B.name]</td>
|
||||
<td>[B.description]</td>
|
||||
<td>[B.reward_string()]</td>"}
|
||||
dat += "<td>[B.completion_string()]</td>"
|
||||
if(B.claimed)
|
||||
dat += "<td>Claimed</td>"
|
||||
else if(B.can_claim())
|
||||
dat += "<td><A href='?src=[REF(src)];refresh=1;choice=Claim;d_rec=[REF(B)]'>Claim</a></td>"
|
||||
else
|
||||
dat += text("<td>Unclaimed</td>")
|
||||
dat += "<td>Unclaimed</td>"
|
||||
dat += "</tr>"
|
||||
dat += "</table>"
|
||||
|
||||
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()
|
||||
|
||||
|
||||
@@ -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("<span class='warning'>[user] swipes a suspicious card through [src]!</span>",
|
||||
@@ -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, "<span class='notice'>Access denied.</span>")
|
||||
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"
|
||||
|
||||
@@ -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("<span class='warning'>[user] swipes a suspicious card through [src]!</span>",
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"])
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -942,10 +942,6 @@
|
||||
/mob/proc/can_hold_items()
|
||||
return FALSE
|
||||
|
||||
/mob/proc/get_idcard()
|
||||
return
|
||||
|
||||
|
||||
/mob/vv_get_dropdown()
|
||||
. = ..()
|
||||
. += "---"
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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, "<span class='danger'>\The [computer] flashes an \"RFID Error - Unable to scan ID\" warning.</span>")
|
||||
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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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, "<span class='warning'>You don't have an ID.</span>")
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 KiB |
@@ -1,3 +0,0 @@
|
||||
/obj/machinery/computer/card
|
||||
list/blacklisted = list(
|
||||
"Quartermaster")
|
||||
@@ -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, "<span class='warning'>You can't do that right now!</span>")
|
||||
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)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Alt-click to recolor it.</span>"
|
||||
|
||||
//=================================================
|
||||
|
||||
/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, "<span class='notice'>It can add up to [uses] charges to compatible devices</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>It has a small, red, blinking light coming from inside of it. It's spent.</span>")
|
||||
|
||||
/obj/item/card/emag
|
||||
var/uses = 10
|
||||
|
||||
/obj/item/card/emag/examine(mob/user)
|
||||
. = ..()
|
||||
to_chat(user, "<span class='notice'>It has <b>[uses ? uses : "no"]</b> charges left.</span>")
|
||||
|
||||
/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, "<span class='notice'>You have added [ER.uses] charges to [src]. It now has [uses] charges.</span>")
|
||||
playsound(src, "sparks", 100, 1)
|
||||
ER.uses = 0
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[ER] has no charges left.</span>")
|
||||
return
|
||||
. = ..()
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user