From 7bdf4cafa5c1aef01d76d6b2a1fbc893d82f8768 Mon Sep 17 00:00:00 2001 From: Crosarius <30341877+Crosarius@users.noreply.github.com> Date: Fri, 24 May 2024 05:22:44 +1000 Subject: [PATCH] Alcoholism overhaul (#19179) Takes on feedback from the implementation of the previous alcoholism overhaul, and applies fixes to it to make things better, generally. - Fixed up alcohol and butanol affect_ingest() to improve the logic flow, and fix bugs where Unathi were able to drink alcohol without being poisoned. Non-Unathi are now no longer intoxicated by butanol, as well. - Better intoxication messages. - Generally buffed intoxication resistances for Unathi, Tajara, and Skrell, to compensate for recent changes to intoxication potency. Unathi are MUCH more resistant to intoxication now (total resistance increased from 0.4 to 0.8, which is slightly less than Tajara now) however they can no longer drink alcohol at all without getting poisoned. - Alcohol poisoning now does not kill by giving you liver damage and MSOF, but by suppressing, and eventually stopping breathing. - Ethylredoxrazine now prevents people from falling into comas from alcohol toxicity alltogether. - Vomiting from being intoxicated now happens much less often. - Being drunk enough to cause vomiting now has a pulsing message to go along with other drunkeness messages. - You can now correctly black out or fall into an alcoholic coma while buckled to a bed or laying down. --------- Signed-off-by: Crosarius <30341877+Crosarius@users.noreply.github.com> --- code/__DEFINES/chemistry.dm | 5 +- code/game/objects/items/devices/scanners.dm | 10 +- .../mob/living/carbon/human/intoxication.dm | 93 +++++++++++-------- .../human/species/station/skrell/skrell.dm | 2 +- .../human/species/station/tajara/tajara.dm | 2 +- .../station/tajara/tajaran_subspecies.dm | 2 +- .../human/species/station/unathi/unathi.dm | 2 +- .../Chemistry-Reagents-Dispenser.dm | 76 ++++++++------- .../Chemistry-Reagents-Food-Drinks.dm | 2 +- html/changelogs/crosarius-alcoholismfixes.yml | 16 ++++ 10 files changed, 124 insertions(+), 86 deletions(-) create mode 100644 html/changelogs/crosarius-alcoholismfixes.yml diff --git a/code/__DEFINES/chemistry.dm b/code/__DEFINES/chemistry.dm index de7aa5398d5..c7412b08a98 100644 --- a/code/__DEFINES/chemistry.dm +++ b/code/__DEFINES/chemistry.dm @@ -100,8 +100,8 @@ #define INTOX_JUDGEIMP 0.03 #define INTOX_MUSCLEIMP 0.08 #define INTOX_REACTION 0.10 -#define INTOX_VOMIT 0.12 #define INTOX_BALANCE 0.15 +#define INTOX_VOMIT 0.15 #define INTOX_BLACKOUT 0.20 #define INTOX_CONSCIOUS 0.30 #define INTOX_DEATH 0.45 @@ -114,6 +114,9 @@ #define BASE_DIZZY 50 //Base dizziness from getting drunk. #define DIZZY_ADD_SCALE 15 //Amount added for every 0.01 percent over the JUDGEIMP limit +#define BASE_SLUR 5 //Base slurring from getting drunk. +#define SLUR_ADD_SCALE 10 //Amount added for every 0.01 percent over the REACTION limit + #define BASE_VOMIT_CHANCE 1 //Base chance #define VOMIT_CHANCE_SCALE 1 //Percent change added for every 0.01 percent over the VOMIT limit diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 27747190857..ed07cd302db 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -670,12 +670,12 @@ BREATH ANALYZER switch(bac) if(INTOX_JUDGEIMP to INTOX_MUSCLEIMP) additional_string = "\[LIGHTLY INTOXICATED\]" - if(INTOX_MUSCLEIMP to INTOX_VOMIT) + if(INTOX_MUSCLEIMP to INTOX_BALANCE) additional_string = "\[MODERATELY INTOXICATED\]" - if(INTOX_VOMIT to INTOX_BALANCE) - additional_string = SPAN_WARNING("\[HEAVILY INTOXICATED\]") - if(INTOX_BALANCE to INTOX_DEATH) - additional_string = SPAN_WARNING("\[ALCOHOL POISONING LIKELY\]") + if(INTOX_BALANCE to INTOX_BLACKOUT) + additional_string = "\[HEAVILY INTOXICATED\]" + if(INTOX_BLACKOUT to INTOX_DEATH) + additional_string = "\[ALCOHOL POISONING LIKELY\]" if(INTOX_DEATH to INFINITY) additional_string = SPAN_WARNING("\[DEATH IMMINENT\]") to_chat(user,"Blood Alcohol Content: [round(bac,0.01)] [additional_string]") diff --git a/code/modules/mob/living/carbon/human/intoxication.dm b/code/modules/mob/living/carbon/human/intoxication.dm index c0d8ee7ae71..32f3ad3efee 100644 --- a/code/modules/mob/living/carbon/human/intoxication.dm +++ b/code/modules/mob/living/carbon/human/intoxication.dm @@ -26,68 +26,81 @@ if(bac > INTOX_BUZZED*SR && bac < INTOX_MUSCLEIMP*SR) sprint_cost_factor += -0.1 - if(prob(5)) - to_chat(src, SPAN_NOTICE("You feel buzzed.")) + if(prob(3)) + to_chat(src, SPAN_GOOD(pick("You feel buzzed.","You feel good!","You feel less inhibited.","You feel relaxed."))) if(bac > INTOX_JUDGEIMP*SR) if (dizziness == 0) - to_chat(src, SPAN_NOTICE("You feel a little tipsy.")) + to_chat(src, SPAN_GOOD("You feel a little tipsy!")) var/target_dizziness = BASE_DIZZY + ((bac - INTOX_JUDGEIMP*SR)*DIZZY_ADD_SCALE*100) make_dizzy(target_dizziness - dizziness) if(bac > INTOX_MUSCLEIMP*SR && bac < INTOX_REACTION*SR) - slurring = max(slurring, 25) - if (prob(5)) - to_chat(src, SPAN_NOTICE("You feel drunk!")) + if (prob(3)) + to_chat(src, SPAN_GOOD(pick("You feel drunk!", "You feel great!", "Your inhibitions fall away...", "All your anxieties melt away."))) move_delay_mod += 2 sprint_cost_factor += 0.2 - if(bac > INTOX_REACTION*SR && bac < INTOX_BALANCE*SR) - if (prob(5)) - to_chat(src, SPAN_NOTICE("You feel absolutely smashed!")) + if(bac > INTOX_REACTION*SR) + if (prob(3) && bac < INTOX_BALANCE*SR) + to_chat(src, SPAN_GOOD(pick("You feel very drunk!", "You feel reckless!", "You don't have a care in the world!", "You feel amazing!"))) if (confused == 0) to_chat(src, SPAN_WARNING("You feel uncoordinated and unsteady on your feet!")) + var/target_slurring = BASE_SLUR + ((bac - INTOX_REACTION*SR)*SLUR_ADD_SCALE*100) + slurring = max(slurring, target_slurring) confused = max(confused, 10) - slurring = max(slurring, 50) + eye_blurry = max(eye_blurry, 10) + move_delay_mod += 2 + sprint_cost_factor += 0.2 - if(bac > INTOX_VOMIT*SR) - slurring = max(slurring, 75) - if (life_tick % 4 == 1) - var/chance = BASE_VOMIT_CHANCE + ((bac - INTOX_VOMIT*SR)*VOMIT_CHANCE_SCALE*100) - if (prob(chance)) + if(bac > INTOX_VOMIT*SR)//Vomiting starts here. 1% chance every 10 ticks, escalating with increased intoxication (1% per 0.01 BAC) + if (prob(3)) + to_chat(src, SPAN_WARNING("You feel a little nauseous...")) + if (life_tick % 10 == 1) + var/vomitchance = BASE_VOMIT_CHANCE + ((bac - INTOX_VOMIT*SR)*VOMIT_CHANCE_SCALE*100) + if (prob(vomitchance)) delayed_vomit() - if(bac > INTOX_BALANCE*SR) - slurring = max(slurring, 100) - if (prob(5)) - to_chat(src, SPAN_NOTICE("You feel the room spinning...")) - if (life_tick % 4 == 1 && !lying && !buckled_to && prob(10)) + if(bac > INTOX_BALANCE*SR)//Can no longer walk properly. Will fall to the ground very often. Good drunkeness messages replaced by alcohol dysphoria and confusion + var/fallchance = ((bac - INTOX_BALANCE*SR)*100) + if (prob(3)) + to_chat(src, SPAN_WARNING(pick("You feel the room spinning...", "It's hard to think...", "You can't see straight...", "You feel absolutely hammered!"))) + if (life_tick % 4 == 1 && !lying && !buckled_to && prob(fallchance)) src.visible_message(SPAN_WARNING("[src] loses balance and falls to the ground!"),SPAN_WARNING("You lose balance and fall to the ground!")) Paralyse(3 SECONDS) - if(bac > INTOX_CONSCIOUS*SR) - slurring = max(slurring, 90) - src.visible_message(SPAN_DANGER("[src] loses consciousness!"),SPAN_DANGER("You lose consciousness!")) - paralysis = max(paralysis, 60 SECONDS) - sleeping = max(sleeping, 60 SECONDS) - adjustBrainLoss(5,30) - add_chemical_effect(CE_HEPATOTOXIC, 3) - else if(bac > INTOX_BLACKOUT*SR) - slurring = max(slurring, 80) - src.visible_message(SPAN_DANGER("[src] blacks out!"),SPAN_DANGER("You black out!")) - paralysis = max(paralysis, 20 SECONDS) - sleeping = max(sleeping, 20 SECONDS) - adjustBrainLoss(3,10) - add_chemical_effect(CE_HEPATOTOXIC, 1) - else if(prob(10)) + if(prob(33) && stat == CONSCIOUS && !src.reagents.has_reagent(/singleton/reagent/ethylredoxrazine)) slurring = max(slurring, 70) - to_chat(src,SPAN_WARNING("You decide that you like the ground and spend a few seconds to rest.")) + to_chat(src,SPAN_GOOD("You decide that you like the ground and spend a few seconds to rest.")) sleeping = max(sleeping, 6 SECONDS) adjustBrainLoss(1,5) - if (bac > INTOX_DEATH*SR && !src.reagents.has_reagent(/singleton/reagent/ethylredoxrazine)) //Death usually occurs here - add_chemical_effect(CE_HEPATOTOXIC, 10) - adjustOxyLoss(3,100) - adjustBrainLoss(1,50) + if(bac > INTOX_BLACKOUT*SR && bac < INTOX_CONSCIOUS*SR && !src.reagents.has_reagent(/singleton/reagent/ethylredoxrazine))//Alcohol poisoing causing short blackouts. + if (prob(3) && bac < INTOX_BLACKOUT*SR) + to_chat(src, SPAN_GOOD(pick("You feel very drunk!", "You feel invincible!", "You don't have a care in the world!", "You feel amazing!"))) + if (life_tick % 4 == 1 && prob(5) && stat == CONSCIOUS) + src.visible_message(SPAN_DANGER("[src] blacks out!"),SPAN_DANGER("You black out!")) + paralysis = max(paralysis, 6 SECONDS) + sleeping = max(sleeping, 6 SECONDS) + adjustBrainLoss(3,10) + + if(bac > INTOX_CONSCIOUS*SR && !src.reagents.has_reagent(/singleton/reagent/ethylredoxrazine)) //Life threatening alcohol poisoning causing coma and possible loss of breathing. + if (stat == CONSCIOUS)//Put them into a coma + src.visible_message(SPAN_DANGER("[src] loses consciousness!"),SPAN_DANGER("You lose consciousness!")) + paralysis = max(paralysis, 60 SECONDS) + sleeping = max(sleeping, 60 SECONDS) + adjustBrainLoss(5,30) + if(losebreath && losebreath < 15)//Patient's breathing is suppressed. If already not breathing, don't start again. Stay not breathing. + losebreath++ + if(prob(1) && life_tick % 10 == 1 && stat == UNCONSCIOUS && bac < INTOX_DEATH*SR)//2.5% chance every minute, roughly, to stop breathing while unconscious. + if (!losebreath)//To prevent this message from being spammed. + src.visible_message(SPAN_DANGER("[src] stops breathing!"),SPAN_DANGER("You stop breathing!")) + losebreath += 15 + + if (bac > INTOX_DEATH*SR && !src.reagents.has_reagent(/singleton/reagent/ethylredoxrazine)) //Fatal alcohol poisoning. Central nervous system no longer able to promote unconscious breathing + if (!losebreath)//To prevent this message from being spammed. + src.visible_message(SPAN_DANGER("[src] stops breathing!"),SPAN_DANGER("You stop breathing!")) + if(losebreath < 15)//Stop breathing + losebreath++ /mob/living/carbon/human/proc/is_drunk() var/SR = species.ethanol_resistance diff --git a/code/modules/mob/living/carbon/human/species/station/skrell/skrell.dm b/code/modules/mob/living/carbon/human/species/station/skrell/skrell.dm index d11c080fc61..b4cc61a095d 100644 --- a/code/modules/mob/living/carbon/human/species/station/skrell/skrell.dm +++ b/code/modules/mob/living/carbon/human/species/station/skrell/skrell.dm @@ -77,7 +77,7 @@ base_color = "#006666" reagent_tag = IS_SKRELL - ethanol_resistance = 0.5//gets drunk faster + ethanol_resistance = 0.6//gets drunk faster taste_sensitivity = TASTE_SENSITIVE stamina = 80 diff --git a/code/modules/mob/living/carbon/human/species/station/tajara/tajara.dm b/code/modules/mob/living/carbon/human/species/station/tajara/tajara.dm index 5aaae91b4e1..1473992c679 100644 --- a/code/modules/mob/living/carbon/human/species/station/tajara/tajara.dm +++ b/code/modules/mob/living/carbon/human/species/station/tajara/tajara.dm @@ -41,7 +41,7 @@ num_alternate_languages = 2 secondary_langs = list(LANGUAGE_SIIK_MAAS, LANGUAGE_SIIK_TAJR, LANGUAGE_YA_SSA) name_language = LANGUAGE_SIIK_MAAS - ethanol_resistance = 0.8//Gets drunk a little faster + ethanol_resistance = 0.9//Gets drunk a little faster rarity_value = 2 economic_modifier = 7 selectable_pronouns = list(MALE, FEMALE) diff --git a/code/modules/mob/living/carbon/human/species/station/tajara/tajaran_subspecies.dm b/code/modules/mob/living/carbon/human/species/station/tajara/tajaran_subspecies.dm index 66ea0909796..4d69a29f61b 100644 --- a/code/modules/mob/living/carbon/human/species/station/tajara/tajaran_subspecies.dm +++ b/code/modules/mob/living/carbon/human/species/station/tajara/tajaran_subspecies.dm @@ -62,7 +62,7 @@ standing_jump_range = 3 stamina = 80 // As opposed to 90 brute_mod = 1.3 // More Brute Damage - ethanol_resistance = 0.6 // Species Default 0.8 + ethanol_resistance = 0.7 // Species Default 0.9 maneuvers = list( /singleton/maneuver/leap/tajara/msai diff --git a/code/modules/mob/living/carbon/human/species/station/unathi/unathi.dm b/code/modules/mob/living/carbon/human/species/station/unathi/unathi.dm index 3a44508f154..18d70ea5e3c 100644 --- a/code/modules/mob/living/carbon/human/species/station/unathi/unathi.dm +++ b/code/modules/mob/living/carbon/human/species/station/unathi/unathi.dm @@ -34,7 +34,7 @@ grab_mod = 1.25 // Huge, usually have horns resist_mod = 2.5 // Arguably our strongest organic species - ethanol_resistance = 0.4 + ethanol_resistance = 0.8 taste_sensitivity = TASTE_SENSITIVE economic_modifier = 7 diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm index 77a115e2739..dcf77d1dc43 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm @@ -167,26 +167,7 @@ return /singleton/reagent/alcohol/affect_ingest(mob/living/carbon/M, alien, removed, var/datum/reagents/holder) - - if(alien != IS_DIONA) - M.intoxication += (strength / 100) * removed * 6 - - if (druggy != 0) - M.druggy = max(M.druggy, druggy) - - if (halluci) - M.hallucination = max(M.hallucination, halluci) - - if(caffeine) - M.add_chemical_effect(CE_PULSE, caffeine*2) - M.add_up_to_chemical_effect(CE_SPEEDBOOST, 1) - - if (adj_temp > 0 && M.bodytemperature < targ_temp) // 310 is the normal bodytemp. 310.055 - M.bodytemperature = min(targ_temp, M.bodytemperature + (adj_temp * TEMPERATURE_DAMAGE_COEFFICIENT)) - if (adj_temp < 0 && M.bodytemperature > targ_temp) - M.bodytemperature = min(targ_temp, M.bodytemperature - (adj_temp * TEMPERATURE_DAMAGE_COEFFICIENT)) - - if(ishuman(M)) + if(alien != IS_DIONA && ishuman(M)) var/has_valid_aug = FALSE var/obj/item/organ/internal/augment/ethanol_burner/aug = M.internal_organs_by_name[BP_AUG_ETHANOL_BURNER] if(aug && !aug.is_broken()) @@ -194,13 +175,31 @@ var/obj/item/organ/internal/parasite/P = M.internal_organs_by_name["blackkois"] if(!has_valid_aug && (alien == IS_VAURCA || (istype(P) && P.stage >= 3)))//Vaurca are damaged instead of getting nutrients, but they can still get drunk - M.adjustToxLoss(1.5 * removed * (strength / 100)) - else + M.adjustToxLoss(12 * removed * (strength / 100)) + + if (!has_valid_aug && alien == IS_UNATHI) //unathi are poisoned by alcohol as well + M.adjustToxLoss(12 * removed * (strength / 100)) + if(!M.lastpuke) + to_chat(M, SPAN_WARNING("Your gizzard lurches as the alcohol burns its way down your gullet!"))//Make it clear that you should not be drinking this. + var/mob/living/carbon/human/H = M + H.delayed_vomit() + + if (has_valid_aug | alien != IS_UNATHI) + M.intoxication += (strength / 100) * removed * 6 + if (druggy != 0) + M.druggy = max(M.druggy, druggy) + if (halluci) + M.hallucination = max(M.hallucination, halluci) + if(caffeine) + M.add_chemical_effect(CE_PULSE, caffeine*2) + M.add_up_to_chemical_effect(CE_SPEEDBOOST, 1) M.adjustNutritionLoss(-nutriment_factor * removed) M.adjustHydrationLoss(-hydration_factor * removed) - if (!has_valid_aug && alien == IS_UNATHI)//unathi are poisoned by alcohol as well - M.adjustToxLoss(1.5 * removed * (strength / 100)) + if (adj_temp > 0 && M.bodytemperature < targ_temp) // 310 is the normal bodytemp. 310.055 + M.bodytemperature = min(targ_temp, M.bodytemperature + (adj_temp * TEMPERATURE_DAMAGE_COEFFICIENT)) + if (adj_temp < 0 && M.bodytemperature > targ_temp) + M.bodytemperature = min(targ_temp, M.bodytemperature - (adj_temp * TEMPERATURE_DAMAGE_COEFFICIENT)) /singleton/reagent/alcohol/touch_obj(var/obj/O, var/amount, var/datum/reagents/holder) if(istype(O, /obj/item/paper)) @@ -243,7 +242,7 @@ description = "A fairly harmless alcohol that has intoxicating effects on certain species." reagent_state = LIQUID color = "#404030" - ingest_met = REM * 0.25 //Extremely slow metabolic rate means the liver will generally purge it faster than it can intoxicate you + ingest_met = REM * 2.5 flammability_divisor = 7 //Butanol is a bit less flammable than ethanol taste_description = "alcohol" @@ -257,19 +256,26 @@ distillation_point = T0C + 117.7 /singleton/reagent/alcohol/butanol/affect_ingest(var/mob/living/carbon/human/M, var/alien, var/removed, var/datum/reagents/holder) - if(!istype(M)) - return - var/obj/item/organ/internal/parasite/P = M.internal_organs_by_name["blackkois"] - if((alien == IS_VAURCA) || (istype(P) && P.stage >= 3)) - M.adjustToxLoss(removed * (strength / 100)) - else + if (alien == IS_UNATHI) + M.intoxication += (strength / 100) * removed * 6 + if (druggy != 0) + M.druggy = max(M.druggy, druggy) + if (halluci) + M.hallucination = max(M.hallucination, halluci) + if(caffeine) + M.add_chemical_effect(CE_PULSE, caffeine*2) + M.add_up_to_chemical_effect(CE_SPEEDBOOST, 1) + M.adjustNutritionLoss(-nutriment_factor * removed) M.adjustHydrationLoss(-hydration_factor * removed) - if (alien == IS_UNATHI) - ingest_met = initial(ingest_met)*9 - - ..() + if (adj_temp > 0 && M.bodytemperature < targ_temp) // 310 is the normal bodytemp. 310.055 + M.bodytemperature = min(targ_temp, M.bodytemperature + (adj_temp * TEMPERATURE_DAMAGE_COEFFICIENT)) + if (adj_temp < 0 && M.bodytemperature > targ_temp) + M.bodytemperature = min(targ_temp, M.bodytemperature - (adj_temp * TEMPERATURE_DAMAGE_COEFFICIENT)) + else + strength = 0 //Only Unathi are intoxicated by butanol. + ..() /singleton/reagent/hydrazine name = "Hydrazine" diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm index 3bfe0d3d99f..edae4f064cc 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm @@ -2727,7 +2727,7 @@ if(!istype(M)) return if(alien == IS_VAURCA) - M.intoxication += (strength / 100) * removed * 3.5 + M.intoxication += (strength / 100) * removed * 6 /singleton/reagent/drink/toothpaste/cold_gate name = "Cold Gate" diff --git a/html/changelogs/crosarius-alcoholismfixes.yml b/html/changelogs/crosarius-alcoholismfixes.yml new file mode 100644 index 00000000000..b6339a7b0a9 --- /dev/null +++ b/html/changelogs/crosarius-alcoholismfixes.yml @@ -0,0 +1,16 @@ +author: Crosarius + +delete-after: True + +changes: + - refactor: "Fixed up alcohol and butanol affect_ingest()" + - qol: "Generally buffed intoxication resistances for Unathi, Tajara, and Skrell, to compensate for recent changes to alcohol potency." + - qol: "Alcohol poisoning now no longer kills you by destroying your liver. Instead, it causes the patient to fall into a coma, and stop breathing." + - qol: "Better messages for drunkeness." + - qol: "Ethylredoxrazine now prevents people from falling into comas from alcohol toxicity alltogether." + - qol: "Vomiting from being intoxicated now happens much less often, and at a higher level of intoxication." + - qol: "Being drunk enough to cause vomiting now has a pulsing message to go along with other drunkeness messages." + - bugfix: "You can now correctly black out or fall into an alcoholic coma while buckled to a bed or laying down." + - bugfix: "Unathi are no longer poisoned by butanol." + - bugfix: "Unathi are now correctly poisoned by alcohol" + - bugfix: "Non-Unathi are no longer intoxicated by butanol."