mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
[MDB IGNORE] BIDDLE TRAITORS - Adds progression traitors. Refactors uplink code in its entirety (#63588)
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com> Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com> Co-authored-by: Ghilker <42839747+Ghilker@users.noreply.github.com> Co-authored-by: tgstation-server <tgstation-server@tgstation13.org> Co-authored-by: gbfree <guillaumebfree@gmail.com> Co-authored-by: Sealed101 <75863639+Sealed101@users.noreply.github.com> Co-authored-by: Changelogs <action@github.com> Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Co-authored-by: vincentiusvin <54709710+vincentiusvin@users.noreply.github.com> Co-authored-by: oranges <email@oranges.net.nz> Co-authored-by: Seth Scherer <supernovaa41@gmx.com> Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com> Co-authored-by: Azarak <azarak10@gmail.com> Co-authored-by: RandomGamer123 <31096837+RandomGamer123@users.noreply.github.com> Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: Kylerace <kylerlumpkin1@gmail.com> Co-authored-by: ike709 <ike709@users.noreply.github.com> Co-authored-by: Iamgoofball <iamgoofball@gmail.com> Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Pepsilawn <reisenrui@gmail.com> Co-authored-by: AnturK <AnturK@users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com> Co-authored-by: SuperNovaa41 <supernovaa41@protonmail.com> Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com> Co-authored-by: san7890 <34697715+san7890@users.noreply.github.com> Co-authored-by: MMMiracles <lolaccount1@hotmail.com> Co-authored-by: Krysonism <49783092+Krysonism@users.noreply.github.com> Co-authored-by: Aziz Chynaliev <azizonkg@gmail.com> Co-authored-by: Tastyfish <crazychris32@gmail.com> Co-authored-by: Mooshimi <85910816+Mooshimi@users.noreply.github.com> Co-authored-by: carshalash <carshalash@gmail.com> Co-authored-by: Ryll Ryll <3589655+Ryll-Ryll@users.noreply.github.com>
This commit is contained in:
co-authored by
Watermelon914
tralezab
Ghilker
tgstation-server
gbfree
Sealed101
Changelogs
John Willard
vincentiusvin
oranges
Seth Scherer
Jeremiah
Azarak
RandomGamer123
LemonInTheDark
Kylerace
ike709
Iamgoofball
MrMelbert
Pepsilawn
AnturK
Mothblocks
SuperNovaa41
GoldenAlpharex
Fikou
san7890
MMMiracles
Krysonism
Aziz Chynaliev
Tastyfish
Mooshimi
carshalash
Ryll Ryll
parent
eb6145fb7d
commit
8fd85e9666
@@ -82,6 +82,7 @@
|
||||
#include "modsuit.dm"
|
||||
#include "ntnetwork_tests.dm"
|
||||
#include "outfit_sanity.dm"
|
||||
#include "objectives.dm"
|
||||
#include "pills.dm"
|
||||
#include "plantgrowth_tests.dm"
|
||||
#include "preferences.dm"
|
||||
@@ -105,6 +106,7 @@
|
||||
#include "strippable.dm"
|
||||
#include "subsystem_init.dm"
|
||||
#include "surgeries.dm"
|
||||
#include "traitor.dm"
|
||||
#include "teleporters.dm"
|
||||
#include "tgui_create_message.dm"
|
||||
#include "timer_sanity.dm"
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/datum/unit_test/objectives_category/Run()
|
||||
var/datum/traitor_category_handler/category_handler = allocate(/datum/traitor_category_handler)
|
||||
var/list/objectives_that_exist = list()
|
||||
for(var/datum/traitor_objective_category/category as anything in category_handler.all_categories)
|
||||
for(var/value in category.objectives)
|
||||
TEST_ASSERT(isnum(category.objectives[value]), "[category.type] does not have a valid format for its objectives as an objective category! ([value] requires a weight to be assigned to it)")
|
||||
if(islist(value))
|
||||
recursive_check_list(category.type, value, objectives_that_exist)
|
||||
else
|
||||
objectives_that_exist += value
|
||||
|
||||
for(var/datum/traitor_objective/objective_typepath as anything in subtypesof(/datum/traitor_objective))
|
||||
if(initial(objective_typepath.abstract_type) == objective_typepath)
|
||||
continue
|
||||
if(!(objective_typepath in objectives_that_exist))
|
||||
Fail("[objective_typepath] is not in a traitor category and isn't an abstract type! Place it into a [/datum/traitor_objective_category] or remove it from code.")
|
||||
|
||||
/datum/unit_test/objectives_category/proc/recursive_check_list(base_type, list/to_check, list/to_add_to)
|
||||
for(var/value in to_check)
|
||||
TEST_ASSERT(isnum(to_check[value]), "[base_type] does not have a valid format for its objectives as an objective category! ([value] requires a weight to be assigned to it)")
|
||||
if(islist(value))
|
||||
recursive_check_list(base_type, value, to_add_to)
|
||||
else
|
||||
to_add_to += value
|
||||
@@ -0,0 +1,26 @@
|
||||
/datum/unit_test/traitor/Run()
|
||||
var/datum/dynamic_ruleset/roundstart/traitor/traitor_ruleset = allocate(/datum/dynamic_ruleset/roundstart/traitor)
|
||||
var/list/possible_jobs = SSjob.station_jobs.Copy()
|
||||
possible_jobs -= traitor_ruleset.protected_roles
|
||||
possible_jobs -= traitor_ruleset.restricted_roles
|
||||
|
||||
for(var/job_name in possible_jobs)
|
||||
var/datum/job/job = SSjob.GetJob(job_name)
|
||||
var/mob/living/player = allocate(job.spawn_type)
|
||||
player.mind_initialize()
|
||||
var/datum/mind/mind = player.mind
|
||||
if(ishuman(player))
|
||||
var/mob/living/carbon/human/human = player
|
||||
human.equipOutfit(job.outfit)
|
||||
mind.set_assigned_role(job)
|
||||
var/datum/antagonist/traitor/traitor = mind.add_antag_datum(/datum/antagonist/traitor)
|
||||
if(!traitor.uplink_handler)
|
||||
Fail("[job_name] when made traitor does not have a proper uplink created when spawned in!")
|
||||
for(var/datum/traitor_objective/objective_typepath as anything in subtypesof(/datum/traitor_objective))
|
||||
if(initial(objective_typepath.abstract_type) == objective_typepath)
|
||||
continue
|
||||
var/datum/traitor_objective/objective = allocate(objective_typepath, traitor.uplink_handler)
|
||||
try
|
||||
objective.generate_objective(mind, list())
|
||||
catch(var/exception/exception)
|
||||
Fail("[objective_typepath] failed to generate their objective. Reason: [exception.name] [exception.file]:[exception.line]\n[exception.desc]")
|
||||
Reference in New Issue
Block a user