Cleanups and tweaks observer code (#30250)

* observer cleanup

* this

* bit more

* Update tgui.bundle.js
This commit is contained in:
kyunkyunkyun
2025-09-05 05:54:22 +00:00
committed by GitHub
parent 8f98876b47
commit 10f2e67e65
66 changed files with 362 additions and 447 deletions
+2 -2
View File
@@ -662,7 +662,7 @@ structure_check() searches for nearby cultist structures required for the invoca
var/mob/dead/observer/C = pick(candidates)
to_chat(mob_to_revive, "<span class='biggerdanger'>Your physical form has been taken over by another soul due to your inactivity! Ahelp if you wish to regain your form.</span>")
message_admins("[key_name_admin(C)] has taken control of ([key_name_admin(mob_to_revive)]) to replace an AFK player.")
mob_to_revive.ghostize(FALSE)
mob_to_revive.ghostize(GHOST_FLAGS_NO_REENTER)
mob_to_revive.key = C.key
dust_if_respawnable(C)
else
@@ -1007,7 +1007,7 @@ structure_check() searches for nearby cultist structures required for the invoca
ADD_TRAIT(user, SCRYING, CULT_TRAIT)
user.visible_message("<span class='warning'>[user] freezes statue-still, glowing an unearthly red.</span>",
"<span class='cult'>You see what lies beyond. All is revealed. In this form you find that your voice booms above all others.</span>")
ghost = user.ghostize(TRUE, RUNE_COLOR_DARKRED, "Dark Spirit of [user.name]")
ghost = user.ghostize(ghost_name = "Dark Spirit of [user.name]", ghost_color = RUNE_COLOR_DARKRED)
var/datum/action/innate/cult/comm/spirit/CM = new
var/datum/action/innate/cult/check_progress/V = new
//var/datum/action/innate/cult/ghostmark/GM = new
+2 -2
View File
@@ -454,7 +454,7 @@
continue //Dead
continue //Happy connected client
for(var/mob/dead/observer/D in GLOB.mob_list)
for(var/mob/dead/observer/D in GLOB.dead_mob_list)
if(D.mind && (D.mind.is_original_mob(L) || D.mind.current == L))
if(L.stat == DEAD)
if(L.suiciding) //Suicider
@@ -464,7 +464,7 @@
msg += "<b>[L.name]</b> ([ckey(D.mind.key)]), the [L.job] (Dead)\n"
continue //Dead mob, ghost abandoned
else
if(D.can_reenter_corpse)
if(D.ghost_flags & GHOST_CAN_REENTER)
msg += "<b>[L.name]</b> ([ckey(D.mind.key)]), the [L.job] (<font color='red'><b>This shouldn't appear.</b></font>)\n"
continue //Lolwhat
else
@@ -213,7 +213,7 @@
icon_state = "revenant_draining"
animate(src, alpha = 0, time = 3 SECONDS)
visible_message("<span class='danger'>[src]'s body breaks apart into a fine pile of blue dust.</span>")
ghostize(FALSE)
ghostize(GHOST_FLAGS_OBSERVE_ONLY)
name = "ectoplasm"
desc = "A pile of clumpy dust from a restless spirit"
alpha = 255
+1 -1
View File
@@ -217,7 +217,7 @@
ADD_TRAIT(user, SCRYING, SCRYING_ORB)
user.visible_message("<span class='notice'>[user] stares into [src], [user.p_their()] eyes glazing over.</span>",
"<span class='danger'>You stare into [src], you can see the entire universe!</span>")
ghost = user.ghostize(TRUE, COLOR_BLUE, "Magic Spirit of [user.name]")
ghost = user.ghostize(ghost_name = "Magic Spirit of [user.name]", ghost_color = COLOR_BLUE)
while(!QDELETED(user))
if(user.key || QDELETED(src))
user.visible_message("<span class='notice'>[user] blinks, returning to the world around [user.p_them()].</span>",
+2 -2
View File
@@ -445,9 +445,9 @@
// Ghost and delete the mob.
if(!occupant.get_ghost(TRUE))
if(TOO_EARLY_TO_GHOST)
occupant.ghostize(FALSE) // Players despawned too early may not re-enter the game
occupant.ghostize(GHOST_FLAGS_OBSERVE_ONLY) // Players despawned too early may not re-enter the game
else
occupant.ghostize(TRUE)
occupant.ghostize()
QDEL_NULL(occupant)
name = initial(name)
@@ -14,7 +14,7 @@
return ..()
/obj/item/bio_chip/grey_autocloner/death_trigger(mob/source, gibbed)
imp_in.ghostize(TRUE)
imp_in.ghostize()
if(linked)
linked.growclone(our_record)
@@ -203,7 +203,7 @@
qdel(src)
else if(tickstokill <= 0)
to_chat(captured, "<span class='boldnotice'>As the last essence of your being is erased from time, you begin to re-experience your most enjoyable memory. You feel happy...</span>")
var/mob/dead/observer/ghost = captured.ghostize(1)
var/mob/dead/observer/ghost = captured.ghostize()
if(captured.mind)
if(ghost)
ghost.mind = null
@@ -148,6 +148,7 @@
if(selected_outfit)
new_human.equipOutfit(selected_outfit)
// used by admins
/obj/structure/ghost_beacon
name = "ethereal beacon"
desc = "A structure that draws ethereal attention when active. Use an empty hand to activate."
@@ -161,7 +162,6 @@
var/alert_title = "Ethereal Beacon Active!"
var/atom/attack_atom
/obj/structure/ghost_beacon/Initialize(mapload)
. = ..()
last_ghost_alert = world.time
+7 -10
View File
@@ -616,18 +616,15 @@ GLOBAL_LIST_EMPTY(crematoriums)
if(C.id == id && !C.cremating)
C.cremate(user)
/mob/proc/update_morgue()
if(stat == DEAD)
var/obj/structure/morgue/morgue
var/mob/living/C = src
var/mob/dead/observer/G = src
if(istype(G) && G.can_reenter_corpse && G.mind) //We're a ghost, let's find our corpse
C = G.mind.current
if(istype(C)) //We found our corpse, is it inside a morgue?
morgue = get(C.loc, /obj/structure/morgue)
if(morgue)
morgue.update_icon(UPDATE_OVERLAYS)
var/mob/living/corpse = src
var/mob/dead/observer/ghost = src
if(istype(ghost) && ghost.ghost_flags & GHOST_CAN_REENTER && ghost.mind) //We're a ghost, let's find our corpse
corpse = ghost.mind.current
if(istype(corpse)) //We found our corpse, is it inside a morgue?
var/obj/structure/morgue/morgue = get(corpse.loc, /obj/structure/morgue)
morgue?.update_icon(UPDATE_OVERLAYS)
#undef EXTENDED_TRAY
#undef EMPTY_MORGUE
@@ -11,7 +11,7 @@
ADD_TRAIT(user, SCRYING, SCRYING_ORB)
user.visible_message("<span class='notice'>[user] stares into [src], [user.p_their()] eyes glazing over.</span>",
"<span class='danger'>You stare into [src], you can see the entire universe!</span>")
ghost = user.ghostize(TRUE, COLOR_BLUE, "Magic Spirit of [user.name]")
ghost = user.ghostize(ghost_name = "Magic Spirit of [user.name]", ghost_color = COLOR_BLUE)
while(!QDELETED(user))
if(user.key || QDELETED(src))
user.visible_message("<span class='notice'>[user] blinks, returning to the world around [user.p_them()].</span>",
@@ -82,7 +82,7 @@
to_chat(buckled_mob, "<span class='ghostalert'>You may now click on the ghost prompt on your screen to leave your body. You will be alerted when you're removed from the nest.</span>")
if(tgui_alert(buckled_mob, "You may now ghost and keep respawnability, you will be notified if you leave the nest, would you like to do so?", "Ghosting", list("Yes", "No")) != "Yes")
return
buckled_mob.ghostize(TRUE)
buckled_mob.ghostize()
/obj/structure/bed/nest/post_buckle_mob(mob/living/M)
M.pixel_y = 0
+1 -1
View File
@@ -64,7 +64,7 @@
if(DEAD)
if(isobserver(C.mob))
var/mob/dead/observer/observer = C.mob
if(observer.started_as_observer)
if(observer.ghost_flags & GHOST_START_AS_OBSERVER)
entry += " - <font color='gray'>Observing</font>"
else
entry += " - <font color='black'><b>DEAD</b></font>"