From c81e529ffe5ef483b6f5bdf0638dc7633a7f4fb2 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Tue, 17 May 2022 22:20:06 +0200 Subject: [PATCH] [MIRROR] Allows ethereals to ghost out of crystallization [MDB IGNORE] (#13568) * Allows ethereals to ghost out of crystallization * Update observer.dm Co-authored-by: wesoda25 <37246588+wesoda25@users.noreply.github.com> Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com> --- code/modules/mob/dead/observer/observer.dm | 42 ++++++++++++++-------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 6e8d6c9b96d..f75c6a6dc20 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -281,19 +281,30 @@ Works together with spawning an observer, noted above. */ /mob/proc/ghostize(can_reenter_corpse = TRUE) - if(key) - if(key[1] != "@") // Skip aghosts. - if(HAS_TRAIT(src, TRAIT_CORPSELOCKED) && can_reenter_corpse) //If you can re-enter the corpse you can't leave when corpselocked - return - stop_sound_channel(CHANNEL_HEARTBEAT) //Stop heartbeat sounds because You Are A Ghost Now - var/mob/dead/observer/ghost = new(src) // Transfer safety to observer spawning proc. - SStgui.on_transfer(src, ghost) // Transfer NanoUIs. - ghost.can_reenter_corpse = can_reenter_corpse - ghost.key = key - ghost.client?.init_verbs() - if(!can_reenter_corpse)// Disassociates observer mind from the body mind - ghost.mind = null - return ghost + if(!key) + return + if(key[1] == "@") // Skip aghosts. + return + + if(HAS_TRAIT(src, TRAIT_CORPSELOCKED)) + if(can_reenter_corpse) //If you can re-enter the corpse you can't leave when corpselocked + return + if(ishuman(usr)) //following code only applies to those capable of having an ethereal heart, ie humans + var/mob/living/carbon/human/crystal_fella = usr + var/our_heart = crystal_fella.getorganslot(ORGAN_SLOT_HEART) + if(istype(our_heart, /obj/item/organ/heart/ethereal)) //so you got the heart? + var/obj/item/organ/heart/ethereal/ethereal_heart = our_heart + ethereal_heart.stop_crystalization_process(crystal_fella) //stops the crystallization process + + stop_sound_channel(CHANNEL_HEARTBEAT) //Stop heartbeat sounds because You Are A Ghost Now + var/mob/dead/observer/ghost = new(src) // Transfer safety to observer spawning proc. + SStgui.on_transfer(src, ghost) // Transfer NanoUIs. + ghost.can_reenter_corpse = can_reenter_corpse + ghost.key = key + ghost.client?.init_verbs() + if(!can_reenter_corpse)// Disassociates observer mind from the body mind + ghost.mind = null + return ghost /mob/living/ghostize(can_reenter_corpse = TRUE) . = ..() @@ -312,8 +323,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(stat != DEAD) succumb() if(stat == DEAD) - ghostize(TRUE) - return TRUE + if(!HAS_TRAIT(src, TRAIT_CORPSELOCKED)) //corpse-locked have to confirm with the alert below + ghostize(TRUE) + return TRUE // SKYRAT EDIT ADDITION -- Free Ghost Cafe Ghosting if(HAS_TRAIT(src, TRAIT_FREE_GHOST)) ghostize(TRUE) // Can return with TRUE