Merge pull request #5092 from Citadel-Station-13/upstream-merge-34383

[MIRROR] You can now defib monkeys
This commit is contained in:
LetterJay
2018-01-24 21:45:16 -06:00
committed by GitHub
3 changed files with 34 additions and 31 deletions
+7 -7
View File
@@ -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, "<span class='warning'>The instructions on [defib] don't mention how to revive that...</span>")
else
to_chat(user, "<span class='warning'>You aren't sure how to revive that...</span>")
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("<span class='warning'>[user] begins to place [src] on [H]'s chest.</span>", "<span class='warning'>You begin to place [src] on [H]'s chest...</span>")
busy = TRUE
update_icon()
@@ -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)
+27
View File
@@ -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