Fixes DNA scanner bwoinking ghosts that can't rejoin their body, fixes defib reviving corpses from ghosts that can't rejoin their body.

This commit is contained in:
9600bauds
2015-11-15 18:20:42 -03:00
parent 836a2721b7
commit 6d8062ebc7
4 changed files with 20 additions and 25 deletions

View File

@@ -269,7 +269,7 @@
if(!M.client && M.mind)
for(var/mob/dead/observer/ghost in player_list)
if(ghost.mind == M.mind)
if(ghost.client)
if(ghost.client && ghost.can_reenter_corpse)
ghost << 'sound/effects/adminhelp.ogg'
ghost << "<span class='interface'><b><font size = 3>Your corpse has been placed into a cloning scanner. Return to your body if you want to be resurrected/cloned!</b> \
(Verbs -> Ghost -> Re-enter corpse, or <a href='?src=\ref[ghost];reentercorpse=1'>click here!</a>)</font></span>"

View File

@@ -140,7 +140,7 @@
user << "<span class='notice'>You shock [target] with the paddles.</span>"
var/datum/organ/external/head/head = target.get_organ("head")
if(!head || head.status & ORGAN_DESTROYED || M_NOCLONE in target.mutations || !target.has_brain() || target.suiciding == 1)
target.visible_message("<span class='notice'>[src] buzzes: Defibrillation failed. Patient's condition does not allow reviving.</span>")
target.visible_message("<span class='warning'>[src] buzzes: Defibrillation failed. Patient's condition does not allow reviving.</span>")
return
if(target.wear_suit && istype(target.wear_suit,/obj/item/clothing/suit/armor) && prob(95)) //75 ? Let's stay realistic here
user << "<span class='warning'>[src] buzzes: Defibrillation failed. Please apply on bare skin.</span>"
@@ -152,12 +152,14 @@
return
if(target.mind && !target.client) //Let's call up the ghost! Also, bodies with clients only, thank you.
for(var/mob/dead/observer/ghost in player_list)
if(ghost.mind == target.mind && ghost.can_reenter_corpse)
if(ghost.mind == target.mind && ghost.client && ghost.can_reenter_corpse)
ghost << 'sound/effects/adminhelp.ogg'
ghost << "<span class='interface'><b><font size = 3>Someone is trying to revive your body. Return to it if you want to be resurrected!</b> \
(Verbs -> Ghost -> Re-enter corpse, or <a href='?src=\ref[ghost];reentercorpse=1'>click here!</a>)</font></span>"
break
user << "<span class='warning'>[src] buzzes: Defibrillation failed. Vital signs are too weak, please try again in five seconds.</span>"
user << "<span class='warning'>[src] buzzes: Defibrillation failed. Vital signs are too weak, please try again in five seconds.</span>"
return
//we couldn't find a suitable ghost.
target.visible_message("<span class='warning'>[src] buzzes: Defibrillation failed. Patient's condition does not allow reviving.</span>")
return
var/datum/organ/internal/heart/heart = target.internal_organs_by_name["heart"]
if(prob(25)) heart.damage += 5 //Allow the defibrilator to possibly worsen heart damage. Still rare enough to just be the "clone damage" of the defib
@@ -180,5 +182,5 @@
target.update_canmove()
target << "<span class='notice'>You suddenly feel a spark and your consciousness returns, dragging you back to the mortal plane.</span>"
else
target.visible_message("<span class='notice'>[src] buzzes: Defibrillation failed. Patient's condition does not allow reviving.</span>")
target.visible_message("<span class='warning'>[src] buzzes: Defibrillation failed. Patient's condition does not allow reviving.</span>")
return

View File

@@ -397,24 +397,17 @@
if ((M_NOCLONE in subject.mutations) || (subject.suiciding == 1))
scantemp = "Error: Mental interface failure." //uncloneable, this guy is done for
return
if (!subject.client)
if (subject.mind) //this guy ghosted from his corpse, but he can still come back!
for(var/mob/dead/observer/ghost in player_list)
if(ghost.mind == subject.mind && ghost.client)
if(ghost.can_reenter_corpse)
ghost << 'sound/effects/adminhelp.ogg'
ghost << "<span class='interface'><b><font size = 3>Someone is trying to clone your corpse. Return to your body if you want to be resurrected/cloned!</b> \
(Verbs -> Ghost -> Re-enter corpse, or <a href='?src=\ref[ghost];reentercorpse=1'>click here!</a>)</font></span>"
scantemp = "Error: Subject's brain is not responding to scanning stimuli, subject may be brain dead. Please try again in five seconds."
return
else
break
// We couldn't find a suitable ghost!
scantemp = "Error: Mental interface failure."
return
else
scantemp = "Error: Mental interface failure."
return
if (!subject.client && subject.mind) //this guy ghosted from his corpse, but he can still come back!
for(var/mob/dead/observer/ghost in player_list)
if(ghost.mind == subject.mind && ghost.client && ghost.can_reenter_corpse)
ghost << 'sound/effects/adminhelp.ogg'
ghost << "<span class='interface'><b><font size = 3>Someone is trying to clone your corpse. Return to your body if you want to be cloned!</b> \
(Verbs -> Ghost -> Re-enter corpse, or <a href='?src=\ref[ghost];reentercorpse=1'>click here!</a>)</font></span>"
scantemp = "Error: Subject's brain is not responding to scanning stimuli, subject may be brain dead. Please try again in five seconds."
return
//we couldn't find a suitable ghost.
scantemp = "Error: Mental interface failure."
return
if (!subject.ckey) //checking this only now, since a ghosted player won't have a ckey
scantemp = "Error: Mental interface failure." //ideally would never happen but a check never hurts
return

View File

@@ -4,7 +4,7 @@
if(src.check_rights(R_ADMIN|R_FUN))
src << "<span class='warning'>You are now an admin ghost. Think of yourself as an AI that doesn't show up anywhere and cannot speak. You can access any console or machine by standing next to it and clicking on it. Abuse of this privilege may result in hilarity or removal of your flags, so caution is recommended.</span>"
if(istype(canclone) && canclone.mind == mind)
if(istype(canclone.loc, /obj/machinery/dna_scannernew))
if(can_reenter_corpse && istype(canclone.loc, /obj/machinery/dna_scannernew))
for(dir in list(NORTH, EAST, SOUTH, WEST))
if(locate(/obj/machinery/computer/cloning, get_step(canclone.loc, dir)))
src << 'sound/effects/adminhelp.ogg'