mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-02-05 22:09:05 +00:00
* [MDB IGNORE] BIDDLE TRAITORS - Adds progression traitors. Refactors uplink code in its entirety * updates and fixes * ffff Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com> Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
27 lines
1.3 KiB
Plaintext
27 lines
1.3 KiB
Plaintext
/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]")
|