43 lines
32 KiB
HTML
43 lines
32 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../"><link rel="stylesheet" href="dmdoc.css"><title>/datum/dynamic_ruleset - /tg/ Station 13</title></head><body><header><a href="index.html">/tg/ Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a> — <a href="datum/dynamic_ruleset.html#var">Var Details</a> - <a href="datum/dynamic_ruleset.html#proc">Proc Details</a></header><main><h1>dynamic_ruleset <aside>/<a href="datum.html">datum</a>/<a href="datum/dynamic_ruleset.html">dynamic_ruleset</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L4"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 4"></a></h1><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/antag_cap">antag_cap</a></th><td>Judges the amount of antagonists to apply, for both solo and teams.
|
||
Note that some antagonists (such as traitors, lings, heretics, etc) will add more based on how many times they've been scaled.
|
||
Written as a linear equation--ceil(x/denominator) + offset, or as a fixed constant.
|
||
If written as a linear equation, will be in the form of `list("denominator" = denominator, "offset" = offset).</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/antag_datum">antag_datum</a></th><td>The antagonist datum that is assigned to the mobs mind on ruleset execution.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/antag_flag">antag_flag</a></th><td>Preferences flag such as ROLE_WIZARD that need to be turned on for players to be antag</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/antag_flag_override">antag_flag_override</a></th><td>If a role is to be considered another for the purpose of banning.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/assigned">assigned</a></th><td>List of players that were selected for this rule</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/base_prob">base_prob</a></th><td>Base probability used in scaling. The higher it is, the more likely to scale. Kept as a var to allow for config editing._SendSignal(sigtype, list/arguments)</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/blocking_rules">blocking_rules</a></th><td>If a ruleset type which is in this list has been executed, then the ruleset will not be executed.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/candidates">candidates</a></th><td>List of players that are being drafted for this rule</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/cost">cost</a></th><td>Threat cost for this rule, this is decreased from the mode's threat when the rule is executed.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/delay">delay</a></th><td>Delay for when execute will get called from the time of post_setup (roundstart) or process (midround/latejoin).
|
||
Make sure your ruleset works with execute being called during the game when using this, and that the clean_up proc reverts it properly in case of faliure.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/enemy_roles">enemy_roles</a></th><td>If set, there needs to be a certain amount of players doing those roles (among the players who won't be drafted) for the rule to be drafted IMPORTANT: DOES NOT WORK ON ROUNDSTART RULESETS.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/exclusive_roles">exclusive_roles</a></th><td>If set, rule will only accept candidates from those roles. If on a roundstart ruleset, requires the player to have the correct antag pref enabled and any of the possible roles enabled.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/flags">flags</a></th><td>A flag that determines how the ruleset is handled. Check __DEFINES/dynamic.dm for an explanation of the accepted values.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/indice_pop">indice_pop</a></th><td>Calculated during acceptable(), used in scaling and team sizes.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/maximum_players">maximum_players</a></th><td>The maximum amount of players required for the rule to be considered.
|
||
Anything below zero or exactly zero is ignored.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/minimum_players">minimum_players</a></th><td>The minimum amount of players required for the rule to be considered.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/minimum_required_age">minimum_required_age</a></th><td>The required minimum account age for this ruleset.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/mode">mode</a></th><td>Reference to the mode, use this instead of SSticker.mode.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/name">name</a></th><td>For admin logging and round end screen.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/persistent">persistent</a></th><td>If set to TRUE, the rule won't be discarded after being executed, and dynamic will call rule_process() every time it ticks.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/pop_per_requirement">pop_per_requirement</a></th><td>Pop range per requirement. If zero defaults to mode's pop_per_requirement.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/protected_roles">protected_roles</a></th><td>If set, and config flag protect_roles_from_antagonist is false, then the rule will not pick players from these roles.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/repeatable">repeatable</a></th><td>If set to TRUE, dynamic mode will be able to draft this ruleset again later on. (doesn't apply for roundstart rules)</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/repeatable_weight_decrease">repeatable_weight_decrease</a></th><td>If set higher than 0 decreases weight by itself causing the ruleset to appear less often the more it is repeated.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/required_candidates">required_candidates</a></th><td>The rule needs this many candidates (post-trimming) to be executed (example: Cult needs 4 players at round start)</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/required_enemies">required_enemies</a></th><td>If enemy_roles was set, this is the amount of enemy job workers needed per threat_level range (0-10,10-20,etc) IMPORTANT: DOES NOT WORK ON ROUNDSTART RULESETS.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/requirements">requirements</a></th><td>Requirements are the threat level requirements per pop range.
|
||
With the default values, The rule will never get drafted below 10 threat level (aka: "peaceful extended"), and it requires a higher threat level at lower pops.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/restricted_roles">restricted_roles</a></th><td>If set, rule will deny candidates from those roles always.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/ruletype">ruletype</a></th><td>For admin logging and round end screen, do not change this unless making a new rule type.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/scaled_times">scaled_times</a></th><td>How many times a rule has scaled up upon getting picked.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/scaling_cost">scaling_cost</a></th><td>Cost per level the rule scales up.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/total_cost">total_cost</a></th><td>Used for the roundend report</td></tr><tr><th><a href="datum/dynamic_ruleset.html#var/weight">weight</a></th><td>0 -> 9, probability for this rule to be picked against other rules. If zero this will effectively disable the rule.</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/dynamic_ruleset.html#proc/acceptable">acceptable</a></th><td>By default, a rule is acceptable if it satisfies the threat level/population requirements.
|
||
If your rule has extra checks, such as counting security officers, do that in ready() instead</td></tr><tr><th><a href="datum/dynamic_ruleset.html#proc/clean_up">clean_up</a></th><td>Runs from gamemode process() if ruleset fails to start, like delayed rulesets not getting valid candidates.
|
||
This one only handles refunding the threat, override in ruleset to clean up the rest.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#proc/execute">execute</a></th><td>Called on post_setup on roundstart and when the rule executes on midround and latejoin.
|
||
Give your candidates or assignees equipment and antag datum here.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#proc/get_antag_cap">get_antag_cap</a></th><td>Returns what the antag cap with the given population is.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#proc/get_weight">get_weight</a></th><td>Gets weight of the ruleset
|
||
Note that this decreases weight if repeatable is TRUE and repeatable_weight_decrease is higher than 0
|
||
Note: If you don't want repeatable rulesets to decrease their weight use the weight variable directly</td></tr><tr><th><a href="datum/dynamic_ruleset.html#proc/pre_execute">pre_execute</a></th><td>Called on game mode pre_setup for roundstart rulesets.
|
||
Do everything you need to do before job is assigned here.
|
||
IMPORTANT: ASSIGN special_role HERE</td></tr><tr><th><a href="datum/dynamic_ruleset.html#proc/ready">ready</a></th><td>Here you can perform any additional checks you want. (such as checking the map etc)
|
||
Remember that on roundstart no one knows what their job is at this point.
|
||
IMPORTANT: If ready() returns TRUE, that means pre_execute() or execute() should never fail!</td></tr><tr><th><a href="datum/dynamic_ruleset.html#proc/round_result">round_result</a></th><td>Set mode result and news report here.
|
||
Only called if ruleset is flagged as HIGH_IMPACT_RULESET</td></tr><tr><th><a href="datum/dynamic_ruleset.html#proc/rule_process">rule_process</a></th><td>This is called if persistent variable is true everytime SSTicker ticks.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#proc/scale_up">scale_up</a></th><td>When picking rulesets, if dynamic picks the same one multiple times, it will "scale up".
|
||
However, doing this blindly would result in lowpop rounds (think under 10 people) where over 80% of the crew is antags!
|
||
This function is here to ensure the antag ratio is kept under control while scaling up.
|
||
Returns how much threat to actually spend in the end.</td></tr><tr><th><a href="datum/dynamic_ruleset.html#proc/trim_candidates">trim_candidates</a></th><td>Here you can remove candidates that do not meet your requirements.
|
||
This means if their job is not correct or they have disconnected you can remove them from candidates here.
|
||
Usually this does not need to be changed unless you need some specific requirements from your candidates.</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/antag_cap"><aside class="declaration">var </aside>antag_cap <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L79"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 79"></a></h3><p>Judges the amount of antagonists to apply, for both solo and teams.
|
||
Note that some antagonists (such as traitors, lings, heretics, etc) will add more based on how many times they've been scaled.
|
||
Written as a linear equation--ceil(x/denominator) + offset, or as a fixed constant.
|
||
If written as a linear equation, will be in the form of `list("denominator" = denominator, "offset" = offset).</p><h3 id="var/antag_datum"><aside class="declaration">var </aside>antag_datum <aside>– /<a href="datum.html">datum</a>/<a href="datum/antagonist.html">antagonist</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L24"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 24"></a></h3><p>The antagonist datum that is assigned to the mobs mind on ruleset execution.</p><h3 id="var/antag_flag"><aside class="declaration">var </aside>antag_flag <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L22"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 22"></a></h3><p>Preferences flag such as ROLE_WIZARD that need to be turned on for players to be antag</p><h3 id="var/antag_flag_override"><aside class="declaration">var </aside>antag_flag_override <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L59"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 59"></a></h3><p>If a role is to be considered another for the purpose of banning.</p><h3 id="var/assigned"><aside class="declaration">var </aside>assigned <aside>– /list/datum/mind</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L20"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 20"></a></h3><p>List of players that were selected for this rule</p><h3 id="var/base_prob"><aside class="declaration">var </aside>base_prob <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L70"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 70"></a></h3><p>Base probability used in scaling. The higher it is, the more likely to scale. Kept as a var to allow for config editing._SendSignal(sigtype, list/arguments)</p><h3 id="var/blocking_rules"><aside class="declaration">var </aside>blocking_rules <aside>– /list</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L61"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 61"></a></h3><p>If a ruleset type which is in this list has been executed, then the ruleset will not be executed.</p><h3 id="var/candidates"><aside class="declaration">var </aside>candidates <aside>– /list/mob</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L18"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 18"></a></h3><p>List of players that are being drafted for this rule</p><h3 id="var/cost"><aside class="declaration">var </aside>cost <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L42"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 42"></a></h3><p>Threat cost for this rule, this is decreased from the mode's threat when the rule is executed.</p><h3 id="var/delay"><aside class="declaration">var </aside>delay <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L73"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 73"></a></h3><p>Delay for when execute will get called from the time of post_setup (roundstart) or process (midround/latejoin).
|
||
Make sure your ruleset works with execute being called during the game when using this, and that the clean_up proc reverts it properly in case of faliure.</p><h3 id="var/enemy_roles"><aside class="declaration">var </aside>enemy_roles <aside>– /list</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L34"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 34"></a></h3><p>If set, there needs to be a certain amount of players doing those roles (among the players who won't be drafted) for the rule to be drafted IMPORTANT: DOES NOT WORK ON ROUNDSTART RULESETS.</p><h3 id="var/exclusive_roles"><aside class="declaration">var </aside>exclusive_roles <aside>– /list</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L32"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 32"></a></h3><p>If set, rule will only accept candidates from those roles. If on a roundstart ruleset, requires the player to have the correct antag pref enabled and any of the possible roles enabled.</p><h3 id="var/flags"><aside class="declaration">var </aside>flags <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L50"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 50"></a></h3><p>A flag that determines how the ruleset is handled. Check __DEFINES/dynamic.dm for an explanation of the accepted values.</p><h3 id="var/indice_pop"><aside class="declaration">var </aside>indice_pop <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L68"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 68"></a></h3><p>Calculated during acceptable(), used in scaling and team sizes.</p><h3 id="var/maximum_players"><aside class="declaration">var </aside>maximum_players <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L66"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 66"></a></h3><p>The maximum amount of players required for the rule to be considered.
|
||
Anything below zero or exactly zero is ignored.</p><h3 id="var/minimum_players"><aside class="declaration">var </aside>minimum_players <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L63"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 63"></a></h3><p>The minimum amount of players required for the rule to be considered.</p><h3 id="var/minimum_required_age"><aside class="declaration">var </aside>minimum_required_age <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L26"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 26"></a></h3><p>The required minimum account age for this ruleset.</p><h3 id="var/mode"><aside class="declaration">var </aside>mode <aside>– /<a href="datum.html">datum</a>/<a href="datum/game_mode.html">game_mode</a>/<a href="datum/game_mode/dynamic.html">dynamic</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L57"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 57"></a></h3><p>Reference to the mode, use this instead of SSticker.mode.</p><h3 id="var/name"><aside class="declaration">var </aside>name <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L8"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 8"></a></h3><p>For admin logging and round end screen.</p><h3 id="var/persistent"><aside class="declaration">var </aside>persistent <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L12"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 12"></a></h3><p>If set to TRUE, the rule won't be discarded after being executed, and dynamic will call rule_process() every time it ticks.</p><h3 id="var/pop_per_requirement"><aside class="declaration">var </aside>pop_per_requirement <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L52"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 52"></a></h3><p>Pop range per requirement. If zero defaults to mode's pop_per_requirement.</p><h3 id="var/protected_roles"><aside class="declaration">var </aside>protected_roles <aside>– /list</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L28"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 28"></a></h3><p>If set, and config flag protect_roles_from_antagonist is false, then the rule will not pick players from these roles.</p><h3 id="var/repeatable"><aside class="declaration">var </aside>repeatable <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L14"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 14"></a></h3><p>If set to TRUE, dynamic mode will be able to draft this ruleset again later on. (doesn't apply for roundstart rules)</p><h3 id="var/repeatable_weight_decrease"><aside class="declaration">var </aside>repeatable_weight_decrease <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L16"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 16"></a></h3><p>If set higher than 0 decreases weight by itself causing the ruleset to appear less often the more it is repeated.</p><h3 id="var/required_candidates"><aside class="declaration">var </aside>required_candidates <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L38"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 38"></a></h3><p>The rule needs this many candidates (post-trimming) to be executed (example: Cult needs 4 players at round start)</p><h3 id="var/required_enemies"><aside class="declaration">var </aside>required_enemies <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L36"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 36"></a></h3><p>If enemy_roles was set, this is the amount of enemy job workers needed per threat_level range (0-10,10-20,etc) IMPORTANT: DOES NOT WORK ON ROUNDSTART RULESETS.</p><h3 id="var/requirements"><aside class="declaration">var </aside>requirements <aside>– /list</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L55"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 55"></a></h3><p>Requirements are the threat level requirements per pop range.
|
||
With the default values, The rule will never get drafted below 10 threat level (aka: "peaceful extended"), and it requires a higher threat level at lower pops.</p><h3 id="var/restricted_roles"><aside class="declaration">var </aside>restricted_roles <aside>– /list</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L30"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 30"></a></h3><p>If set, rule will deny candidates from those roles always.</p><h3 id="var/ruletype"><aside class="declaration">var </aside>ruletype <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L10"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 10"></a></h3><p>For admin logging and round end screen, do not change this unless making a new rule type.</p><h3 id="var/scaled_times"><aside class="declaration">var </aside>scaled_times <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L46"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 46"></a></h3><p>How many times a rule has scaled up upon getting picked.</p><h3 id="var/scaling_cost"><aside class="declaration">var </aside>scaling_cost <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L44"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 44"></a></h3><p>Cost per level the rule scales up.</p><h3 id="var/total_cost"><aside class="declaration">var </aside>total_cost <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L48"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 48"></a></h3><p>Used for the roundend report</p><h3 id="var/weight"><aside class="declaration">var </aside>weight <aside>– </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L40"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 40"></a></h3><p>0 -> 9, probability for this rule to be picked against other rules. If zero this will effectively disable the rule.</p><h2 id="proc">Proc Details</h2><h3 id="proc/acceptable"><aside class="declaration">proc </aside>acceptable<aside>(population, threat_level) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L100"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 100"></a></aside></h3><p>By default, a rule is acceptable if it satisfies the threat level/population requirements.
|
||
If your rule has extra checks, such as counting security officers, do that in ready() instead</p><h3 id="proc/clean_up"><aside class="declaration">proc </aside>clean_up<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L167"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 167"></a></aside></h3><p>Runs from gamemode process() if ruleset fails to start, like delayed rulesets not getting valid candidates.
|
||
This one only handles refunding the threat, override in ruleset to clean up the rest.</p><h3 id="proc/execute"><aside class="declaration">proc </aside>execute<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L151"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 151"></a></aside></h3><p>Called on post_setup on roundstart and when the rule executes on midround and latejoin.
|
||
Give your candidates or assignees equipment and antag datum here.</p><h3 id="proc/get_antag_cap"><aside class="declaration">proc </aside>get_antag_cap<aside>(population) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L133"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 133"></a></aside></h3><p>Returns what the antag cap with the given population is.</p><h3 id="proc/get_weight"><aside class="declaration">proc </aside>get_weight<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L174"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 174"></a></aside></h3><p>Gets weight of the ruleset
|
||
Note that this decreases weight if repeatable is TRUE and repeatable_weight_decrease is higher than 0
|
||
Note: If you don't want repeatable rulesets to decrease their weight use the weight variable directly</p><h3 id="proc/pre_execute"><aside class="declaration">proc </aside>pre_execute<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L146"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 146"></a></aside></h3><p>Called on game mode pre_setup for roundstart rulesets.
|
||
Do everything you need to do before job is assigned here.
|
||
IMPORTANT: ASSIGN special_role HERE</p><h3 id="proc/ready"><aside class="declaration">proc </aside>ready<aside>(forced) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L159"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 159"></a></aside></h3><p>Here you can perform any additional checks you want. (such as checking the map etc)
|
||
Remember that on roundstart no one knows what their job is at this point.
|
||
IMPORTANT: If ready() returns TRUE, that means pre_execute() or execute() should never fail!</p><h3 id="proc/round_result"><aside class="declaration">proc </aside>round_result<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L189"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 189"></a></aside></h3><p>Set mode result and news report here.
|
||
Only called if ruleset is flagged as HIGH_IMPACT_RULESET</p><h3 id="proc/rule_process"><aside class="declaration">proc </aside>rule_process<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L140"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 140"></a></aside></h3><p>This is called if persistent variable is true everytime SSTicker ticks.</p><h3 id="proc/scale_up"><aside class="declaration">proc </aside>scale_up<aside>(population, max_scale) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L116"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 116"></a></aside></h3><p>When picking rulesets, if dynamic picks the same one multiple times, it will "scale up".
|
||
However, doing this blindly would result in lowpop rounds (think under 10 people) where over 80% of the crew is antags!
|
||
This function is here to ensure the antag ratio is kept under control while scaling up.
|
||
Returns how much threat to actually spend in the end.</p><h3 id="proc/trim_candidates"><aside class="declaration">proc </aside>trim_candidates<aside>() <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/gamemodes/dynamic/dynamic_rulesets.dm#L184"><img src="git.png" width="16" height="16" title="code/game/gamemodes/dynamic/dynamic_rulesets.dm 184"></a></aside></h3><p>Here you can remove candidates that do not meet your requirements.
|
||
This means if their job is not correct or they have disconnected you can remove them from candidates here.
|
||
Usually this does not need to be changed unless you need some specific requirements from your candidates.</p></main><footer>tgstation.dme <a href="https://github.com/evilew/GS13-Citadel/tree/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e">e8e0068</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.9.0</a></footer></body></html> |