Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle ghost now leaves the users mob visible #6065

Merged
merged 5 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_VISIBLE_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_VISIBLE_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
Loading