diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index fbd44dff64b..b73474a3db9 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -1003,4 +1003,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// Trait given to foam darts that have an insert in them #define TRAIT_DART_HAS_INSERT "dart_has_insert" + +/// Trait given when a mob is currently in invisimin mode +#define TRAIT_INVISIMIN "invisimin" + // END TRAIT DEFINES diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 84b02886f52..3479a5553e9 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -242,6 +242,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_INCAPACITATED" = TRAIT_INCAPACITATED, "TRAIT_INTROVERT" = TRAIT_INTROVERT, "TRAIT_INVISIBLE_MAN" = TRAIT_INVISIBLE_MAN, + "TRAIT_INVISIMIN" = TRAIT_INVISIMIN, "TRAIT_IWASBATONED" = TRAIT_IWASBATONED, "TRAIT_JOLLY" = TRAIT_JOLLY, "TRAIT_KISS_OF_DEATH" = TRAIT_KISS_OF_DEATH, diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 30bb5ff4ffe..930861bd5b2 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -395,18 +395,21 @@ GLOBAL_PROTECT(admin_verbs_poll) set name = "Invisimin" set category = "Admin.Game" set desc = "Toggles ghost-like invisibility (Don't abuse this)" + if(isnull(holder) || isnull(mob)) return - if(mob.invisimin) + + if(HAS_TRAIT(mob, TRAIT_INVISIMIN)) + REMOVE_TRAIT(mob, TRAIT_INVISIMIN, ADMIN_TRAIT) mob.add_to_all_human_data_huds() - mob.invisimin = FALSE mob.RemoveInvisibility(INVISIBILITY_SOURCE_INVISIMIN) - to_chat(mob, span_boldannounce("Invisimin off. Invisibility reset."), confidential = TRUE) - else - mob.remove_from_all_data_huds() - mob.invisimin = TRUE - mob.SetInvisibility(INVISIBILITY_OBSERVER, INVISIBILITY_SOURCE_INVISIMIN, INVISIBILITY_PRIORITY_ADMIN) - to_chat(mob, span_adminnotice("Invisimin on. You are now as invisible as a ghost."), confidential = TRUE) + to_chat(mob, span_adminnotice(span_bold("Invisimin off. Invisibility reset.")), confidential = TRUE) + return + + ADD_TRAIT(mob, TRAIT_INVISIMIN, ADMIN_TRAIT) + mob.remove_from_all_data_huds() + mob.SetInvisibility(INVISIBILITY_OBSERVER, INVISIBILITY_SOURCE_INVISIMIN, INVISIBILITY_PRIORITY_ADMIN) + to_chat(mob, span_adminnotice(span_bold("Invisimin on. You are now as invisible as a ghost.")), confidential = TRUE) /client/proc/check_antagonists() set name = "Check Antagonists" diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 2c2f8519e25..32766db5ab7 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -215,5 +215,3 @@ /// User is thinking in character. Used to revert to thinking state after stop_typing var/thinking_IC = FALSE - /// Whether invisimin is enabled on this mob - var/invisimin = FALSE