mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
[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>
This commit is contained in:
co-authored by
wesoda25
Tom
parent
79183cf5b5
commit
c81e529ffe
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user