Refactors heart attacks, unbreaks incremental cloning

This commit is contained in:
Crazylemon64
2017-04-29 22:22:57 -07:00
parent 2e59984ae9
commit 528e359296
16 changed files with 95 additions and 72 deletions
@@ -249,9 +249,9 @@
if(istype(owner, /mob/living/carbon/human))
var/mob/living/carbon/human/H = owner
if(H.stat != DEAD && prob(50 / severity))
H.heart_attack = 1
H.set_heartattack(TRUE)
spawn(600 / severity)
H.heart_attack = 0
H.set_heartattack(FALSE)
if(H.stat == CONSCIOUS)
to_chat(H, "<span class='notice'>You feel your heart beating again!</span>")
+1 -1
View File
@@ -286,7 +286,7 @@ var/list/organ_cache = list()
/obj/item/organ/internal/heart/emp_act(intensity)
if(owner && robotic == 2)
owner.heart_attack = 1
Stop() // In the name of looooove~!
owner.visible_message("<span class='danger'>[owner] clutches their chest and gasps!</span>","<span class='userdanger'>You clutch your chest in pain!</span>")
else if(owner && robotic == 1)
take_damage(11,1)
+1 -12
View File
@@ -165,11 +165,9 @@
. = ..()
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.stat == DEAD || H.heart_attack)
if(H.stat == DEAD)
Stop()
return
if(!special)
H.heart_attack = 1
spawn(120)
if(!owner)
@@ -183,15 +181,6 @@
if(!owner)
Stop()
/obj/item/organ/internal/heart/insert(mob/living/carbon/M, special = 0)
..()
if(ishuman(M) && beating)
var/mob/living/carbon/human/H = M
if(H.heart_attack)
H.heart_attack = 0
return
/obj/item/organ/internal/heart/proc/Stop()
beating = 0
update_icon()