From 24a53a5e75ffa5c53c856d9ad7663c416da8c33e Mon Sep 17 00:00:00 2001 From: cadyn <35672377+cadyn@users.noreply.github.com> Date: Thu, 4 Mar 2021 13:56:06 -0800 Subject: [PATCH] Make allergen traits make proper use of bitflags So, there's really no need to even have these exclude each other if you just change the way they apply. Also, this should fix any potential issues with species' default allergens being overridden. --- .../species/station/traits_vr/neutral.dm | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm index 014df1315f0..a6e158004e2 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm @@ -155,30 +155,30 @@ //Allergen traits! Not available to any species with a base allergens var. -/datum/trait/allergy_gluten +/datum/trait/allergy name = "Allergy: Gluten" desc = "You're highly allergic to gluten proteins, which are found in most common grains." cost = 0 custom_only = FALSE - var_changes = list("allergens" = 16) - excludes = list(/datum/trait/allergy_nuts,/datum/trait/allergy_soy) + var/allergen = 16 -/datum/trait/allergy_nuts +/datum/trait/allergy/apply(var/datum/species/S,var/mob/living/carbon/human/H) + S.allergens |= allergen + ..(S,H) + +/datum/trait/allergy/nuts name = "Allergy: Nuts" desc = "You're highly allergic to hard-shell seeds, such as peanuts." cost = 0 custom_only = FALSE - var_changes = list("allergens" = 64) - excludes = list(/datum/trait/allergy_gluten,/datum/trait/allergy_soy) + allergen = 64 -/datum/trait/allergy_soy +/datum/trait/allergy/soy name = "Allergy: Soy" desc = "You're highly allergic to soybeans, and some other kinds of bean." cost = 0 custom_only = FALSE - var_changes = list("allergens" = 32) - excludes = list(/datum/trait/allergy_gluten,/datum/trait/allergy_nuts) - + allergen = 32 // Spicy Food Traits, from negative to positive. /datum/trait/spice_intolerance_extreme