From 758e66ac2d69246ad8c5d27a196f372bbf354b57 Mon Sep 17 00:00:00 2001 From: Putnam Date: Fri, 20 Dec 2019 16:46:38 -0800 Subject: [PATCH 1/4] 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" From 7bf504247b83a32b1495247c1fc00bb9247a09e3 Mon Sep 17 00:00:00 2001 From: Putnam Date: Sat, 21 Dec 2019 08:21:15 -0800 Subject: [PATCH 2/4] should be mutually exclusive whoops --- code/controllers/subsystem/processing/quirks.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/controllers/subsystem/processing/quirks.dm b/code/controllers/subsystem/processing/quirks.dm index f96690126a..9f04b43912 100644 --- a/code/controllers/subsystem/processing/quirks.dm +++ b/code/controllers/subsystem/processing/quirks.dm @@ -17,7 +17,7 @@ PROCESSING_SUBSYSTEM_DEF(quirks) /datum/controller/subsystem/processing/quirks/Initialize(timeofday) if(!quirks.len) SetupQuirks() - quirk_blacklist = list(list("Blind","Nearsighted"),list("Jolly","Depression","Apathetic"),list("Ageusia","Deviant Tastes"),list("Ananas Affinity","Ananas Aversion")) + quirk_blacklist = list(list("Blind","Nearsighted"),list("Jolly","Depression","Apathetic"),list("Ageusia","Deviant Tastes"),list("Ananas Affinity","Ananas Aversion"),list("Alcohol Tolerance","Alcohol Intolerance"),list("Alcohol Intolerance","Drunken Resilience")) return ..() /datum/controller/subsystem/processing/quirks/proc/SetupQuirks() From 0b1b249ebaeb4d60153277897665004a27f3cce0 Mon Sep 17 00:00:00 2001 From: Putnam Date: Tue, 24 Dec 2019 23:53:33 -0800 Subject: [PATCH 3/4] just makes alcohol toxic rather than drunk-inducing --- .../reagents/chemistry/reagents/alcohol_reagents.dm | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index 7ba4a74ff4..7a77ffd180 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -36,7 +36,9 @@ All effects don't start immediately, but rather get worse over time; the rate is */ /datum/reagent/consumable/ethanol/on_mob_life(mob/living/carbon/C) - if(C.drunkenness < volume * boozepwr * ALCOHOL_THRESHOLD_MODIFIER) + if(HAS_TRAIT(L, TRAIT_NO_ALCOHOL)) + C.adjustToxLoss((boozepwr/25)*REM,forced = TRUE) + else if(C.drunkenness < volume * boozepwr * ALCOHOL_THRESHOLD_MODIFIER) var/booze_power = boozepwr if(HAS_TRAIT(C, TRAIT_ALCOHOL_TOLERANCE)) //we're an accomplished drinker booze_power *= 0.7 @@ -77,14 +79,6 @@ 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" From 88222c0901d3b148f6e7d5a709d327a3bbbc194b Mon Sep 17 00:00:00 2001 From: Putnam Date: Tue, 24 Dec 2019 23:58:22 -0800 Subject: [PATCH 4/4] uh, actually did that --- code/datums/traits/neutral.dm | 6 ++---- .../modules/reagents/chemistry/reagents/alcohol_reagents.dm | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/code/datums/traits/neutral.dm b/code/datums/traits/neutral.dm index 83ae3dd784..0ae8d5914f 100644 --- a/code/datums/traits/neutral.dm +++ b/code/datums/traits/neutral.dm @@ -153,12 +153,10 @@ /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." + desc = "You take toxin damage from alcohol rather than getting drunk." 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." + medical_record_text = "Patient's body does not react properly to ethyl alcohol." /datum/quirk/alcohol_intolerance/add() var/mob/living/carbon/human/H = quirk_holder diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index 7a77ffd180..077ab1fb7a 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -36,7 +36,7 @@ All effects don't start immediately, but rather get worse over time; the rate is */ /datum/reagent/consumable/ethanol/on_mob_life(mob/living/carbon/C) - if(HAS_TRAIT(L, TRAIT_NO_ALCOHOL)) + if(HAS_TRAIT(C, TRAIT_NO_ALCOHOL)) C.adjustToxLoss((boozepwr/25)*REM,forced = TRUE) else if(C.drunkenness < volume * boozepwr * ALCOHOL_THRESHOLD_MODIFIER) var/booze_power = boozepwr