diff --git a/code/__DEFINES/department.dm b/code/__DEFINES/department.dm index bab09c05e6d37..62a212a83403c 100644 --- a/code/__DEFINES/department.dm +++ b/code/__DEFINES/department.dm @@ -1,29 +1,35 @@ +// station departments +#define DEPT_NAME_COMMAND "Command" #define DEPT_BITFLAG_COM (1<<0) -#define DEPARTMENT_COMMAND "Command" +#define DEPT_NAME_CIVILIAN "Civilian" #define DEPT_BITFLAG_CIV (1<<1) -#define DEPARTMENT_CIVILIAN "Civilian" +#define DEPT_NAME_SERVICE "Service" #define DEPT_BITFLAG_SRV (1<<2) -#define DEPARTMENT_SERVICE "Service" +#define DEPT_NAME_CARGO "Cargo" #define DEPT_BITFLAG_CAR (1<<3) -#define DEPARTMENT_CARGO "Cargo" +#define DEPT_NAME_SCIENCE "Science" #define DEPT_BITFLAG_SCI (1<<4) -#define DEPARTMENT_SCIENCE "Science" +#define DEPT_NAME_ENGINEERING "Engineering" #define DEPT_BITFLAG_ENG (1<<5) -#define DEPARTMENT_ENGINEERING "Engineering" +#define DEPT_NAME_MEDICAL "Medical" #define DEPT_BITFLAG_MED (1<<6) -#define DEPARTMENT_MEDICAL "Medical" +#define DEPT_NAME_SECURITY "Security" #define DEPT_BITFLAG_SEC (1<<7) -#define DEPARTMENT_SECURITY "Security" +#define DEPT_NAME_VIP "VIP" #define DEPT_BITFLAG_VIP (1<<8) -#define DEPARTMENT_VIP "VIP" +#define DEPT_NAME_SILICON "Silicon" #define DEPT_BITFLAG_SILICON (1<<9) -#define DEPARTMENT_SILICON "Silicon" -#define DEPT_BITFLAG_CENTCOM (1<<10) -#define DEPARTMENT_CENTCOM "CentCom" -#define DEPT_BITFLAG_OTHER (1<<11) -#define DEPARTMENT_OTHER "Other" -#define DEPT_BITFLAG_CAPTAIN (1<<12) -#define DEPARTMENT_CAPTAIN +#define DEPT_NAME_UNASSIGNED "Misc" +#define DEPT_BITFLAG_UNASSIGNED (1<<10) + +#define DEPT_NAME_CENTCOM "CentCom" +#define DEPT_BITFLAG_CENTCOM (1<<11) +#define DEPT_NAME_OTHER "Other" +#define DEPT_BITFLAG_OTHER (1<<12) + +// not real department. These exist for pref grouping +#define DEPT_NAME_ASSISTANT "Assistant" +#define DEPT_NAME_CAPTAIN "Captain" // Crew Manifest will show crew data in this order @@ -39,15 +45,16 @@ #define DEPT_MANIFEST_ORDER_SERVICE 70 #define DEPT_MANIFEST_ORDER_CIVILIAN 80 #define DEPT_MANIFEST_ORDER_SILICON 90 -#define DEPT_MANIFEST_ORDER_OTHER 999 // not used but just in case +#define DEPT_MANIFEST_ORDER_UNASSIGNED 666 // dummy department for people with no department -#define DEPT_PREF_ORDER_COMMAND 10 -#define DEPT_PREF_ORDER_SECURITY 20 +// used for /mob/dead/new_player/proc/LateChoices() +#define DEPT_PREF_ORDER_COMMAND 10 +#define DEPT_PREF_ORDER_SECURITY 20 #define DEPT_PREF_ORDER_ENGINEERING 30 -#define DEPT_PREF_ORDER_MEDICAL 40 -#define DEPT_PREF_ORDER_SCIENCE 50 -#define DEPT_PREF_ORDER_CARGO 60 -#define DEPT_PREF_ORDER_SERVICE 70 -#define DEPT_PREF_ORDER_CIVILIAN 80 -#define DEPT_PREF_ORDER_SILICON 90 +#define DEPT_PREF_ORDER_MEDICAL 40 +#define DEPT_PREF_ORDER_SCIENCE 50 +#define DEPT_PREF_ORDER_CARGO 60 +#define DEPT_PREF_ORDER_SERVICE 70 +#define DEPT_PREF_ORDER_CIVILIAN 80 +#define DEPT_PREF_ORDER_SILICON 90 diff --git a/code/__HELPERS/jobs.dm b/code/__HELPERS/jobs.dm index 33531e367d7fa..5b63047c706ca 100644 --- a/code/__HELPERS/jobs.dm +++ b/code/__HELPERS/jobs.dm @@ -249,13 +249,3 @@ GLOBAL_LIST_INIT(command_huds, list( JOB_HUD_UNKNOWN = JOB_CHATCOLOR_UNKNOWN ) return hud_to_chatcolor[jobname] || JOB_CHATCOLOR_UNKNOWN - -/proc/get_job_departments(field) - . = list() - for(var/flag in GLOB.bitflags) - var/key = "[flag]" - var/department = SSdepartment.department_bitflag_to_name[key] - if(!department || !SSdepartment.departments[department]) - continue - if(CHECK_BITFIELD(field, flag)) - . += department diff --git a/code/controllers/subsystem/department.dm b/code/controllers/subsystem/department.dm index eecc6b4840e44..8e6b88badf6bc 100644 --- a/code/controllers/subsystem/department.dm +++ b/code/controllers/subsystem/department.dm @@ -4,106 +4,108 @@ SUBSYSTEM_DEF(department) init_order = INIT_ORDER_DEPARTMENT flags = SS_NO_FIRE - // - var/list/department_id_list = list() - var/list/department_type_list = list() - var/list/department_by_key = list() - var/list/sorted_department_for_manifest = list() - var/list/sorted_department_for_pref = list() - - var/list/checker - - var/list/all_station_departments_list = list( - DEPARTMENT_COMMAND, - DEPARTMENT_CIVILIAN, - DEPARTMENT_SERVICE, - DEPARTMENT_CARGO, - DEPARTMENT_SCIENCE, - DEPARTMENT_ENGINEERING, - DEPARTMENT_MEDICAL, - DEPARTMENT_SECURITY, - DEPARTMENT_VIP, - DEPARTMENT_SILICON - ) - - // A list of each bitflag and the name of its associated department. For use in the preferences menu. - var/list/department_bitflag_to_name = list() + /// full list of department datums. + var/list/department_datums + /// assoc list of department datums by its department name(dept_id). The list may not have full departments of ingame. + var/list/department_assoc - // A list of each department and its associated bitflag. - var/list/departments = list() - - // department order and its dept color - var/list/department_order = list() + /// department datums in a 'crew manifest' priority order. Only used for crew manifest window. + var/list/sorted_department_for_manifest + /// department datums in a 'job pref' priority order in character selection. + var/list/sorted_department_for_latejoin /datum/controller/subsystem/department/Initialize(timeofday) - for(var/datum/department_group/each_dept as() in subtypesof(/datum/department_group)) + department_datums = list() + department_assoc = list() + + for(var/datum/department_group/each_dept as anything in subtypesof(/datum/department_group)) each_dept = new each_dept() - department_type_list += each_dept - department_by_key[each_dept.dept_id] = each_dept - department_id_list += each_dept.dept_id - //To do: remind for #10933 Just in case: Blame EvilDragonFiend. - // initialising static list inside of the procs - get_departments_by_pref_order() - get_departments_by_manifest_order() - department_bitflag_to_name = list( - "[DEPT_BITFLAG_CAPTAIN]" = "Captain", - "[DEPT_BITFLAG_COM]" = "Command", - "[DEPT_BITFLAG_CIV]" = "Civilian", - "[DEPT_BITFLAG_SRV]" = "Service", - "[DEPT_BITFLAG_CAR]" = "Cargo", - "[DEPT_BITFLAG_SCI]" = "Science", - "[DEPT_BITFLAG_ENG]" = "Engineering", - "[DEPT_BITFLAG_MED]" = "Medical", - "[DEPT_BITFLAG_SEC]" = "Security", - "[DEPT_BITFLAG_VIP]" = "Very Important People", - "[DEPT_BITFLAG_SILICON]" = "Silicon" - ) - departments = list( - "Command" = DEPT_BITFLAG_COM, - "Very Important People" = DEPT_BITFLAG_VIP, - "Security" = DEPT_BITFLAG_SEC, - "Engineering" = DEPT_BITFLAG_ENG, - "Medical" = DEPT_BITFLAG_MED, - "Science" = DEPT_BITFLAG_SCI, - "Supply" = DEPT_BITFLAG_CAR, - "Cargo" = DEPT_BITFLAG_CAR, - "Service" = DEPT_BITFLAG_SRV, - "Civilian" = DEPT_BITFLAG_CIV, - "Silicon" = DEPT_BITFLAG_SILICON - ) - department_order = list( - DEPARTMENT_COMMAND = "#ddddff", - DEPARTMENT_VIP = "#999791", - DEPARTMENT_SECURITY = "#ffdddd", - DEPARTMENT_ENGINEERING = "#ffeeaa", - DEPARTMENT_MEDICAL= "#c1e1ec", - DEPARTMENT_SCIENCE = "#ffddff", - DEPARTMENT_CARGO = "#d7b088", - DEPARTMENT_SERVICE = "#bbe291", - DEPARTMENT_CIVILIAN = "#bbe291", - DEPARTMENT_SILICON = "#ccffcc" + + department_datums += each_dept + if(each_dept.dept_id) + department_assoc[each_dept.dept_id] = each_dept + + var/datum/department_group/dummy_datum + dummy_datum = dummy_datum // be gone compile warning + sorted_department_for_manifest = list() + sorted_department_for_latejoin = list() + init_and_sort_department(sorted_department_for_manifest, NAMEOF(dummy_datum, manifest_category_order)) + init_and_sort_department(sorted_department_for_latejoin, NAMEOF(dummy_datum, pref_category_order)) + + // I don't like this here, but this globallist can't take proper values on its declaration. + GLOB.exp_jobsmap = list( + EXP_TYPE_CREW = list("titles" = get_all_jobs()), + EXP_TYPE_COMMAND = list("titles" = SSdepartment.department_assoc[DEPT_NAME_COMMAND]), + EXP_TYPE_ENGINEERING = list("titles" = SSdepartment.department_assoc[DEPT_NAME_ENGINEERING]), + EXP_TYPE_MEDICAL = list("titles" = SSdepartment.department_assoc[DEPT_NAME_MEDICAL]), + EXP_TYPE_SCIENCE = list("titles" = SSdepartment.department_assoc[DEPT_NAME_SCIENCE]), + EXP_TYPE_SUPPLY = list("titles" = SSdepartment.department_assoc[DEPT_NAME_CARGO]), + EXP_TYPE_SECURITY = list("titles" = SSdepartment.department_assoc[DEPT_NAME_SECURITY]), + EXP_TYPE_SILICON = list("titles" = SSdepartment.department_assoc[DEPT_NAME_SILICON]), + EXP_TYPE_SERVICE = list("titles" = SSdepartment.department_assoc[DEPT_NAME_CIVILIAN]) ) + return SS_INIT_SUCCESS +/// Puts department datums into a list in a desired sort priority. Only called once in subsystem Initialize. +/// * list_instance: takes a list instance, to initialize and sort departments into this list +/// * priority_varname: a hacky one since sorting code does the same thing. +/datum/controller/subsystem/department/proc/init_and_sort_department(list/list_instance, priority_varname) + if(isnull(list_instance)) + CRASH("'list_instance' does not exist: target_var [priority_varname]") + if(!islist(list_instance)) + CRASH("'list_instance' is not a list: target_var [priority_varname]") + if(!priority_varname || !length(priority_varname)) + CRASH("something's wrong to init department: target_var [priority_varname]") + + var/list/_department_datums_to_sort = department_datums.Copy() + var/sanity_check = 1000 + while(length(_department_datums_to_sort) && sanity_check--) + if(!sanity_check) + CRASH("the proc reached 0 sanity check - something's causing the infinite loop.") + + var/datum/department_group/current + for(var/datum/department_group/each_dept in _department_datums_to_sort) + if(!each_dept.vars[priority_varname]) + _department_datums_to_sort -= each_dept + continue + if(!current) + current = each_dept + continue + if(each_dept.vars[priority_varname] < current.vars[priority_varname]) + current = each_dept + continue + list_instance += current + _department_datums_to_sort -= current + +/// WARNING: This always returns as a list. +/// If your bitflag only gets a single department, it will return as a list. /datum/controller/subsystem/department/proc/get_department_by_bitflag(bitflag) - for(var/datum/department_group/each_dept in department_type_list) + var/return_result = list() + . = return_result + + for(var/datum/department_group/each_dept in department_datums) if(each_dept.dept_bitflag & bitflag) - return each_dept - CRASH("[bitflag] isn't an existing department bitflag.") + . += each_dept + + return return_result /datum/controller/subsystem/department/proc/get_department_by_dept_id(id) - . = department_by_key[id] + . = department_assoc[id] if(!.) CRASH("[id] isn't an existing department id.") - return department_by_key[id] + return department_assoc[id] -/// WARNING: include_dispatch parameter is important. Avoid using it to security positions. /datum/controller/subsystem/department/proc/get_jobs_by_dept_id(id_or_list) if(!id_or_list) stack_trace("proc has no id value") return list() + if(istext(id_or_list)) + var/datum/department_group/dept = department_assoc[id_or_list] + return dept.jobs + if(!islist(id_or_list)) id_or_list = list(id_or_list) else if(islist(id_or_list?[1])) @@ -111,7 +113,7 @@ SUBSYSTEM_DEF(department) var/list/jobs_to_return = list() for(var/each in id_or_list) - var/datum/department_group/dept = department_by_key[each] + var/datum/department_group/dept = department_assoc[each] if(!dept) message_admins("is not exist: [each]") continue @@ -121,52 +123,6 @@ SUBSYSTEM_DEF(department) return jobs_to_return -/// returns the department list as manifest order -/datum/controller/subsystem/department/proc/get_departments_by_manifest_order() - if(!length(sorted_department_for_manifest)) - var/list/copied_dept = department_type_list.Copy() - var/sanity_check = 1000 // this won't happen but just in case - while(length(copied_dept) && sanity_check--) - var/datum/department_group/current - for(var/datum/department_group/each_dept in copied_dept) - if(!each_dept.manifest_category_order || !each_dept.manifest_category_name) - copied_dept -= each_dept - continue - if(!current) - current = each_dept - continue - if(each_dept.manifest_category_order < current.manifest_category_order) - current = each_dept - continue - sorted_department_for_manifest += current - copied_dept -= current - if(!sanity_check) - stack_trace("the proc reached 0 sanity check - something's causing the infinite loop.") - return sorted_department_for_manifest - -/// returns the department list as preference order (used in latejoin) -/datum/controller/subsystem/department/proc/get_departments_by_pref_order() - if(!length(sorted_department_for_pref)) - var/list/copied_dept = department_type_list.Copy() - var/sanity_check = 1000 - while(length(copied_dept) && sanity_check--) - var/datum/department_group/current - for(var/datum/department_group/each_dept in copied_dept) - if(!each_dept.pref_category_order || !each_dept.pref_category_name) - copied_dept -= each_dept - continue - if(!current) - current = each_dept - continue - if(each_dept.pref_category_order < current.pref_category_order) - current = each_dept - continue - sorted_department_for_pref += current - copied_dept -= current - if(!sanity_check) - stack_trace("the proc reached 0 sanity check - something's causing the infinite loop.") - return sorted_department_for_pref - // -------------------------------------------- // department group datums for this subsystem /datum/department_group @@ -178,35 +134,43 @@ SUBSYSTEM_DEF(department) var/dept_radio_channel = null var/is_station = FALSE - // job preference & roundjoin window - var/pref_category_name = "No department" - var/pref_category_order = 0 - // job related variables /// who's responsible of a department? (this is made as a list just in case) var/list/leaders = list() /// job list of people working in a department var/list/jobs = list() - /// If you check crew manifest, department name will be displayed as this - var/manifest_category_name = "No department" + /// Alternative department name in latejoin job selection window + /// dept_name variable will be used if this variable has no value + var/pref_category_name + /// Latejoin department sort by low number (Command first) + var/pref_category_order = 0 + + /// Alternative department name in crew manifest. + /// dept_name variable will be used if this variable has no value + var/manifest_category_name /// Crew manifest sort by low number (Command first) var/manifest_category_order = 0 +/datum/department_group/New() + . = ..() + if(dept_name) + if(isnull(pref_category_name)) + pref_category_name = dept_name + if(isnull(manifest_category_name)) + manifest_category_name = dept_name + // --------------------------------------------------------------------- // COMMAND // --------------------------------------------------------------------- /datum/department_group/command - dept_name = DEPARTMENT_COMMAND - dept_id = DEPARTMENT_COMMAND + dept_name = DEPT_NAME_COMMAND + dept_id = DEPT_NAME_COMMAND dept_bitflag = DEPT_BITFLAG_COM dept_colour = "#ddddff" dept_radio_channel = FREQ_COMMAND is_station = TRUE - pref_category_name = DEPARTMENT_COMMAND - pref_category_order = DEPT_PREF_ORDER_COMMAND - leaders = list(JOB_NAME_CAPTAIN) jobs = list(JOB_NAME_CAPTAIN, JOB_NAME_HEADOFPERSONNEL, @@ -215,23 +179,23 @@ SUBSYSTEM_DEF(department) JOB_NAME_CHIEFMEDICALOFFICER, JOB_NAME_HEADOFSECURITY) - manifest_category_name = DEPARTMENT_COMMAND + pref_category_name = DEPT_NAME_COMMAND + pref_category_order = DEPT_PREF_ORDER_COMMAND + + manifest_category_name = DEPT_NAME_COMMAND manifest_category_order = DEPT_MANIFEST_ORDER_COMMAND // --------------------------------------------------------------------- // SERVICE // --------------------------------------------------------------------- /datum/department_group/service - dept_name = DEPARTMENT_SERVICE - dept_id = DEPARTMENT_SERVICE + dept_name = DEPT_NAME_SERVICE + dept_id = DEPT_NAME_SERVICE dept_bitflag = DEPT_BITFLAG_SRV dept_colour = "#bbe291" dept_radio_channel = FREQ_SERVICE is_station = TRUE - pref_category_name = DEPARTMENT_SERVICE - pref_category_order = DEPT_PREF_ORDER_SERVICE - leaders = list(JOB_NAME_HEADOFPERSONNEL) jobs = list(JOB_NAME_HEADOFPERSONNEL, JOB_NAME_BARTENDER, @@ -241,21 +205,22 @@ SUBSYSTEM_DEF(department) JOB_NAME_MIME, JOB_NAME_CLOWN) - manifest_category_name = DEPARTMENT_SERVICE + pref_category_name = DEPT_NAME_SERVICE + pref_category_order = DEPT_PREF_ORDER_SERVICE + + manifest_category_name = DEPT_NAME_SERVICE manifest_category_order = DEPT_MANIFEST_ORDER_SERVICE // --------------------------------------------------------------------- // CIVILIAN // --------------------------------------------------------------------- /datum/department_group/civilian - dept_name = DEPARTMENT_CIVILIAN - dept_id = DEPARTMENT_CIVILIAN + dept_name = DEPT_NAME_CIVILIAN + dept_id = DEPT_NAME_CIVILIAN dept_bitflag = DEPT_BITFLAG_CIV + dept_colour = "#bbe291" is_station = TRUE - pref_category_name = DEPARTMENT_CIVILIAN - pref_category_order = DEPT_PREF_ORDER_CIVILIAN - leaders = list(JOB_NAME_HEADOFPERSONNEL) jobs = list(JOB_NAME_ASSISTANT, JOB_NAME_GIMMICK, @@ -267,93 +232,91 @@ SUBSYSTEM_DEF(department) JOB_NAME_CURATOR, JOB_NAME_LAWYER) - manifest_category_name = DEPARTMENT_CIVILIAN + pref_category_name = DEPT_NAME_CIVILIAN + pref_category_order = DEPT_PREF_ORDER_CIVILIAN + + manifest_category_name = DEPT_NAME_CIVILIAN manifest_category_order = DEPT_MANIFEST_ORDER_CIVILIAN // --------------------------------------------------------------------- // SUPPLY (CARGO) // --------------------------------------------------------------------- /datum/department_group/cargo - dept_name = DEPARTMENT_CARGO - dept_id = DEPARTMENT_CARGO + dept_name = DEPT_NAME_CARGO + dept_id = DEPT_NAME_CARGO dept_bitflag = DEPT_BITFLAG_CAR dept_colour = "#d7b088" dept_radio_channel = FREQ_SUPPLY is_station = TRUE - pref_category_name = DEPARTMENT_CARGO - pref_category_order = DEPT_PREF_ORDER_CARGO - leaders = list(JOB_NAME_HEADOFPERSONNEL) jobs = list(JOB_NAME_HEADOFPERSONNEL, JOB_NAME_QUARTERMASTER, JOB_NAME_CARGOTECHNICIAN, JOB_NAME_SHAFTMINER) - manifest_category_name = DEPARTMENT_CARGO + pref_category_name = DEPT_NAME_CARGO + pref_category_order = DEPT_PREF_ORDER_CARGO + + manifest_category_name = DEPT_NAME_CARGO manifest_category_order = DEPT_MANIFEST_ORDER_CARGO // --------------------------------------------------------------------- // SCIENCE // --------------------------------------------------------------------- /datum/department_group/science - dept_name = DEPARTMENT_SCIENCE - dept_id = DEPARTMENT_SCIENCE + dept_name = DEPT_NAME_SCIENCE + dept_id = DEPT_NAME_SCIENCE dept_bitflag = DEPT_BITFLAG_SCI dept_colour = "#ffddff" dept_radio_channel = FREQ_SCIENCE is_station = TRUE - pref_category_name = DEPARTMENT_SCIENCE - pref_category_order = DEPT_PREF_ORDER_SCIENCE - leaders = list(JOB_NAME_RESEARCHDIRECTOR) jobs = list(JOB_NAME_RESEARCHDIRECTOR, JOB_NAME_SCIENTIST, JOB_NAME_EXPLORATIONCREW, JOB_NAME_ROBOTICIST) - manifest_category_name = DEPARTMENT_SCIENCE + pref_category_name = DEPT_NAME_SCIENCE + pref_category_order = DEPT_PREF_ORDER_SCIENCE + + manifest_category_name = DEPT_NAME_SCIENCE manifest_category_order = DEPT_MANIFEST_ORDER_SCIENCE // --------------------------------------------------------------------- // ENGINEERING // --------------------------------------------------------------------- /datum/department_group/engineering - dept_name = DEPARTMENT_ENGINEERING - dept_id = DEPARTMENT_ENGINEERING + dept_name = DEPT_NAME_ENGINEERING + dept_id = DEPT_NAME_ENGINEERING dept_bitflag = DEPT_BITFLAG_ENG dept_colour = "#ffeeaa" dept_radio_channel = FREQ_ENGINEERING is_station = TRUE - pref_category_name = DEPARTMENT_ENGINEERING - pref_category_order = DEPT_PREF_ORDER_ENGINEERING - leaders = list(JOB_NAME_CHIEFENGINEER) jobs = list(JOB_NAME_CHIEFENGINEER, JOB_NAME_STATIONENGINEER, JOB_NAME_ATMOSPHERICTECHNICIAN) + pref_category_name = DEPT_NAME_ENGINEERING + pref_category_order = DEPT_PREF_ORDER_ENGINEERING - - manifest_category_name = DEPARTMENT_ENGINEERING + manifest_category_name = DEPT_NAME_ENGINEERING manifest_category_order = DEPT_MANIFEST_ORDER_ENGINEERING // --------------------------------------------------------------------- // MEDICAL // --------------------------------------------------------------------- /datum/department_group/medical - dept_name = DEPARTMENT_MEDICAL - dept_id = DEPARTMENT_MEDICAL + dept_name = DEPT_NAME_MEDICAL + dept_id = DEPT_NAME_MEDICAL dept_bitflag = DEPT_BITFLAG_MED dept_colour = "#c1e1ec" dept_radio_channel = FREQ_MEDICAL is_station = TRUE - pref_category_name = DEPARTMENT_MEDICAL - pref_category_order = DEPT_PREF_ORDER_MEDICAL - leaders = list(JOB_NAME_CHIEFMEDICALOFFICER) jobs = list(JOB_NAME_CHIEFMEDICALOFFICER, JOB_NAME_MEDICALDOCTOR, @@ -364,24 +327,23 @@ SUBSYSTEM_DEF(department) JOB_NAME_VIROLOGIST, JOB_NAME_PSYCHIATRIST) + pref_category_name = DEPT_NAME_MEDICAL + pref_category_order = DEPT_PREF_ORDER_MEDICAL - manifest_category_name = DEPARTMENT_MEDICAL + manifest_category_name = DEPT_NAME_MEDICAL manifest_category_order = DEPT_MANIFEST_ORDER_MEDICAL // --------------------------------------------------------------------- // SECURITY // --------------------------------------------------------------------- /datum/department_group/security - dept_name = DEPARTMENT_SECURITY - dept_id = DEPARTMENT_SECURITY + dept_name = DEPT_NAME_SECURITY + dept_id = DEPT_NAME_SECURITY dept_bitflag = DEPT_BITFLAG_SEC dept_colour = "#ffdddd" dept_radio_channel = FREQ_SECURITY is_station = TRUE - pref_category_name = DEPARTMENT_SECURITY - pref_category_order = DEPT_PREF_ORDER_SECURITY - leaders = list(JOB_NAME_HEADOFSECURITY) jobs = list(JOB_NAME_HEADOFSECURITY, JOB_NAME_WARDEN, @@ -389,7 +351,10 @@ SUBSYSTEM_DEF(department) JOB_NAME_SECURITYOFFICER, JOB_NAME_DEPUTY) - manifest_category_name = DEPARTMENT_SECURITY + pref_category_name = DEPT_NAME_SECURITY + pref_category_order = DEPT_PREF_ORDER_SECURITY + + manifest_category_name = DEPT_NAME_SECURITY manifest_category_order = DEPT_MANIFEST_ORDER_SECURITY // --------------------------------------------------------------------- @@ -398,34 +363,46 @@ SUBSYSTEM_DEF(department) // --------------------------------------------------------------------- // in fact, nobody belongs here even VIPs don't because how system works. This is dummy department actually. /datum/department_group/vip - dept_name = DEPARTMENT_VIP - dept_id = DEPARTMENT_VIP + dept_name = DEPT_NAME_VIP + dept_id = DEPT_NAME_VIP dept_bitflag = DEPT_BITFLAG_VIP manifest_category_name = "Very Important People" manifest_category_order = DEPT_MANIFEST_ORDER_VIP +// --------------------------------------------------------------------- +// Unassigned +// Used for: crew manifest +// --------------------------------------------------------------------- +// This is a dummy department for crew manifest of people who have no department assigned +/datum/department_group/unassigned + dept_name = DEPT_NAME_UNASSIGNED + dept_id = DEPT_NAME_UNASSIGNED + + manifest_category_name = DEPT_NAME_UNASSIGNED + manifest_category_order = DEPT_MANIFEST_ORDER_UNASSIGNED + // --------------------------------------------------------------------- // SILICON // Used for: job pref & roundjoin window // (currently not for crew manifest) // --------------------------------------------------------------------- /datum/department_group/silicon - dept_name = DEPARTMENT_SILICON - dept_id = DEPARTMENT_SILICON + dept_name = DEPT_NAME_SILICON + dept_id = DEPT_NAME_SILICON dept_bitflag = DEPT_BITFLAG_SILICON dept_colour = "#ccffcc" // is_station = TRUE // It's station department, but silicon list... maybe not a good idea using this - pref_category_name = DEPARTMENT_SILICON - pref_category_order = DEPT_PREF_ORDER_SILICON - leaders = list() jobs = list(JOB_NAME_AI, JOB_NAME_CYBORG) - // currently not used - manifest_category_name = DEPARTMENT_SILICON + pref_category_name = DEPT_NAME_SILICON + pref_category_order = DEPT_PREF_ORDER_SILICON + + // currently not used, but just in case + manifest_category_name = DEPT_NAME_SILICON manifest_category_order = DEPT_MANIFEST_ORDER_SILICON // --------------------------------------------------------------------- @@ -433,13 +410,14 @@ SUBSYSTEM_DEF(department) // Used for: access sorting (mainly), cerw manifest (admin gimmick) // --------------------------------------------------------------------- /datum/department_group/centcom - dept_name = DEPARTMENT_CENTCOM - dept_id = DEPARTMENT_CENTCOM + dept_name = DEPT_NAME_CENTCOM + dept_id = DEPT_NAME_CENTCOM dept_bitflag = DEPT_BITFLAG_CENTCOM dept_colour = "#00eba4" dept_radio_channel = FREQ_CENTCOM - manifest_category_name = DEPARTMENT_CENTCOM + // currently not used, but just in case + manifest_category_name = DEPT_NAME_CENTCOM manifest_category_order = DEPT_MANIFEST_ORDER_CENTCOM // --------------------------------------------------------------------- @@ -447,11 +425,12 @@ SUBSYSTEM_DEF(department) // Used for: access sorting (mainly), cerw manifest (admin gimmick) // --------------------------------------------------------------------- /datum/department_group/other - dept_name = DEPARTMENT_OTHER - dept_id = DEPARTMENT_OTHER + dept_name = DEPT_NAME_OTHER + dept_id = DEPT_NAME_OTHER dept_bitflag = DEPT_BITFLAG_OTHER dept_colour = "#00eba4" dept_radio_channel = FREQ_CENTCOM - manifest_category_name = DEPARTMENT_OTHER + // currently not used, but just in case + manifest_category_name = DEPT_NAME_OTHER manifest_category_order = 1000 diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index c096cc012a636..163191774bf77 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -214,7 +214,7 @@ SUBSYSTEM_DEF(job) if(istype(job, GetJob(SSjob.overflow_role))) // We don't want to give him assistant, that's boring! continue - if(job.title in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND)) //If you want a command position, select it! + if(job.title in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) //If you want a command position, select it! continue if(QDELETED(player)) @@ -259,7 +259,7 @@ SUBSYSTEM_DEF(job) //This is basically to ensure that there's atleast a few heads in the round /datum/controller/subsystem/job/proc/FillHeadPosition() for(var/level in level_order) - for(var/command_position in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND)) + for(var/command_position in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) var/datum/job/job = GetJob(command_position) if(!job) continue @@ -277,7 +277,7 @@ SUBSYSTEM_DEF(job) //This proc is called at the start of the level loop of DivideOccupations() and will cause head jobs to be checked before any other jobs of the same level //This is also to ensure we get as many heads as possible /datum/controller/subsystem/job/proc/CheckHeadPositions(level) - for(var/command_position in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND)) + for(var/command_position in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) var/datum/job/job = GetJob(command_position) if(!job) continue @@ -772,7 +772,7 @@ SUBSYSTEM_DEF(job) /datum/controller/subsystem/job/proc/get_living_heads() . = list() for(var/mob/living/carbon/human/player in GLOB.alive_mob_list) - if(player.stat != DEAD && player.mind && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND))) + if(player.stat != DEAD && player.mind && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND))) . |= player.mind @@ -783,7 +783,7 @@ SUBSYSTEM_DEF(job) . = list() for(var/i in GLOB.mob_list) var/mob/player = i - if(player.mind && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND))) + if(player.mind && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND))) . |= player.mind ////////////////////////////////////////////// @@ -792,7 +792,7 @@ SUBSYSTEM_DEF(job) /datum/controller/subsystem/job/proc/get_living_sec() . = list() for(var/mob/living/carbon/human/player in GLOB.carbon_list) - if(player.stat != DEAD && player.mind && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY))) + if(player.stat != DEAD && player.mind && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY))) . |= player.mind //////////////////////////////////////// @@ -801,7 +801,7 @@ SUBSYSTEM_DEF(job) /datum/controller/subsystem/job/proc/get_all_sec() . = list() for(var/mob/living/carbon/human/player in GLOB.carbon_list) - if(player.mind && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY))) + if(player.mind && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY))) . |= player.mind /datum/controller/subsystem/job/proc/JobDebug(message) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index c7f0af2d61483..286a05a333abc 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -448,7 +448,7 @@ SUBSYSTEM_DEF(ticker) if(mind.assigned_role == JOB_NAME_CAPTAIN) captainless = FALSE spare_id_candidates += N - else if(captainless && (mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND)) && !(is_banned_from(N.ckey, JOB_NAME_CAPTAIN))) + else if(captainless && (mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) && !(is_banned_from(N.ckey, JOB_NAME_CAPTAIN))) if(!enforce_coc) spare_id_candidates += N else diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 181dc1fa72c61..eaa1b3c19d37c 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -187,31 +187,38 @@ SEND_GLOBAL_SIGNAL(COMSIG_GLOB_CREW_MANIFEST_UPDATE) /datum/datacore/proc/get_manifest() + /// assoc-ing to head names, so that we give their name an officer mark on crew manifest + var/static/list/heads + if(!heads) // do not do this in pre-runtime. + heads = make_associative(SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) + /// Takes a result of each crew data in a format var/list/manifest_out = list() - var/static/list/heads = make_associative(SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND)) for(var/datum/data/record/t in GLOB.data_core.general) var/name = t.fields["name"] var/rank = t.fields["rank"] var/hud = t.fields["hud"] var/dept_bitflags = t.fields["active_dept"] - var/has_department = FALSE var/entry = list("name" = name, "rank" = rank, "hud" = hud) - for(var/department in get_job_departments(dept_bitflags)) - var/list/department_manifest = manifest_out[department] - if(!department_manifest) - manifest_out[department] = department_manifest = list() - // Append to beginning of list if captain or department head - var/put_at_top = hud == JOB_HUD_CAPTAIN || hud == JOB_HUD_ACTINGCAPTAIN || (department != DEPARTMENT_COMMAND && heads[rank]) - department_manifest.Insert(put_at_top, list(entry)) - has_department = TRUE - if(!has_department) - LAZYADDASSOCLIST(manifest_out, "Misc", entry) - //Sort the list by 'departments' primarily so command is on top. + if(dept_bitflags) + for(var/datum/department_group/department as anything in SSdepartment.get_department_by_bitflag(dept_bitflags)) + LAZYINITLIST(manifest_out[department.dept_id]) + // Append to beginning of list if captain or department head + var/put_at_top = (hud == JOB_HUD_CAPTAIN) || (hud == JOB_HUD_ACTINGCAPTAIN) || (department.dept_id != DEPT_NAME_COMMAND && heads[rank]) + var/list/_internal = manifest_out[department.dept_id] + _internal.Insert(put_at_top, list(entry)) + else + LAZYINITLIST(manifest_out["Misc"]) + var/put_at_top = (hud == JOB_HUD_CAPTAIN) || (hud == JOB_HUD_ACTINGCAPTAIN) || (heads[rank]) + var/list/_internal = manifest_out["Misc"] + _internal.Insert(put_at_top, list(entry)) + + // 'manifest_out' is not sorted. var/list/sorted_out = list() - for(var/department in (assoc_to_keys(SSdepartment.departments) + "Misc")) - if(!isnull(manifest_out[department])) - sorted_out[department] = manifest_out[department] + for(var/datum/department_group/department as anything in SSdepartment.sorted_department_for_manifest) + if(isnull(manifest_out[department.dept_id])) + continue + sorted_out[department.manifest_category_name] = manifest_out[department.dept_id] // this also changes a department name. return sorted_out /datum/datacore/proc/get_manifest_html(monochrome = FALSE) diff --git a/code/game/gamemodes/brother/traitor_bro.dm b/code/game/gamemodes/brother/traitor_bro.dm index 7a86c23de4a09..8e6f6294fd806 100644 --- a/code/game/gamemodes/brother/traitor_bro.dm +++ b/code/game/gamemodes/brother/traitor_bro.dm @@ -25,7 +25,7 @@ if(CONFIG_GET(flag/protect_assistant_from_antagonist)) restricted_jobs += JOB_NAME_ASSISTANT if(CONFIG_GET(flag/protect_heads_from_antagonist)) - restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) + restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) var/list/datum/mind/possible_brothers = get_players_for_role(/datum/antagonist/brother, /datum/role_preference/antagonist/blood_brother) diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index e4e4ee2803f52..727c5dc732bad 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -38,7 +38,7 @@ GLOBAL_LIST_INIT(slot2type, list("head" = /obj/item/clothing/head/changeling, "w restricted_jobs += JOB_NAME_ASSISTANT if(CONFIG_GET(flag/protect_heads_from_antagonist)) - restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) + restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) var/num_changelings = 1 diff --git a/code/game/gamemodes/changeling/traitor_chan.dm b/code/game/gamemodes/changeling/traitor_chan.dm index 700cf672f084c..fa0dad5ff66a2 100644 --- a/code/game/gamemodes/changeling/traitor_chan.dm +++ b/code/game/gamemodes/changeling/traitor_chan.dm @@ -35,7 +35,7 @@ restricted_jobs += JOB_NAME_ASSISTANT if(CONFIG_GET(flag/protect_heads_from_antagonist)) - restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) + restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) var/list/datum/mind/possible_changelings = get_players_for_role(/datum/antagonist/changeling, /datum/role_preference/antagonist/changeling) diff --git a/code/game/gamemodes/clock_cult/clockcult.dm b/code/game/gamemodes/clock_cult/clockcult.dm index 4544fc7fcc4fb..34b7ac63be260 100644 --- a/code/game/gamemodes/clock_cult/clockcult.dm +++ b/code/game/gamemodes/clock_cult/clockcult.dm @@ -229,15 +229,15 @@ GLOBAL_VAR(clockcult_eminence) if(CLOCKCULT_PREFIX_RECRUIT) var/role = sender.mind?.assigned_role //Ew, this could be done better with a dictionary list, but this isn't much slower - if(role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND)) + if(role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) prefix = "High Priest" - else if(role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_ENGINEERING)) + else if(role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_ENGINEERING)) prefix = "Cogturner" - else if(role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_MEDICAL)) + else if(role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_MEDICAL)) prefix = "Rejuvinator" - else if(role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SCIENCE)) + else if(role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SCIENCE)) prefix = "Calculator" - else if(role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CARGO)) + else if(role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CARGO)) prefix = "Pathfinder" else if(role in JOB_NAME_ASSISTANT) prefix = "Helper" @@ -245,11 +245,11 @@ GLOBAL_VAR(clockcult_eminence) prefix = "Cogwatcher" else if(role in JOB_NAME_CLOWN) prefix = "Clonker" - else if((role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CIVILIAN))) + else if((role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CIVILIAN))) prefix = "Cogworker" - else if(role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY)) + else if(role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY)) prefix = "Warrior" - else if(role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SILICON)) + else if(role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SILICON)) prefix = "CPU" //Fallthrough is default of "Clockbrother" hierophant_message += "[prefix] [sender.name] transmits, \"[msg]\"" diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index 9af4632214436..b744700762e8d 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -71,7 +71,7 @@ restricted_jobs += JOB_NAME_ASSISTANT if(CONFIG_GET(flag/protect_heads_from_antagonist)) - restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) + restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) //cult scaling goes here recommended_enemies = 1 + round(num_players()/CULT_SCALING_COEFFICIENT) diff --git a/code/game/gamemodes/devil/devil_game_mode.dm b/code/game/gamemodes/devil/devil_game_mode.dm index 79b7bdea50230..75dae99a9ad49 100644 --- a/code/game/gamemodes/devil/devil_game_mode.dm +++ b/code/game/gamemodes/devil/devil_game_mode.dm @@ -29,7 +29,7 @@ if(CONFIG_GET(flag/protect_assistant_from_antagonist)) restricted_jobs += JOB_NAME_ASSISTANT if(CONFIG_GET(flag/protect_heads_from_antagonist)) - restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) + restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) var/num_devils = 1 diff --git a/code/game/gamemodes/dynamic/dynamic.dm b/code/game/gamemodes/dynamic/dynamic.dm index b532960f23a9c..f108a5d345fe4 100644 --- a/code/game/gamemodes/dynamic/dynamic.dm +++ b/code/game/gamemodes/dynamic/dynamic.dm @@ -775,7 +775,7 @@ GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1) if(CONFIG_GET(flag/protect_assistant_from_antagonist)) ruleset.restricted_roles |= JOB_NAME_ASSISTANT if(CONFIG_GET(flag/protect_heads_from_antagonist)) - ruleset.restricted_roles |= SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) + ruleset.restricted_roles |= SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) /// Refund threat, but no more than threat_level. /datum/game_mode/dynamic/proc/refund_threat(regain) diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm index cce2c01e63613..1c55c57cfc0ed 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm @@ -667,7 +667,7 @@ || candidate.mind.has_antag_datum(/datum/antagonist/obsessed) \ || candidate.stat == DEAD \ || !SSjob.GetJob(candidate.mind.assigned_role) \ - || (candidate.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SILICON)) \ + || (candidate.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SILICON)) \ ) candidates -= candidate diff --git a/code/game/gamemodes/eldritch_cult/eldritch_cult.dm b/code/game/gamemodes/eldritch_cult/eldritch_cult.dm index 2e4030bb1d25f..daac5d2db44a8 100644 --- a/code/game/gamemodes/eldritch_cult/eldritch_cult.dm +++ b/code/game/gamemodes/eldritch_cult/eldritch_cult.dm @@ -32,7 +32,7 @@ restricted_jobs += JOB_NAME_ASSISTANT if(CONFIG_GET(flag/protect_heads_from_antagonist)) - restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) + restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) var/esc = CONFIG_GET(number/ecult_scaling_coeff) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index a5501b8281d96..41dfa7866419a 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -272,7 +272,7 @@ if(CONFIG_GET(flag/protect_assistant_from_antagonist)) replacementmode.restricted_jobs += JOB_NAME_ASSISTANT if(CONFIG_GET(flag/protect_heads_from_antagonist)) - replacementmode.restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) + replacementmode.restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) message_admins("The roundtype will be converted. If you have other plans for the station or feel the station is too messed up to inhabit stop the creation of antags or end the round now.") log_game("Roundtype converted to [replacementmode.name]") @@ -629,7 +629,7 @@ /datum/game_mode/proc/get_living_silicon() . = list() for(var/mob/living/silicon/player in GLOB.mob_list) - if(player.stat != DEAD && player.mind && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SILICON))) + if(player.stat != DEAD && player.mind && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SILICON))) . |= player.mind /////////////////////////////////////// @@ -638,21 +638,22 @@ /datum/game_mode/proc/get_all_silicon() . = list() for(var/mob/living/silicon/player in GLOB.mob_list) - if(player.mind && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SILICON))) + if(player.mind && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SILICON))) . |= player.mind /proc/reopen_roundstart_suicide_roles() + stack_trace("reopen_roundstart_suicide_roles called") var/list/valid_positions = list() - valid_positions += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_ENGINEERING) - valid_positions += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_MEDICAL) - valid_positions += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SCIENCE) - valid_positions += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CARGO) - valid_positions += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CIVILIAN) - valid_positions += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY) + valid_positions += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_ENGINEERING) + valid_positions += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_MEDICAL) + valid_positions += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SCIENCE) + valid_positions += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CARGO) + valid_positions += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CIVILIAN) + valid_positions += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY) if(CONFIG_GET(flag/reopen_roundstart_suicide_roles_command_positions)) - valid_positions += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) //add any remaining command positions + valid_positions += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) //add any remaining command positions else - valid_positions -= SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) //remove all command positions that were added from their respective department positions lists. + valid_positions -= SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) //remove all command positions that were added from their respective department positions lists. var/list/reopened_jobs = list() for(var/X in GLOB.suicided_mob_list) @@ -802,7 +803,7 @@ // HEADS OF STAFF round_credits += "

