diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 028c05cca76..7c2aaeb8735 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -395,6 +395,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// If something has been engraved/cannot be engraved #define TRAIT_NOT_ENGRAVABLE "not_engravable" +/// Whether or not orbiting is blocked or not +#define TRAIT_ORBITING_FORBIDDEN "orbiting_forbidden" + // METABOLISMS // Various jobs on the station have historically had better reactions // to various drinks and foodstuffs. Security liking donuts is a classic diff --git a/code/datums/components/orbiter.dm b/code/datums/components/orbiter.dm index d748e31e289..761b02142e0 100644 --- a/code/datums/components/orbiter.dm +++ b/code/datums/components/orbiter.dm @@ -164,6 +164,10 @@ /atom/movable/proc/orbit(atom/A, radius = 10, clockwise = FALSE, rotation_speed = 20, rotation_segments = 36, pre_rotation = TRUE) if(!istype(A) || !get_turf(A) || A == src) return + if (HAS_TRAIT(A, TRAIT_ORBITING_FORBIDDEN)) + // Stealth-mins have an empty name, don't want "You cannot orbit at this time." + to_chat(src, span_notice("You cannot orbit ["[A]" || "them"] at this time.")) + return orbit_target = A return A.AddComponent(/datum/component/orbiter, src, radius, clockwise, rotation_speed, rotation_segments, pre_rotation) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index be3493e76a7..54f02bb4378 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -462,33 +462,53 @@ GLOBAL_PROTECT(admin_verbs_hideable) return if(holder.fakekey) - holder.fakekey = null - if(isobserver(mob)) - mob.invisibility = initial(mob.invisibility) - mob.alpha = initial(mob.alpha) - if(mob.mind) - if(mob.mind.ghostname) - mob.name = mob.mind.ghostname - else - mob.name = mob.mind.name - else - mob.name = mob.real_name - mob.mouse_opacity = initial(mob.mouse_opacity) + disable_stealth_mode() else - var/new_key = ckeyEx(stripped_input(usr, "Enter your desired display name.", "Fake Key", key, 26)) - if(!new_key) - return - holder.fakekey = new_key - createStealthKey() - if(isobserver(mob)) - mob.invisibility = INVISIBILITY_MAXIMUM //JUST IN CASE - mob.alpha = 0 //JUUUUST IN CASE - mob.name = " " - mob.mouse_opacity = MOUSE_OPACITY_TRANSPARENT - log_admin("[key_name(usr)] has turned stealth mode [holder.fakekey ? "ON" : "OFF"]") - message_admins("[key_name_admin(usr)] has turned stealth mode [holder.fakekey ? "ON" : "OFF"]") + enable_stealth_mode() + SSblackbox.record_feedback("tally", "admin_verb", 1, "Stealth Mode") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! +#define STEALTH_MODE_TRAIT "stealth_mode" + +/client/proc/enable_stealth_mode() + var/new_key = ckeyEx(stripped_input(usr, "Enter your desired display name.", "Fake Key", key, 26)) + if(!new_key) + return + holder.fakekey = new_key + createStealthKey() + if(isobserver(mob)) + mob.invisibility = INVISIBILITY_MAXIMUM //JUST IN CASE + mob.alpha = 0 //JUUUUST IN CASE + mob.name = " " + mob.mouse_opacity = MOUSE_OPACITY_TRANSPARENT + + ADD_TRAIT(mob, TRAIT_ORBITING_FORBIDDEN, STEALTH_MODE_TRAIT) + QDEL_NULL(mob.orbiters) + + log_admin("[key_name(usr)] has turned stealth mode ON") + message_admins("[key_name_admin(usr)] has turned stealth mode ON") + +/client/proc/disable_stealth_mode() + holder.fakekey = null + if(isobserver(mob)) + mob.invisibility = initial(mob.invisibility) + mob.alpha = initial(mob.alpha) + if(mob.mind) + if(mob.mind.ghostname) + mob.name = mob.mind.ghostname + else + mob.name = mob.mind.name + else + mob.name = mob.real_name + mob.mouse_opacity = initial(mob.mouse_opacity) + + REMOVE_TRAIT(mob, TRAIT_ORBITING_FORBIDDEN, STEALTH_MODE_TRAIT) + + log_admin("[key_name(usr)] has turned stealth mode OFF") + message_admins("[key_name_admin(usr)] has turned stealth mode OFF") + +#undef STEALTH_MODE_TRAIT + /client/proc/drop_bomb() set category = "Admin.Fun" set name = "Drop Bomb"