diff --git a/code/game/gamemodes/blob/overmind.dm b/code/game/gamemodes/blob/overmind.dm index 531f5f1897d..37b70de409a 100644 --- a/code/game/gamemodes/blob/overmind.dm +++ b/code/game/gamemodes/blob/overmind.dm @@ -14,13 +14,26 @@ var/obj/effect/blob/core/blob_core = null // The blob overmind's core var/blob_points = 0 var/max_blob_points = 100 + var/ghostimage = null /mob/camera/blob/New() var/new_name = "[initial(name)] ([rand(1, 999)])" name = new_name real_name = new_name + + ghostimage = image(src.icon,src,src.icon_state) + ghost_darkness_images |= ghostimage //so ghosts can see the blob cursor when they disable darkness + updateallghostimages() + ..() +/mob/camera/blob/Destroy() + if (ghostimage) + ghost_darkness_images -= ghostimage + qdel(ghostimage) + ghostimage = null; + updateallghostimages() + /mob/camera/blob/Login() ..() sync_mind() diff --git a/code/modules/mob/dead/observer/login.dm b/code/modules/mob/dead/observer/login.dm index ce0dbe3d57f..e5041e959c1 100644 --- a/code/modules/mob/dead/observer/login.dm +++ b/code/modules/mob/dead/observer/login.dm @@ -1,2 +1,5 @@ /mob/dead/observer/Login() - ..() \ No newline at end of file + ..() + if (ghostimage) + ghostimage.icon_state = src.icon_state + updateghostimages() \ No newline at end of file diff --git a/code/modules/mob/dead/observer/logout.dm b/code/modules/mob/dead/observer/logout.dm index cf51df634eb..969f6574b9b 100644 --- a/code/modules/mob/dead/observer/logout.dm +++ b/code/modules/mob/dead/observer/logout.dm @@ -1,4 +1,6 @@ /mob/dead/observer/Logout() + if (client) + client.images -= ghost_darkness_images ..() spawn(0) if(src && !key) //we've transferred to another mob. This ghost should be deleted. diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index e999f919091..87b60348e03 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -1,6 +1,7 @@ #define GHOST_CAN_REENTER 1 #define GHOST_IS_OBSERVER 2 +var/list/image/ghost_darkness_images = list() //this is a list of images for things ghosts should still be able to see when they toggle darkness /mob/dead/observer name = "ghost" @@ -25,6 +26,9 @@ var/medHUD = 0 var/secHUD = 0 var/anonsay = 0 + var/image/ghostimage = null //this mobs ghost image, for deleting and stuff + var/ghostvision = 1 //is the ghost able to see things humans can't? + var/seedarkness = 1 /mob/dead/observer/New(var/mob/body=null, var/flags=1) sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF @@ -41,6 +45,10 @@ stat = DEAD + ghostimage = image(src.icon,src,src.icon_state) + ghost_darkness_images |= ghostimage + updateallghostimages() + var/turf/T if(ismob(body)) T = get_turf(body) //Where is the body located? @@ -78,6 +86,14 @@ real_name = name ..() +/mob/dead/observer/Destroy() + if (ghostimage) + ghost_darkness_images -= ghostimage + qdel(ghostimage) + ghostimage = null + updateallghostimages() + ..() + /mob/dead/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) return 1 /* @@ -114,7 +130,7 @@ Works together with spawning an observer, noted above. for(var/mob/living/carbon/human/patient in oview(M, 14)) C.images += patient.hud_list[HEALTH_HUD] C.images += patient.hud_list[STATUS_HUD_OOC] - + /mob/dead/proc/process_secHUD(var/mob/M) var/client/C = M.client for(var/mob/living/carbon/human/target in oview(M, 14)) @@ -461,21 +477,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp src << "\blue Heat Capacity: [round(environment.heat_capacity(),0.1)]" -/mob/dead/observer/verb/toggle_sight() - set name = "Toggle Sight" - set category = "Ghost" - - switch(see_invisible) - if(SEE_INVISIBLE_OBSERVER_AI_EYE) - see_invisible = SEE_INVISIBLE_OBSERVER_NOOBSERVERS - usr << "You no longer see other observers or the AI eye." - if(SEE_INVISIBLE_OBSERVER_NOOBSERVERS) - see_invisible = SEE_INVISIBLE_OBSERVER_NOLIGHTING - usr << "You no longer see darkness." - else - see_invisible = SEE_INVISIBLE_OBSERVER_AI_EYE - usr << "You again see everything." - /mob/dead/observer/verb/view_manfiest() set name = "View Crew Manifest" set category = "Ghost" @@ -491,7 +492,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(usr != src) return ..() - + if (href_list["track"]) var/mob/target = locate(href_list["track"]) in mob_list if(target) @@ -549,3 +550,41 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp src << "Your key won't be shown when you speak in dead chat." else src << "Your key will be publicly visible again." + +/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 category = "Ghost" + ghostvision = !(ghostvision) + updateghostsight() + usr << "You [(ghostvision?"now":"no longer")] have ghost vision." + +/mob/dead/observer/verb/toggle_darkness() + set name = "Toggle Darkness" + set category = "Ghost" + seedarkness = !(seedarkness) + updateghostsight() + +/mob/dead/observer/proc/updateghostsight() + if (!seedarkness) + see_invisible = SEE_INVISIBLE_OBSERVER_NOLIGHTING + else + see_invisible = SEE_INVISIBLE_OBSERVER + if (!ghostvision) + see_invisible = SEE_INVISIBLE_LIVING; + updateghostimages() + +/proc/updateallghostimages() + for (var/mob/dead/observer/O in player_list) + O.updateghostimages() + +/mob/dead/observer/proc/updateghostimages() + if (!client) + return + if (seedarkness || !ghostvision) + client.images -= ghost_darkness_images + else + //add images for the 60inv things ghosts can normally see when darkness is enabled so they can see them now + client.images |= ghost_darkness_images + if (ghostimage) + client.images -= ghostimage //remove ourself \ No newline at end of file diff --git a/paradise.dme b/paradise.dme index a59937230f9..ccaf5d866a5 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1207,6 +1207,7 @@ #include "code\modules\mob\update_icons.dm" #include "code\modules\mob\camera\camera.dm" #include "code\modules\mob\dead\death.dm" +#include "code\modules\mob\dead\observer\login.dm" #include "code\modules\mob\dead\observer\logout.dm" #include "code\modules\mob\dead\observer\observer.dm" #include "code\modules\mob\dead\observer\say.dm"