The Glorious Command Staff:

" len_before_addition = round_credits.len - for(var/datum/mind/current in SSticker.mode.get_all_by_department(SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND))) + for(var/datum/mind/current in SSticker.mode.get_all_by_department(SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND))) custom_title_holder = get_custom_title_from_id(current, newline=TRUE) round_credits += "

[current.name] as the [current.assigned_role][custom_title_holder]

" if(round_credits.len == len_before_addition) @@ -821,7 +822,7 @@ // SECURITY round_credits += "

The Brave Security Officers:

" len_before_addition = round_credits.len - for(var/datum/mind/current in SSticker.mode.get_all_by_department(SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY))) + for(var/datum/mind/current in SSticker.mode.get_all_by_department(SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY))) custom_title_holder = get_custom_title_from_id(current, newline=TRUE) round_credits += "

[current.name] as the [current.assigned_role][custom_title_holder]

" if(round_credits.len == len_before_addition) @@ -831,7 +832,7 @@ // MEDICAL round_credits += "

The Wise Medical Department:

" len_before_addition = round_credits.len - for(var/datum/mind/current in SSticker.mode.get_all_by_department(SSdepartment.get_jobs_by_dept_id(DEPARTMENT_MEDICAL))) + for(var/datum/mind/current in SSticker.mode.get_all_by_department(SSdepartment.get_jobs_by_dept_id(DEPT_NAME_MEDICAL))) custom_title_holder = get_custom_title_from_id(current, newline=TRUE) round_credits += "

