diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index 14c752613b..6fa9fa0daf 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -32,6 +32,8 @@ GLOBAL_LIST_EMPTY(active_jammers) // List of active radio jammers GLOBAL_LIST_EMPTY(ladders) GLOBAL_LIST_EMPTY(trophy_cases) +GLOBAL_LIST_INIT(freezing_objects, list(/obj/structure/closet/crate/freezer, /obj/structure/closet/secure_closet/freezer, /obj/structure/bodycontainer, /obj/item/autosurgeon, /obj/machinery/smartfridge/organ)) //list of all cold objects, that freeze organs when inside + GLOBAL_LIST_EMPTY(wire_color_directory) GLOBAL_LIST_EMPTY(wire_name_directory) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index c07c52b075..19a82ab818 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -319,18 +319,30 @@ SLIME SCANNER //END; LOOK FOR MISSING ORGANS? - if(!M.getorgan(/obj/item/organ/eyes)) + var/breathes = TRUE + var/blooded = TRUE + if(C.dna && C.dna.species) + if(HAS_TRAIT_FROM(C, TRAIT_NOBREATH, SPECIES_TRAIT)) + breathes = FALSE + if(NOBLOOD in C.dna.species.species_traits) + blooded = FALSE + var/has_liver = (!(NOLIVER in C.dna.species.species_traits)) + var/has_stomach = (!(NOSTOMACH in C.dna.species.species_traits)) + if(!M.getorganslot(ORGAN_SLOT_EYES)) msg += "\tSubject does not have eyes.\n" - if(!M.getorgan(/obj/item/organ/ears)) + if(!M.getorganslot(ORGAN_SLOT_EARS)) msg += "\tSubject does not have ears.\n" - if(!M.getorgan(/obj/item/organ/brain)) - msg += "\tSubject's brain function is non-existent.\n" - if(!M.getorgan(/obj/item/organ/liver)) - msg += "\tSubject's liver is missing.\n" - if(!M.getorgan(/obj/item/organ/lungs)) - msg += "\tSubject's lungs have collapsed from trauma!\n" - if(!M.getorgan(/obj/item/organ/heart)) + if(!M.getorganslot(ORGAN_SLOT_BRAIN)) + msg += "\tSubject's brain function is non-existent!\n" + if(has_liver && !M.getorganslot(ORGAN_SLOT_LIVER)) + msg += "\tSubject's liver is missing!/span>\n" + if(blooded && !M.getorganslot(ORGAN_SLOT_HEART)) msg += "\tSubject's heart is missing!\n" + if(breathes && !M.getorganslot(ORGAN_SLOT_LUNGS)) + msg += "\tSubject's lungs have collapsed from trauma!\n" + if(has_stomach && !M.getorganslot(ORGAN_SLOT_STOMACH)) + msg += "\tSubject's stomach is missing!\n" + if(M.radiation) msg += "\tSubject is irradiated.\n" diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 0bf1339bad..e380d96921 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -941,18 +941,18 @@ datum/reagent/medicine/styptic_powder/overdose_start(mob/living/M) color = "#EEFF8F" /datum/reagent/neurine/reaction_mob(mob/living/M, method=TOUCH, reac_volume) - var/obj/item/organ/brain/B = M.getorganslot(ORGAN_SLOT_BRAIN) - if(!B) + if(method != INJECT) return - if(method == INJECT) - if(B.organ_flags & ORGAN_FAILING) - B.applyOrganDamage(-20) - if(prob(80)) - B.gain_trauma_type(BRAIN_TRAUMA_MILD) - else if(prob(50)) - B.gain_trauma_type(BRAIN_TRAUMA_SEVERE) - else - B.gain_trauma_type(BRAIN_TRAUMA_SPECIAL) + var/obj/item/organ/brain/B = M.getorganslot(ORGAN_SLOT_BRAIN) + if(!B || !(B.organ_flags & ORGAN_FAILING)) + return + B.applyOrganDamage(-20) + if(prob(80)) + B.gain_trauma_type(BRAIN_TRAUMA_MILD) + else if(prob(50)) + B.gain_trauma_type(BRAIN_TRAUMA_SEVERE) + else + B.gain_trauma_type(BRAIN_TRAUMA_SPECIAL) /datum/reagent/medicine/neurine/on_mob_life(mob/living/carbon/C) if(holder.has_reagent("neurotoxin")) diff --git a/code/modules/surgery/emergency_cardioversion_recovery.dm b/code/modules/surgery/emergency_cardioversion_recovery.dm index 284722d271..ae451fbbd1 100644 --- a/code/modules/surgery/emergency_cardioversion_recovery.dm +++ b/code/modules/surgery/emergency_cardioversion_recovery.dm @@ -16,17 +16,13 @@ if(!pads.wielded) to_chat(user, "You need to wield the paddles in both hands before you can use them!") return FALSE - display_results(user, target, "You begin to apply the [tool] onto the heart directly...", - "[user] begin to prepare the heart for contact with the [tool].", - "[user] begin to prepare the heart for contact with the [tool]. ") + 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 Surgery!") playsound(src, 'sound/machines/defib_charge.ogg', 75, 0) /datum/surgery_step/ventricular_electrotherapy/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - if(istype(tool, /obj/item/twohanded/shockpaddles)) - var/obj/item/twohanded/shockpaddles/pads = tool - if(!pads.wielded) - return FALSE var/mob/living/carbon/human/H = target playsound(src, 'sound/machines/defib_zap.ogg', 75, 1, -1) playsound(src, "bodyfall", 50, 1) @@ -35,12 +31,12 @@ "[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.emote("scream") - H.electrocute_act(25, (tool), 1, FALSE, FALSE, FALSE, TRUE) + 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, "You attach the [tool] to [target]'s heart and prepare to pulse.", + display_results(user, target, "You attach the [tool] to [target]'s heart and prepares to pulse.", "[user] attaches the [tool] to [H]'s heart and prepares to pulse.", "") H.adjustBruteLoss(10) @@ -50,10 +46,10 @@ var/obj/item/organ/brain/BR = H.getorgan(/obj/item/organ/brain) if(BR.organ_flags & ORGAN_FAILING) H.adjustOrganLoss(ORGAN_SLOT_BRAIN, -5) - H.electrocute_act(0, (tool), 1, FALSE, FALSE, FALSE, TRUE) + H.electrocute_act(0, (get_turf(H)), 1, FALSE, FALSE, FALSE, TRUE) //If we're using a defib, let the defib handle the revive. if(istype(tool, /obj/item/twohanded/shockpaddles)) - return + return TRUE //Otherwise, we're ad hocing it if(!(do_after(user, 50, target = target))) return FALSE @@ -70,8 +66,8 @@ 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, (tool), 1, FALSE, FALSE, FALSE, TRUE) - H.adjustFireLoss(5) + H.electrocute_act(25, (get_turf(H)), 1, FALSE, FALSE, FALSE, TRUE) + H.adjustFireLoss(10) H.emote("flip") H.adjustOrganLoss(ORGAN_SLOT_HEART, 10) @@ -87,18 +83,18 @@ else if (H.hellbound) failed = "The heart is zapped by the [tool], but nothing happens. You notice a small tatoo with the words \"Property of Satan\" branded just above the right ventricle." else if(tdelta > (DEFIB_TIME_LIMIT * 10)) - failed = "The heart is zapped by the [tool], but nothing happens. It appears their body has become too decomposed." + failed = "The heart is zapped by the [tool], but nothing happens. It appears their body has beomce too decomposed." else if(total_burn >= 180 || total_brute >= 180) - failed = "The [tool] zaps the heart, inducing a sudden contraction, but it appears [H]'s body is too damaged to revive presently." + failed = "The [tool] zaps the heart, incuding a sudden contraction, but it appears [H]'s body is too damaged to revive presently." else if(H.get_ghost()) - failed = "The [tool] zaps the heart, inducing several contractions before dying down, but there's no spark of life in [H]'s eyes. It may be worth it to try again, however." + failed = "The [tool] zaps the heart, incuding several contractions before dying down, but there's no spark of life in [H]'s eyes. It may be worth it to try again, however." else var/obj/item/organ/brain/BR = H.getorgan(/obj/item/organ/brain) if(BR) if(H.suiciding || BR.brainmob?.suiciding) failed = "The heart is zapped by the [tool], but nothing happens. You feel like the spark of life has fully left [H]." else - failed = "The [tool] zaps the heart, restarting the heart, but without a brain the contractions quickly die out." + failed = "The [tool] zaps the heart, incuding several contractions before dying down, but without a brain the contractions quickly die out." if(failed) @@ -116,7 +112,7 @@ 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. - H.visible_message("The [tool] zaps the heart, inducing several contractions before speeding up into a regular rhythm, [H]'s eyes snapping open with a loud gasp!") + H.visible_message("The [tool] zaps the heart, incuding several contractions before speeding up into a regular rhythm, [H]'s eyes snapping open with a loud gasp!") playsound(src, 'sound/machines/defib_success.ogg', 50, 0) H.set_heartattack(FALSE) H.revive() diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index ddd7378008..c44a2cae4d 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -98,16 +98,12 @@ //Checks to see if the organ is frozen from temperature /obj/item/organ/proc/is_cold() - var/freezing_objects = list(/obj/structure/closet/crate/freezer, /obj/structure/closet/secure_closet/freezer, /obj/structure/bodycontainer, /obj/item/autosurgeon, /obj/machinery/smartfridge/organ) if(istype(loc, /obj/))//Freezer of some kind, I hope. - if(is_type_in_list(loc, freezing_objects)) + if(is_type_in_list(loc, GLOB.freezing_objects)) if(!(organ_flags & ORGAN_FROZEN))//Incase someone puts them in when cold, but they warm up inside of the thing. (i.e. they have the flag, the thing turns it off, this rights it.) organ_flags |= ORGAN_FROZEN return TRUE - var/external_check = FALSE - if(organ_flags & ORGAN_FROZEN) - external_check = TRUE - return external_check + return (organ_flags & ORGAN_FROZEN) //Incase something else toggles it var/local_temp if(istype(loc, /turf/))//Only concern is adding an organ to a freezer when the area around it is cold. @@ -117,7 +113,7 @@ else if(istype(loc, /mob/) && !owner) var/mob/M = loc - if(is_type_in_list(M.loc, freezing_objects)) + if(is_type_in_list(M.loc, GLOB.freezing_objects)) if(!(organ_flags & ORGAN_FROZEN)) organ_flags |= ORGAN_FROZEN return TRUE @@ -127,7 +123,7 @@ if(owner) //Don't interfere with bodies frozen by structures. - if(is_type_in_list(owner.loc, freezing_objects)) + if(is_type_in_list(owner.loc, GLOB.freezing_objects)) if(!(organ_flags & ORGAN_FROZEN)) organ_flags |= ORGAN_FROZEN return TRUE