Daedalus Dock - Modules - TypesVar Details - Proc Details

Families gamemode / dynamic ruleset handler

A special datum used by the families gamemode and dynamic rulesets to centralize code. "Family" and "gang" used interchangeably in code.

This datum centralizes code used for the families gamemode / dynamic rulesets. Families incorporates a significant amount of unique processing; without this datum, that could would be duplicated. To ensure the maintainability of the families gamemode / rulesets, the code was moved to this datum. The gamemode / rulesets instance this datum, pass it lists (lists are passed by reference; removing candidates here removes candidates in the gamemode), and call its procs. Additionally, the families antagonist datum and families induction package also contain vars that reference this datum, allowing for new families / family members to add themselves to this datum's lists thereof (primarily used for point calculation). Despite this, the basic team mechanics themselves should function regardless of this datum's instantiation, should a player have the gang or cop antagonist datum added to them through methods external to the families gamemode / rulesets.

Vars

antag_candidatesList of all eligible starting family members / undercover cops. Set externally (passed by reference) by gamemode / ruleset; used internally. Note that dynamic uses a list of mobs to handle candidates while game_modes use lists of minds! Don't be fooled!
check_counterA counter used to minimize the overhead of computationally intensive, periodic family point gain checks. Used and set internally.
cops_arrivedWhether the space cops have arrived. Set internally; used internally, and for updating the wanted HUD.
current_themeThe current chosen gamemode theme. Decides the available Gangs, objectives, and equipment.
deaths_during_shift_at_beginningKeeps track of the amount of deaths since the calling of pre_setup_analogue() if this is a midround handler. Used to prevent a high wanted level due to a large amount of deaths during the shift prior to the activation of this handler / the midround ruleset.
end_timeThe time, in deciseconds, that the space cops will arrive at. Calculated based on wanted level and start_time. Used and set internally.
gang_balance_capThe number of family members more that a family may have over other active families. Can be set externally; used internally.
gangbangersList of all family member minds. Used internally; added to internally, and externally by /obj/item/gang_induction_package when used to induct a new family member.
gangsList of all /datum/team/gang. Used internally; added to externally by /datum/antagonist/gang when it generates a new /datum/team/gang.
gangs_to_generateThe number of families (and 1:1 corresponding undercover cops) that should be generated. Can be set externally; used internally.
midround_rulesetWhether the handler corresponds to a ruleset that does not trigger at round start. Should be set externally only if applicable; used internally.
restricted_jobsList of jobs not eligible for starting family member / undercover cop. Set externally (passed by reference) by gamemode / ruleset; used internally.
sent_announcementWhether the gamemode-announcing announcement has been sent. Used and set internally.
sent_second_announcementWhether the "5 minute warning" announcement has been sent. Used and set internally.
start_timeThe time, in deciseconds, that the datum's pre_setup() occured at. Used in end_time. Used and set internally.
undercover_copsList of all undercover cop minds. Used and set internally.
use_dynamic_timingWhether we want to use the 30 to 15 minute timer instead of the 60 to 30 minute timer, for Dynamic.
wanted_levelThe current wanted level. Set internally; used internally, and for updating the wanted HUD.

Procs

NewSets antag_candidates and restricted_jobs.
announce_gang_locationsInternal. Announces the presence of families to the entire station and sets sent_announcement to true to allow other checks to occur.
check_wanted_levelInternal. Checks if our wanted level has changed; calls update_wanted_level. Only updates wanted level post the initial announcement and until the cops show up. After that, it's locked.
on_gain_wanted_levelInternal. Updates the end_time and sends out an announcement if the wanted level has increased. Called by update_wanted_level().
on_lower_wanted_levelInternal. Updates the end_time and sends out an announcement if the wanted level has decreased. Called by update_wanted_level().
post_setup_analoguepost_setup() or execute() equivalent.
pre_setup_analoguepre_setup() or pre_execute() equivalent.
process_analogueprocess() or rule_process() equivalent.
send_in_the_fuzzInternal. Polls ghosts and sends in a team of space cops according to the wanted level, accompanied by an announcement. Will let the shuttle leave 10 minutes after sending. Freezes the wanted level.
set_round_result_analogueset_round_result() or round_result() equivalent.
update_wanted_levelInternal. Updates the icon states for everyone, and calls procs that send out announcements / change the end_time if the wanted level has changed.

Var Details

antag_candidates

List of all eligible starting family members / undercover cops. Set externally (passed by reference) by gamemode / ruleset; used internally. Note that dynamic uses a list of mobs to handle candidates while game_modes use lists of minds! Don't be fooled!

check_counter

A counter used to minimize the overhead of computationally intensive, periodic family point gain checks. Used and set internally.

cops_arrived

Whether the space cops have arrived. Set internally; used internally, and for updating the wanted HUD.

current_theme

The current chosen gamemode theme. Decides the available Gangs, objectives, and equipment.

deaths_during_shift_at_beginning

Keeps track of the amount of deaths since the calling of pre_setup_analogue() if this is a midround handler. Used to prevent a high wanted level due to a large amount of deaths during the shift prior to the activation of this handler / the midround ruleset.

end_time

The time, in deciseconds, that the space cops will arrive at. Calculated based on wanted level and start_time. Used and set internally.

