better handling

This commit is contained in:
Fox-McCloud
2016-06-29 11:08:51 -04:00
parent 3f31744255
commit d61583dd1f
3 changed files with 22 additions and 12 deletions

View File

@@ -1516,6 +1516,19 @@
spell.action.Grant(new_character)
return
/datum/mind/proc/get_ghost(even_if_they_cant_reenter)
for(var/mob/dead/observer/G in dead_mob_list)
if(G.mind == src)
if(G.can_reenter_corpse || even_if_they_cant_reenter)
return G
break
/datum/mind/proc/grab_ghost(force)
var/mob/dead/observer/G = get_ghost(even_if_they_cant_reenter = force)
. = G
if(G)
G.reenter_corpse()
//Initialisation procs
/mob/proc/mind_initialize()
if(mind)

View File

@@ -207,13 +207,10 @@
/mob/living/simple_animal/slaughter/laughter/death()
for(var/mob/living/M in consumed_mobs)
M.revive()
if(!M.ckey)
for(var/mob/dead/observer/ghost in player_list)
if(M.real_name == ghost.real_name)
ghost.reenter_corpse()
break
to_chat(M, "<span class='clown'>You leave the [src]'s warm embrace, and feel ready to take on the world.</span>")
if(M.revive())
M.grab_ghost(force = TRUE)
playsound(get_turf(src), feast_sound, 50, 1, -1)
to_chat(M, "<span class='clown'>You leave the [src]'s warm embrace, and feel ready to take on the world.</span>")
..()

View File

@@ -1328,11 +1328,11 @@ mob/proc/yank_out_object()
/mob/proc/get_ghost(even_if_they_cant_reenter = 0)
if(mind)
for(var/mob/dead/observer/G in dead_mob_list)
if(G.mind == mind)
if(G.can_reenter_corpse || even_if_they_cant_reenter)
return G
break
return mind.get_ghost(even_if_they_cant_reenter)
/mob/proc/grab_ghost(force)
if(mind)
return mind.grab_ghost(force = force)
/mob/proc/notify_ghost_cloning(var/message = "Someone is trying to revive you. Re-enter your corpse if you want to be revived!", var/sound = 'sound/effects/genetics.ogg', var/atom/source = null)
var/mob/dead/observer/ghost = get_ghost()