From 35be96ed64567943654824407f04e356d2cb4d0c Mon Sep 17 00:00:00 2001 From: MoreRobustThanYou Date: Wed, 24 Jan 2018 19:39:22 -0500 Subject: [PATCH 1/2] You can now defib monkeys (#34383) * You can now defib non-human carbons * WOOPS * Woops. --- code/game/objects/items/defib.dm | 14 +++++----- code/modules/mob/living/carbon/human/life.dm | 24 ----------------- code/modules/mob/living/carbon/life.dm | 27 ++++++++++++++++++++ 3 files changed, 34 insertions(+), 31 deletions(-) diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index cce97f6766..a314f8191e 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -158,7 +158,7 @@ set category = "Object" on = !on - var/mob/living/carbon/human/user = usr + var/mob/living/carbon/user = usr if(on) //Detach the paddles into the user's hands if(!usr.put_in_hands(paddles)) @@ -338,7 +338,7 @@ defib.update_icon() return unwield(user) -/obj/item/twohanded/shockpaddles/proc/check_defib_exists(mainunit, mob/living/carbon/human/M, obj/O) +/obj/item/twohanded/shockpaddles/proc/check_defib_exists(mainunit, mob/living/carbon/M, obj/O) if(!req_defib) return TRUE //If it doesn't need a defib, just say it exists if (!mainunit || !istype(mainunit, /obj/item/defibrillator)) //To avoid weird issues from admin spawns @@ -372,13 +372,13 @@ do_disarm(M, user) return - if(!ishuman(M)) + if(!iscarbon(M)) if(req_defib) to_chat(user, "The instructions on [defib] don't mention how to revive that...") else to_chat(user, "You aren't sure how to revive that...") return - var/mob/living/carbon/human/H = M + var/mob/living/carbon/H = M if(user.zone_selected != "chest") @@ -397,7 +397,7 @@ do_help(H, user) -/obj/item/twohanded/shockpaddles/proc/can_defib(mob/living/carbon/human/H) +/obj/item/twohanded/shockpaddles/proc/can_defib(mob/living/carbon/H) var/obj/item/organ/brain/BR = H.getorgan(/obj/item/organ/brain) return (!H.suiciding && !(H.has_disability(DISABILITY_NOCLONE)) && !H.hellbound && ((world.time - H.timeofdeath) < tlimit) && (H.getBruteLoss() < 180) && (H.getFireLoss() < 180) && H.getorgan(/obj/item/organ/heart) && BR && !BR.damaged_brain) @@ -432,7 +432,7 @@ else recharge(60) -/obj/item/twohanded/shockpaddles/proc/do_harm(mob/living/carbon/human/H, mob/living/user) +/obj/item/twohanded/shockpaddles/proc/do_harm(mob/living/carbon/H, mob/living/user) if(req_defib && defib.safety) return if(!req_defib && !combat) @@ -487,7 +487,7 @@ busy = FALSE update_icon() -/obj/item/twohanded/shockpaddles/proc/do_help(mob/living/carbon/human/H, mob/living/user) +/obj/item/twohanded/shockpaddles/proc/do_help(mob/living/carbon/H, mob/living/user) user.visible_message("[user] begins to place [src] on [H]'s chest.", "You begin to place [src] on [H]'s chest...") busy = TRUE update_icon() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 5254c6aa0e..65d47694af 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -320,30 +320,6 @@ if(!has_embedded_objects()) clear_alert("embeddedobject") -/mob/living/carbon/human/proc/can_heartattack() - CHECK_DNA_AND_SPECIES(src) - if(NOBLOOD in dna.species.species_traits) - return FALSE - return TRUE - -/mob/living/carbon/human/proc/undergoing_cardiac_arrest() - if(!can_heartattack()) - return FALSE - var/obj/item/organ/heart/heart = getorganslot(ORGAN_SLOT_HEART) - if(istype(heart) && heart.beating) - return FALSE - return TRUE - -/mob/living/carbon/human/proc/set_heartattack(status) - if(!can_heartattack()) - return FALSE - - var/obj/item/organ/heart/heart = getorganslot(ORGAN_SLOT_HEART) - if(!istype(heart)) - return - - heart.beating = !status - /mob/living/carbon/human/proc/handle_active_genes() for(var/datum/mutation/human/HM in dna.mutations) HM.on_life(src) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 1a610d97a6..658d7a90c4 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -460,3 +460,30 @@ var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN) if(B) B.damaged_brain = TRUE + +///////////////////////////////////// +//MONKEYS WITH TOO MUCH CHOLOESTROL// +///////////////////////////////////// + +/mob/living/carbon/proc/can_heartattack() + if(dna && dna.species && (NOBLOOD in dna.species.species_traits)) //not all carbons have species! + return FALSE + return TRUE + +/mob/living/carbon/proc/undergoing_cardiac_arrest() + if(!can_heartattack()) + return FALSE + var/obj/item/organ/heart/heart = getorganslot(ORGAN_SLOT_HEART) + if(istype(heart) && heart.beating) + return FALSE + return TRUE + +/mob/living/carbon/proc/set_heartattack(status) + if(!can_heartattack()) + return FALSE + + var/obj/item/organ/heart/heart = getorganslot(ORGAN_SLOT_HEART) + if(!istype(heart)) + return + + heart.beating = !status