From 5b3199e03e1e7d0528e4e633444a011b9a38e26d Mon Sep 17 00:00:00 2001 From: XeonMations <62395746+XeonMations@users.noreply.github.com> Date: Sat, 21 Sep 2024 00:23:58 +0300 Subject: [PATCH] [Port] Departmental Refactor (#11209) * brbrbr * made latejoin work * Squashed commit of the following: commit feb4830175e42ca8bf990def154c3a067ca74bbd Author: Evildragon Date: Mon Aug 12 19:18:41 2024 +0900 squashed commit 3995bb69dcf98ebc5e8c74379eee253916fcf12b Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Tue Jul 30 00:12:18 2024 +0000 Automatic changelog compile [ci skip] commit bfa45eb2a10832386ec4037871d0686daf7225e8 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Mon Jul 29 13:06:00 2024 +0000 Automatic changelog compile [ci skip] commit 4718a841c88807c527405936b9cda9f264f570e0 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Mon Jul 29 07:20:21 2024 -0500 Automatic changelog generation for PR #11246 [ci skip] commit 25bba7ddfa1c9d792a20861d6f9e0c44b447235c Author: spockye <79304582+spockye@users.noreply.github.com> Date: Mon Jul 29 14:10:09 2024 +0200 fixes missing wall (#11246) commit 75fed789d90bdf5c1c8dccd364e89f6b4ae2b95e Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Mon Jul 29 00:12:20 2024 +0000 Automatic changelog compile [ci skip] commit ad07e7cd45f1a90921b342a7e9319858ae6dccda Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Sun Jul 28 23:03:33 2024 +0000 Automatic changelog compile [ci skip] commit 3a20888e1e44d79be3db118da91b6a6d44d1b0b9 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Sun Jul 28 17:07:12 2024 -0500 Automatic changelog generation for PR #11245 [ci skip] commit 1c7a624ce4793ff0d790673daab7c122faf58a49 Author: spockye <79304582+spockye@users.noreply.github.com> Date: Sun Jul 28 23:57:54 2024 +0200 removes holopad from glass floor on corg (#11245) * removes holopad from glass floor * replaced glass floor with holopad commit 384db435c980e564160d1ee5f9dd561ab70dff0d Author: BeeBot <56381746+ss13-beebot@users.noreply.github.com> Date: Sun Jul 28 16:48:45 2024 -0500 Update TGS DMAPI (#11232) commit fa030d512a6ed5bed1ce002d2ca38ede0d0b3b47 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Sun Jul 28 00:13:22 2024 +0000 Automatic changelog compile [ci skip] commit 1aba55ed392cf01345ae5f6fa23533ccac1c7a78 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Sat Jul 27 21:03:32 2024 +0000 Automatic changelog compile [ci skip] commit fc224ac76b736ac5d96f5976adbd68f74e7f5384 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Sat Jul 27 15:17:35 2024 -0500 Automatic changelog generation for PR #11235 [ci skip] commit 7d5399c5c9a757826f8625758cc770c505494a16 Author: spockye <79304582+spockye@users.noreply.github.com> Date: Sat Jul 27 21:58:19 2024 +0200 [PORT] ports the shark plushie (#11235) * ports shark plushie from TG * adds the plush to the choice beacon * oops adds a comma * Pigeon Variation Package: moodlet, better icon and spawners --------- Co-authored-by: PigeonVerde322 commit 3a18dca5fafa70318a6ab80b8be877409b735cd3 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Sat Jul 27 15:07:48 2024 -0500 Automatic changelog generation for PR #11237 [ci skip] commit 32b1ae22d457e80f5ac303c8db2790289d5a6551 Author: spockye <79304582+spockye@users.noreply.github.com> Date: Sat Jul 27 21:58:08 2024 +0200 simply ports better cone sprites (#11237) commit f2841a94ea9bd5ce87be6601acd70752c2c27b6c Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Sat Jul 27 00:11:38 2024 +0000 Automatic changelog compile [ci skip] commit 1f3df7e2346f922088e6bd4707c86e4d92dd2451 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Fri Jul 26 16:03:54 2024 +0000 Automatic changelog compile [ci skip] commit 731495425885bd32be357da70f7018c72ffa2d44 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Fri Jul 26 10:16:56 2024 -0500 Automatic changelog generation for PR #11231 [ci skip] commit a1c996217c2c3518b4cc4f50a04ed2c1b9ac215c Author: Markus Larsson <82539179+MarkusLarsson421@users.noreply.github.com> Date: Fri Jul 26 17:07:21 2024 +0200 Prevents Free Range Intercoms from Accessing Syndicate and CentCom Radio Channels (#11231) * Update radio.dm * Update radio.dm commit daf7f9962034b3e6c031a2bcfe4fb5f3cd4aaab4 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Fri Jul 26 13:04:56 2024 +0000 Automatic changelog compile [ci skip] commit f56e6e43b323c6fc4682e3d22ef67c69c4ae7fd4 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Fri Jul 26 07:55:51 2024 -0500 Automatic changelog generation for PR #11213 [ci skip] commit 45bfa988ad4e6a3d0615769662fa83d5ecc4f93c Author: XeonMations <62395746+XeonMations@users.noreply.github.com> Date: Fri Jul 26 15:42:09 2024 +0300 Adds the ability to craft different types of lockers. (#11213) * done * done commit 08a6811206103ed583c3dd3f14549491fcd5acbc Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Fri Jul 26 07:46:25 2024 -0500 Automatic changelog generation for PR #11121 [ci skip] commit 57f99c482632cb1e09b3c06693ffa6b45049585c Author: XeonMations <62395746+XeonMations@users.noreply.github.com> Date: Fri Jul 26 15:36:50 2024 +0300 Fixed space dragon's gust ability hitting people through walls (#11121) * Update space_dragon.dm * stuffs * Update space_dragon.dm commit 01d39bc131552892c153cc7d76eef93517ede0c0 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Fri Jul 26 00:11:45 2024 +0000 Automatic changelog compile [ci skip] commit 98ecd3c3235b1c58571c5f4550f52ba0324d225b Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Thu Jul 25 01:29:46 2024 +0000 Automatic changelog compile [ci skip] commit 1514cd26770dc986e94b685cbe9d4333b7677764 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Wed Jul 24 20:12:13 2024 -0500 Automatic changelog generation for PR #11217 [ci skip] commit 6b40f764b9e451f673af3f2560cff505c0059911 Author: XeonMations <62395746+XeonMations@users.noreply.github.com> Date: Thu Jul 25 04:02:28 2024 +0300 no more bugs (#11217) commit 4eb2ffa3883790a105a1a35325fb45a9e0414010 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Wed Jul 24 04:03:49 2024 +0000 Automatic changelog compile [ci skip] commit 7f5c69bc035a42f44a033117598e70868ba95557 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Tue Jul 23 22:35:43 2024 -0500 Automatic changelog generation for PR #11228 [ci skip] commit 4c30a59df388daae16d9efe53627559ebc27b82c Author: Rukofamicom Date: Tue Jul 23 22:26:01 2024 -0500 Revert "Pirate shuttle rebalancing and update (#11221)" (#11228) This reverts commit 00c836b9ae1e2b363037f64f0eb6f95f0ed5ad99. commit dcecb26896568020c1b12af758f0c7ceffbc602d Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Wed Jul 24 00:12:56 2024 +0000 Automatic changelog compile [ci skip] commit 25e2ea98d94a7e7e601cb980cb4d58115d753984 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Tue Jul 23 23:04:03 2024 +0000 Automatic changelog compile [ci skip] commit 7c497d22dd233f66b6372ae142e3f3aad902aaca Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Tue Jul 23 17:06:20 2024 -0500 Automatic changelog generation for PR #11182 [ci skip] commit d0359b68ed50443554729460cd1c630a4757fd9b Author: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com> Date: Tue Jul 23 17:56:51 2024 -0400 MetaSec brig retiling (#11182) * nice * oops * redoes armoury / storage and gear room decalling * oops fixed a floor decal * more small decal changes to offices and sec --------- Co-authored-by: spockye <79304582+spockye@users.noreply.github.com> commit 51fb1234e00cff556a76f1e8a7311ba82123fb94 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Tue Jul 23 17:03:16 2024 +0000 Automatic changelog compile [ci skip] commit 8e7dc53e353f1617491213f8be669a9e2947d557 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Tue Jul 23 11:18:59 2024 -0500 Automatic changelog generation for PR #11220 [ci skip] commit f427c3a7e1c07e267cfcb29664a30df89625c33e Author: Geatish <130587823+Geatish@users.noreply.github.com> Date: Tue Jul 23 18:09:06 2024 +0200 Small Radstation atmos fix and changes take 2 (#11220) * rad atmos dep fix Rerouted distro piping around the designated work area, also removed the unremovable glass floor from there. Finally fixed the atmosphereic shutters not being openable. * Fixes small things around gas miners Fixed: Removed plating between the eastern miners and atmos. Fixed plasma glass tiles on gas chambers spawning with N2, making them contaminate the gas chamber if you were to remove the glass. * I hate maints I hate maints I hate maints also removed the extra apc in xeno. * Empty commit Just dirt * god i pray guhh * The apc was added again??? how? * added back a window whoops * Now it was too many windows smh, better be fucking done now --------- Co-authored-by: HowToLoLu commit d7cd6e6a87645dfe4fd6bd4d9d9d79e4299d6573 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Tue Jul 23 16:04:38 2024 +0000 Automatic changelog compile [ci skip] commit 8ee0c29540778adf4bb160cb25629cdf5a72cebf Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Tue Jul 23 10:59:17 2024 -0500 Automatic changelog generation for PR #11225 [ci skip] commit 7348c949b6eb5753c319825869f44e21b5324577 Author: spockye <79304582+spockye@users.noreply.github.com> Date: Tue Jul 23 17:49:43 2024 +0200 small fix for cameras on explo shuttle (#11225) commit c319bc00050417e08046c2d11f2d27caf844e084 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Tue Jul 23 00:12:12 2024 +0000 Automatic changelog compile [ci skip] commit af9e3703c7f10cf07376be06ab81b74a8c0cb6ec Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Mon Jul 22 08:04:39 2024 +0000 Automatic changelog compile [ci skip] commit a6b490cc0f3acf84be5510282d6d5ccecef8e670 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Mon Jul 22 02:25:07 2024 -0500 Automatic changelog generation for PR #11221 [ci skip] commit 85300f25952d71318b336c898923abd3af6471cf Author: spockye <79304582+spockye@users.noreply.github.com> Date: Mon Jul 22 09:15:31 2024 +0200 Pirate shuttle rebalancing and update (#11221) * tones down decalling and supplies * Update pirate_default.dmm commit fb21ec8b7c015858aa6bae7879ca412d3c5f9ade Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Mon Jul 22 01:30:07 2024 +0000 Automatic changelog compile [ci skip] commit 95b42546df7b8425bb10b98d8806ef9be4dcd70f Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Sun Jul 21 20:15:49 2024 -0500 Automatic changelog generation for PR #11211 [ci skip] commit 57fff7a90b8b700d76d43b0ffb4f4dd74d498809 Author: ClownMoff <148357670+ClownMoff@users.noreply.github.com> Date: Mon Jul 22 02:06:12 2024 +0100 Fixes the bananium sword causing bleed (#11211) * henk * Update clown_weapons.dm commit 50f164056385fb5e631dc774c840e941b36950d3 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Sun Jul 21 00:13:07 2024 +0000 Automatic changelog compile [ci skip] commit 6cae2a64968e78e49c539e6d236f1c7040d4a429 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Sat Jul 20 00:11:40 2024 +0000 Automatic changelog compile [ci skip] commit e72bb001da9ce2414716f5bac8f7d3a527703750 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Fri Jul 19 12:04:44 2024 +0000 Automatic changelog compile [ci skip] commit 947433af167ae4027634b0cb6ebeb73ebdee5805 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Fri Jul 19 06:35:45 2024 -0500 Automatic changelog generation for PR #11208 [ci skip] commit 7da94eb06d022ab7c699912a2169fb15be734ac1 Author: Aramix <27755442+aramix273@users.noreply.github.com> Date: Fri Jul 19 14:26:18 2024 +0300 added divable var to closet and its logic (#11208) commit af034cd22034506af333cd45d7169797407684b0 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Fri Jul 19 00:12:42 2024 +0000 Automatic changelog compile [ci skip] commit 286b02e8ee3d1bcf3748353884cd61eb311637f1 Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Thu Jul 18 17:03:21 2024 +0000 Automatic changelog compile [ci skip] commit 3dcaaa4b75d3ce7da0e9e6d69fa97ad309a4508c Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Thu Jul 18 11:40:19 2024 -0500 Automatic changelog generation for PR #11187 [ci skip] commit b40c9a0b6398b36efc903ca12530b93de923fec6 Author: ToasterBan <54711687+ToasterBan@users.noreply.github.com> Date: Thu Jul 18 18:23:16 2024 +0200 Baton shove now requires disarm intent (#11187) * tonfa now paralyses rather than sleeps, stunbaton only shoves on disarm * Revert "tonfa now paralyses rather than sleeps, stunbaton only shoves on disarm" This reverts commit ac7814c15fd82aa92ebb5264f8184dc7a12e8335. commit aabea95f586bcc78fc92d0d39da31dcfcc55265a Author: ss13-beebot <56381746+ss13-beebot@users.noreply.github.com> Date: Thu Jul 18 11:30:39 2024 -0500 Automatic changelog generation for PR #11175 [ci skip] commit 1040e750ca13d27ddaf0c6a8b9ddd7fa4bd31684 Author: Hardly3D <66234359+Hardly3D@users.noreply.github.com> Date: Thu Jul 18 13:20:52 2024 -0300 New Hairstyle: Short Bangs 2 (#11175) * Adds short bangs 2 * Consistency fix * hope this works * Revert "hope this works" This reverts commit dd018cf33fe59a83bae4f15dc7269c01fc0e006d. * take 2 --- beestation.dme | 4 +- code/__DEFINES/department.dm | 60 +++ code/__DEFINES/departments.dm | 9 - code/__DEFINES/jobs.dm | 14 - code/__DEFINES/subsystems.dm | 7 +- code/__HELPERS/jobs.dm | 10 - code/_globalvars/lists/jobs.dm | 30 -- code/controllers/subsystem/department.dm | 436 ++++++++++++++++++ code/controllers/subsystem/job.dm | 14 +- code/controllers/subsystem/ticker.dm | 2 +- code/datums/datacore.dm | 39 +- code/game/gamemodes/brother/traitor_bro.dm | 2 +- code/game/gamemodes/changeling/changeling.dm | 2 +- .../game/gamemodes/changeling/traitor_chan.dm | 2 +- code/game/gamemodes/clock_cult/clockcult.dm | 16 +- code/game/gamemodes/cult/cult.dm | 2 +- code/game/gamemodes/devil/devil_game_mode.dm | 2 +- code/game/gamemodes/dynamic/dynamic.dm | 2 +- .../dynamic/dynamic_rulesets_midround.dm | 2 +- .../gamemodes/eldritch_cult/eldritch_cult.dm | 2 +- code/game/gamemodes/game_mode.dm | 38 +- code/game/gamemodes/hivemind/hivemind.dm | 2 +- code/game/gamemodes/traitor/traitor.dm | 2 +- code/game/machinery/cryopod.dm | 2 +- code/modules/admin/sql_ban_system.dm | 47 +- code/modules/admin/verbs/one_click_antag.dm | 6 +- .../antagonists/heretic/heretic_antag.dm | 4 +- .../sacrifice_knowledge.dm | 6 +- .../hivemind/spells/hivemind_shatter.dm | 2 +- .../hivemind/spells/hivemind_shock.dm | 2 +- code/modules/antagonists/ninja/ninja.dm | 2 +- .../obsessed/objectives/jealousy.dm | 24 +- .../antagonists/revolution/revolution.dm | 2 +- .../roundstart_special/special_antagonist.dm | 2 +- .../undercover/undercover.dm | 2 +- .../client/preferences/middleware/jobs.dm | 13 +- code/modules/clothing/gloves/color.dm | 8 +- .../crew_objectives/civilian_objectives.dm | 2 +- .../crew_objectives/security_objectives.dm | 2 +- code/modules/events/creep_awakening.dm | 2 +- code/modules/events/heart_attack.dm | 2 +- code/modules/events/pirates.dm | 2 +- code/modules/events/special_antag_event.dm | 2 +- code/modules/events/zombie_outbreak.dm | 2 +- code/modules/jobs/job_exp.dm | 8 +- code/modules/jobs/job_types/_job.dm | 2 +- code/modules/jobs/job_types/ai.dm | 2 +- code/modules/jobs/job_types/assistant.dm | 2 +- .../jobs/job_types/atmospheric_technician.dm | 2 +- code/modules/jobs/job_types/bartender.dm | 2 +- code/modules/jobs/job_types/botanist.dm | 2 +- code/modules/jobs/job_types/brig_physician.dm | 2 +- code/modules/jobs/job_types/captain.dm | 2 +- .../jobs/job_types/cargo_technician.dm | 2 +- code/modules/jobs/job_types/chaplain.dm | 2 +- code/modules/jobs/job_types/chemist.dm | 2 +- code/modules/jobs/job_types/chief_engineer.dm | 2 +- .../jobs/job_types/chief_medical_officer.dm | 2 +- code/modules/jobs/job_types/clown.dm | 2 +- code/modules/jobs/job_types/cook.dm | 2 +- code/modules/jobs/job_types/curator.dm | 2 +- code/modules/jobs/job_types/cyborg.dm | 2 +- code/modules/jobs/job_types/deputy.dm | 2 +- code/modules/jobs/job_types/detective.dm | 2 +- .../jobs/job_types/exploration_team.dm | 2 +- code/modules/jobs/job_types/geneticist.dm | 2 +- code/modules/jobs/job_types/gimmick.dm | 2 +- .../jobs/job_types/head_of_personnel.dm | 2 +- .../jobs/job_types/head_of_security.dm | 2 +- code/modules/jobs/job_types/janitor.dm | 2 +- code/modules/jobs/job_types/lawyer.dm | 2 +- code/modules/jobs/job_types/medical_doctor.dm | 2 +- code/modules/jobs/job_types/mime.dm | 2 +- code/modules/jobs/job_types/paramedic.dm | 2 +- code/modules/jobs/job_types/quartermaster.dm | 2 +- .../jobs/job_types/research_director.dm | 2 +- code/modules/jobs/job_types/roboticist.dm | 2 +- code/modules/jobs/job_types/scientist.dm | 2 +- .../jobs/job_types/security_officer.dm | 2 +- code/modules/jobs/job_types/shaft_miner.dm | 2 +- .../jobs/job_types/station_engineer.dm | 2 +- code/modules/jobs/job_types/virologist.dm | 2 +- code/modules/jobs/job_types/warden.dm | 2 +- code/modules/jobs/jobs.dm | 176 +------ code/modules/mob/dead/crew_manifest.dm | 2 +- .../modules/mob/dead/new_player/new_player.dm | 36 +- .../mob/living/carbon/human/species.dm | 2 +- .../carbon/human/species_types/plasmamen.dm | 2 +- .../file_system/programs/card.dm | 12 +- 89 files changed, 705 insertions(+), 444 deletions(-) create mode 100644 code/__DEFINES/department.dm delete mode 100644 code/__DEFINES/departments.dm delete mode 100644 code/_globalvars/lists/jobs.dm create mode 100644 code/controllers/subsystem/department.dm diff --git a/beestation.dme b/beestation.dme index f6d5d032728b9..6a824dcbbd330 100644 --- a/beestation.dme +++ b/beestation.dme @@ -70,7 +70,7 @@ #include "code\__DEFINES\crafting.dm" #include "code\__DEFINES\cult.dm" #include "code\__DEFINES\database.dm" -#include "code\__DEFINES\departments.dm" +#include "code\__DEFINES\department.dm" #include "code\__DEFINES\devices.dm" #include "code\__DEFINES\directional.dm" #include "code\__DEFINES\diseases.dm" @@ -335,7 +335,6 @@ #include "code\_globalvars\lists\ambience.dm" #include "code\_globalvars\lists\client.dm" #include "code\_globalvars\lists\flavor_misc.dm" -#include "code\_globalvars\lists\jobs.dm" #include "code\_globalvars\lists\maintenance_loot.dm" #include "code\_globalvars\lists\mapping.dm" #include "code\_globalvars\lists\mobs.dm" @@ -434,6 +433,7 @@ #include "code\controllers\subsystem\communications.dm" #include "code\controllers\subsystem\dbcore.dm" #include "code\controllers\subsystem\dcs.dm" +#include "code\controllers\subsystem\department.dm" #include "code\controllers\subsystem\disease.dm" #include "code\controllers\subsystem\early_assets.dm" #include "code\controllers\subsystem\economy.dm" diff --git a/code/__DEFINES/department.dm b/code/__DEFINES/department.dm new file mode 100644 index 0000000000000..62a212a83403c --- /dev/null +++ b/code/__DEFINES/department.dm @@ -0,0 +1,60 @@ +// station departments +#define DEPT_NAME_COMMAND "Command" +#define DEPT_BITFLAG_COM (1<<0) +#define DEPT_NAME_CIVILIAN "Civilian" +#define DEPT_BITFLAG_CIV (1<<1) +#define DEPT_NAME_SERVICE "Service" +#define DEPT_BITFLAG_SRV (1<<2) +#define DEPT_NAME_CARGO "Cargo" +#define DEPT_BITFLAG_CAR (1<<3) +#define DEPT_NAME_SCIENCE "Science" +#define DEPT_BITFLAG_SCI (1<<4) +#define DEPT_NAME_ENGINEERING "Engineering" +#define DEPT_BITFLAG_ENG (1<<5) +#define DEPT_NAME_MEDICAL "Medical" +#define DEPT_BITFLAG_MED (1<<6) +#define DEPT_NAME_SECURITY "Security" +#define DEPT_BITFLAG_SEC (1<<7) +#define DEPT_NAME_VIP "VIP" +#define DEPT_BITFLAG_VIP (1<<8) +#define DEPT_NAME_SILICON "Silicon" +#define DEPT_BITFLAG_SILICON (1<<9) +#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 +// in favour of our downstreams, sort order is increased by 10, so that they can add anything between these (i.e NSV munition dept) +#define DEPT_MANIFEST_ORDER_COMMAND 10 +#define DEPT_MANIFEST_ORDER_CENTCOM 13 // generally it won't be used +#define DEPT_MANIFEST_ORDER_VIP 16 +#define DEPT_MANIFEST_ORDER_SECURITY 20 +#define DEPT_MANIFEST_ORDER_ENGINEERING 30 +#define DEPT_MANIFEST_ORDER_MEDICAL 40 +#define DEPT_MANIFEST_ORDER_SCIENCE 50 +#define DEPT_MANIFEST_ORDER_CARGO 60 +#define DEPT_MANIFEST_ORDER_SERVICE 70 +#define DEPT_MANIFEST_ORDER_CIVILIAN 80 +#define DEPT_MANIFEST_ORDER_SILICON 90 +#define DEPT_MANIFEST_ORDER_UNASSIGNED 666 // dummy department for people with no department + + +// 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 diff --git a/code/__DEFINES/departments.dm b/code/__DEFINES/departments.dm deleted file mode 100644 index fcbf4836b109f..0000000000000 --- a/code/__DEFINES/departments.dm +++ /dev/null @@ -1,9 +0,0 @@ -// All departments on the station - -#define DEPT_SCIENCE "Science" -#define DEPT_ENGINEERING "Engineering" -#define DEPT_MEDICAL "Medical" -#define DEPT_SECURITY "Security" -#define DEPT_SUPPLY "Supply" -#define DEPT_SERVICE "Service" -#define DEPT_COMMAND "Command" diff --git a/code/__DEFINES/jobs.dm b/code/__DEFINES/jobs.dm index 21bd824b82320..b023ab95bc422 100644 --- a/code/__DEFINES/jobs.dm +++ b/code/__DEFINES/jobs.dm @@ -53,20 +53,6 @@ #define JOB_DISPLAY_ORDER_AI 33 #define JOB_DISPLAY_ORDER_CYBORG 34 - -#define DEPT_BITFLAG_COM (1<<0) -#define DEPT_BITFLAG_CIV (1<<1) -#define DEPT_BITFLAG_SRV (1<<2) -#define DEPT_BITFLAG_CAR (1<<3) -#define DEPT_BITFLAG_SCI (1<<4) -#define DEPT_BITFLAG_ENG (1<<5) -#define DEPT_BITFLAG_MED (1<<6) -#define DEPT_BITFLAG_SEC (1<<7) -#define DEPT_BITFLAG_VIP (1<<8) -#define DEPT_BITFLAG_SILICON (1<<9) -#define DEPT_BITFLAG_CAPTAIN (1<<10) -#define DEPT_BITFLAG_ASSISTANT (1<<11) - // should check the ones in `\_DEFINES\economy.dm` // It's true that bitflags shouldn't be separated in two DEFINES if these are same, but just in case the system can be devided, it's remained separated. diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index ea425b2b949e6..8648e8d69686f 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -141,9 +141,10 @@ #define INIT_ORDER_RESEARCH 75 #define INIT_ORDER_ORBITS 74 //Other things use the orbital map, so it needs to be made early on. #define INIT_ORDER_STATION 73 //This is high priority because it manipulates a lot of the subsystems that will initialize after it. -#define INIT_ORDER_QUIRKS 72 -#define INIT_ORDER_JOBS 71 //Must initialize before events for holidays -#define INIT_ORDER_EVENTS 70 +#define INIT_ORDER_DEPARTMENT 72 //This is important: it has access distributing code, so should be initialized quickly +#define INIT_ORDER_QUIRKS 71 +#define INIT_ORDER_JOBS 70 //Must initialize before events for holidays +#define INIT_ORDER_EVENTS 69 #define INIT_ORDER_AI_MOVEMENT 56 //We need the movement setup #define INIT_ORDER_AI_CONTROLLERS 55 //So the controller can get the ref #define INIT_ORDER_TICKER 55 diff --git a/code/__HELPERS/jobs.dm b/code/__HELPERS/jobs.dm index c51f774726a49..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 = GLOB.dept_bitflag_to_name[key] - if(!department || !GLOB.departments[department]) - continue - if(CHECK_BITFIELD(field, flag)) - . += department diff --git a/code/_globalvars/lists/jobs.dm b/code/_globalvars/lists/jobs.dm deleted file mode 100644 index 1b9642e40217e..0000000000000 --- a/code/_globalvars/lists/jobs.dm +++ /dev/null @@ -1,30 +0,0 @@ -/// A list of each bitflag and the name of its associated department. For use in the preferences menu. -GLOBAL_LIST_INIT(dept_bitflag_to_name, list( - "[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", - "[DEPT_BITFLAG_CAPTAIN]" = "Captain", - "[DEPT_BITFLAG_ASSISTANT]" = "Assistant" -)) - -/// A list of each department and its associated bitflag. -GLOBAL_LIST_INIT(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, // code seems to switch between calling it Supply and Cargo. not going to fix that today, let's just split the difference. - "Service" = DEPT_BITFLAG_SRV, - "Civilian" = DEPT_BITFLAG_CIV, - "Silicon" = DEPT_BITFLAG_SILICON -)) diff --git a/code/controllers/subsystem/department.dm b/code/controllers/subsystem/department.dm new file mode 100644 index 0000000000000..8e6b88badf6bc --- /dev/null +++ b/code/controllers/subsystem/department.dm @@ -0,0 +1,436 @@ + +SUBSYSTEM_DEF(department) + name = "Departments" + init_order = INIT_ORDER_DEPARTMENT + flags = SS_NO_FIRE + + /// 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 + + + /// 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) + 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_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) + var/return_result = list() + . = return_result + + for(var/datum/department_group/each_dept in department_datums) + if(each_dept.dept_bitflag & bitflag) + . += each_dept + + return return_result + +/datum/controller/subsystem/department/proc/get_department_by_dept_id(id) + . = department_assoc[id] + if(!.) + CRASH("[id] isn't an existing department id.") + return department_assoc[id] + +/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])) + CRASH("You did something wrong. Check if you did like 'list(list())'") + + var/list/jobs_to_return = list() + for(var/each in id_or_list) + var/datum/department_group/dept = department_assoc[each] + if(!dept) + message_admins("is not exist: [each]") + continue + if(!length(dept.jobs)) + continue + jobs_to_return |= dept.jobs + + return jobs_to_return + +// -------------------------------------------- +// department group datums for this subsystem +/datum/department_group + // basic variables + var/dept_name = "No department" + var/dept_id = NONE + var/dept_bitflag = null + var/dept_colour = null + var/dept_radio_channel = null + var/is_station = FALSE + + // 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() + + /// 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 = DEPT_NAME_COMMAND + dept_id = DEPT_NAME_COMMAND + dept_bitflag = DEPT_BITFLAG_COM + dept_colour = "#ddddff" + dept_radio_channel = FREQ_COMMAND + is_station = TRUE + + leaders = list(JOB_NAME_CAPTAIN) + jobs = list(JOB_NAME_CAPTAIN, + JOB_NAME_HEADOFPERSONNEL, + JOB_NAME_RESEARCHDIRECTOR, + JOB_NAME_CHIEFENGINEER, + JOB_NAME_CHIEFMEDICALOFFICER, + JOB_NAME_HEADOFSECURITY) + + 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 = DEPT_NAME_SERVICE + dept_id = DEPT_NAME_SERVICE + dept_bitflag = DEPT_BITFLAG_SRV + dept_colour = "#bbe291" + dept_radio_channel = FREQ_SERVICE + is_station = TRUE + + leaders = list(JOB_NAME_HEADOFPERSONNEL) + jobs = list(JOB_NAME_HEADOFPERSONNEL, + JOB_NAME_BARTENDER, + JOB_NAME_BOTANIST, + JOB_NAME_COOK, + JOB_NAME_JANITOR, + JOB_NAME_MIME, + JOB_NAME_CLOWN) + + 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 = DEPT_NAME_CIVILIAN + dept_id = DEPT_NAME_CIVILIAN + dept_bitflag = DEPT_BITFLAG_CIV + dept_colour = "#bbe291" + is_station = TRUE + + leaders = list(JOB_NAME_HEADOFPERSONNEL) + jobs = list(JOB_NAME_ASSISTANT, + JOB_NAME_GIMMICK, + JOB_NAME_BARBER, + JOB_NAME_STAGEMAGICIAN, + JOB_NAME_PSYCHIATRIST, + JOB_NAME_VIP, + JOB_NAME_CHAPLAIN, + JOB_NAME_CURATOR, + JOB_NAME_LAWYER) + + 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 = DEPT_NAME_CARGO + dept_id = DEPT_NAME_CARGO + dept_bitflag = DEPT_BITFLAG_CAR + dept_colour = "#d7b088" + dept_radio_channel = FREQ_SUPPLY + is_station = TRUE + + leaders = list(JOB_NAME_HEADOFPERSONNEL) + jobs = list(JOB_NAME_HEADOFPERSONNEL, + JOB_NAME_QUARTERMASTER, + JOB_NAME_CARGOTECHNICIAN, + JOB_NAME_SHAFTMINER) + + 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 = DEPT_NAME_SCIENCE + dept_id = DEPT_NAME_SCIENCE + dept_bitflag = DEPT_BITFLAG_SCI + dept_colour = "#ffddff" + dept_radio_channel = FREQ_SCIENCE + is_station = TRUE + + leaders = list(JOB_NAME_RESEARCHDIRECTOR) + jobs = list(JOB_NAME_RESEARCHDIRECTOR, + JOB_NAME_SCIENTIST, + JOB_NAME_EXPLORATIONCREW, + JOB_NAME_ROBOTICIST) + + 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 = DEPT_NAME_ENGINEERING + dept_id = DEPT_NAME_ENGINEERING + dept_bitflag = DEPT_BITFLAG_ENG + dept_colour = "#ffeeaa" + dept_radio_channel = FREQ_ENGINEERING + is_station = TRUE + + 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 = DEPT_NAME_ENGINEERING + manifest_category_order = DEPT_MANIFEST_ORDER_ENGINEERING + +// --------------------------------------------------------------------- +// MEDICAL +// --------------------------------------------------------------------- +/datum/department_group/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 + + leaders = list(JOB_NAME_CHIEFMEDICALOFFICER) + jobs = list(JOB_NAME_CHIEFMEDICALOFFICER, + JOB_NAME_MEDICALDOCTOR, + JOB_NAME_PARAMEDIC, + JOB_NAME_BRIGPHYSICIAN, + JOB_NAME_CHEMIST, + JOB_NAME_GENETICIST, + JOB_NAME_VIROLOGIST, + JOB_NAME_PSYCHIATRIST) + + pref_category_name = DEPT_NAME_MEDICAL + pref_category_order = DEPT_PREF_ORDER_MEDICAL + + manifest_category_name = DEPT_NAME_MEDICAL + manifest_category_order = DEPT_MANIFEST_ORDER_MEDICAL + +// --------------------------------------------------------------------- +// SECURITY +// --------------------------------------------------------------------- +/datum/department_group/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 + + leaders = list(JOB_NAME_HEADOFSECURITY) + jobs = list(JOB_NAME_HEADOFSECURITY, + JOB_NAME_WARDEN, + JOB_NAME_DETECTIVE, + JOB_NAME_SECURITYOFFICER, + JOB_NAME_DEPUTY) + + 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 + +// --------------------------------------------------------------------- +// VIP +// Used for: crew manifest +// --------------------------------------------------------------------- +// in fact, nobody belongs here even VIPs don't because how system works. This is dummy department actually. +/datum/department_group/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 = 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 + + leaders = list() + jobs = list(JOB_NAME_AI, + JOB_NAME_CYBORG) + + 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 + +// --------------------------------------------------------------------- +// CentCom +// Used for: access sorting (mainly), cerw manifest (admin gimmick) +// --------------------------------------------------------------------- +/datum/department_group/centcom + dept_name = DEPT_NAME_CENTCOM + dept_id = DEPT_NAME_CENTCOM + dept_bitflag = DEPT_BITFLAG_CENTCOM + dept_colour = "#00eba4" + dept_radio_channel = FREQ_CENTCOM + + // currently not used, but just in case + manifest_category_name = DEPT_NAME_CENTCOM + manifest_category_order = DEPT_MANIFEST_ORDER_CENTCOM + +// --------------------------------------------------------------------- +// Others (syndicate, cult, away, etc) +// Used for: access sorting (mainly), cerw manifest (admin gimmick) +// --------------------------------------------------------------------- +/datum/department_group/other + dept_name = DEPT_NAME_OTHER + dept_id = DEPT_NAME_OTHER + dept_bitflag = DEPT_BITFLAG_OTHER + dept_colour = "#00eba4" + dept_radio_channel = FREQ_CENTCOM + + // 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 992c7e6d37169..b1fa8ce50c2f8 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -215,7 +215,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 GLOB.command_positions) //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)) @@ -260,7 +260,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 GLOB.command_positions) + for(var/command_position in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) var/datum/job/job = GetJob(command_position) if(!job) continue @@ -278,7 +278,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 GLOB.command_positions) + for(var/command_position in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) var/datum/job/job = GetJob(command_position) if(!job) continue @@ -780,7 +780,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 GLOB.command_positions)) + if(player.stat != DEAD && player.mind && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND))) . |= player.mind @@ -791,7 +791,7 @@ SUBSYSTEM_DEF(job) . = list() for(var/i in GLOB.mob_list) var/mob/player = i - if(player.mind && (player.mind.assigned_role in GLOB.command_positions)) + if(player.mind && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND))) . |= player.mind ////////////////////////////////////////////// @@ -800,7 +800,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 GLOB.security_positions)) + if(player.stat != DEAD && player.mind && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY))) . |= player.mind //////////////////////////////////////// @@ -809,7 +809,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 GLOB.security_positions)) + 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 264736836da3d..cc5723b3cdaa6 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -450,7 +450,7 @@ SUBSYSTEM_DEF(ticker) if(mind.assigned_role == JOB_NAME_CAPTAIN) captainless = FALSE spare_id_candidates += N - else if(captainless && (mind.assigned_role in GLOB.command_positions) && !(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 4b4dee4d96047..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(GLOB.command_positions) 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 != DEPT_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(GLOB.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 e4363953b7b19..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 += GLOB.command_positions + 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 325ba0eb148ef..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 += GLOB.command_positions + 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 ace442760296f..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 += GLOB.command_positions + 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 82ce08bc5029f..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 GLOB.command_positions) + if(role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND)) prefix = "High Priest" - else if(role in GLOB.engineering_positions) + else if(role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_ENGINEERING)) prefix = "Cogturner" - else if(role in GLOB.medical_positions) + else if(role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_MEDICAL)) prefix = "Rejuvinator" - else if(role in GLOB.science_positions) + else if(role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SCIENCE)) prefix = "Calculator" - else if(role in GLOB.supply_positions) + 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 GLOB.civilian_positions) || (role in GLOB.gimmick_positions)) + else if((role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_CIVILIAN))) prefix = "Cogworker" - else if(role in GLOB.security_positions) + else if(role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SECURITY)) prefix = "Warrior" - else if(role in GLOB.nonhuman_positions) + 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 a9ca65d780a7b..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 += GLOB.command_positions + 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 0f46ee414fa9e..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 += GLOB.command_positions + 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 1856af0e379ea..89d42937fddd0 100644 --- a/code/game/gamemodes/dynamic/dynamic.dm +++ b/code/game/gamemodes/dynamic/dynamic.dm @@ -773,7 +773,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 |= GLOB.command_positions + 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 dce7441b2ebe0..64c35dc67f18a 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm @@ -664,7 +664,7 @@ || candidate.mind.has_antag_datum(/datum/antagonist/obsessed) \ || candidate.stat == DEAD \ || !SSjob.GetJob(candidate.mind.assigned_role) \ - || (candidate.mind.assigned_role in GLOB.nonhuman_positions) \ + || (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 fe8a9a8661430..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 += GLOB.command_positions + 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 7f03d165af976..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 += GLOB.command_positions + 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 GLOB.nonhuman_positions)) + if(player.stat != DEAD && player.mind && (player.mind.assigned_role in SSdepartment.get_jobs_by_dept_id(DEPT_NAME_SILICON))) . |= player.mind /////////////////////////////////////// @@ -638,22 +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 GLOB.nonhuman_positions)) + 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 += GLOB.engineering_positions - valid_positions += GLOB.medical_positions - valid_positions += GLOB.science_positions - valid_positions += GLOB.supply_positions - valid_positions += GLOB.civilian_positions - valid_positions += GLOB.gimmick_positions - valid_positions += GLOB.security_positions + 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 += GLOB.command_positions //add any remaining command positions + valid_positions += SSdepartment.get_jobs_by_dept_id(DEPT_NAME_COMMAND) //add any remaining command positions else - valid_positions -= GLOB.command_positions //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) @@ -803,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(GLOB.command_positions)) + 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) @@ -822,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(GLOB.security_positions)) + 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) @@ -832,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(GLOB.medical_positions)) + 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) @@ -842,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(GLOB.engineering_positions)) + 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) @@ -852,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(GLOB.science_positions)) + 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) @@ -862,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(GLOB.supply_positions)) + 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) @@ -873,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(GLOB.civilian_positions | GLOB.gimmick_positions)) // 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 0224f17be1c2d..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 += GLOB.command_positions + 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 2be3d1bd3bb68..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 += GLOB.command_positions + 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 a6e81d3cf8201..bebbd89ffacf9 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 GLOB.command_positions) + 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 70f5b921c6652..7aa8d2f4693d6 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" = GLOB.command_positions, - "security" = GLOB.security_positions, - "engineering" = GLOB.engineering_positions, - "medical" = GLOB.medical_positions, - "science" = GLOB.science_positions, - "supply" = GLOB.supply_positions, - "silicon" = GLOB.nonhuman_positions, - "civilian" = GLOB.civilian_positions, - "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 GLOB.command_positions) + 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" = GLOB.security_positions, - "Engineering" = GLOB.engineering_positions, - "Medical" = GLOB.medical_positions, - "Science" = GLOB.science_positions, - "Supply" = GLOB.supply_positions) + 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" = GLOB.nonhuman_positions, + 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" = GLOB.civilian_positions | 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 591994462c420..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 += GLOB.command_positions + 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 += GLOB.command_positions + 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 += GLOB.command_positions + 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 65e1aa44d4c56..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 GLOB.command_positions)) + 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 GLOB.command_positions)) + 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 45d07518cd1a8..e07c44fcbf8a2 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 GLOB.command_positions) + 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 GLOB.security_positions) + 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 GLOB.command_positions) + 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 a9c453361e46c..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 = GLOB.security_positions.Copy() + 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 8e30048387fc2..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 (GLOB.security_positions || GLOB.command_positions)) //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 b697e6684bd1a..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 GLOB.command_positions) + 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 06aef8c04bed0..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 GLOB.security_positions) - chosen_department = GLOB.security_positions - else if(obsession.assigned_role in GLOB.engineering_positions) - chosen_department = GLOB.engineering_positions - else if(obsession.assigned_role in GLOB.medical_positions) - chosen_department = GLOB.medical_positions - else if(obsession.assigned_role in GLOB.science_positions) - chosen_department = GLOB.science_positions - else if(obsession.assigned_role in GLOB.supply_positions) - chosen_department = GLOB.supply_positions - else if(obsession.assigned_role in (GLOB.civilian_positions | GLOB.gimmick_positions)) - chosen_department = GLOB.civilian_positions | GLOB.gimmick_positions + 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 89b7987645c1e..8c4e89b264c17 100644 --- a/code/modules/antagonists/revolution/revolution.dm +++ b/code/modules/antagonists/revolution/revolution.dm @@ -18,7 +18,7 @@ /datum/antagonist/rev/can_be_owned(datum/mind/new_owner) . = ..() if(.) - if(new_owner.assigned_role in GLOB.command_positions) + 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 070f531609656..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 += GLOB.command_positions + 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 dadb346ebde18..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 GLOB.engineering_positions) + 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 aee46d2ad040e..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 = GLOB.dept_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 7b6e4a9108017..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 GLOB.security_positions)) + 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 GLOB.security_positions) + 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 GLOB.security_positions) + 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 GLOB.security_positions) + 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 99bf465d33ed0..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 GLOB.security_positions)) + 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 31684cfdcae82..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 GLOB.security_positions)) + 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 b45b45ada95de..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 GLOB.nonhuman_positions)) //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 8a92930af552c..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 GLOB.nonhuman_positions))//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 63fcb52074574..03dc00d479bdf 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 GLOB.command_positions) + 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 ff3f72f4713be..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 GLOB.nonhuman_positions)) //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 79eef8aa63c3d..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 GLOB.nonhuman_positions)) + 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 468561c262170..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 (GLOB.command_positions | 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 (GLOB.command_positions | 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 (GLOB.command_positions | 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 (GLOB.command_positions | 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 7f4ca8766fdcc..b67d2cd0f68e6 100644 --- a/code/modules/jobs/job_types/_job.dm +++ b/code/modules/jobs/job_types/_job.dm @@ -256,7 +256,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 GLOB.command_positions)) + 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 18ec90d6692a4..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_ASSISTANT + 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 128ba71e24c7c..0b685e080f260 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 97d0565c83974..ef97a8fd83979 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 9a36457dd2170..11fd4ce6353e3 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 529a56026bbd2..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_ASSISTANT + 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 3f43189e683a8..3f542cfb50c24 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 9bfb15e8b7ce1..5fab538dc6973 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 23dc2d5273ed8..7fdcfe876d529 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 0d107f05ae756..8e22534c617c6 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 09dda8735ed1b..2881103fa1dba 100644 --- a/code/modules/jobs/jobs.dm +++ b/code/modules/jobs/jobs.dm @@ -1,12 +1,3 @@ -GLOBAL_LIST_INIT(command_positions, list( - JOB_NAME_CAPTAIN, - JOB_NAME_HEADOFPERSONNEL, - JOB_NAME_HEADOFSECURITY, - JOB_NAME_CHIEFENGINEER, - JOB_NAME_RESEARCHDIRECTOR, - JOB_NAME_CHIEFMEDICALOFFICER -)) - GLOBAL_LIST_INIT(command_lightup_areas, typecacheof(list( /area/bridge, /area/gateway, @@ -14,13 +5,6 @@ GLOBAL_LIST_INIT(command_lightup_areas, typecacheof(list( /area/teleporter ))) - -GLOBAL_LIST_INIT(engineering_positions, list( - JOB_NAME_CHIEFENGINEER, - JOB_NAME_STATIONENGINEER, - JOB_NAME_ATMOSPHERICTECHNICIAN -)) - GLOBAL_LIST_INIT(engineering_lightup_areas, \ typecacheof(list( \ /area/construction, \ @@ -35,17 +19,6 @@ GLOBAL_LIST_INIT(engineering_lightup_areas, \ )) \ ) - -GLOBAL_LIST_INIT(medical_positions, list( - JOB_NAME_CHIEFMEDICALOFFICER, - JOB_NAME_MEDICALDOCTOR, - JOB_NAME_GENETICIST, - JOB_NAME_VIROLOGIST, - JOB_NAME_PARAMEDIC, - JOB_NAME_CHEMIST, - JOB_NAME_BRIGPHYSICIAN -)) - GLOBAL_LIST_INIT(medical_lightup_areas, \ typecacheof(list( \ /area/medical, \ @@ -61,14 +34,6 @@ GLOBAL_LIST_INIT(medical_lightup_areas, \ )) \ ) - -GLOBAL_LIST_INIT(science_positions, list( - JOB_NAME_RESEARCHDIRECTOR, - JOB_NAME_SCIENTIST, - JOB_NAME_EXPLORATIONCREW, - JOB_NAME_ROBOTICIST -)) - GLOBAL_LIST_INIT(science_lightup_areas, \ typecacheof(list( \ /area/science, \ @@ -85,14 +50,6 @@ GLOBAL_LIST_INIT(science_lightup_areas, \ )) \ ) - -GLOBAL_LIST_INIT(supply_positions, list( - JOB_NAME_HEADOFPERSONNEL, - JOB_NAME_QUARTERMASTER, - JOB_NAME_CARGOTECHNICIAN, - JOB_NAME_SHAFTMINER -)) - GLOBAL_LIST_INIT(supply_lightup_areas, \ typecacheof(list( \ /area/cargo, \ @@ -106,37 +63,6 @@ GLOBAL_LIST_INIT(supply_lightup_areas, \ )) \ ) - -GLOBAL_LIST_INIT(civilian_positions, list( - JOB_NAME_HEADOFPERSONNEL, - JOB_NAME_BARTENDER, - JOB_NAME_BOTANIST, - JOB_NAME_COOK, - JOB_NAME_JANITOR, - JOB_NAME_LAWYER, - JOB_NAME_CURATOR, - JOB_NAME_CHAPLAIN, - JOB_NAME_MIME, - JOB_NAME_CLOWN, - JOB_NAME_ASSISTANT -)) - -GLOBAL_LIST_INIT(gimmick_positions, list( - JOB_NAME_GIMMICK, - JOB_NAME_BARBER, - JOB_NAME_STAGEMAGICIAN, - JOB_NAME_PSYCHIATRIST, - JOB_NAME_VIP -)) - -GLOBAL_LIST_INIT(security_positions, list( - JOB_NAME_HEADOFSECURITY, - JOB_NAME_WARDEN, - JOB_NAME_DETECTIVE, - JOB_NAME_SECURITYOFFICER, - JOB_NAME_DEPUTY -)) - GLOBAL_LIST_INIT(security_lightup_areas, \ typecacheof(list( \ /area/security \ @@ -147,88 +73,6 @@ GLOBAL_LIST_INIT(security_lightup_areas, \ )) \ ) - -GLOBAL_LIST_INIT(nonhuman_positions, list( - JOB_NAME_AI, - JOB_NAME_CYBORG, - JOB_NAME_POSIBRAIN, - ROLE_PAI -)) - - -// they are for hud_icon-based crew manifest -// we don't use 'gimmick' here. use common sense here. -GLOBAL_LIST_INIT(command_positions_hud, list( - JOB_HUD_CAPTAIN, - JOB_HUD_ACTINGCAPTAIN , - JOB_HUD_HEADOFPERSONNEL, - JOB_HUD_HEADOFSECURITY, - JOB_HUD_CHIEFENGINEER, - JOB_HUD_RESEARCHDIRECTOR, - JOB_HUD_CHEIFMEDICALOFFICIER, - JOB_HUD_RAWCOMMAND)) - -GLOBAL_LIST_INIT(important_positions_hud, list( - JOB_HUD_VIP, - JOB_HUD_KING)) - -GLOBAL_LIST_INIT(engineering_positions_hud, list( - JOB_HUD_CHIEFENGINEER, - JOB_HUD_STATIONENGINEER, - JOB_HUD_ATMOSPHERICTECHNICIAN, - JOB_HUD_RAWENGINEERING)) - -GLOBAL_LIST_INIT(medical_positions_hud, list( - JOB_HUD_CHEIFMEDICALOFFICIER, - JOB_HUD_MEDICALDOCTOR, - JOB_HUD_GENETICIST, - JOB_HUD_VIROLOGIST, - JOB_HUD_PARAMEDIC, - JOB_HUD_CHEMIST, - JOB_HUD_BRIGPHYSICIAN, - JOB_HUD_PSYCHIATRIST, - JOB_HUD_RAWMEDICAL)) - -GLOBAL_LIST_INIT(science_positions_hud, list( - JOB_HUD_RESEARCHDIRECTOR, - JOB_HUD_SCIENTIST, - JOB_HUD_EXPLORATIONCREW, - JOB_HUD_ROBOTICIST, - JOB_HUD_RAWSCIENCE)) - -GLOBAL_LIST_INIT(supply_positions_hud, list( - JOB_HUD_QUARTERMASTER, - JOB_HUD_CARGOTECHNICIAN, - JOB_HUD_SHAFTMINER, - JOB_HUD_RAWCARGO)) - -GLOBAL_LIST_INIT(civilian_positions_hud, list( - JOB_HUD_HEADOFPERSONNEL, - JOB_HUD_BARTENDER, - JOB_HUD_BOTANIST, - JOB_HUD_COOK, - JOB_HUD_JANITOR, - JOB_HUD_CURATOR, - JOB_HUD_LAWYER, - JOB_HUD_CHAPLAIN, - JOB_HUD_CLOWN, - JOB_HUD_MIME, - JOB_HUD_BARBER, - JOB_HUD_STAGEMAGICIAN, - JOB_HUD_ASSISTANT, - JOB_HUD_RAWSERVICE)) - -//GLOBAL_LIST_INIT(gimmick_positions_hud, list() -// NO. don't use this. - -GLOBAL_LIST_INIT(security_positions_hud, list( - JOB_HUD_HEADOFSECURITY, - JOB_HUD_WARDEN, - JOB_HUD_DETECTIVE, - JOB_HUD_SECURITYOFFICER, - JOB_HUD_DEPUTY, - JOB_HUD_RAWSECURITY)) - /// Put any removed jobs here so they can still show in playtime listings. GLOBAL_LIST_INIT(exp_removed_jobs, list( // "Virologist", @@ -242,19 +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" = command_positions | engineering_positions | medical_positions | science_positions | supply_positions | security_positions | civilian_positions | gimmick_positions | list(JOB_NAME_AI,JOB_NAME_CYBORG)), // crew positions - EXP_TYPE_COMMAND = list("titles" = command_positions), - EXP_TYPE_ENGINEERING = list("titles" = engineering_positions), - EXP_TYPE_MEDICAL = list("titles" = medical_positions), - EXP_TYPE_SCIENCE = list("titles" = science_positions), - EXP_TYPE_SUPPLY = list("titles" = supply_positions), - EXP_TYPE_SECURITY = list("titles" = security_positions), - EXP_TYPE_SILICON = list("titles" = list(JOB_NAME_AI,JOB_NAME_CYBORG)), - EXP_TYPE_SERVICE = list("titles" = civilian_positions | gimmick_positions), - EXP_TYPE_GIMMICK = list("titles" = gimmick_positions) -)) - +// 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(), @@ -264,11 +97,6 @@ GLOBAL_LIST_INIT(exp_specialmap, list( GLOBAL_PROTECT(exp_jobsmap) GLOBAL_PROTECT(exp_specialmap) -/proc/guest_jobbans(job) - return ((job in GLOB.command_positions) || (job in GLOB.nonhuman_positions) || (job in GLOB.security_positions)) - - - //this is necessary because antags happen before job datums are handed out, but NOT before they come into existence //so I can't simply use job datum.department_head straight from the mind datum, laaaaame. /proc/get_department_heads(var/job_title) diff --git a/code/modules/mob/dead/crew_manifest.dm b/code/modules/mob/dead/crew_manifest.dm index 94c2f3bb8616d..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" = GLOB.command_positions, + "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 49e6a83db78dd..d83b53a72f705 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -389,19 +389,6 @@ */ /mob/dead/new_player/proc/LateChoices() - var/static/list/department_order = list( // department order and its dept color - "Command" = "#ddddff", - "Engineering" = "#ffeeaa", - "Supply"= "#d7b088", - "Silicon" = "#ccffcc", - "Civilian"= "#bbe291", - "Gimmick" = "#dddddd", - "Medical" = "#c1e1ec", - "Science" = "#ffddff", - "Security" = "#ffdddd" - ) - var/static/list/department_list = list(GLOB.command_positions) + list(GLOB.engineering_positions) + list(GLOB.supply_positions) + list(GLOB.nonhuman_positions - ROLE_PAI) + list(GLOB.civilian_positions) + list(GLOB.gimmick_positions) + list(GLOB.medical_positions) + list(GLOB.science_positions) + list(GLOB.security_positions) - var/list/dat = list("
Round Duration: [DisplayTimeText(world.time - SSticker.round_start_time)]
") if(SSjob.prioritized_jobs.len > 0) dat+="
Jobs in Green have been prioritized by the Head of Personnel.
Please consider joining the game as that role.
" @@ -417,24 +404,25 @@ SSjob.prioritized_jobs -= prioritized_job dat += "
" var/column_counter = 0 - for(var/list/category in department_list) - var/cat_color = department_order[department_order[column_counter+1]] // color from `department_order` + 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 += "[department_order[column_counter+1]]" - var/list/dept_dat = list() - for(var/job in category) + 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(job in GLOB.command_positions) + if(each_dept.dept_id == DEPT_NAME_COMMAND || (job in each_dept.leaders)) command_bold = " command" if(job_datum in SSjob.prioritized_jobs) - dept_dat += "[job_datum.title] ([job_datum.current_positions])" + valid_jobs += "[job_datum.title] ([job_datum.current_positions])" else - dept_dat += "[job_datum.title] ([job_datum.current_positions])" - if(!dept_dat.len) - dept_dat += "No positions open." - dat += jointext(dept_dat, "") + valid_jobs += "[job_datum.title] ([job_datum.current_positions])" + if(!valid_jobs.len) + valid_jobs += "No positions open." + dat += jointext(valid_jobs, "") dat += "

" column_counter++ if(column_counter > 0 && (column_counter % 3 == 0)) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index b5291a76da879..65e0bf52c933a 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -252,7 +252,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 GLOB.command_positions) + 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 d6bf487d66f31..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 GLOB.security_positions) + 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 288b007adb7b1..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 = GLOB.engineering_positions, - CARDCON_DEPARTMENT_MEDICAL = GLOB.medical_positions, - CARDCON_DEPARTMENT_SCIENCE = GLOB.science_positions, - CARDCON_DEPARTMENT_SECURITY = GLOB.security_positions, - CARDCON_DEPARTMENT_SUPPLY = GLOB.supply_positions, - CARDCON_DEPARTMENT_CIVILIAN = GLOB.civilian_positions | GLOB.gimmick_positions + 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)