job
Vars | |
all_occupations | List of all jobs. |
---|---|
assigned_captain | If TRUE, some player has been assigned Captaincy or Acting Captaincy at some point during the shift and has been given the spare ID safe code. |
chain_of_command | Keys should be assigned job roles. Values should be >= 1. Represents the chain of command on the station. Lower numbers mean higher priority. Used to give the Cap's Spare safe code to a an appropriate player. Assumed Captain is always the highest in the chain of command. See [/datum/controller/subsystem/ticker/proc/equip_characters] |
config_documentation | This is just the message we prepen and put into all of the config files to ensure documentation. We use this in more than one place, so let's put it in the SS to make life a bit easier. |
dynamic_forced_occupations | Lazylist of mob:occupation_string pairs. |
experience_jobs_map | Dictionary of jobs indexed by the experience type they grant. |
job_config_datum_singletons | List of job config datum singletons. |
job_priorities_to_strings | Dictionary that maps job priorities to low/medium/high. Keys have to be number-strings as assoc lists cannot be indexed by integers. Set in setup_job_lists. |
joinable_departments | List of all departments with joinable jobs. |
joinable_departments_by_type | List of all joinable departments indexed by their typepath, sorted by their own display order. |
joinable_occupations | List of jobs that can be joined through the starting menu. |
legacy_mode | Are we using the old job config system (txt) or the new job config system (TOML)? IF we are going to use the txt file, then we are in "legacy mode", and this will flip to TRUE. |
name_occupations | Dictionary of all jobs, keys are titles. |
safe_code_request_loc | The loc to which the emergency safe code has been requested for delivery. |
safe_code_requested | Whether the emergency safe code has been requested via a comms console on shifts with no Captain or Acting Captain. |
safe_code_timer_id | Timer ID for the emergency safe code request. |
type_occupations | Dictionary of all jobs, keys are types. |
Procs | |
AssignRole | Assigns the given job role to the player. |
CheckHeadPositions | Attempts to fill out all possible head positions for players with that job at a a given job priority level. |
DivideOccupations | |
DropLandAtRandomHallwayPoint | Lands specified mob at a random spot in the hallways |
FillHeadPosition | Will try to select a head, ignoring ALL non-head preferences for every level until. |
OccupyRole | Used for clocking back in, re-claiming the previously freed role. Returns false if no slot is available. |
assign_priority_positions | Blindly assigns the required roles to every player in the dynamic_forced_occupations list. |
check_job_eligibility | Runs a standard suite of eligibility checks to make sure the player can take the reqeusted job. |
export_toml | Proc that we call to generate a new jobconfig.toml file and send it to the requesting client. Returns TRUE if a file is successfully generated. |
fill_ai_positions | Attempts to fill out all available AI positions. |
generate_blank_job_config | This will just return a list for a completely new job that doesn't need to be migrated from an old config (completely new). Just done here to reduce copypasta |
generate_config | Will generate a new jobconfig.toml file if one does not exist, or if one does exist, will migrate the old jobs.txt file into the new TOML format for download Returns TRUE if a file is successfully generated, FALSE otherwise. |
generate_config_singletons | Returns an associated list of all of the job config types that we have in the codebase. |
generate_job_config_excluding_legacy | Like generate_blank_job_config , but we opt-out of adding the legacy variables in case we handle it elsewhere. |
get_all_heads | Returns a list of minds of all heads of staff |
get_all_sec | Returns a list of minds of all security members |
get_job_staff_records | Returns a list of minds of staff in a particular job |
get_living_heads | Returns a list of minds of all heads of staff who are alive |
get_living_sec | Returns a list of minds of all security members who are alive |
get_valid_overflow_jobs | Returns a list of jobs that we are allowed to fuck with during random events |
has_minimum_jobs | Check if the station manifest has at least a certain amount of this staff type. If a matching head of staff is on the manifest, automatically passes (returns TRUE) |
import_config_from_txt | Loads the job config from the TXT and creates a new TOML file from it. Returns TRUE if a file is successfully generated, FALSE otherwise. |
is_skeleton_engineering | Check if the station manifest has at least a certain amount of this staff type |
job_priority_level_to_string | Takes a job priority #define such as JP_LOW and gets its string representation for logging. |
legacy_load | Operates the legacy jobs.txt parser to load jobs from the old config system. |
load_jobs_from_config | Sets all of the job datum configurable values to what they've been set to in the config file, jobconfig.toml. |
regenerate_job_config | If we add a new job or more fields to config a job with, quickly spin up a brand new config that inherits all of your old settings, but adds the new job with codebase defaults. Returns TRUE if a file is successfully generated, FALSE otherwise. |
send_spare_id_safe_code | Send a drop pod containing a piece of paper with the spare ID safe code to loc |
setup_alt_job_items | Shows a list of all current and future polls and buttons to edit or delete them or create a new poll. |
setup_job_lists | Builds various lists of jobs based on station, centcom and additional jobs with icons associated with them. |
Var Details
all_occupations
List of all jobs.
assigned_captain
If TRUE, some player has been assigned Captaincy or Acting Captaincy at some point during the shift and has been given the spare ID safe code.
chain_of_command
Keys should be assigned job roles. Values should be >= 1. Represents the chain of command on the station. Lower numbers mean higher priority. Used to give the Cap's Spare safe code to a an appropriate player. Assumed Captain is always the highest in the chain of command. See [/datum/controller/subsystem/ticker/proc/equip_characters]
config_documentation
This is just the message we prepen and put into all of the config files to ensure documentation. We use this in more than one place, so let's put it in the SS to make life a bit easier.
dynamic_forced_occupations
Lazylist of mob:occupation_string pairs.
experience_jobs_map
Dictionary of jobs indexed by the experience type they grant.
job_config_datum_singletons
List of job config datum singletons.
job_priorities_to_strings
Dictionary that maps job priorities to low/medium/high. Keys have to be number-strings as assoc lists cannot be indexed by integers. Set in setup_job_lists.
joinable_departments
List of all departments with joinable jobs.
joinable_departments_by_type
List of all joinable departments indexed by their typepath, sorted by their own display order.
joinable_occupations
List of jobs that can be joined through the starting menu.
legacy_mode
Are we using the old job config system (txt) or the new job config system (TOML)? IF we are going to use the txt file, then we are in "legacy mode", and this will flip to TRUE.
name_occupations
Dictionary of all jobs, keys are titles.
safe_code_request_loc
The loc to which the emergency safe code has been requested for delivery.
safe_code_requested
Whether the emergency safe code has been requested via a comms console on shifts with no Captain or Acting Captain.
safe_code_timer_id
Timer ID for the emergency safe code request.
type_occupations
Dictionary of all jobs, keys are types.
Proc Details
AssignRole
Assigns the given job role to the player.
Arguments:
- player - The player to assign the job to
- job - The job to assign
- latejoin - Set to TRUE if this is a latejoin role assignment.
- do_eligibility_checks - Set to TRUE to conduct all job eligibility tests and reject on failure. Set to FALSE if job eligibility has been tested elsewhere and they can be safely skipped.
CheckHeadPositions
Attempts to fill out all possible head positions for players with that job at a a given job priority level.
Arguments:
- level - One of the JP_LOW, JP_MEDIUM or JP_HIGH defines. Attempts to find candidates with head jobs at this priority only.
DivideOccupations
- Proc DivideOccupations
- fills var "assigned_role" for all ready players.
- This proc must not have any side effect besides of modifying "assigned_role".
DropLandAtRandomHallwayPoint
Lands specified mob at a random spot in the hallways
FillHeadPosition
Will try to select a head, ignoring ALL non-head preferences for every level until.
Basically tries to ensure there is at least one head in every shift if anyone has that job preference enabled at all.
OccupyRole
Used for clocking back in, re-claiming the previously freed role. Returns false if no slot is available.
assign_priority_positions
Blindly assigns the required roles to every player in the dynamic_forced_occupations list.
check_job_eligibility
Runs a standard suite of eligibility checks to make sure the player can take the reqeusted job.
Checks:
- Role bans
- How many days old the player account is
- Whether the player has the required hours in other jobs to take that role
- If the job is in the mind's restricted roles, for example if they have an antag datum that's incompatible with certain roles.
Arguments:
- player - The player to check for job eligibility.
- possible_job - The job to check for eligibility against.
- debug_prefix - Logging prefix for the JobDebug log entries. For example, GRJ during GiveRandomJob or DO during DivideOccupations.
- add_job_to_log - If TRUE, appends the job type to the log entry. If FALSE, does not. Set to FALSE when check is part of iterating over players for a specific job, set to TRUE when check is part of iterating over jobs for a specific player and you don't want extra log entry spam.
export_toml
Proc that we call to generate a new jobconfig.toml file and send it to the requesting client. Returns TRUE if a file is successfully generated.
fill_ai_positions
Attempts to fill out all available AI positions.
generate_blank_job_config
This will just return a list for a completely new job that doesn't need to be migrated from an old config (completely new). Just done here to reduce copypasta
generate_config
Will generate a new jobconfig.toml file if one does not exist, or if one does exist, will migrate the old jobs.txt file into the new TOML format for download Returns TRUE if a file is successfully generated, FALSE otherwise.
generate_config_singletons
Returns an associated list of all of the job config types that we have in the codebase.
generate_job_config_excluding_legacy
Like generate_blank_job_config
, but we opt-out of adding the legacy variables in case we handle it elsewhere.
get_all_heads
Returns a list of minds of all heads of staff
get_all_sec
Returns a list of minds of all security members
get_job_staff_records
Returns a list of minds of staff in a particular job
get_living_heads
Returns a list of minds of all heads of staff who are alive
get_living_sec
Returns a list of minds of all security members who are alive
get_valid_overflow_jobs
Returns a list of jobs that we are allowed to fuck with during random events
has_minimum_jobs
Check if the station manifest has at least a certain amount of this staff type. If a matching head of staff is on the manifest, automatically passes (returns TRUE)
Arguments:
- crew_threshold - amount of crew to meet the requirement
- jobs - a list of jobs that qualify the requirement
- head_jobs - a list of head jobs that qualify the requirement
import_config_from_txt
Loads the job config from the TXT and creates a new TOML file from it. Returns TRUE if a file is successfully generated, FALSE otherwise.
is_skeleton_engineering
Check if the station manifest has at least a certain amount of this staff type
Arguments:
- crew_threshold - amount of crew before it's no longer considered a skeleton crew
job_priority_level_to_string
Takes a job priority #define such as JP_LOW and gets its string representation for logging.
legacy_load
Operates the legacy jobs.txt parser to load jobs from the old config system.
load_jobs_from_config
Sets all of the job datum configurable values to what they've been set to in the config file, jobconfig.toml.
regenerate_job_config
If we add a new job or more fields to config a job with, quickly spin up a brand new config that inherits all of your old settings, but adds the new job with codebase defaults. Returns TRUE if a file is successfully generated, FALSE otherwise.
send_spare_id_safe_code
Send a drop pod containing a piece of paper with the spare ID safe code to loc
setup_alt_job_items
Shows a list of all current and future polls and buttons to edit or delete them or create a new poll.
All extra functionality to run on new player mobs, in a place where we actually have the client, and haven't called COMSIG_GLOB_JOB_AFTER_SPAWN yet, so we are running before the wallet trait, and other things that rely on items already being settled.
setup_job_lists
Builds various lists of jobs based on station, centcom and additional jobs with icons associated with them.