diff --git a/code/__DEFINES/mob_defines.dm b/code/__DEFINES/mob_defines.dm index dfb55686bcc..7d467199e28 100644 --- a/code/__DEFINES/mob_defines.dm +++ b/code/__DEFINES/mob_defines.dm @@ -410,6 +410,7 @@ #define GHOST_SEE_RADS (1 << 5) // Ghost can see radiation #define GHOST_GAS_SCAN (1 << 6) // Ghost uses gas analyzer on click #define GHOST_PLANT_ANALYZER (1 << 7) // Ghost uses plant analyzer on click +#define GHOST_NO_VISION (1 << 8) // Ghost cannot see any ghosts at all #define GHOST_FLAGS_DEFAULT (GHOST_CAN_REENTER | GHOST_RESPAWNABLE | GHOST_VISION) #define GHOST_FLAGS_START_AS_OBSERVER (GHOST_FLAGS_DEFAULT | GHOST_START_AS_OBSERVER) diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index bb9a3c8fa57..06cd11bf6e7 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -226,6 +226,7 @@ DEFINE_BITFIELD(ghost_flags, list( "GHOST_START_AS_OBSERVER" = GHOST_START_AS_OBSERVER, "GHOST_RESPAWNABLE" = GHOST_RESPAWNABLE, "GHOST_VISION" = GHOST_VISION, + "GHOST_NO_VISION" = GHOST_NO_VISION, "GHOST_SEE_RADS" = GHOST_SEE_RADS, "GHOST_HEALTH_SCAN" = GHOST_HEALTH_SCAN, "GHOST_GAS_SCAN" = GHOST_GAS_SCAN, diff --git a/code/modules/mob/dead/observer/observer_base.dm b/code/modules/mob/dead/observer/observer_base.dm index 480777aeb52..9a616908e97 100644 --- a/code/modules/mob/dead/observer/observer_base.dm +++ b/code/modules/mob/dead/observer/observer_base.dm @@ -716,12 +716,20 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/dead/observer/verb/toggle_ghostsee() set name = "Toggle Ghost Vision" - set desc = "Toggles your ability to see things only ghosts can see, like other ghosts" + set desc = "Cycles between seeing all ghosts, only your own ghost, or no ghosts." set category = "Ghost" - ghost_flags ^= GHOST_VISION + if(ghost_flags & GHOST_VISION) + ghost_flags &= ~GHOST_VISION + to_chat(src, SPAN_NOTICE("Ghost vision set to: Only your own ghost visible.")) + else if(ghost_flags & GHOST_NO_VISION) + ghost_flags &= ~GHOST_NO_VISION + ghost_flags |= GHOST_VISION + to_chat(src, SPAN_NOTICE("Ghost vision set to: All ghosts visible.")) + else + ghost_flags |= GHOST_NO_VISION + to_chat(src, SPAN_NOTICE("Ghost vision set to: No ghosts visible.")) update_sight() - to_chat(src, SPAN_NOTICE("Ghost vision [ghost_flags & GHOST_VISION ? "en" : "dis"]abled.")) /mob/dead/observer/verb/pick_darkness() set name = "Pick Darkness" @@ -755,7 +763,18 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp update_sight() /mob/dead/observer/update_sight() - see_invisible = ghost_flags & GHOST_VISION ? SEE_INVISIBLE_OBSERVER : SEE_INVISIBLE_OBSERVER_NO_OBSERVERS + if(ghost_flags & GHOST_VISION) + // See all ghosts + see_invisible = SEE_INVISIBLE_OBSERVER + sight |= SEE_SELF + else if(ghost_flags & GHOST_NO_VISION) + // See no ghosts at all, including own ghost + see_invisible = SEE_INVISIBLE_OBSERVER_NO_OBSERVERS - 1 + sight &= ~SEE_SELF + else + // See only own ghost + see_invisible = SEE_INVISIBLE_OBSERVER_NO_OBSERVERS + sight |= SEE_SELF return ..() // Ghosts can see all the reagents inside things.