Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Fixes banned/days remaining preferences display for non-dynamic ruleset antagonists. #2780

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 27 additions & 10 deletions code/modules/client/preferences/middleware/antags.dm
Original file line number Diff line number Diff line change
@@ -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),
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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)
Expand Down
Loading