Files
Bubberstation/code/modules/unit_tests/dynamic_ruleset_sanity.dm
MrMelbert 8b8bcfd674 Adds two heavy midround rulesets, mass traitors and mass changelings (#93447)
## About The Pull Request

- [ ] I tested this pr

Adds "Midround Mass Traitors" and "Midround Mass Changelings" heavy
rulesets

Midround Mass Traitors will turn a number of the crew into sleeper
agents

Midround Mass Lings will spawn a number of changeling meteors 

BY DEFAULT:
- Traitors will spawn 2-4 sleeper agents
- Lings will spawn 2-3 changeling meteors
- They won't run without >=2 candidates
- They have no config blacklist (so the HoP can roll mass midround
traitor, despite not being able to roll normal midround traitor. However
default blacklisted roles like security officers are still blocked)
- They're weighted impossible on tier 0, same weight as most midrounds
on tier 1, and fairly high on tiers 2 and 3
- They're repeatable but very unlikely to repeat
- Significantly higher min pop brackets than their solo counter part

## Why It's Good For The Game

Adds more options for lategame antags than big midrounds

## Changelog

🆑 Melbert
add: Two new heavy dynamic rulesets: "Midround Mass Traitors" and
"Midround Mass Changelings"
/🆑
2025-10-18 19:06:29 +02:00

38 lines
1.6 KiB
Plaintext

/// Verifies that dynamic rulesets are setup properly without external configuration.
/datum/unit_test/dynamic_ruleset_sanity
/datum/unit_test/dynamic_ruleset_sanity/Run()
for (var/datum/dynamic_ruleset/midround/ruleset as anything in subtypesof(/datum/dynamic_ruleset/midround))
if(!initial(ruleset.config_tag))
continue
var/midround_ruleset_style = initial(ruleset.midround_type)
if (midround_ruleset_style != HEAVY_MIDROUND && midround_ruleset_style != LIGHT_MIDROUND)
TEST_FAIL("[ruleset] has an invalid midround_ruleset_style, it should be HEAVY_MIDROUND or LIGHT_MIDROUND")
/// Verifies that dynamic rulesets have unique antag_flag.
/datum/unit_test/dynamic_unique_antag_flags
/datum/unit_test/dynamic_unique_antag_flags/Run()
var/list/known_antag_flags = list()
for (var/datum/dynamic_ruleset/ruleset as anything in subtypesof(/datum/dynamic_ruleset))
if(!initial(ruleset.config_tag))
continue
var/antag_flag = initial(ruleset.pref_flag)
// null antag flag is valid for rulesets with no associated preferecne
if (isnull(antag_flag))
// however if you set preview_antag_datum, it is assumed you do have a preference, and thus should have a flag
if (initial(ruleset.preview_antag_datum))
TEST_FAIL("[ruleset] sets preview_antag_datum, but has no pref_flag! \
If you want to use a preview antag datum, you must set a pref_flag.")
continue
if (antag_flag in known_antag_flags)
if(!(initial(ruleset.ruleset_flags) & RULESET_VARIATION))
TEST_FAIL("[ruleset] has a non-unique antag_flag [antag_flag] (used by [known_antag_flags[antag_flag]])!")
continue
known_antag_flags[antag_flag] = ruleset