From 58194974613b2ee633cd0bf0171d5c8a9b9db4b2 Mon Sep 17 00:00:00 2001 From: PapaMichael Date: Fri, 24 May 2024 03:16:00 -0400 Subject: [PATCH] Epinephrine will properly freeze multiple allergic reagents (#83403) ## About The Pull Request Thanks to an early return, epinephrine was only freezing the metabolism of a single allergic reagent at a time; refactored the relevant code to rectify this. ## Why It's Good For The Game Fixes https://github.com/tgstation/tgstation/issues/83393 ## Changelog :cl: PapaMichael fix: Epinephrine will prevent metabolism of all allergic reagents (instead of just one), if taken with multiple chemicals that one is allergic to. /:cl: --- code/datums/quirks/negative_quirks/allergic.dm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/code/datums/quirks/negative_quirks/allergic.dm b/code/datums/quirks/negative_quirks/allergic.dm index 64b4c560bde..8588b95e6e3 100644 --- a/code/datums/quirks/negative_quirks/allergic.dm +++ b/code/datums/quirks/negative_quirks/allergic.dm @@ -55,14 +55,19 @@ return var/mob/living/carbon/carbon_quirk_holder = quirk_holder + //Just halts the progression, I'd suggest you run to medbay asap to get it fixed + if(carbon_quirk_holder.reagents.has_reagent(/datum/reagent/medicine/epinephrine)) + for(var/allergy in allergies) + var/datum/reagent/instantiated_med = carbon_quirk_holder.reagents.has_reagent(allergy) + if(!instantiated_med) + continue + instantiated_med.reagent_removal_skip_list |= ALLERGIC_REMOVAL_SKIP + return //block damage so long as epinephrine exists + for(var/allergy in allergies) var/datum/reagent/instantiated_med = carbon_quirk_holder.reagents.has_reagent(allergy) if(!instantiated_med) continue - //Just halts the progression, I'd suggest you run to medbay asap to get it fixed - if(carbon_quirk_holder.reagents.has_reagent(/datum/reagent/medicine/epinephrine)) - instantiated_med.reagent_removal_skip_list |= ALLERGIC_REMOVAL_SKIP - return //intentionally stops the entire proc so we avoid the organ damage after the loop instantiated_med.reagent_removal_skip_list -= ALLERGIC_REMOVAL_SKIP carbon_quirk_holder.adjustToxLoss(3 * seconds_per_tick) carbon_quirk_holder.reagents.add_reagent(/datum/reagent/toxin/histamine, 3 * seconds_per_tick)