diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm index 6bcbca01daa..5dcc6c8e4f8 100644 --- a/code/game/objects/items/weapons/defib.dm +++ b/code/game/objects/items/weapons/defib.dm @@ -390,26 +390,27 @@ user.visible_message("[user] begins to place [src] on [M.name]'s chest.", "You begin to place [src] on [M.name]'s chest.") busy = TRUE update_icon() + var/mob/dead/observer/ghost = H.get_ghost(TRUE) + if(ghost && ghost.can_reenter_corpse) + to_chat(ghost, "Your heart is being defibrillated. Return to your body if you want to be revived! (Verbs -> Ghost -> Re-enter corpse)") + window_flash(ghost.client) + notify_ghosts() + ghost << sound('sound/effects/genetics.ogg') if(do_after(user, 30 * toolspeed, target = M)) //beginning to place the paddles on patient's chest to allow some time for people to move away to stop the process user.visible_message("[user] places [src] on [M.name]'s chest.", "You place [src] on [M.name]'s chest.") playsound(get_turf(src), 'sound/machines/defib_charge.ogg', 50, 0) - var/mob/dead/observer/ghost = H.get_ghost(TRUE) + if(ghost && !ghost.client) // In case the ghost's not getting deleted for some reason H.key = ghost.key log_runtime(EXCEPTION("Ghost of name [ghost.name] is bound to [H.real_name], but lacks a client. Deleting ghost."), src) - QDEL_NULL(ghost) var/tplus = world.time - H.timeofdeath var/tlimit = DEFIB_TIME_LIMIT var/tloss = DEFIB_TIME_LOSS var/total_burn = 0 var/total_brute = 0 - if(ghost && ghost.can_reenter_corpse) - to_chat(ghost, "Your heart is being defibrillated. Return to your body if you want to be revived! (Verbs -> Ghost -> Re-enter corpse)") - window_flash(ghost.client) - notify_ghosts() - ghost << sound('sound/effects/genetics.ogg') + if(do_after(user, 20 * toolspeed, target = M)) //placed on chest and short delay to shock for dramatic effect, revive time is 5sec total for(var/obj/item/carried_item in H.contents) if(istype(carried_item, /obj/item/clothing/suit/space))