[current.name] as the [current.assigned_role][custom_title_holder]

" if(round_credits.len == len_before_addition) @@ -841,7 +842,7 @@ // ENGINEERING round_credits += "

The Industrious Engineers:

" len_before_addition = round_credits.len - for(var/datum/mind/current in SSticker.mode.get_all_by_department(SSdepartment.get_jobs_by_dept_id(DEPARTMENT_ENGINEERING))) + for(var/datum/mind/current in SSticker.mode.get_all_by_department(SSdepartment.get_jobs_by_dept_id(DEPT_NAME_ENGINEERING))) custom_title_holder = get_custom_title_from_id(current, newline=TRUE) round_credits += "

[current.name] as the [current.assigned_role][custom_title_holder]

" if(round_credits.len == len_before_addition) @@ -851,7 +852,7 @@ // SCIENCE round_credits += "

The Inventive Science Employees:

" len_before_addition = round_credits.len - for(var/datum/mind/current in SSticker.mode.get_all_by_department(SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SCIENCE))) + for(var/datum/mind/current in SSticker.mode.get_all_by_department(SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SCIENCE))) custom_title_holder = get_custom_title_from_id(current, newline=TRUE) round_credits += "

[current.name] as the [current.assigned_role][custom_title_holder]

" if(round_credits.len == len_before_addition) @@ -861,7 +862,7 @@ // CARGO round_credits += "