gang_balance_cap

The number of family members more that a family may have over other active families. Can be set externally; used internally.

gangbangers

List of all family member minds. Used internally; added to internally, and externally by /obj/item/gang_induction_package when used to induct a new family member.

gangs

List of all /datum/team/gang. Used internally; added to externally by /datum/antagonist/gang when it generates a new /datum/team/gang.

gangs_to_generate

The number of families (and 1:1 corresponding undercover cops) that should be generated. Can be set externally; used internally.

midround_ruleset

Whether the handler corresponds to a ruleset that does not trigger at round start. Should be set externally only if applicable; used internally.

restricted_jobs

List of jobs not eligible for starting family member / undercover cop. Set externally (passed by reference) by gamemode / ruleset; used internally.

sent_announcement

Whether the gamemode-announcing announcement has been sent. Used and set internally.

sent_second_announcement

Whether the "5 minute warning" announcement has been sent. Used and set internally.

start_time

The time, in deciseconds, that the datum's pre_setup() occured at. Used in end_time. Used and set internally.

undercover_cops

List of all undercover cop minds. Used and set internally.

use_dynamic_timing

Whether we want to use the 30 to 15 minute timer instead of the 60 to 30 minute timer, for Dynamic.

wanted_level

The current wanted level. Set internally; used internally, and for updating the wanted HUD.

Proc Details

New

Sets antag_candidates and restricted_jobs.

Sets the antag_candidates and restricted_jobs lists to the equivalent lists of its instantiating game_mode / dynamic_ruleset datum. As lists are passed by reference, the variable set in this datum and the passed list list used to set it are literally the same; changes to one affect the other. Like all New() procs, called when the datum is first instantiated. There's an annoying caveat here, though -- dynamic rulesets don't have lists of minds for candidates, they have lists of mobs. Ghost mobs, before the round has started. But we still want to preserve the structure of the candidates list by not duplicating it and making sure to remove the candidates as we use them. So there's a little bit of boilerplate throughout to preserve the sanctity of this reference. Arguments:

announce_gang_locations

Internal. Announces the presence of families to the entire station and sets sent_announcement to true to allow other checks to occur.

check_wanted_level

Internal. Checks if our wanted level has changed; calls update_wanted_level. Only updates wanted level post the initial announcement and until the cops show up. After that, it's locked.

on_gain_wanted_level

Internal. Updates the end_time and sends out an announcement if the wanted level has increased. Called by update_wanted_level().

on_lower_wanted_level

Internal. Updates the end_time and sends out an announcement if the wanted level has decreased. Called by update_wanted_level().

post_setup_analogue

post_setup() or execute() equivalent.

This proc is always called externally, by the instantiating game_mode / dynamic_ruleset. This is done during the post_setup() or execute() phase, after the pre_setup() / pre_execute() phase. It is intended to take the place of the code that would normally occupy the pre_setup() or pre_execute() proc. As such, it ensures that all prospective starting family members / undercover cops are eligible, and picks replacements if there were ineligible cops / family members. It then assigns gear to the finalized family members and undercover cops, adding them to its lists, and sets the families announcement proc (that does the announcing) to trigger in five minutes. Additionally, if given the argument TRUE, it will return FALSE if there are no eligible starting family members. This is only to be done if the instantiating datum is a dynamic_ruleset, as these require returns while a game_mode is not expected to return early during this phase. Arguments:

pre_setup_analogue

pre_setup() or pre_execute() equivalent.

This proc is always called externally, by the instantiating game_mode / dynamic_ruleset. This is done during the pre_setup() or pre_execute() phase, after first instantiation and the modification of gangs_to_generate, gang_balance_cap, and midround_ruleset. It is intended to take the place of the code that would normally occupy the pre_setup() or pre_execute() proc, were the code localized to the game_mode or dynamic_ruleset datum respectively as opposed to this handler. As such, it picks players to be chosen for starting familiy members or undercover cops prior to assignment to jobs. Sets start_time, default end_time, and the current value of deaths_during_shift, to ensure the wanted level only cares about the deaths since this proc has been called. Takes no arguments.

process_analogue

process() or rule_process() equivalent.

This proc is always called externally, by the instantiating game_mode / dynamic_ruleset. This is done during the process() or rule_process() phase, after post_setup() or execute() and at regular intervals thereafter. process() and rule_process() are optional for a game_mode / dynamic_ruleset, but are important for this gamemode. It is of central importance to the gamemode's flow, calculating wanted level updates, family point gain, and announcing + executing the arrival of the space cops, achieved through calling internal procs. Takes no arguments.

send_in_the_fuzz

Internal. Polls ghosts and sends in a team of space cops according to the wanted level, accompanied by an announcement. Will let the shuttle leave 10 minutes after sending. Freezes the wanted level.

set_round_result_analogue

set_round_result() or round_result() equivalent.

This proc is always called externally, by the instantiating game_mode / dynamic_ruleset. This is done by the set_round_result() or round_result() procs, at roundend. Sets the ticker subsystem to the correct result based off of the relative populations of space cops and family members. Takes no arguments.

update_wanted_level

Internal. Updates the icon states for everyone, and calls procs that send out announcements / change the end_time if the wanted level has changed.