diff --git a/code/modules/client/preferences/middleware/antags.dm b/code/modules/client/preferences/middleware/antags.dm index acd4b265bd6..cba28bf2305 100644 --- a/code/modules/client/preferences/middleware/antags.dm +++ b/code/modules/client/preferences/middleware/antags.dm @@ -1,3 +1,12 @@ +// Antagonists that don't have a dynamic ruleset, but do have a preference +GLOBAL_LIST_INIT(non_ruleset_antagonists, list( + ROLE_GLITCH = /datum/antagonist/bitrunning_glitch, + ROLE_FUGITIVE = /datum/antagonist/fugitive, + ROLE_LONE_OPERATIVE = /datum/antagonist/nukeop/lone, + ROLE_SENTIENCE = /datum/antagonist/sentient_creature, + ROLE_DRIFTING_CONTRACTOR = /datum/antagonist/contractor, // NOVA EDIT ADDITION + )) + /datum/preference_middleware/antags action_delegations = list( "set_antags" = PROC_REF(set_antags), @@ -69,6 +78,12 @@ if (is_banned_from(preferences.parent.ckey, list(antag_flag_override || antag_flag, ROLE_SYNDICATE))) antag_bans += serialize_antag_name(antag_flag) + for(var/antag_key in GLOB.non_ruleset_antagonists) + var/datum/antagonist/antag = GLOB.non_ruleset_antagonists[antag_key] + var/antag_flag = initial(antag.job_rank) + if(is_banned_from(preferences.parent.ckey, list(antag_flag, ROLE_SYNDICATE))) + antag_bans += serialize_antag_name(antag_flag) + return antag_bans /datum/preference_middleware/antags/proc/get_antag_days_left() @@ -91,6 +106,17 @@ if (days_needed > 0) antag_days_left[serialize_antag_name(antag_flag)] = days_needed + for(var/antag_key in GLOB.non_ruleset_antagonists) + var/datum/antagonist/antag = GLOB.non_ruleset_antagonists[antag_key] + var/antag_flag = initial(antag.job_rank) + + var/days_needed = preferences.parent?.get_remaining_days( + GLOB.special_roles[antag_flag] + ) + + if (days_needed > 0) + antag_days_left[serialize_antag_name(antag_flag)] = days_needed + return antag_days_left /datum/preference_middleware/antags/proc/get_serialized_antags() @@ -113,16 +139,7 @@ var/list/antag_icons = list() /datum/asset/spritesheet/antagonists/create_spritesheets() - // Antagonists that don't have a dynamic ruleset, but do have a preference - var/static/list/non_ruleset_antagonists = list( - ROLE_GLITCH = /datum/antagonist/bitrunning_glitch, - ROLE_FUGITIVE = /datum/antagonist/fugitive, - ROLE_LONE_OPERATIVE = /datum/antagonist/nukeop/lone, - ROLE_DRIFTING_CONTRACTOR = /datum/antagonist/contractor, //NOVA EDIT - ROLE_SENTIENCE = /datum/antagonist/sentient_creature, - ) - - var/list/antagonists = non_ruleset_antagonists.Copy() + var/list/antagonists = GLOB.non_ruleset_antagonists.Copy() for (var/datum/dynamic_ruleset/ruleset as anything in subtypesof(/datum/dynamic_ruleset)) var/datum/antagonist/antagonist_type = initial(ruleset.antag_datum)