The Rugged Cargo Crew:

" len_before_addition = round_credits.len - for(var/datum/mind/current in SSticker.mode.get_all_by_department(SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CARGO))) + for(var/datum/mind/current in SSticker.mode.get_all_by_department(SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CARGO))) custom_title_holder = get_custom_title_from_id(current, newline=TRUE) round_credits += "

[current.name] as the [current.assigned_role][custom_title_holder]

" if(round_credits.len == len_before_addition) @@ -872,7 +873,7 @@ var/list/human_garbage = list() round_credits += "

The Hardy Civilians:

" len_before_addition = round_credits.len - for(var/datum/mind/current in SSticker.mode.get_all_by_department(SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CIVILIAN))) // gimmicks shouldn't be here, but let's not make the code dirty + for(var/datum/mind/current in SSticker.mode.get_all_by_department(SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CIVILIAN))) // gimmicks shouldn't be here, but let's not make the code dirty if(current.assigned_role == JOB_NAME_ASSISTANT) human_garbage += current else diff --git a/code/game/gamemodes/hivemind/hivemind.dm b/code/game/gamemodes/hivemind/hivemind.dm index fe0db4e2e6f0b..2159fcc800ca4 100644 --- a/code/game/gamemodes/hivemind/hivemind.dm +++ b/code/game/gamemodes/hivemind/hivemind.dm @@ -55,7 +55,7 @@ GLOBAL_LIST_EMPTY(hivehosts) restricted_jobs += JOB_NAME_ASSISTANT if(CONFIG_GET(flag/protect_heads_from_antagonist)) - restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) + restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) var/num_hosts = max( 3 , rand(0,1) + min(8, round(num_players() / 8) ) ) //1 host for every 8 players up to 64, with a 50% chance of an extra diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index c5ffa191d47d3..9a829bfc3892a 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -41,7 +41,7 @@ restricted_jobs += JOB_NAME_ASSISTANT if(CONFIG_GET(flag/protect_heads_from_antagonist)) - restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) + restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) if(num_players() < CONFIG_GET(number/malf_ai_minimum_pop)) restricted_jobs += JOB_NAME_AI diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 2f2ac20650d87..436d19bae2a19 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -380,7 +380,7 @@ GLOBAL_LIST_EMPTY(cryopod_computers) if(target == user && world.time - target.client.cryo_warned > 5 MINUTES)//if we haven't warned them in the last 5 minutes var/caught = FALSE var/datum/antagonist/A = target.mind.has_antag_datum(/datum/antagonist) - if(target.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND)) + if(target.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) alert("You're a Head of Staff![generic_plsnoleave_message]") caught = TRUE if(A) diff --git a/code/modules/admin/sql_ban_system.dm b/code/modules/admin/sql_ban_system.dm index 48c8d3749c3b4..ef2280917cd37 100644 --- a/code/modules/admin/sql_ban_system.dm +++ b/code/modules/admin/sql_ban_system.dm @@ -223,26 +223,29 @@ var/duration_type = "Temporary" var/time_units = "Minutes" var/use_last_connection = FALSE - var/static/list/static_roles = list("command" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND), - "security" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY), - "engineering" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_ENGINEERING), - "medical" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_MEDICAL), - "science" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SCIENCE), - "supply" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CARGO), - "silicon" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SILICON), - "civilian" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CIVILIAN), - "gimmick" = list(JOB_NAME_CLOWN,JOB_NAME_MIME,JOB_NAME_GIMMICK,JOB_NAME_ASSISTANT), //Hardcoded since it's not a real category but handy for rolebans - "antagonist_positions" = list(BAN_ROLE_ALL_ANTAGONISTS) + GLOB.antagonist_bannable_roles, - "forced_antagonist_positions" = list(BAN_ROLE_FORCED_ANTAGONISTS) + GLOB.forced_bannable_roles, - "ghost_roles" = list(BAN_ROLE_ALL_GHOST) + GLOB.ghost_role_bannable_roles, - "abstract" = list("Appearance", "Emote", "OOC", "DSAY"), - "other" = GLOB.other_bannable_roles) + var/static/list/static_roles var/static/list/group_list = list("command","security", "engineering", "medical", "science", "supply", "civilian", "gimmick", "antagonist_positions", "forced_antagonist_positions", "ghost_roles", "others") var/list/selected_roles var/list/selected_groups /datum/banning_panel/New() .=..() + if(!static_roles) + static_roles = list( + "command" = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND), + "security" = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY), + "engineering" = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_ENGINEERING), + "medical" = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_MEDICAL), + "science" = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SCIENCE), + "supply" = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CARGO), + "silicon" = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SILICON), + "civilian" = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CIVILIAN), + "gimmick" = list(JOB_NAME_CLOWN,JOB_NAME_MIME,JOB_NAME_GIMMICK,JOB_NAME_ASSISTANT), //Hardcoded since it's not a real category but handy for rolebans + "antagonist_positions" = list(BAN_ROLE_ALL_ANTAGONISTS) + GLOB.antagonist_bannable_roles, + "forced_antagonist_positions" = list(BAN_ROLE_FORCED_ANTAGONISTS) + GLOB.forced_bannable_roles, + "ghost_roles" = list(BAN_ROLE_ALL_GHOST) + GLOB.ghost_role_bannable_roles, + "abstract" = list("Appearance", "Emote", "OOC", "DSAY"), + "other" = GLOB.other_bannable_roles) selected_roles = list(0) selected_groups = list(0) @@ -1239,7 +1242,7 @@ output += "
" //all heads are listed twice so have a javascript call to toggle both their checkboxes when one is pressed //for simplicity this also includes the captain even though it doesn't do anything - for(var/job in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND)) + for(var/job in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) if(break_counter > 0 && (break_counter % 3 == 0)) output += "
" output += {"
" //standard departments all have identical handling - var/list/job_lists = list("Security" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY), - "Engineering" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_ENGINEERING), - "Medical" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_MEDICAL), - "Science" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SCIENCE), - "Supply" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CARGO)) + var/list/job_lists = list("Security" = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY), + "Engineering" = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_ENGINEERING), + "Medical" = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_MEDICAL), + "Science" = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SCIENCE), + "Supply" = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CARGO)) for(var/department in job_lists) //the first element is the department head so they need the same javascript call as above output += "
" @@ -1272,7 +1275,7 @@ break_counter++ output += "
" //departments/groups that don't have command staff would throw a javascript error since there's no corresponding reference for toggle_head() - var/list/headless_job_lists = list("Silicon" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SILICON), + var/list/headless_job_lists = list("Silicon" = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SILICON), "Abstract" = list("Appearance", "Emote", "OOC", "DSAY")) for(var/department in headless_job_lists) output += "
" @@ -1287,7 +1290,7 @@ break_counter++ output += "
" var/list/long_job_lists = list( - "Civilian" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CIVILIAN) | JOB_NAME_GIMMICK, + "Civilian" = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CIVILIAN) | JOB_NAME_GIMMICK, "Antagonist Positions" = list(BAN_ROLE_ALL_ANTAGONISTS) + GLOB.antagonist_bannable_roles, "Forced Antagonist Positions" = list(BAN_ROLE_FORCED_ANTAGONISTS) + GLOB.forced_bannable_roles, "Ghost Roles" = list(BAN_ROLE_ALL_GHOST) + GLOB.ghost_role_bannable_roles, diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index 1a20eac8d534c..99c15742591fe 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -53,7 +53,7 @@ temp.restricted_jobs += JOB_NAME_ASSISTANT if(CONFIG_GET(flag/protect_heads_from_antagonist)) - temp.restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) + temp.restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) var/list/mob/living/carbon/human/candidates = list() var/mob/living/carbon/human/H = null @@ -87,7 +87,7 @@ temp.restricted_jobs += JOB_NAME_ASSISTANT if(CONFIG_GET(flag/protect_heads_from_antagonist)) - temp.restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) + temp.restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) var/list/mob/living/carbon/human/candidates = list() var/mob/living/carbon/human/H = null @@ -157,7 +157,7 @@ temp.restricted_jobs += JOB_NAME_ASSISTANT if(CONFIG_GET(flag/protect_heads_from_antagonist)) - temp.restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) + temp.restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) var/list/mob/living/carbon/human/candidates = list() var/mob/living/carbon/human/H = null diff --git a/code/modules/antagonists/heretic/heretic_antag.dm b/code/modules/antagonists/heretic/heretic_antag.dm index b9f4c9b44061b..8daad0bd1335e 100644 --- a/code/modules/antagonists/heretic/heretic_antag.dm +++ b/code/modules/antagonists/heretic/heretic_antag.dm @@ -342,7 +342,7 @@ var/num_heads = 0 for(var/mob/player in SSticker.mode.current_players[CURRENT_LIVING_PLAYERS]) - if(player.client && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND))) + if(player.client && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND))) num_heads++ // Give normal sacrifice objective var/datum/objective/minor_sacrifice/sac_objective = new() @@ -622,7 +622,7 @@ return TRUE // You can ALWAYS sacrifice heads of staff if you need to do so. var/datum/objective/major_sacrifice/major_sacc_objective = locate() in objectives - if(major_sacc_objective && !major_sacc_objective.check_completion() && (target_mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND))) + if(major_sacc_objective && !major_sacc_objective.check_completion() && (target_mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND))) return TRUE /* diff --git a/code/modules/antagonists/heretic/knowledge/sacrifice_knowledge/sacrifice_knowledge.dm b/code/modules/antagonists/heretic/knowledge/sacrifice_knowledge/sacrifice_knowledge.dm index 97846aa85d4fd..e50e6b02b5dc3 100644 --- a/code/modules/antagonists/heretic/knowledge/sacrifice_knowledge/sacrifice_knowledge.dm +++ b/code/modules/antagonists/heretic/knowledge/sacrifice_knowledge/sacrifice_knowledge.dm @@ -112,14 +112,14 @@ // First target, any command. for(var/datum/mind/head_mind as anything in shuffle_inplace(valid_targets)) - if(head_mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND)) + if(head_mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) final_targets += head_mind valid_targets -= head_mind break // Second target, any security for(var/datum/mind/sec_mind as anything in shuffle_inplace(valid_targets)) - if(sec_mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY)) + if(sec_mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY)) final_targets += sec_mind valid_targets -= sec_mind break @@ -174,7 +174,7 @@ to_chat(user, "Your patron accepts your offer.") - if(sacrifice_mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND)) + if(sacrifice_mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) heretic_datum.adjust_knowledge_points(1) heretic_datum.high_value_sacrifices++ diff --git a/code/modules/antagonists/hivemind/spells/hivemind_shatter.dm b/code/modules/antagonists/hivemind/spells/hivemind_shatter.dm index 04289ee9ec18e..8537e1f6f2014 100644 --- a/code/modules/antagonists/hivemind/spells/hivemind_shatter.dm +++ b/code/modules/antagonists/hivemind/spells/hivemind_shatter.dm @@ -10,7 +10,7 @@ /obj/effect/proc_holder/spell/target_hive/hive_shatter/Initialize(mapload) . = ..() if(!special_roles) - special_roles = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY) + JOB_NAME_CAPTAIN + special_roles = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY) + JOB_NAME_CAPTAIN /obj/effect/proc_holder/spell/target_hive/hive_shatter/cast(list/targets, mob/living/user = usr) var/mob/living/carbon/human/target = targets[1] diff --git a/code/modules/antagonists/hivemind/spells/hivemind_shock.dm b/code/modules/antagonists/hivemind/spells/hivemind_shock.dm index 9993eea5778eb..c6c8772cccd86 100644 --- a/code/modules/antagonists/hivemind/spells/hivemind_shock.dm +++ b/code/modules/antagonists/hivemind/spells/hivemind_shock.dm @@ -13,7 +13,7 @@ return to_chat(user, "We begin increasing the psionic bandwidth between ourself and the vessel!") if(do_after(user, 30, user, timed_action_flags = IGNORE_HELD_ITEM)) - if(target.mind.assigned_role in (SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY) || SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND))) //Doesn't work on sec or command for balance reasons + if(target.mind.assigned_role in (SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY) || SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND))) //Doesn't work on sec or command for balance reasons to_chat(user, "A subconsciously trained response barely protects [target.name]'s mind.") to_chat(target, "Powerful mental attacks strike out against us, our training allows us to barely overcome it.") return diff --git a/code/modules/antagonists/ninja/ninja.dm b/code/modules/antagonists/ninja/ninja.dm index 722f0af4039c1..b09c6a50f3b5f 100644 --- a/code/modules/antagonists/ninja/ninja.dm +++ b/code/modules/antagonists/ninja/ninja.dm @@ -37,7 +37,7 @@ if(ishuman(M.current)) if(M.special_role) possible_targets[M] = 0 //bad-guy - else if(M.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND)) + else if(M.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) possible_targets[M] = 1 //good-guy var/list/possible_objectives = list(1,2,3,4) diff --git a/code/modules/antagonists/obsessed/objectives/jealousy.dm b/code/modules/antagonists/obsessed/objectives/jealousy.dm index e6ef6a0b5b230..58b3071f97664 100644 --- a/code/modules/antagonists/obsessed/objectives/jealousy.dm +++ b/code/modules/antagonists/obsessed/objectives/jealousy.dm @@ -19,18 +19,18 @@ var/list/all_coworkers = list() var/list/chosen_department //note that command and sillycone are gone because borgs can't be obsessions and the heads have their respective department. Sorry cap, your place is more with centcom or something - if(obsession.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY)) - chosen_department = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY) - else if(obsession.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_ENGINEERING)) - chosen_department = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_ENGINEERING) - else if(obsession.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_MEDICAL)) - chosen_department = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_MEDICAL) - else if(obsession.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SCIENCE)) - chosen_department = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SCIENCE) - else if(obsession.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CARGO)) - chosen_department = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CARGO) - else if(obsession.assigned_role in (SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CIVILIAN))) - chosen_department = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CIVILIAN) + if(obsession.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY)) + chosen_department = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY) + else if(obsession.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_ENGINEERING)) + chosen_department = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_ENGINEERING) + else if(obsession.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_MEDICAL)) + chosen_department = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_MEDICAL) + else if(obsession.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SCIENCE)) + chosen_department = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SCIENCE) + else if(obsession.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CARGO)) + chosen_department = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CARGO) + else if(obsession.assigned_role in (SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CIVILIAN))) + chosen_department = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CIVILIAN) else set_target(null) update_explanation_text() diff --git a/code/modules/antagonists/revolution/revolution.dm b/code/modules/antagonists/revolution/revolution.dm index 189adcff5943a..35eca74626a1b 100644 --- a/code/modules/antagonists/revolution/revolution.dm +++ b/code/modules/antagonists/revolution/revolution.dm @@ -15,7 +15,7 @@ /datum/antagonist/rev/can_be_owned(datum/mind/new_owner) . = ..() if(.) - if(new_owner.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND)) + if(new_owner.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) return FALSE if(new_owner.unconvertable) return FALSE diff --git a/code/modules/antagonists/roundstart_special/special_antagonist.dm b/code/modules/antagonists/roundstart_special/special_antagonist.dm index 3c713d263b8f2..21096d13338aa 100644 --- a/code/modules/antagonists/roundstart_special/special_antagonist.dm +++ b/code/modules/antagonists/roundstart_special/special_antagonist.dm @@ -37,7 +37,7 @@ restricted_jobs += JOB_NAME_ASSISTANT if(CONFIG_GET(flag/protect_heads_from_antagonist)) - restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) + restricted_jobs += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) /datum/special_role/proc/add_to_pool() if(spawn_mode == SPAWNTYPE_ROUNDSTART) diff --git a/code/modules/antagonists/roundstart_special/undercover/undercover.dm b/code/modules/antagonists/roundstart_special/undercover/undercover.dm index 1d2a8501fde99..c87c329c2f8bf 100644 --- a/code/modules/antagonists/roundstart_special/undercover/undercover.dm +++ b/code/modules/antagonists/roundstart_special/undercover/undercover.dm @@ -41,7 +41,7 @@ objectives += chosen_objective log_objective(owner, chosen_objective.explanation_text) - if(owner.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_ENGINEERING)) + if(owner.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_ENGINEERING)) var/datum/objective/protect_sm/objective = new if(objective.get_target()) objective.update_explanation_text() diff --git a/code/modules/client/preferences/middleware/jobs.dm b/code/modules/client/preferences/middleware/jobs.dm index 9fbc416c3c85d..8c167036a261c 100644 --- a/code/modules/client/preferences/middleware/jobs.dm +++ b/code/modules/client/preferences/middleware/jobs.dm @@ -46,8 +46,8 @@ if(job.lock_flags & ~JOB_LOCK_REASON_MAP) // anything but map reason shouldn't be visible continue - var/department_flag = job.department_for_prefs - if (isnull(department_flag)) + var/department_id = job.department_for_prefs + if (isnull(department_id)) stack_trace("[job] does not have a department set, yet is a joinable occupation!") continue @@ -55,17 +55,18 @@ stack_trace("[job] does not have a description set, yet is a joinable occupation!") continue - var/department_name = SSdepartment.department_bitflag_to_name["[department_flag]"] - if (isnull(departments[department_name])) + var/datum/department_group/dept = SSdepartment.department_assoc[department_id] + var/department_name = dept ? dept.dept_name : department_id // a bit of hardcoding. Captain/Assistant department doesn't exist, but it has a fancy theme in TGUI side. + if (isnull(departments[department_id])) var/department_head_jobname = job.department_head_for_prefs || job.department_head if(islist(department_head_jobname) && length(department_head_jobname)) department_head_jobname = department_head_jobname[1] if(length(department_head_jobname)) - departments[department_name] = list( + departments[department_id] = list( "head" = department_head_jobname, ) else - departments[department_name] = list() + departments[department_id] = list() jobs[job.title] = list( "lock_reason" = job.get_lock_reason(), diff --git a/code/modules/clothing/gloves/color.dm b/code/modules/clothing/gloves/color.dm index 5ed7d0686cf5b..e83b3e298df58 100644 --- a/code/modules/clothing/gloves/color.dm +++ b/code/modules/clothing/gloves/color.dm @@ -13,14 +13,14 @@ /obj/item/clothing/gloves/color/black/equipped(mob/user, slot) . = ..() - if((slot == ITEM_SLOT_GLOVES) && (user.mind?.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY))) + if((slot == ITEM_SLOT_GLOVES) && (user.mind?.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY))) SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "sec_black_gloves", /datum/mood_event/sec_black_gloves) /obj/item/clothing/gloves/color/black/dropped(mob/living/carbon/user) ..() if(user.gloves != src) return - if(user.mind?.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY)) + if(user.mind?.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY)) SEND_SIGNAL(user, COMSIG_CLEAR_MOOD_EVENT, "sec_black_gloves") /obj/item/clothing/gloves/color/yellow/equipped(mob/user, slot) @@ -28,7 +28,7 @@ if(slot == ITEM_SLOT_GLOVES) if(user.mind?.assigned_role == JOB_NAME_ASSISTANT) SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "assistant_insulated_gloves", /datum/mood_event/assistant_insulated_gloves) - if(user.mind?.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY)) + if(user.mind?.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY)) SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "sec_insulated_gloves", /datum/mood_event/sec_insulated_gloves) /obj/item/clothing/gloves/color/yellow/dropped(mob/living/carbon/user) @@ -37,7 +37,7 @@ return if(user.mind?.assigned_role == JOB_NAME_ASSISTANT) SEND_SIGNAL(user, COMSIG_CLEAR_MOOD_EVENT, "assistant_insulated_gloves") - if(user.mind?.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY)) + if(user.mind?.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY)) SEND_SIGNAL(user, COMSIG_CLEAR_MOOD_EVENT, "sec_insulated_gloves") diff --git a/code/modules/crew_objectives/civilian_objectives.dm b/code/modules/crew_objectives/civilian_objectives.dm index 0389310286c66..f1f83c0eec1e1 100644 --- a/code/modules/crew_objectives/civilian_objectives.dm +++ b/code/modules/crew_objectives/civilian_objectives.dm @@ -332,7 +332,7 @@ if(!owner?.current) return FALSE for(var/datum/mind/M in SSticker.minds) - if(!istype(M.current) || !(M.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY))) + if(!istype(M.current) || !(M.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY))) continue if(istype(get_area(M.current), /area/security/prison)) return FALSE diff --git a/code/modules/crew_objectives/security_objectives.dm b/code/modules/crew_objectives/security_objectives.dm index 2c783ee37dbe7..fc468e36ed957 100644 --- a/code/modules/crew_objectives/security_objectives.dm +++ b/code/modules/crew_objectives/security_objectives.dm @@ -45,7 +45,7 @@ if(!owner?.current) return FALSE for(var/datum/mind/M in SSticker.minds) - if(!istype(M.current) || (M.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY))) + if(!istype(M.current) || (M.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY))) continue if(istype(get_area(M.current), /area/security/prison)) return FALSE diff --git a/code/modules/events/creep_awakening.dm b/code/modules/events/creep_awakening.dm index cf639d6cf46fd..0a10e8acf6261 100644 --- a/code/modules/events/creep_awakening.dm +++ b/code/modules/events/creep_awakening.dm @@ -14,7 +14,7 @@ continue if(H.stat == DEAD) continue - if(!SSjob.GetJob(H.mind.assigned_role) || (H.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SILICON))) //only station jobs sans nonhuman roles, prevents ashwalkers trying to stalk with crewmembers they never met + if(!SSjob.GetJob(H.mind.assigned_role) || (H.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SILICON))) //only station jobs sans nonhuman roles, prevents ashwalkers trying to stalk with crewmembers they never met continue if(H.mind.has_antag_datum(/datum/antagonist/obsessed)) continue diff --git a/code/modules/events/heart_attack.dm b/code/modules/events/heart_attack.dm index 4e5e813495c2a..8717667474135 100644 --- a/code/modules/events/heart_attack.dm +++ b/code/modules/events/heart_attack.dm @@ -10,7 +10,7 @@ for(var/mob/living/carbon/human/victim in shuffle(GLOB.player_list)) if(victim.stat == DEAD || HAS_TRAIT(victim, TRAIT_CRITICAL_CONDITION) || !victim.can_heartattack() || victim.has_status_effect(STATUS_EFFECT_EXERCISED) || (/datum/disease/heart_failure in victim.diseases) || victim.undergoing_cardiac_arrest()) continue - if(!SSjob.GetJob(victim.mind.assigned_role) || (victim.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SILICON)))//only crewmembers can get one, a bit unfair for some ghost roles and it wastes the event + if(!SSjob.GetJob(victim.mind.assigned_role) || (victim.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SILICON)))//only crewmembers can get one, a bit unfair for some ghost roles and it wastes the event continue if(victim.satiety <= -60) //Multiple junk food items recently heart_attack_contestants[victim] = 3 diff --git a/code/modules/events/pirates.dm b/code/modules/events/pirates.dm index b97ac724c8517..943667e99ce5c 100644 --- a/code/modules/events/pirates.dm +++ b/code/modules/events/pirates.dm @@ -442,7 +442,7 @@ DEFINE_BUFFER_HANDLER(/obj/machinery/computer/piratepad_control) else if("pirate" in H.faction) //can't ransom your fellow pirates to CentCom! return 0 else - if(H.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND)) + if(H.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) return 3000 else return 1000 diff --git a/code/modules/events/special_antag_event.dm b/code/modules/events/special_antag_event.dm index aaa3f319411f5..d42fb634e66c9 100644 --- a/code/modules/events/special_antag_event.dm +++ b/code/modules/events/special_antag_event.dm @@ -49,7 +49,7 @@ continue if(H.stat == DEAD) continue - if(!SSjob.GetJob(H.mind.assigned_role) || (H.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SILICON))) //only station jobs sans nonhuman roles, prevents ashwalkers trying to stalk with crewmembers they never met + if(!SSjob.GetJob(H.mind.assigned_role) || (H.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SILICON))) //only station jobs sans nonhuman roles, prevents ashwalkers trying to stalk with crewmembers they never met continue if(H.mind.assigned_role in protected_jobs) continue diff --git a/code/modules/events/zombie_outbreak.dm b/code/modules/events/zombie_outbreak.dm index 182831d289447..57e3ff50322cc 100644 --- a/code/modules/events/zombie_outbreak.dm +++ b/code/modules/events/zombie_outbreak.dm @@ -17,7 +17,7 @@ for(var/mob/living/carbon/human/H in shuffle(GLOB.player_list)) if(H.stat == DEAD) continue - if(!SSjob.GetJob(H.mind.assigned_role) || (H.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SILICON))) + if(!SSjob.GetJob(H.mind.assigned_role) || (H.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SILICON))) continue if(!H.getorgan(/obj/item/organ/brain)) continue diff --git a/code/modules/jobs/job_exp.dm b/code/modules/jobs/job_exp.dm index be171d1e96738..a9d7237e71f91 100644 --- a/code/modules/jobs/job_exp.dm +++ b/code/modules/jobs/job_exp.dm @@ -28,22 +28,22 @@ GLOBAL_PROTECT(exp_to_update) return (job_requirement - my_exp) /datum/job/proc/get_exp_req_amount() - if(title in (SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) | list(JOB_NAME_AI))) + if(title in (SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) | list(JOB_NAME_AI))) var/uerhh = CONFIG_GET(number/use_exp_restrictions_heads_hours) if(uerhh) return uerhh * 60 return exp_requirements /datum/job/proc/get_exp_req_type() - if(title in (SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) | list(JOB_NAME_AI))) + if(title in (SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) | list(JOB_NAME_AI))) if(CONFIG_GET(flag/use_exp_restrictions_heads_department) && exp_type_department) return exp_type_department return exp_type /proc/job_is_xp_locked(jobtitle) - if(!CONFIG_GET(flag/use_exp_restrictions_heads) && (jobtitle in (SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) | list(JOB_NAME_AI)))) + if(!CONFIG_GET(flag/use_exp_restrictions_heads) && (jobtitle in (SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) | list(JOB_NAME_AI)))) return FALSE - if(!CONFIG_GET(flag/use_exp_restrictions_other) && !(jobtitle in (SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) | list(JOB_NAME_AI)))) + if(!CONFIG_GET(flag/use_exp_restrictions_other) && !(jobtitle in (SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) | list(JOB_NAME_AI)))) return FALSE return TRUE diff --git a/code/modules/jobs/job_types/_job.dm b/code/modules/jobs/job_types/_job.dm index c74c16a2b951f..9076903f7d390 100644 --- a/code/modules/jobs/job_types/_job.dm +++ b/code/modules/jobs/job_types/_job.dm @@ -255,7 +255,7 @@ /datum/job/proc/equip(mob/living/carbon/human/H, visualsOnly = FALSE, announce = TRUE, latejoin = FALSE, datum/outfit/outfit_override = null, client/preference_source) if(!H) return FALSE - if(CONFIG_GET(flag/enforce_human_authority) && (title in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND))) + if(CONFIG_GET(flag/enforce_human_authority) && (title in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND))) if(H.dna.species.id != SPECIES_HUMAN) H.set_species(/datum/species/human) H.apply_pref_name(/datum/preference/name/backup_human, preference_source) diff --git a/code/modules/jobs/job_types/ai.dm b/code/modules/jobs/job_types/ai.dm index ec6c6c2c044c3..f188d8d3c9168 100644 --- a/code/modules/jobs/job_types/ai.dm +++ b/code/modules/jobs/job_types/ai.dm @@ -1,7 +1,7 @@ /datum/job/ai title = JOB_NAME_AI description = "Follow your laws above all else, be the invisible eye that watches all." - department_for_prefs = DEPT_BITFLAG_SILICON + department_for_prefs = DEPT_NAME_SILICON department_head_for_prefs = JOB_NAME_AI auto_deadmin_role_flags = DEADMIN_POSITION_SILICON faction = "Station" diff --git a/code/modules/jobs/job_types/assistant.dm b/code/modules/jobs/job_types/assistant.dm index d7f6220d937b2..a978829c9977f 100644 --- a/code/modules/jobs/job_types/assistant.dm +++ b/code/modules/jobs/job_types/assistant.dm @@ -4,7 +4,7 @@ Assistant /datum/job/assistant title = JOB_NAME_ASSISTANT description = "Help out around the station or ask the Head of Personnel for an assignment. As the lowest-level position, expect to be treated like an intern most of the time." - department_for_prefs = DEPT_BITFLAG_CIV + department_for_prefs = DEPT_NAME_ASSISTANT supervisors = "absolutely everyone" faction = "Station" total_positions = 5 diff --git a/code/modules/jobs/job_types/atmospheric_technician.dm b/code/modules/jobs/job_types/atmospheric_technician.dm index ea50e71dacc03..5fce048294065 100644 --- a/code/modules/jobs/job_types/atmospheric_technician.dm +++ b/code/modules/jobs/job_types/atmospheric_technician.dm @@ -1,7 +1,7 @@ /datum/job/atmospheric_technician title = JOB_NAME_ATMOSPHERICTECHNICIAN description = "Maintain the air distribution loop to ensure adequate atmospheric conditions in the station, re-pressurize areas after hull breaches, and be a firefighter if necessary." - department_for_prefs = DEPT_BITFLAG_ENG + department_for_prefs = DEPT_NAME_ENGINEERING department_head = list(JOB_NAME_CHIEFENGINEER) supervisors = "the chief engineer" faction = "Station" diff --git a/code/modules/jobs/job_types/bartender.dm b/code/modules/jobs/job_types/bartender.dm index 929f7206caf2c..0485b07361056 100644 --- a/code/modules/jobs/job_types/bartender.dm +++ b/code/modules/jobs/job_types/bartender.dm @@ -1,7 +1,7 @@ /datum/job/bartender title = JOB_NAME_BARTENDER description = "Brew a variety of drinks for the crew, cooperate with Botany and Chemistry for more exotic recipes, create a comfy atmosphere in your Bar." - department_for_prefs = DEPT_BITFLAG_SRV + department_for_prefs = DEPT_NAME_SERVICE department_head = list(JOB_NAME_HEADOFPERSONNEL) supervisors = "the head of personnel" faction = "Station" diff --git a/code/modules/jobs/job_types/botanist.dm b/code/modules/jobs/job_types/botanist.dm index a941393c5d5c0..0996256ea346a 100644 --- a/code/modules/jobs/job_types/botanist.dm +++ b/code/modules/jobs/job_types/botanist.dm @@ -1,7 +1,7 @@ /datum/job/botanist title = JOB_NAME_BOTANIST description = "Grow plants for the Kitchen, Bar and Chemistry. Sell cannabis and other goods to the crew. Clone people with Replica Pods when needed." - department_for_prefs = DEPT_BITFLAG_SRV + department_for_prefs = DEPT_NAME_SERVICE department_head = list(JOB_NAME_HEADOFPERSONNEL) supervisors = "the head of personnel" faction = "Station" diff --git a/code/modules/jobs/job_types/brig_physician.dm b/code/modules/jobs/job_types/brig_physician.dm index 061f548aca764..0f98d71dc8d42 100644 --- a/code/modules/jobs/job_types/brig_physician.dm +++ b/code/modules/jobs/job_types/brig_physician.dm @@ -1,7 +1,7 @@ /datum/job/brig_physician title = JOB_NAME_BRIGPHYSICIAN description = "Tend to the health of Security Officers and Prisoners, help out at Medbay if you have free time." - department_for_prefs = DEPT_BITFLAG_SEC + department_for_prefs = DEPT_NAME_SECURITY department_head_for_prefs = JOB_NAME_HEADOFSECURITY department_head = list(JOB_NAME_CHIEFMEDICALOFFICER) supervisors = "chief medical officer" diff --git a/code/modules/jobs/job_types/captain.dm b/code/modules/jobs/job_types/captain.dm index d219ba7c5591c..c24ee581c7295 100755 --- a/code/modules/jobs/job_types/captain.dm +++ b/code/modules/jobs/job_types/captain.dm @@ -1,7 +1,7 @@ /datum/job/captain title = JOB_NAME_CAPTAIN description = "Supreme leader of the station, oversee and appoint missing heads of staff, manage alert levels and contact CentCom if needed. Don't forget to secure the nuclear authentication disk." - department_for_prefs = DEPT_BITFLAG_CAPTAIN + department_for_prefs = DEPT_NAME_CAPTAIN department_head_for_prefs = JOB_NAME_CAPTAIN auto_deadmin_role_flags = DEADMIN_POSITION_HEAD|DEADMIN_POSITION_SECURITY department_head = list("CentCom") diff --git a/code/modules/jobs/job_types/cargo_technician.dm b/code/modules/jobs/job_types/cargo_technician.dm index ba07498cbd9fa..0c3305a6d1c96 100644 --- a/code/modules/jobs/job_types/cargo_technician.dm +++ b/code/modules/jobs/job_types/cargo_technician.dm @@ -1,7 +1,7 @@ /datum/job/cargo_technician title = JOB_NAME_CARGOTECHNICIAN description = "Push crates around, deliver bounty papers and mail around the station, make use of the Disposals network to make your life easier." - department_for_prefs = DEPT_BITFLAG_CAR + department_for_prefs = DEPT_NAME_CARGO department_head_for_prefs = JOB_NAME_QUARTERMASTER department_head = list(JOB_NAME_HEADOFPERSONNEL) supervisors = "the quartermaster and the head of personnel" diff --git a/code/modules/jobs/job_types/chaplain.dm b/code/modules/jobs/job_types/chaplain.dm index 40b62532d1feb..8fa86133668ac 100644 --- a/code/modules/jobs/job_types/chaplain.dm +++ b/code/modules/jobs/job_types/chaplain.dm @@ -1,7 +1,7 @@ /datum/job/chaplain title = JOB_NAME_CHAPLAIN description = "Tend to the spiritual well-being of the crew, conduct rites and rituals in your Chapel, exorcise evil spirits and other supernatural beings." - department_for_prefs = DEPT_BITFLAG_CIV + department_for_prefs = DEPT_NAME_CIVILIAN department_head = list(JOB_NAME_HEADOFPERSONNEL) supervisors = "the head of personnel" faction = "Station" diff --git a/code/modules/jobs/job_types/chemist.dm b/code/modules/jobs/job_types/chemist.dm index a16860e35611c..109508d12fbcc 100644 --- a/code/modules/jobs/job_types/chemist.dm +++ b/code/modules/jobs/job_types/chemist.dm @@ -1,7 +1,7 @@ /datum/job/chemist title = JOB_NAME_CHEMIST description = "Create healing medicines and fullfill other requests when medicine isn't needed. Label everything you produce correctly to prevent confusion." - department_for_prefs = DEPT_BITFLAG_MED + department_for_prefs = DEPT_NAME_MEDICAL department_head = list(JOB_NAME_CHIEFMEDICALOFFICER) supervisors = "the chief medical officer" faction = "Station" diff --git a/code/modules/jobs/job_types/chief_engineer.dm b/code/modules/jobs/job_types/chief_engineer.dm index fef77efd53931..6ab3169c97500 100644 --- a/code/modules/jobs/job_types/chief_engineer.dm +++ b/code/modules/jobs/job_types/chief_engineer.dm @@ -1,7 +1,7 @@ /datum/job/chief_engineer title = JOB_NAME_CHIEFENGINEER description = "Oversee the engineers and atmospheric technicians, keep a watchful eye on the station's engine, gravity generator, and telecomms. Send your staff to repair hull breaches and damaged equipment as necessary." - department_for_prefs = DEPT_BITFLAG_ENG + department_for_prefs = DEPT_NAME_ENGINEERING auto_deadmin_role_flags = DEADMIN_POSITION_HEAD department_head = list(JOB_NAME_CAPTAIN) supervisors = "the captain" diff --git a/code/modules/jobs/job_types/chief_medical_officer.dm b/code/modules/jobs/job_types/chief_medical_officer.dm index 9c0244dd0bc3a..c6d52684a0b00 100644 --- a/code/modules/jobs/job_types/chief_medical_officer.dm +++ b/code/modules/jobs/job_types/chief_medical_officer.dm @@ -3,7 +3,7 @@ description = "Oversee paramedics, doctors, chemists, geneticists and the virologist. \ Ensure doctors and paramedicts are treating people in a timely manner, request medicine and other concoctions from chemists, \ and ensure geneticists and the virologist are following appropriate safety precautions while performing their research." - department_for_prefs = DEPT_BITFLAG_MED + department_for_prefs = DEPT_NAME_MEDICAL department_head = list(JOB_NAME_CAPTAIN) supervisors = "the captain" auto_deadmin_role_flags = DEADMIN_POSITION_HEAD diff --git a/code/modules/jobs/job_types/clown.dm b/code/modules/jobs/job_types/clown.dm index 89814a413c64e..bb3e5727df133 100644 --- a/code/modules/jobs/job_types/clown.dm +++ b/code/modules/jobs/job_types/clown.dm @@ -1,7 +1,7 @@ /datum/job/clown title = JOB_NAME_CLOWN description = "Be the life and soul of the station. Entertain the crew with your hilarious jokes and silly antics, including slipping, pie-ing and honking around. Remember your job is to keep things funny for others, not just yourself." - department_for_prefs = DEPT_BITFLAG_SRV + department_for_prefs = DEPT_NAME_SERVICE department_head = list(JOB_NAME_HEADOFPERSONNEL) supervisors = "the head of personnel" faction = "Station" diff --git a/code/modules/jobs/job_types/cook.dm b/code/modules/jobs/job_types/cook.dm index 94d50a5002284..1b75a9340dbd3 100644 --- a/code/modules/jobs/job_types/cook.dm +++ b/code/modules/jobs/job_types/cook.dm @@ -1,7 +1,7 @@ /datum/job/cook title = JOB_NAME_COOK description = "Whip up meals for the crew, get creative and cook different meals, request ingredients from Botany and Cargo. Make sure everyone stays well fed and happy." - department_for_prefs = DEPT_BITFLAG_SRV + department_for_prefs = DEPT_NAME_SERVICE department_head = list(JOB_NAME_HEADOFPERSONNEL) supervisors = "the head of personnel" faction = "Station" diff --git a/code/modules/jobs/job_types/curator.dm b/code/modules/jobs/job_types/curator.dm index 560c97f8bf238..a50627fbe99a8 100644 --- a/code/modules/jobs/job_types/curator.dm +++ b/code/modules/jobs/job_types/curator.dm @@ -1,7 +1,7 @@ /datum/job/curator title = JOB_NAME_CURATOR description = "Be in charge of maintaining the library, engage in peace talks with alien races using your knowledge of all languages, cosplay to your heart's content." - department_for_prefs = DEPT_BITFLAG_CIV + department_for_prefs = DEPT_NAME_CIVILIAN department_head = list(JOB_NAME_HEADOFPERSONNEL) supervisors = "the head of personnel" faction = "Station" diff --git a/code/modules/jobs/job_types/cyborg.dm b/code/modules/jobs/job_types/cyborg.dm index 44f340c3bd80d..f9d1ccf21a7ad 100644 --- a/code/modules/jobs/job_types/cyborg.dm +++ b/code/modules/jobs/job_types/cyborg.dm @@ -1,7 +1,7 @@ /datum/job/cyborg title = JOB_NAME_CYBORG description = "Follow your AI's interpretation of your laws above all else, or your own interpretation if not connected to an AI. Choose one of many modules with different tools, ask robotics for maintenance and upgrades." - department_for_prefs = DEPT_BITFLAG_SILICON + department_for_prefs = DEPT_NAME_SILICON department_head_for_prefs = JOB_NAME_AI auto_deadmin_role_flags = DEADMIN_POSITION_SILICON faction = "Station" diff --git a/code/modules/jobs/job_types/deputy.dm b/code/modules/jobs/job_types/deputy.dm index a230b81277615..1592731e31a69 100644 --- a/code/modules/jobs/job_types/deputy.dm +++ b/code/modules/jobs/job_types/deputy.dm @@ -2,7 +2,7 @@ title = JOB_NAME_DEPUTY description = "Follow orders and do your best to maintain order on the station while following Space Law." lock_flags = JOB_LOCK_REASON_ABSTRACT - department_for_prefs = DEPT_BITFLAG_SEC + department_for_prefs = DEPT_NAME_SECURITY department_head = list(JOB_NAME_HEADOFSECURITY) supervisors = "the head of security" faction = "Station" diff --git a/code/modules/jobs/job_types/detective.dm b/code/modules/jobs/job_types/detective.dm index 19d228d8c5a19..f0e993d9496cd 100644 --- a/code/modules/jobs/job_types/detective.dm +++ b/code/modules/jobs/job_types/detective.dm @@ -1,7 +1,7 @@ /datum/job/detective title = JOB_NAME_DETECTIVE description = "Investigate crimes, solve murder mysteries, report your findings to the rest of Security." - department_for_prefs = DEPT_BITFLAG_SEC + department_for_prefs = DEPT_NAME_SECURITY auto_deadmin_role_flags = DEADMIN_POSITION_SECURITY department_head = list(JOB_NAME_HEADOFSECURITY) supervisors = "the head of security" diff --git a/code/modules/jobs/job_types/exploration_team.dm b/code/modules/jobs/job_types/exploration_team.dm index 8e70971e5f94d..d268a78292208 100644 --- a/code/modules/jobs/job_types/exploration_team.dm +++ b/code/modules/jobs/job_types/exploration_team.dm @@ -1,7 +1,7 @@ /datum/job/exploration_crew title = JOB_NAME_EXPLORATIONCREW description = "Go out into space to complete different missions for loads of cash. Find and deliver back research disks for rare technologies." - department_for_prefs = DEPT_BITFLAG_SCI + department_for_prefs = DEPT_NAME_SCIENCE department_head = list(JOB_NAME_RESEARCHDIRECTOR) supervisors = "the research director" faction = "Station" diff --git a/code/modules/jobs/job_types/geneticist.dm b/code/modules/jobs/job_types/geneticist.dm index f3fd7d3c29b1b..07d6a43a9a1b6 100644 --- a/code/modules/jobs/job_types/geneticist.dm +++ b/code/modules/jobs/job_types/geneticist.dm @@ -1,7 +1,7 @@ /datum/job/geneticist title = JOB_NAME_GENETICIST description = "Discover useful mutations and give them out to the crew at CMO's approval, oversee Cloning, create humanized monkeys for replacement organs and bodyparts if needed." - department_for_prefs = DEPT_BITFLAG_MED + department_for_prefs = DEPT_NAME_MEDICAL department_head = list(JOB_NAME_CHIEFMEDICALOFFICER) supervisors = "the chief medical officer" faction = "Station" diff --git a/code/modules/jobs/job_types/gimmick.dm b/code/modules/jobs/job_types/gimmick.dm index f9c81734717e5..9c96c6777e238 100644 --- a/code/modules/jobs/job_types/gimmick.dm +++ b/code/modules/jobs/job_types/gimmick.dm @@ -1,7 +1,7 @@ /datum/job/gimmick //gimmick var must be set to true for all gimmick jobs BUT the parent title = JOB_NAME_GIMMICK description = "Use your unique position to provide a service or entertain the crew." - department_for_prefs = DEPT_BITFLAG_CIV + department_for_prefs = DEPT_NAME_ASSISTANT show_in_prefs = TRUE faction = "Station" total_positions = 0 diff --git a/code/modules/jobs/job_types/head_of_personnel.dm b/code/modules/jobs/job_types/head_of_personnel.dm index ad742cde12ee2..bb263db490a18 100644 --- a/code/modules/jobs/job_types/head_of_personnel.dm +++ b/code/modules/jobs/job_types/head_of_personnel.dm @@ -1,7 +1,7 @@ /datum/job/head_of_personnel title = JOB_NAME_HEADOFPERSONNEL description = "Second in command on the station, oversee the crew assigned to service and cargo positions, handle department transfer requests by consulting relevant heads. Protect Ian at all costs." - department_for_prefs = DEPT_BITFLAG_CAPTAIN + department_for_prefs = DEPT_NAME_CAPTAIN department_head_for_prefs = JOB_NAME_CAPTAIN auto_deadmin_role_flags = DEADMIN_POSITION_HEAD department_head = list(JOB_NAME_CAPTAIN) diff --git a/code/modules/jobs/job_types/head_of_security.dm b/code/modules/jobs/job_types/head_of_security.dm index 9776bb8c450b2..4bd8b768ae9f7 100644 --- a/code/modules/jobs/job_types/head_of_security.dm +++ b/code/modules/jobs/job_types/head_of_security.dm @@ -1,7 +1,7 @@ /datum/job/head_of_security title = JOB_NAME_HEADOFSECURITY description = "Oversee the members of security and ensure they follow Space Law. Deputize other crew members when the station is in need of additional protection." - department_for_prefs = DEPT_BITFLAG_SEC + department_for_prefs = DEPT_NAME_SECURITY auto_deadmin_role_flags = DEADMIN_POSITION_HEAD|DEADMIN_POSITION_SECURITY department_head = list(JOB_NAME_CAPTAIN) supervisors = "the captain" diff --git a/code/modules/jobs/job_types/janitor.dm b/code/modules/jobs/job_types/janitor.dm index 5a333a00d53c3..5acac3c911f03 100644 --- a/code/modules/jobs/job_types/janitor.dm +++ b/code/modules/jobs/job_types/janitor.dm @@ -1,7 +1,7 @@ /datum/job/janitor title = JOB_NAME_JANITOR description = "Clean up vomit, trash, and other messes around the station. Put down signs to warn people of slipping hazards, and eradicate rodents when you find them. Keep the station clean and tidy." - department_for_prefs = DEPT_BITFLAG_SRV + department_for_prefs = DEPT_NAME_SERVICE department_head = list(JOB_NAME_HEADOFPERSONNEL) supervisors = "the head of personnel" faction = "Station" diff --git a/code/modules/jobs/job_types/lawyer.dm b/code/modules/jobs/job_types/lawyer.dm index 5762360acf3a4..3d2f6e0e1f38f 100644 --- a/code/modules/jobs/job_types/lawyer.dm +++ b/code/modules/jobs/job_types/lawyer.dm @@ -1,7 +1,7 @@ /datum/job/lawyer title = JOB_NAME_LAWYER description = "Ensure Security follows Space Law and Standard Operating Procedure perfectly, represent your clients in trials and other legal troubles, make sure the crew is treated fairly by the men in red." - department_for_prefs = DEPT_BITFLAG_CIV + department_for_prefs = DEPT_NAME_CIVILIAN department_head = list(JOB_NAME_HEADOFPERSONNEL) supervisors = "the head of personnel" faction = "Station" diff --git a/code/modules/jobs/job_types/medical_doctor.dm b/code/modules/jobs/job_types/medical_doctor.dm index 8e66812bdd2b8..724fd92b5640b 100644 --- a/code/modules/jobs/job_types/medical_doctor.dm +++ b/code/modules/jobs/job_types/medical_doctor.dm @@ -1,7 +1,7 @@ /datum/job/medical_doctor title = JOB_NAME_MEDICALDOCTOR description = "Treat people of both minor wounds, serious injuries and resurrect them from the dead. Make use of surgeries and surgical tools, Chemistry's pills and patches, Virology's viruses and in dire cases, Genetics' cloning." - department_for_prefs = DEPT_BITFLAG_MED + department_for_prefs = DEPT_NAME_MEDICAL department_head = list(JOB_NAME_CHIEFMEDICALOFFICER) supervisors = "the chief medical officer" faction = "Station" diff --git a/code/modules/jobs/job_types/mime.dm b/code/modules/jobs/job_types/mime.dm index ea4076e5edcb0..a6a74bc713df7 100644 --- a/code/modules/jobs/job_types/mime.dm +++ b/code/modules/jobs/job_types/mime.dm @@ -1,7 +1,7 @@ /datum/job/mime title = JOB_NAME_MIME description = "Be the Clown's mute counterpart and arch nemesis. Conduct pantomimes and performances, create interesting situations with your mime powers. Remember your job is to keep things funny for others, not just yourself." - department_for_prefs = DEPT_BITFLAG_SRV + department_for_prefs = DEPT_NAME_SERVICE department_head = list(JOB_NAME_HEADOFPERSONNEL) supervisors = "the head of personnel" faction = "Station" diff --git a/code/modules/jobs/job_types/paramedic.dm b/code/modules/jobs/job_types/paramedic.dm index 9446f367c64b1..7d6ead4ac4e35 100644 --- a/code/modules/jobs/job_types/paramedic.dm +++ b/code/modules/jobs/job_types/paramedic.dm @@ -1,7 +1,7 @@ /datum/job/paramedic title = JOB_NAME_PARAMEDIC description = "Retrieve the gravely injured and dead people from around the station, deliver medicine for minor wounds, and keep a close eye on the Crew Monitor in your free time." - department_for_prefs = DEPT_BITFLAG_MED + department_for_prefs = DEPT_NAME_MEDICAL department_head = list(JOB_NAME_CHIEFMEDICALOFFICER) supervisors = "the chief medical officer" faction = "Station" diff --git a/code/modules/jobs/job_types/quartermaster.dm b/code/modules/jobs/job_types/quartermaster.dm index e7f73f93703d7..ab851240e59b3 100644 --- a/code/modules/jobs/job_types/quartermaster.dm +++ b/code/modules/jobs/job_types/quartermaster.dm @@ -1,7 +1,7 @@ /datum/job/quartermaster title = JOB_NAME_QUARTERMASTER description = "Oversee and direct cargo technicians to fulfill requests for supplies and keep the station well stocked, request funds from department budgets to cover costs, deny frivolous orders when money is tight, and sell anything the station doesn't need." - department_for_prefs = DEPT_BITFLAG_CAR + department_for_prefs = DEPT_NAME_CARGO department_head = list(JOB_NAME_HEADOFPERSONNEL) supervisors = "the head of personnel" faction = "Station" diff --git a/code/modules/jobs/job_types/research_director.dm b/code/modules/jobs/job_types/research_director.dm index 90bb0625798e6..5f6b8f3920b16 100644 --- a/code/modules/jobs/job_types/research_director.dm +++ b/code/modules/jobs/job_types/research_director.dm @@ -1,7 +1,7 @@ /datum/job/research_director title = JOB_NAME_RESEARCHDIRECTOR description = "Oversee the scientists and roboticists and keep up with their research projects, take care of any issues with the station's AI that may arise, ensure research is being prioritized in accordance with the needs of the station." - department_for_prefs = DEPT_BITFLAG_SCI + department_for_prefs = DEPT_NAME_SCIENCE auto_deadmin_role_flags = DEADMIN_POSITION_HEAD department_head = list(JOB_NAME_CAPTAIN) supervisors = "the captain" diff --git a/code/modules/jobs/job_types/roboticist.dm b/code/modules/jobs/job_types/roboticist.dm index 1e74792bb1826..358353cebcdd3 100644 --- a/code/modules/jobs/job_types/roboticist.dm +++ b/code/modules/jobs/job_types/roboticist.dm @@ -1,7 +1,7 @@ /datum/job/roboticist title = JOB_NAME_ROBOTICIST description = "Create bots and utility mechs for helping out around the station. Construct war machines by the request of the Captain or Head of Security. Make new Cyborgs, give augmentations and implants to crew members." - department_for_prefs = DEPT_BITFLAG_SCI + department_for_prefs = DEPT_NAME_SCIENCE department_head = list(JOB_NAME_RESEARCHDIRECTOR) faction = "Station" total_positions = 2 diff --git a/code/modules/jobs/job_types/scientist.dm b/code/modules/jobs/job_types/scientist.dm index 766d48a679d50..e1fe515d40a4b 100644 --- a/code/modules/jobs/job_types/scientist.dm +++ b/code/modules/jobs/job_types/scientist.dm @@ -1,7 +1,7 @@ /datum/job/scientist title = JOB_NAME_SCIENTIST description = "Engage in Xenobiology, Xenoarchaeology, Nanites, and Toxins; research new technology; and upgrade the machine parts around the station." - department_for_prefs = DEPT_BITFLAG_SCI + department_for_prefs = DEPT_NAME_SCIENCE department_head = list(JOB_NAME_RESEARCHDIRECTOR) supervisors = "the research director" faction = "Station" diff --git a/code/modules/jobs/job_types/security_officer.dm b/code/modules/jobs/job_types/security_officer.dm index 05b9f5aef5aa2..2e39e130d1508 100644 --- a/code/modules/jobs/job_types/security_officer.dm +++ b/code/modules/jobs/job_types/security_officer.dm @@ -1,7 +1,7 @@ /datum/job/security_officer title = JOB_NAME_SECURITYOFFICER description = "Follow Space Law, patrol the station, arrest criminals and bring them to the Brig." - department_for_prefs = DEPT_BITFLAG_SEC + department_for_prefs = DEPT_NAME_SECURITY auto_deadmin_role_flags = DEADMIN_POSITION_SECURITY department_head = list(JOB_NAME_HEADOFSECURITY) supervisors = "the head of security, and the head of your assigned department (if applicable)" diff --git a/code/modules/jobs/job_types/shaft_miner.dm b/code/modules/jobs/job_types/shaft_miner.dm index e354e11dfac6a..017d02ecc8251 100644 --- a/code/modules/jobs/job_types/shaft_miner.dm +++ b/code/modules/jobs/job_types/shaft_miner.dm @@ -1,7 +1,7 @@ /datum/job/shaft_miner title = JOB_NAME_SHAFTMINER description = "Collect resources for the station, redeem them for points, and purchase gear to collect even more ores." - department_for_prefs = DEPT_BITFLAG_CAR + department_for_prefs = DEPT_NAME_CARGO department_head_for_prefs = JOB_NAME_QUARTERMASTER department_head = list(JOB_NAME_HEADOFPERSONNEL) supervisors = "the quartermaster and the head of personnel" diff --git a/code/modules/jobs/job_types/station_engineer.dm b/code/modules/jobs/job_types/station_engineer.dm index 6f275877b348a..be804c940e18b 100644 --- a/code/modules/jobs/job_types/station_engineer.dm +++ b/code/modules/jobs/job_types/station_engineer.dm @@ -1,7 +1,7 @@ /datum/job/station_engineer title = JOB_NAME_STATIONENGINEER description = "Ensure the station has an adequate power supply, repair and build new machinery, repair wiring chewed up by mice." - department_for_prefs = DEPT_BITFLAG_ENG + department_for_prefs = DEPT_NAME_ENGINEERING department_head = list(JOB_NAME_CHIEFENGINEER) supervisors = "the chief engineer" faction = "Station" diff --git a/code/modules/jobs/job_types/virologist.dm b/code/modules/jobs/job_types/virologist.dm index 42ae7a5ecca43..b4c99aab59b89 100644 --- a/code/modules/jobs/job_types/virologist.dm +++ b/code/modules/jobs/job_types/virologist.dm @@ -1,7 +1,7 @@ /datum/job/virologist title = JOB_NAME_VIROLOGIST description = "Collect virus samples from dormant viruses, old blood, and crusty vomit from around the station, isolate the symptoms and use them to create useful healing viruses for the crew." - department_for_prefs = DEPT_BITFLAG_MED + department_for_prefs = DEPT_NAME_MEDICAL department_head = list(JOB_NAME_CHIEFMEDICALOFFICER) supervisors = "the chief medical officer" faction = "Station" diff --git a/code/modules/jobs/job_types/warden.dm b/code/modules/jobs/job_types/warden.dm index c96b0bfcbad32..c06cd31ce4a43 100644 --- a/code/modules/jobs/job_types/warden.dm +++ b/code/modules/jobs/job_types/warden.dm @@ -1,7 +1,7 @@ /datum/job/warden title = JOB_NAME_WARDEN description = "Oversee prisoners in the brig and guard the armory. Hand out equipment when necessary and ensure it is returned after threats have been contained." - department_for_prefs = DEPT_BITFLAG_SEC + department_for_prefs = DEPT_NAME_SECURITY auto_deadmin_role_flags = DEADMIN_POSITION_SECURITY department_head = list(JOB_NAME_HEADOFSECURITY) supervisors = "the head of security" diff --git a/code/modules/jobs/jobs.dm b/code/modules/jobs/jobs.dm index 49799f9aafbad..14ec902def64c 100644 --- a/code/modules/jobs/jobs.dm +++ b/code/modules/jobs/jobs.dm @@ -86,18 +86,8 @@ GLOBAL_LIST_INIT(exp_removed_jobsmap, list( )) GLOBAL_PROTECT(exp_removed_jobsmap) -GLOBAL_LIST_INIT(exp_jobsmap, list( - EXP_TYPE_CREW = list("titles" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND) | SSdepartment.get_jobs_by_dept_id(DEPARTMENT_ENGINEERING) | SSdepartment.get_jobs_by_dept_id(DEPARTMENT_MEDICAL) | SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SCIENCE) | SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CARGO) | SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY) | SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CIVILIAN) | SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SILICON)), // crew positions - EXP_TYPE_COMMAND = list("titles" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND)), - EXP_TYPE_ENGINEERING = list("titles" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_ENGINEERING)), - EXP_TYPE_MEDICAL = list("titles" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_MEDICAL)), - EXP_TYPE_SCIENCE = list("titles" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SCIENCE)), - EXP_TYPE_SUPPLY = list("titles" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CARGO)), - EXP_TYPE_SECURITY = list("titles" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY)), - EXP_TYPE_SILICON = list("titles" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SILICON)), - EXP_TYPE_SERVICE = list("titles" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CIVILIAN)) -)) - +// DO NOT INITIALIZE HERE. department subsystem initializes this. +GLOBAL_LIST_EMPTY(exp_jobsmap) GLOBAL_LIST_INIT(exp_specialmap, list( EXP_TYPE_LIVING = list(), // all living mobs EXP_TYPE_ANTAG = list(), diff --git a/code/modules/mob/dead/crew_manifest.dm b/code/modules/mob/dead/crew_manifest.dm index fb7ed91527216..82eb0e8066612 100644 --- a/code/modules/mob/dead/crew_manifest.dm +++ b/code/modules/mob/dead/crew_manifest.dm @@ -27,7 +27,7 @@ GLOBAL_DATUM_INIT(crew_manifest_tgui, /datum/crew_manifest, new) "command" = list( "name" = "Command", "huds" = GLOB.command_huds, - "jobs" = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND), + "jobs" = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND), "order" = SSjob.chain_of_command ), "order" = ordering, diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index 2b05868002d98..8e5aa9ad1598a 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -407,16 +407,17 @@ SSjob.prioritized_jobs -= prioritized_job dat += "
" var/column_counter = 0 - for(var/datum/department_group/each_dept in SSdepartment.get_departments_by_pref_order()) - var/cat_color = each_dept.dept_colour + for(var/datum/department_group/each_dept as anything in SSdepartment.sorted_department_for_latejoin) + var/dept_name = each_dept.pref_category_name + var/cat_color = each_dept.dept_colour || "#ff46c7" // failsafe colour dat += "
" - dat += "[each_dept.dept_name]" + dat += "[dept_name]" var/list/valid_jobs = list() for(var/job in each_dept.jobs) var/datum/job/job_datum = SSjob.name_occupations[job] if(job_datum && IsJobUnavailable(job_datum.title, TRUE) == JOB_AVAILABLE) var/command_bold = "" - if(each_dept.dept_id == DEPARTMENT_COMMAND || (job in each_dept.leaders)) + if(each_dept.dept_id == DEPT_NAME_COMMAND || (job in each_dept.leaders)) command_bold = " command" if(job_datum in SSjob.prioritized_jobs) valid_jobs += "[job_datum.title] ([job_datum.current_positions])" diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 26475d7b13865..856abe2b7ee61 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -227,7 +227,7 @@ GLOBAL_LIST_EMPTY(features_by_species) //Please override this locally if you want to define when what species qualifies for what rank if human authority is enforced. /datum/species/proc/qualifies_for_rank(rank, list/features) - if(rank in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_COMMAND)) + if(rank in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) return 0 return 1 diff --git a/code/modules/mob/living/carbon/human/species_types/plasmamen.dm b/code/modules/mob/living/carbon/human/species_types/plasmamen.dm index a427e13f57de2..584ea5dddfa43 100644 --- a/code/modules/mob/living/carbon/human/species_types/plasmamen.dm +++ b/code/modules/mob/living/carbon/human/species_types/plasmamen.dm @@ -93,7 +93,7 @@ H.open_internals(H.get_item_for_held_index(2)) /datum/species/plasmaman/qualifies_for_rank(rank, list/features) - if(rank in SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY)) + if(rank in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY)) return 0 if(rank == JOB_NAME_CLOWN || rank == JOB_NAME_MIME)//No funny bussiness return 0 diff --git a/code/modules/modular_computers/file_system/programs/card.dm b/code/modules/modular_computers/file_system/programs/card.dm index 2d125064be040..d20e3d132b6b7 100644 --- a/code/modules/modular_computers/file_system/programs/card.dm +++ b/code/modules/modular_computers/file_system/programs/card.dm @@ -300,12 +300,12 @@ else if(isnull(departments)) departments = list( CARDCON_DEPARTMENT_COMMAND = list(JOB_NAME_CAPTAIN),//lol - CARDCON_DEPARTMENT_ENGINEERING = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_ENGINEERING), - CARDCON_DEPARTMENT_MEDICAL = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_MEDICAL), - CARDCON_DEPARTMENT_SCIENCE = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SCIENCE), - CARDCON_DEPARTMENT_SECURITY = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_SECURITY), - CARDCON_DEPARTMENT_SUPPLY = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CARGO), - CARDCON_DEPARTMENT_CIVILIAN = SSdepartment.get_jobs_by_dept_id(DEPARTMENT_CIVILIAN) + CARDCON_DEPARTMENT_ENGINEERING = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_ENGINEERING), + CARDCON_DEPARTMENT_MEDICAL = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_MEDICAL), + CARDCON_DEPARTMENT_SCIENCE = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SCIENCE), + CARDCON_DEPARTMENT_SECURITY = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY), + CARDCON_DEPARTMENT_SUPPLY = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CARGO), + CARDCON_DEPARTMENT_CIVILIAN = SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CIVILIAN) ) data["jobs"] = list() for(var/department in departments) diff --git a/html/changelog.html b/html/changelog.html index fed0ac601781f..5a1963c19fba9 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -847,6 +847,62 @@

