Removes spawn() from some things

Yay, refactoring.
This commit is contained in:
Jack Edge
2016-06-05 19:47:17 +01:00
parent 94a5d5bfad
commit a01b48aa48
12 changed files with 134 additions and 112 deletions
+29 -24
View File
@@ -21,11 +21,11 @@
return
if(owner.nutrition <= hunger_threshold)
synthesizing = 1
synthesizing = TRUE
owner << "<span class='notice'>You feel less hungry...</span>"
owner.nutrition += 50
spawn(50)
synthesizing = 0
sleep(50)
synthesizing = FALSE
/obj/item/organ/cyberimp/chest/nutriment/emp_act(severity)
if(!owner)
@@ -57,22 +57,10 @@
/obj/item/organ/cyberimp/chest/reviver/on_life()
if(reviving)
if(owner.stat == UNCONSCIOUS)
spawn(30)
if(prob(90) && owner.getOxyLoss())
owner.adjustOxyLoss(-3)
revive_cost += 5
if(prob(75) && owner.getBruteLoss())
owner.adjustBruteLoss(-1)
revive_cost += 20
if(prob(75) && owner.getFireLoss())
owner.adjustFireLoss(-1)
revive_cost += 20
if(prob(40) && owner.getToxLoss())
owner.adjustToxLoss(-1)
revive_cost += 50
addtimer(src, "heal", 30)
else
cooldown = revive_cost + world.time
reviving = 0
reviving = FALSE
return
if(cooldown > world.time)
@@ -83,7 +71,21 @@
return
revive_cost = 0
reviving = 1
reviving = TRUE
/obj/item/organ/cyberimp/chest/reviver/proc/heal()
if(prob(90) && owner.getOxyLoss())
owner.adjustOxyLoss(-3)
revive_cost += 5
if(prob(75) && owner.getBruteLoss())
owner.adjustBruteLoss(-1)
revive_cost += 20
if(prob(75) && owner.getFireLoss())
owner.adjustFireLoss(-1)
revive_cost += 20
if(prob(40) && owner.getToxLoss())
owner.adjustToxLoss(-1)
revive_cost += 50
/obj/item/organ/cyberimp/chest/reviver/emp_act(severity)
if(!owner)
@@ -97,13 +99,16 @@
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
spawn(600 / severity)
H.heart_attack = 0
if(H.stat == CONSCIOUS)
H << "<span class='notice'>You feel your heart beating again!</span>"
H.heart_attack = TRUE
addtimer(src, "undo_heart_attack", 600 / severity)
/obj/item/organ/cyberimp/chest/reviver/proc/undo_heart_attack()
var/mob/living/carbon/human/H = owner
if(!istype(H))
return
H.heart_attack = FALSE
if(H.stat == CONSCIOUS)
H << "<span class='notice'>You feel your heart beating again!</span>"
/obj/item/organ/cyberimp/chest/thrusters
@@ -140,9 +140,11 @@
/obj/item/organ/cyberimp/brain/anti_stun/emp_act(severity)
if(crit_fail)
return
crit_fail = 1
spawn(90 / severity)
crit_fail = 0
crit_fail = TRUE
addtimer(src, "reboot", 90 / severity)
/obj/item/organ/cyberimp/brain/anti_stun/proc/reboot()
crit_fail = FALSE
//[[[[MOUTH]]]]
@@ -125,18 +125,19 @@
if(!special)
H.heart_attack = 1
spawn(120)
if(!owner)
Stop()
addtimer(src, "stop_if_unowned", 120)
/obj/item/organ/heart/proc/stop_if_unowned()
if(!owner)
Stop()
/obj/item/organ/heart/attack_self(mob/user)
..()
if(!beating)
visible_message("<span class='notice'>[user] squeezes [src] to \
make it beat again!</span>")
Restart()
spawn(80)
if(!owner)
Stop()
addtimer(src, "stop_if_unowned", 80)
/obj/item/organ/heart/Insert(mob/living/carbon/M, special = 0)
..()