diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm
index c555815ac44..abcb0d324b8 100644
--- a/code/modules/mob/dead/observer/observer.dm
+++ b/code/modules/mob/dead/observer/observer.dm
@@ -22,6 +22,7 @@
universal_speak = 1
var/atom/movable/following = null
var/admin_ghosted = 0
+ var/anonsay = 0
/mob/dead/observer/New(mob/body)
sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
@@ -588,8 +589,19 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
toggled_invisible = world.time
visible_message("It fades from sight...", "You are now invisible")
else
- src << "You are now visible"
invisibility = invisibility == INVISIBILITY_OBSERVER ? 0 : INVISIBILITY_OBSERVER
// Give the ghost a cult icon which should be visible only to itself
toggle_icon("cult")
+
+/mob/dead/observer/verb/toggle_anonsay()
+ set category = "Ghost"
+ set name = "Toggle Anonymous Chat"
+ set desc = "Toggles showing your key in dead chat."
+
+ src.anonsay = !src.anonsay
+ if(anonsay)
+ src << "Your key won't be shown when you speak in dead chat."
+ else
+ src << "Your key will be publicly visible again."
\ No newline at end of file
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index daddf617f70..177651f7dff 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -471,9 +471,10 @@ proc/is_blind(A)
//I know you can't see the change, but I rewrote the name code. It is significantly less messy now
/proc/say_dead_direct(var/message, var/mob/subject = null)
var/name
+ var/keyname
if(subject && subject.client)
var/client/C = subject.client
- var/keyname = (C.holder && C.holder.fakekey) ? C.holder.fakekey : C.key
+ keyname = (C.holder && C.holder.fakekey) ? C.holder.fakekey : C.key
if(C.mob) //Most of the time this is the dead/observer mob; we can totally use him if there is no better name
var/mindname
var/realname = C.mob.real_name
@@ -485,17 +486,30 @@ proc/is_blind(A)
name = "[realname] died as [mindname]"
else
name = realname
- name = "[keyname] ([name]) "
for(var/mob/M in player_list)
if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || (M.client.holder && !is_mentor(M.client))) && (M.client.prefs.toggles & CHAT_DEAD))
- var/follow = ""
+ var/follow
+ var/lname
if(subject)
if(subject != M)
follow = "(follow) "
if(M.stat != DEAD && M.client.holder)
follow = "(JMP) "
- M << "" + create_text_tag("dead", "DEAD:", M.client) + " [name][follow][message]"
+ var/mob/dead/observer/DM
+ if(istype(subject, /mob/dead/observer))
+ DM = subject
+ if(M.client.holder) // What admins see
+ lname = "[keyname][(DM && DM.anonsay) ? "*" : (DM ? "" : "^")] ([name])"
+ else
+ if(DM && DM.anonsay) // If the person is actually observer they have the option to be anonymous
+ lname = "Ghost of [name]"
+ else if(DM) // Non-anons
+ lname = "[keyname] ([name])"
+ else // Everyone else (dead people who didn't ghost yet, etc.)
+ lname = name
+ lname = "[lname] "
+ M << "" + create_text_tag("dead", "DEAD:", M.client) + " [lname][follow][message]"
//Announces that a ghost has joined/left, mainly for use with wizards
/proc/announce_ghost_joinleave(O, var/joined_ghosts = 1, var/message = "")