rkz, MrMelbert(Lizard Variants), Krysonism(New sprites), Thun
  • new lizard plushy variants!
  • Find a few new lizard plushy hiding spots, because they now exist in the maps! Oppose the moths!
  • + +

    09 June 2024

    +

    PowerfulBacon updated:

    +
      +
    • Removes the unintuitive and inconsistent interaction with PDA and firelock.
    • +
    + +

    07 June 2024

    +

    TsunamiAnt updated:

    +
      +
    • no pool overlay on ocean water
    • +
    • deep water is now called deep water
    • +
    +

    ro5490 updated:

    +
      +
    • Added Final Darkness rite to the Shadow-Sect
    • +
    • Faithsworn mob
    • +
    + +

    04 June 2024

    +

    EvilDragonfiend updated:

    +
      +
    • _basemap.dm has FORCE_MAP define options for debug
    • +
    +

    PowerfulBacon updated:

    +
      +
    • Increases weapon slowdown for heavy weapons.
    • +
    • Fixes incorrect message on brains and heads.
    • +
    • Fixes z-clear not announcing brains that have someone inside their brain instead of ghosted.
    • +
    +

    ro5490 updated:

    +
      +
    • fixed openspace tiles being replaced by a nature orb
    • +
    + +

    03 June 2024

    +

    Geatish updated:

    +
      +
    • You can now choose cigars and DromedaryCo cigs in the smoker trait option
    • +
    +

    HowToLoLu updated:

    +
      +
    • The autolathe shock wire reacts to cutting the wire once more
    • +
    + +

    01 June 2024

    +

    Gilgaxx updated:

    +
      +
    • fixed even MORE broken arcade machines
    • +
    + +

    30 May 2024

    +

    PowerfulBacon updated:

    +
      +
    • Fix cult construct creation spawning copies of the construct.
    • +
    GoonStation 13 Development Team