diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index f5799e1a22..ee85005c61 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -762,5 +762,3 @@ desc = "An upgrade to the defibrillator capacitors, which let it charge faster" icon_state = "fast_disk" materials = list(MAT_METAL=16000, MAT_GLASS = 8000, MAT_GOLD = 26000, MAT_SILVER = 26000) - -#undef HALFWAYCRITDEATH diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index 9af7235815..893a53ede7 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -406,8 +406,8 @@ . = ..() if(!.) //if the item loads, clear can_decompose return - var/obj/item/organ/organ = O - if(organ) + if(istype(O, /obj/item/organ)) + var/obj/item/organ/organ = O organ.organ_flags |= ORGAN_FROZEN /obj/machinery/smartfridge/organ/RefreshParts() @@ -436,7 +436,7 @@ ..() var/list = list(/obj/item/organ/tongue, /obj/item/organ/brain, /obj/item/organ/heart, /obj/item/organ/liver, /obj/item/organ/ears, /obj/item/organ/eyes, /obj/item/organ/tail, /obj/item/organ/stomach) var/newtype = pick(list) - load(new newtype) + load(new newtype(src.loc)) // ----------------------------- // Chemistry Medical Smartfridge diff --git a/code/modules/surgery/emergency_cardioversion_recovery.dm b/code/modules/surgery/emergency_cardioversion_recovery.dm index fd14c2ea8f..f0540e78c0 100644 --- a/code/modules/surgery/emergency_cardioversion_recovery.dm +++ b/code/modules/surgery/emergency_cardioversion_recovery.dm @@ -10,14 +10,14 @@ time = 50 repeatable = TRUE //So you can retry -/datum/surgery_step/incise_heart/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - display_results(user, target, "You begin apply an electrical charge directly to the heart and across the body...", +/datum/surgery_step/ventricular_electrotherapy/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + display_results(user, target, "You begin to apply an electrical charge directly to the heart body...", "[user] begins to make an incision in [target]'s heart.", "[user] begins to make an incision in [target]'s heart.") - target.notify_ghost_cloning("Your heart is undergoing Emergency Cardioversion Induction!") + target.notify_ghost_cloning("Your heart is undergoing Emergency Cardioversion Induction Surgery!") playsound(src, 'sound/machines/defib_charge.ogg', 75, 0) -/datum/surgery_step/incise_heart/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) +/datum/surgery_step/ventricular_electrotherapy/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) var/mob/living/carbon/human/H = target playsound(src, 'sound/machines/defib_zap.ogg', 75, 1, -1) playsound(src, "bodyfall", 50, 1) @@ -25,51 +25,56 @@ display_results(user, target, "You can't use this procedure on the living! [H]'s body flops madly like a wild fish on the table from the current, and your crazed surgical methods.", "[user] screws up, causing [H] to flop around violently as they're zapped!", "[user] screws up, causing [H] to flop around violently as they're zapped!") - M.emote("scream") - H.electrocute_act(25, (get_turf(C)), 1, FALSE, FALSE, FALSE, TRUE) + H.emote("scream") + H.electrocute_act(25, (get_turf(H)), 1, FALSE, FALSE, FALSE, TRUE) + H.adjustFireLoss(10) H.emote("flip") H.Jitter(100) return FALSE - display_results(user, target, "induces a stable rythum in [H]'s heart.", - "[H]'s heart is shocked, attemping to bring them back to a stable rythum!.", + display_results(user, target, "You induce a stable cardio in [H]'s heart.", + "[H]'s heart is shocked, attemping to bring them back to a stable rhythm!", "") - if (!(NOBLOOD in H.dna.species.species_traits)) - H.bleed_rate += 10 H.adjustBruteLoss(10) - H.adjustOrganLoss(ORGAN_SLOT_HEART, -10) + H.adjustOrganLoss(ORGAN_SLOT_HEART, -15) H.adjustOrganLoss(ORGAN_SLOT_BRAIN, -5) - H.electrocute_act(0, (get_turf(C)), 1, FALSE, FALSE, FALSE, TRUE) + H.electrocute_act(0, (get_turf(H)), 1, FALSE, FALSE, FALSE, TRUE) + if(istype(tool, /obj/item/twohanded/shockpaddles)) + display_results(user, target, "You move the paddles to the restart position.", + "[user] moves the paddles to the restart position...", + "") + return TRUE if(!do_they_live(H)) playsound(src, 'sound/machines/defib_failed.ogg', 50, 0) + log_combat(user, H, "revived", "Emergency Cardioversion Induction") return TRUE -/datum/surgery_step/incise_heart/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) +/datum/surgery_step/ventricular_electrotherapy/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) playsound(src, 'sound/machines/defib_zap.ogg', 75, 1, -1) playsound(src, "bodyfall", 50, 1) var/mob/living/carbon/human/H = target - display_results(user, target, "You screw up, sending current racing though their body!", + display_results(user, target, "You screw up, sending a current through their body!", "[user] screws up, causing [H] to flop around violently as they're zapped!", "[user] screws up, causing [H] to flop around violently as they're zapped!") - H.electrocute_act(25, (get_turf(C)), 1, FALSE, FALSE, FALSE, TRUE) + H.electrocute_act(25, (get_turf(H)), 1, FALSE, FALSE, FALSE, TRUE) + H.adjustFireLoss(5) H.emote("flip") H.adjustOrganLoss(ORGAN_SLOT_HEART, 10) -/datum/surgery_step/incise_heart/do_they_live(mob/living/carbon/human/H) +/datum/surgery_step/ventricular_electrotherapy/proc/do_they_live(mob/living/carbon/human/H) var/obj/item/organ/heart = H.getorgan(/obj/item/organ/heart) H.visible_message("[H]'s body convulses a bit.") - total_brute = H.getBruteLoss() - total_burn = H.getFireLoss() - shock_touching(30, H) + var/total_brute = H.getBruteLoss() + var/total_burn = H.getFireLoss() var/failed - var/tdelta = round(world.time - timeofdeath) + var/tdelta = round(world.time - H.timeofdeath) if (H.suiciding || (HAS_TRAIT(H, TRAIT_NOCLONE))) failed = "The [src] equipment buzzes: Resuscitation failed - Recovery of patient impossible. Further attempts futile." else if (H.hellbound) failed = "The [src] equipment buzzes: Resuscitation failed - Patient's soul appears to be on another plane of existence. Further attempts futile." - else if(tdelta < (DEFIB_TIME_LIMIT * 10)) + else if(world.time < (DEFIB_TIME_LIMIT * 10)) failed = "The [src] equipment buzzes: Resuscitation failed - Body has decayed for too long. Further attempts futile." else if (!heart) failed = "The [src] equipment buzzes: Resuscitation failed - Patient's heart is missing." @@ -93,7 +98,7 @@ if(failed) - user.visible_message(failed) + H.visible_message(failed) playsound(src, 'sound/machines/defib_failed.ogg', 50, 0) else //If the body has been fixed so that they would not be in crit when defibbed, give them oxyloss to put them back into crit @@ -107,11 +112,10 @@ H.adjustFireLoss((mobhealth - HALFWAYCRITDEATH) * (total_burn / overall_damage), 0) H.adjustBruteLoss((mobhealth - HALFWAYCRITDEATH) * (total_brute / overall_damage), 0) H.updatehealth() // Previous "adjust" procs don't update health, so we do it manually. - user.visible_message("The [src] equipment pings: Resuscitation successful.") + H.visible_message("The [src] equipment pings: Resuscitation successful.") playsound(src, 'sound/machines/defib_success.ogg', 50, 0) H.set_heartattack(FALSE) H.revive() H.emote("gasp") H.Jitter(100) SEND_SIGNAL(H, COMSIG_LIVING_MINOR_SHOCK) - log_combat(user, H, "revived", "Emergency Cardioversion Induction") diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index a9830f36df..963c7ac6f9 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -6,7 +6,7 @@ slot = ORGAN_SLOT_HEART healing_factor = STANDARD_ORGAN_HEALING - decay_factor = 3 * STANDARD_ORGAN_DECAY //designed to fail about 5 minutes after death + decay_factor = 2.5 * STANDARD_ORGAN_DECAY //designed to fail about 5 minutes after death low_threshold_passed = "Prickles of pain appear then die out from within your chest..." high_threshold_passed = "Something inside your chest hurts, and the pain isn't subsiding. You notice yourself breathing far faster than before." diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 55f81504d9..45cbda9898 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -238,7 +238,8 @@ if(delta > 0) if(damage >= maxHealth) organ_flags |= ORGAN_FAILING - owner.med_hud_set_status() + if(owner) + owner.med_hud_set_status() return now_failing if(damage > high_threshold && prev_damage <= high_threshold) return high_threshold_passed @@ -246,7 +247,8 @@ return low_threshold_passed else organ_flags &= ~ORGAN_FAILING - owner.med_hud_set_status() + if(owner) + owner.med_hud_set_status() if(!owner)//Processing is stopped when the organ is dead and outside of someone. This hopefully should restart it if a removed organ is repaired outside of a body. START_PROCESSING(SSobj, src) if(prev_damage > low_threshold && damage <= low_threshold) diff --git a/icons/mob/hud.dmi b/icons/mob/hud.dmi index 5659e0208f..d2b67f4314 100644 Binary files a/icons/mob/hud.dmi and b/icons/mob/hud.dmi differ diff --git a/tgstation.dme b/tgstation.dme index f90c6a6b42..af6de85a9c 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -2825,6 +2825,7 @@ #include "code\modules\surgery\coronary_bypass.dm" #include "code\modules\surgery\dental_implant.dm" #include "code\modules\surgery\embalming.dm" +#include "code\modules\surgery\emergency_cardioversion_recovery.dm" #include "code\modules\surgery\experimental_dissection.dm" #include "code\modules\surgery\eye_surgery.dm" #include "code\modules\surgery\graft_synthtissue.dm"