Adds Skeleton Crew Access (#31389)

* Spooky scary skeletons

* Spooky scary skeletons

* Spooky scary skeletons

* Merge

* Merge

* Update job_defines.dm

* Update support.dm

* Update support.dm

* Update science_jobs.dm

* Update support.dm

* Update security_jobs.dm

* Update cards_ids.dm

* Update cards_ids.dm

* Update support.dm

* Update cards_ids.dm

* config

* Update SSjobs.dm

* captaincy
This commit is contained in:
CRUNCH
2026-01-11 19:22:15 +00:00
committed by GitHub
parent 2df60ba208
commit b7ac71d48a
12 changed files with 302 additions and 104 deletions
@@ -1,5 +1,11 @@
/// Config holder for all job related things
/datum/configuration_section/job_configuration
/// Will the crew be given extended access if the manifest count is low enough?
var/allow_skeleton_crew_access = TRUE
/// Number of crew on the manifest needed to activate skeleton crew access
var/skeleton_crew_threshold = 30
/// Number of crew on the manifest needed to disable skeleton crew access
var/skeleton_crew_escape_threshold = 35
/// Do we want to restrict jobs based on account age
var/restrict_jobs_on_account_age = FALSE
/// Allow admins to bypass age-based job restrictions
@@ -29,6 +35,9 @@
/datum/configuration_section/job_configuration/load_data(list/data)
// Use the load wrappers here. That way the default isnt made 'null' if you comment out the config line
CONFIG_LOAD_BOOL(allow_skeleton_crew_access, data["allow_skeleton_crew_access"])
CONFIG_LOAD_BOOL(skeleton_crew_threshold, data["skeleton_crew_threshold"])
CONFIG_LOAD_BOOL(skeleton_crew_escape_threshold, data["skeleton_crew_escape_threshold"])
CONFIG_LOAD_BOOL(restrict_jobs_on_account_age, data["restrict_jobs_on_account_age"])
CONFIG_LOAD_BOOL(restrict_jobs_on_account_age_admin_bypass, data["restrict_jobs_on_account_age_admin_bypass"])
CONFIG_LOAD_BOOL(enable_exp_tracking, data["enable_exp_tracking"])
+23
View File
@@ -15,6 +15,10 @@ SUBSYSTEM_DEF(jobs)
var/probability_of_antag_role_restriction = 100 // Dict probability of a job rolling an antagonist role
var/id_change_counter = 1
/// Is the crew count below the skeleton crew threshold?
var/skeleton_crew = FALSE
/// Holds a reference to the skeleton timer until it's finished or killed.
var/skeleton_revoke_timer
///list of station departments and their associated roles and economy payments
var/list/station_departments = list()
/// Do we spawn everyone at shuttle due to late arivals?
@@ -33,6 +37,8 @@ SUBSYSTEM_DEF(jobs)
// Only fires every 5 minutes
/datum/controller/subsystem/jobs/fire()
if(GLOB.configuration.jobs.allow_skeleton_crew_access)
check_skeleton_crew()
if(!SSdbcore.IsConnected() || !GLOB.configuration.jobs.enable_exp_tracking)
return
batch_update_player_exp(announce = FALSE) // Set this to true if you ever want to inform players about their EXP gains
@@ -587,3 +593,20 @@ SUBSYSTEM_DEF(jobs)
SSdbcore.MassExecute(playtime_history_update_queries, TRUE, TRUE, FALSE, FALSE)
log_debug("Successfully updated all EXP data in [stop_watch(start_time)]s")
/datum/controller/subsystem/jobs/proc/check_skeleton_crew()
if(length(GLOB.crew_list) <= GLOB.configuration.jobs.skeleton_crew_threshold)
if(skeleton_revoke_timer)
deltimer(skeleton_revoke_timer)
if(!skeleton_crew)
GLOB.minor_announcement.Announce("Due to reduced crew numbers, extended departmental access has been unlocked on crew IDs.", "Extended Access Enabled")
skeleton_crew = TRUE
else
if(skeleton_crew >= GLOB.configuration.jobs.skeleton_crew_escape_threshold)
GLOB.minor_announcement.Announce("Crew count is now above minimal levels, extended departmental access will be revoked from crew IDs in 2 minutes. \
If your ID access has not been upgraded by the Head of Personnel, please vacate any areas you do not normally have access to.", "Extended Access Disabled")
skeleton_revoke_timer = addtimer(CALLBACK(src, PROC_REF(deactivate_skeleton_access)), 2 MINUTES, TIMER_STOPPABLE)
/datum/controller/subsystem/jobs/proc/deactivate_skeleton_access()
skeleton_crew = FALSE
deltimer(skeleton_revoke_timer)