Skip to content

Commit

Permalink
toggle ghost now leaves the users mob visibile
Browse files Browse the repository at this point in the history
  • Loading branch information
DOOM authored and DOOM committed Apr 1, 2024
1 parent 084145d commit 4a0a7ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/__game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
#define SEE_INVISIBLE_LEVEL_TWO 45 //Used by some other stuff in code. It's really poorly organized.
#define INVISIBILITY_LEVEL_TWO 45 //Used by some other stuff in code. It's really poorly organized.

#define HIDE_INVISIBLE_OBSERVER 59 // define for when we want to hide all observer mobs.

#define INVISIBILITY_OBSERVER 60
#define SEE_INVISIBLE_OBSERVER 60

Expand Down
18 changes: 10 additions & 8 deletions code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
/// If the observer is an admin, are they excluded from the xeno queue?
var/admin_larva_protection = TRUE // Enabled by default
var/ghostvision = TRUE
var/self_visibility = TRUE
var/can_reenter_corpse
var/started_as_observer //This variable is set to 1 when you enter the game as an observer.
//If you died in the game and are a ghost - this will remain as null.
Expand Down Expand Up @@ -71,10 +72,10 @@
set desc = "Toggles your ability to see things only ghosts can see, like other ghosts"
set category = "Ghost.Settings"
ghostvision = !ghostvision
if(hud_used)
var/atom/movable/screen/plane_master/lighting/lighting = hud_used.plane_masters["[GHOST_PLANE]"]
if (lighting)
lighting.alpha = ghostvision? 255 : 0
if(ghostvision)
see_invisible = INVISIBILITY_OBSERVER
else
see_invisible = HIDE_INVISIBLE_OBSERVER
to_chat(usr, SPAN_NOTICE("You [(ghostvision?"now":"no longer")] have ghost vision."))

/mob/dead/observer/Initialize(mapload, mob/body)
Expand Down Expand Up @@ -845,11 +846,12 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/dead/observer/verb/toggle_self_visibility()
set name = "Toggle Self Visibility"
set category = "Ghost.Settings"

if (alpha)
alpha = 0
else
self_visibility = !self_visibility
if (self_visibility)
alpha = initial(alpha)
else
alpha = 0
to_chat(usr, SPAN_NOTICE("You are now [(self_visibility?"visible":"invisible")] to other mobs."))

/mob/dead/observer/verb/view_manifest()
set name = "View Crew Manifest"
Expand Down

0 comments on commit 4a0a7ff

Please sign in to comment.