From 758e66ac2d69246ad8c5d27a196f372bbf354b57 Mon Sep 17 00:00:00 2001 From: Putnam Date: Fri, 20 Dec 2019 16:46:38 -0800 Subject: [PATCH] yeah alcohol intolerance --- code/__DEFINES/traits.dm | 2 +- code/datums/traits/neutral.dm | 22 ++++++++++++++++++- code/modules/food_and_drinks/drinks/drinks.dm | 1 - .../chemistry/reagents/alcohol_reagents.dm | 8 +++++++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index d17db07b50..1b63ef3d52 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -171,7 +171,7 @@ #define TRAIT_ASSBLASTUSA "assblastusa" #define TRAIT_CULT_EYES "cult_eyes" #define TRAIT_FREESPRINT "free_sprinting" - +#define TRAIT_NO_ALCOHOL "alcohol_intolerance" // common trait sources #define TRAIT_GENERIC "generic" diff --git a/code/datums/traits/neutral.dm b/code/datums/traits/neutral.dm index eae2db6a5f..83ae3dd784 100644 --- a/code/datums/traits/neutral.dm +++ b/code/datums/traits/neutral.dm @@ -149,4 +149,24 @@ value = 0 medical_record_text = "Patient never skipped ass day." gain_text = "Your ass rivals those of golems." - lose_text = "Your butt feels more squishy and slappable." \ No newline at end of file + lose_text = "Your butt feels more squishy and slappable." + +/datum/quirk/alcohol_intolerance + name = "Alcohol Intolerance" + desc = "Your body just can't handle alcohol at all. You don't get drunk faster, you just vomit it right back up as soon as you taste any." + value = 0 + mob_trait = TRAIT_NO_ALCOHOL + gain_text = "Just smelling alcohol makes you feel a little sick." + lose_text = "You no longer feel like vomiting just from the thought of alcohol." + medical_record_text = "Patient's body violently rejects ethyl alcohol." + +/datum/quirk/alcohol_intolerance/add() + var/mob/living/carbon/human/H = quirk_holder + var/datum/species/species = H.dna.species + species.disliked_food |= ALCOHOL + +/datum/quirk/alcohol_intolerance/remove() + var/mob/living/carbon/human/H = quirk_holder + if(H) + var/datum/species/species = H.dna.species + species.disliked_food &= ~ALCOHOL diff --git a/code/modules/food_and_drinks/drinks/drinks.dm b/code/modules/food_and_drinks/drinks/drinks.dm index 5bf7e3dff3..67beb393f0 100644 --- a/code/modules/food_and_drinks/drinks/drinks.dm +++ b/code/modules/food_and_drinks/drinks/drinks.dm @@ -448,7 +448,6 @@ desc = "Quinine tastes funny, but at least it'll keep that Space Malaria away." icon_state = "tonic" list_reagents = list("tonic" = 50) - foodtype = ALCOHOL /obj/item/reagent_containers/food/drinks/soda_cans/sodawater name = "soda water" diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index fd28ff9c47..7ba4a74ff4 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -77,6 +77,14 @@ All effects don't start immediately, but rather get worse over time; the rate is // +10% success propability on each step, useful while operating in less-than-perfect conditions return ..() +/datum/reagent/consumable/ethanol/on_mob_add(mob/living/L,amount) + if(HAS_TRAIT(L, TRAIT_NO_ALCOHOL) && boozepwr > 0) + if(iscarbon(L)) + var/mob/living/carbon/C = L + C.vomit() + L.reagents.remove_all_type(/datum/reagent/consumable/ethanol, amount*4, 0, 1) + return ..() + /datum/reagent/consumable/ethanol/beer name = "Beer" id = "beer"