This commit is contained in:
shellspeed1
2019-10-14 18:46:06 -07:00
parent 345e69a718
commit 470ec5d62b
114 changed files with 2124 additions and 592 deletions
@@ -72,14 +72,16 @@
/datum/nanite_program/brain_heal/check_conditions()
if(iscarbon(host_mob))
var/mob/living/carbon/C = host_mob
if(length(C.get_traumas()))
return ..()
if(host_mob.getBrainLoss())
for(var/X in C.get_traumas())
var/datum/brain_trauma/BT = X
if(BT.resilience <= TRAUMA_RESILIENCE_BASIC)
return ..()
if(host_mob.getOrganLoss(ORGAN_SLOT_BRAIN))
return ..()
return FALSE
/datum/nanite_program/brain_heal/active_effect()
host_mob.adjustBrainLoss(-1, TRUE)
host_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1, TRUE)
if(iscarbon(host_mob) && prob(10))
var/mob/living/carbon/C = host_mob
C.cure_trauma_type(resilience = TRAUMA_RESILIENCE_BASIC)
@@ -193,14 +195,16 @@
/datum/nanite_program/brain_heal_advanced/check_conditions()
if(iscarbon(host_mob))
var/mob/living/carbon/C = host_mob
if(length(C.get_traumas()))
return ..()
if(host_mob.getBrainLoss())
for(var/X in C.get_traumas())
var/datum/brain_trauma/BT = X
if(BT.resilience <= TRAUMA_RESILIENCE_LOBOTOMY)
return ..()
if(host_mob.getOrganLoss(ORGAN_SLOT_BRAIN))
return ..()
return FALSE
/datum/nanite_program/brain_heal_advanced/active_effect()
host_mob.adjustBrainLoss(-2, TRUE)
host_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, -2, TRUE)
if(iscarbon(host_mob) && prob(10))
var/mob/living/carbon/C = host_mob
C.cure_trauma_type(resilience = TRAUMA_RESILIENCE_LOBOTOMY)
@@ -232,7 +236,7 @@
if(!C.getorgan(/obj/item/organ/heart)) //what are we even shocking
return FALSE
var/obj/item/organ/brain/BR = C.getorgan(/obj/item/organ/brain)
if(QDELETED(BR) || BR.damaged_brain)
if(QDELETED(BR) || BR.brain_death || (BR.organ_flags & ORGAN_FAILING) || C.suiciding)
return FALSE
if(C.get_ghost())
return FALSE
@@ -252,7 +256,7 @@
SEND_SIGNAL(C, COMSIG_LIVING_MINOR_SHOCK)
var/tplus = world.time - C.timeofdeath
if(tplus > 600)
C.adjustBrainLoss( max(0, ((1800 - tplus) / 1800 * 150)), 150)
C.adjustOrganLoss(ORGAN_SLOT_BRAIN, max(0, ((1800 - tplus) / 1800 * 150)), 150)
log_game("[C] has been successfully defibrillated by nanites.")
else
playsound(C, 'sound/machines/defib_failed.ogg', 50, 0)
@@ -59,7 +59,7 @@
/datum/nanite_program/brain_decay/active_effect()
if(prob(4))
host_mob.hallucination = min(15, host_mob.hallucination)
host_mob.adjustBrainLoss(1)
host_mob.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1)
//Generic brain-affecting programs can also decay into this
/datum/nanite_program/brain_misfire