From 5eb6738fa7be61e21cd1d2c8aea1de6a558318da Mon Sep 17 00:00:00 2001 From: Crosarius <30341877+Crosarius@users.noreply.github.com> Date: Mon, 6 May 2024 07:13:27 +1000 Subject: [PATCH] Alcohol Intoxication Overhaul (#19062) This PR will make broad changes to the way that alcohol/butanol intoxication works in game, with the intention of making alcohol consumption actually impactful, and last much longer than it currently does. It also includes some quality of life changes to the way that liver damage works, better indication of the player's level of intoxication to better communicate when the player is getting **too** drunk, and the frequency of vomiting. Players will **no longer** die extremely fast from getting drunk, will be able to get drunk, and stay drunk. - The rate of liver alcohol filtration has been reduced to 0.015 intoxication every second. This calculates out to the elimination of 0.015 BAC (One standard drink) every ten minutes. - New messages have been added to indicate when the player is drunker than drunk. - At 0.10 BAC the "You feel drunk!" message is replaced with the message "You feel absolutely smashed!" - At 0.15 BAC the "You feel drunk!" message is replaced with the message "You feel the room spinning..." - Liver damage no longer occurs when the player vomits from intoxication, and instead occurs when the player blacks out or loses consciousness (0.20 and 0.30 BAC, respectively) - The liver will no longer regenerate BAC is above 0.20. - The coefficient multiplier that Unathi metabolise butanol has been buffed from 3 to 9 (They now metabolise butanol at roughly the same rate that Humans metabolise Alcohol) One thing of note is that these changes have indirectly fixed a "bug" that was occurring for Unathi with Butanolic beverages; The liver was filtering out intoxication faster than Unathi were able to metabolise some lower strength butanolic drinks, making them unable to get drunk from things like sarezhi wine. With the buff to intoxication, and the reduction in liver filtration speed, butanol is going to be returned to being very potent for Unathi (This seems to be the way it was originally intended?) so Unathi players who are used to Butanol being quite useless at intoxicating Unathi are going to need to be especially careful. Also, I have done testing on my local test server, but to be frank the tickrate of my test server is very fast, and I'm not entirely sure just how well these changes will translate to a live environment with a heavier server load and longer tick times. --------- Signed-off-by: Crosarius <30341877+Crosarius@users.noreply.github.com> Co-authored-by: Cody Brittain --- code/__DEFINES/chemistry.dm | 10 +++---- .../mob/living/carbon/human/intoxication.dm | 27 +++++++++++-------- code/modules/organs/internal/liver.dm | 4 +-- .../Chemistry-Reagents-Dispenser.dm | 8 +++--- html/changelogs/crosarius-alcoholism.yml | 12 +++++++++ 5 files changed, 39 insertions(+), 22 deletions(-) create mode 100644 html/changelogs/crosarius-alcoholism.yml diff --git a/code/__DEFINES/chemistry.dm b/code/__DEFINES/chemistry.dm index c448ae48e15..de7aa5398d5 100644 --- a/code/__DEFINES/chemistry.dm +++ b/code/__DEFINES/chemistry.dm @@ -107,15 +107,15 @@ #define INTOX_DEATH 0.45 //How many units of intoxication to remove per second -#define INTOX_FILTER_HEALTHY 0.10 -#define INTOX_FILTER_BRUISED 0.07 -#define INTOX_FILTER_DAMAGED 0.03 +#define INTOX_FILTER_HEALTHY 0.015 +#define INTOX_FILTER_BRUISED 0.007 +#define INTOX_FILTER_DAMAGED 0.003 #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_VOMIT_CHANCE 10 //Base chance -#define VOMIT_CHANCE_SCALE 2.5 //Percent change added for every 0.01 percent over the VOMIT 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 #define REAGENTS_FREE_SPACE(R) (R.maximum_volume - R.total_volume) diff --git a/code/modules/mob/living/carbon/human/intoxication.dm b/code/modules/mob/living/carbon/human/intoxication.dm index ee1e9e01204..c0d8ee7ae71 100644 --- a/code/modules/mob/living/carbon/human/intoxication.dm +++ b/code/modules/mob/living/carbon/human/intoxication.dm @@ -27,24 +27,26 @@ if(bac > INTOX_BUZZED*SR && bac < INTOX_MUSCLEIMP*SR) sprint_cost_factor += -0.1 if(prob(5)) - to_chat(src,"You feel buzzed.") + to_chat(src, SPAN_NOTICE("You feel buzzed.")) if(bac > INTOX_JUDGEIMP*SR) if (dizziness == 0) - to_chat(src,"You feel a little tipsy.") + to_chat(src, SPAN_NOTICE("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) + if(bac > INTOX_MUSCLEIMP*SR && bac < INTOX_REACTION*SR) slurring = max(slurring, 25) if (prob(5)) - to_chat(src,"You feel drunk!") + to_chat(src, SPAN_NOTICE("You feel drunk!")) move_delay_mod += 2 sprint_cost_factor += 0.2 - if(bac > INTOX_REACTION*SR) + if(bac > INTOX_REACTION*SR && bac < INTOX_BALANCE*SR) + if (prob(5)) + to_chat(src, SPAN_NOTICE("You feel absolutely smashed!")) if (confused == 0) - to_chat(src,"You feel uncoordinated and unsteady on your feet!") + to_chat(src, SPAN_WARNING("You feel uncoordinated and unsteady on your feet!")) confused = max(confused, 10) slurring = max(slurring, 50) @@ -54,28 +56,31 @@ var/chance = BASE_VOMIT_CHANCE + ((bac - INTOX_VOMIT*SR)*VOMIT_CHANCE_SCALE*100) if (prob(chance)) delayed_vomit() - add_chemical_effect(CE_HEPATOTOXIC, 1) 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)) - src.visible_message("[src] loses balance and falls to the ground!","You lose balance and fall to the ground!") + 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("[src] loses consciousness!","You lose consciousness!") + 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("[src] blackouts!","You blackout!") + 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)) slurring = max(slurring, 70) - to_chat(src,"You decide that you like the ground and spend a few seconds to rest.") + to_chat(src,SPAN_WARNING("You decide that you like the ground and spend a few seconds to rest.")) sleeping = max(sleeping, 6 SECONDS) adjustBrainLoss(1,5) diff --git a/code/modules/organs/internal/liver.dm b/code/modules/organs/internal/liver.dm index 660da454c10..03d64d93d3b 100644 --- a/code/modules/organs/internal/liver.dm +++ b/code/modules/organs/internal/liver.dm @@ -58,7 +58,7 @@ if (owner.intoxication > 0) var/bac = owner.get_blood_alcohol() var/res = owner.species ? owner.species.ethanol_resistance : 1 - if(bac >= INTOX_MUSCLEIMP * res) //Excessive blood alcohol, difficult to filter + if(bac >= INTOX_BLACKOUT * res) //Excessive blood alcohol, difficult to filter owner.intoxication -= min(owner.intoxication, filter_strength/2) else owner.intoxication -= min(owner.intoxication, filter_strength) @@ -71,7 +71,7 @@ /obj/item/organ/internal/liver/handle_regeneration() if(..()) - if(!owner.total_radiation && damage > 0) + if(!owner.total_radiation && damage > 0 && !(owner.get_blood_alcohol() > INTOX_BLACKOUT)) if(damage < min_broken_damage) heal_damage(0.2) if(damage < min_bruised_damage) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm index dae27a8556f..aec1fd4bac7 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm @@ -126,7 +126,7 @@ description = DESC_PARENT reagent_state = LIQUID color = "#404030" - ingest_met = REM * 5 + ingest_met = REM * 2.5 fallback_specific_heat = 0.605 germ_adjust = 20 // as good as sterilizine, but only if you have pure ethanol. or rubbing alcohol if we get that eventually @@ -169,7 +169,7 @@ /singleton/reagent/alcohol/affect_ingest(mob/living/carbon/M, alien, removed, var/datum/reagents/holder) if(alien != IS_DIONA) - M.intoxication += (strength / 100) * removed * 3.5 + M.intoxication += (strength / 100) * removed * 6 if (druggy != 0) M.druggy = max(M.druggy, druggy) @@ -243,7 +243,7 @@ description = "A fairly harmless alcohol that has intoxicating effects on certain species." reagent_state = LIQUID color = "#404030" - ingest_met = REM * 0.5 //Extremely slow metabolic rate means the liver will generally purge it faster than it can intoxicate you + ingest_met = REM * 0.25 //Extremely slow metabolic rate means the liver will generally purge it faster than it can intoxicate you flammability_divisor = 7 //Butanol is a bit less flammable than ethanol taste_description = "alcohol" @@ -267,7 +267,7 @@ M.adjustHydrationLoss(-hydration_factor * removed) if (alien == IS_UNATHI) - ingest_met = initial(ingest_met)*3 + ingest_met = initial(ingest_met)*9 ..() diff --git a/html/changelogs/crosarius-alcoholism.yml b/html/changelogs/crosarius-alcoholism.yml new file mode 100644 index 00000000000..2dec520ae89 --- /dev/null +++ b/html/changelogs/crosarius-alcoholism.yml @@ -0,0 +1,12 @@ +author: Crosarius + +delete-after: True + +changes: + - qol: "Greatly reduces the rate the liver clears alcohol intoxication" + - qol: "Increases applied intoxication coefficient from alcohol (Alcohol is more potent)" + - qol: "Halves the rate that alcohol and butanol are metabolised by the body (You get drunk slower)" + - qol: "Increases butanol metabolism coefficient for Unathi (Unathi metabolise alcohol at a rate roughly equivalent to Humans and Alcohol)" + - qol: "Greatly reduced frequency of vomiting while moderately inebriated." + - qol: "Changes liver damage from drunkeness to occur when you black out or fall unconscious, rather than when you vomit." + - qol: "Causes the liver to stop regenerating when BAC rises to dangerous levels."