diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index d5467640f702..3b21fc5fbd5f 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -2098,3 +2098,17 @@ /datum/reagent/plaguebacteria/reaction_mob(mob/living/L, method = TOUCH, reac_volume, show_message = TRUE, touch_protection = FALSE) if(method == INGEST || method == TOUCH || method == INJECT) L.ForceContractDisease(new /datum/disease/plague(), FALSE, TRUE) + +/datum/reagent/adrenaline + name = "Adrenaline" + description = "Powerful chemical that termporarily makes the user immune to slowdowns" + color = "#d1cd9a" + can_synth = FALSE + +/datum/reagent/adrenaline/on_mob_add(mob/living/L) + . = ..() + ADD_TRAIT(L, TRAIT_IGNOREDAMAGESLOWDOWN, type) + +/datum/reagent/adrenaline/on_mob_delete(mob/living/L) + . = ..() + REMOVE_TRAIT(L, TRAIT_IGNOREDAMAGESLOWDOWN, type) \ No newline at end of file diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index 890ba1ffee45..23f07e0c94e8 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -1,3 +1,5 @@ +#define ADRENALINE_THRESHOLD 15 + /obj/item/organ/heart name = "heart" desc = "I feel bad for the heartless bastard who lost this." @@ -19,6 +21,8 @@ var/beat = BEAT_NONE//is this mob having a heatbeat sound played? if so, which? var/failed = FALSE //to prevent constantly running failing code var/operated = FALSE //whether the heart's been operated on to fix some of its damages + var/lasthealth + COOLDOWN_DECLARE(adrenal_cooldown) /obj/item/organ/heart/Initialize() . = ..() @@ -70,7 +74,10 @@ var/sound/slowbeat = sound('sound/health/slowbeat.ogg', repeat = TRUE) var/sound/fastbeat = sound('sound/health/fastbeat.ogg', repeat = TRUE) var/mob/living/carbon/H = owner - + if(COOLDOWN_FINISHED(src, adrenal_cooldown) && ((H.health+ADRENALINE_THRESHOLD) < lasthealth)) + H.reagents.add_reagent(/datum/reagent/adrenaline, 5) + COOLDOWN_START(src, adrenal_cooldown, 10 MINUTES) + lasthealth = H.health if(H.health <= H.crit_threshold && beat != BEAT_SLOW) beat = BEAT_SLOW