From dca567b119ddf6b0bdb4d7f4dcdcf46e6b78fa1e Mon Sep 17 00:00:00 2001 From: Ryll-Ryll <3589655+Ryll-Ryll@users.noreply.github.com> Date: Mon, 20 Jul 2020 22:12:02 -0400 Subject: [PATCH] antaggy --- code/modules/admin/topic.dm | 8 ++++- code/modules/admin/verbs/adminhelp.dm | 2 +- code/modules/mob/mob_helpers.dm | 46 ++++----------------------- 3 files changed, 14 insertions(+), 42 deletions(-) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index ab966654972..bdf49c632ad 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1262,7 +1262,13 @@ //Job + antagonist if(M.mind) - special_role_description = "Role: [M.mind.assigned_role]; Antagonist: [M.mind.special_role]" + special_role_description = "Role: [M.mind.assigned_role]; Antagonist: " + var/i = 0 + for(var/datum/antagonist/A in M.mind.antag_datums) + special_role_description += "[A.name]" + if(i++ != length(M.mind.antag_datums)) + special_role_description += ", " + special_role_description += "" else special_role_description = "Role: Mind datum missing Antagonist: Mind datum missing" diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 115feb5731e..b5705e24eb5 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -668,7 +668,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) if(!ai_found && isAI(found)) ai_found = 1 var/is_antag = 0 - if(found.mind && found.mind.special_role) + if(is_special_character(found)) is_antag = 1 founds += "Name: [found.name]([found.real_name]) Key: [found.key] Ckey: [found.ckey] [is_antag ? "(Antag)" : null] " msg += "[original_word](?|F) " diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 4fbb4bf4669..977bc87b894 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -297,52 +297,18 @@ // moved out of admins.dm because things other than admin procs were calling this. -/** - * Is this mob special to the gamemode? - * - * returns 1 for special characters and 2 for heroes of gamemode - * - */ +/// Returns TRUE if the game has started and we're either an AI with a 0th law, or we're someone with a special role/antag datum /proc/is_special_character(mob/M) if(!SSticker.HasRoundStarted()) return FALSE if(!istype(M)) return FALSE - if(issilicon(M)) - if(iscyborg(M)) //For cyborgs, returns 1 if the cyborg has a law 0 and special_role. Returns 0 if the borg is merely slaved to an AI traitor. - return FALSE - else if(isAI(M)) - var/mob/living/silicon/ai/A = M - if(A.laws && A.laws.zeroth && A.mind && A.mind.special_role) - return TRUE + if(iscyborg(M)) //For cyborgs, returns 1 if the cyborg has a law 0 and special_role. Returns 0 if the borg is merely slaved to an AI traitor. return FALSE - if(M.mind && M.mind.special_role)//If they have a mind and special role, they are some type of traitor or antagonist. - switch(SSticker.mode.config_tag) - if("revolution") - if(is_revolutionary(M)) - return 2 - if("cult") - if(M.mind in SSticker.mode.cult) - return 2 - if("nuclear") - if(M.mind.has_antag_datum(/datum/antagonist/nukeop,TRUE)) - return 2 - if("changeling") - if(M.mind.has_antag_datum(/datum/antagonist/changeling,TRUE)) - return 2 - if("wizard") - if(iswizard(M)) - return 2 - if("apprentice") - if(M.mind in SSticker.mode.apprentices) - return 2 - if("monkey") - if(isliving(M)) - var/mob/living/L = M - if(L.diseases && (locate(/datum/disease/transformation/jungle_fever) in L.diseases)) - return 2 - return TRUE - if(M.mind && LAZYLEN(M.mind.antag_datums)) //they have an antag datum! + if(isAI(M)) + var/mob/living/silicon/ai/A = M + return (A.laws?.zeroth && (A.mind?.special_role || !isnull(M.mind?.antag_datums))) + if(M.mind?.special_role || !isnull(M.mind?.antag_datums)) //they have an antag datum! return TRUE return FALSE