diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm
index 56702dd6cee..cbcffb459bb 100644
--- a/code/game/machinery/Sleeper.dm
+++ b/code/game/machinery/Sleeper.dm
@@ -26,6 +26,9 @@
var/disallow_occupant_types = list()
var/display_loading_message = TRUE
+ /// rate at which alcohol is removed per tick (see process())
+ var/intoxication_removal_rate = 1
+
idle_power_usage = 15
active_power_usage = 250 //builtin health analyzer, dialysis machine, injectors.
var/stasis_power = 500
@@ -60,7 +63,7 @@
update_icon()
parts_power_usage = active_power_usage
-/obj/machinery/sleeper/process()
+/obj/machinery/sleeper/process(seconds_per_tick)
if(stat & (NOPOWER|BROKEN))
return
@@ -73,6 +76,9 @@
pumped++
if(ishuman(occupant))
occupant.vessel.trans_to_obj(beaker, pumped + 1)
+ if(occupant.intoxication)
+ //Removes alcohol in the bloodstream if present
+ occupant.intoxication -= min(occupant.intoxication, (seconds_per_tick * intoxication_removal_rate))
else
toggle_filter()
if(pump)
@@ -139,6 +145,7 @@
data["brain_activity"] = occupant.get_brain_result()
data["blood_pressure"] = occupant.get_blood_pressure()
data["blood_pressure_level"] = occupant.get_blood_pressure_alert()
+ data["bac"] = occupant.get_blood_alcohol()
data["blood_o2"] = occupant.get_blood_oxygenation()
data["bloodreagents"] = list()
var/list/blood_reagents = list()
diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm
index 5ac4a26c974..9ce96597cd3 100644
--- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm
+++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm
@@ -815,7 +815,7 @@
description = "Ethylredoxrazine is a powerful medication which oxidises ethanol in the bloodstream, reducing the burden on the liver to complete this task. Ethylredoxrazine also blocks the reuptake of neurotransmitters responsible for symptoms of alcohol intoxication."
reagent_state = SOLID
color = "#605048"
- metabolism = REM * 0.3
+ metabolism = REM
overdose = REAGENTS_OVERDOSE
scannable = TRUE
taste_description = "bitterness"
diff --git a/html/changelogs/nauticall-sleeper_alcohol.yml b/html/changelogs/nauticall-sleeper_alcohol.yml
new file mode 100644
index 00000000000..ebad04f46a9
--- /dev/null
+++ b/html/changelogs/nauticall-sleeper_alcohol.yml
@@ -0,0 +1,59 @@
+################################
+# Example Changelog File
+#
+# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
+#
+# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
+# When it is, any changes listed below will disappear.
+#
+# Valid Prefixes:
+# bugfix
+# - (fixes bugs)
+# wip
+# - (work in progress)
+# qol
+# - (quality of life)
+# soundadd
+# - (adds a sound)
+# sounddel
+# - (removes a sound)
+# rscadd
+# - (adds a feature)
+# rscdel
+# - (removes a feature)
+# imageadd
+# - (adds an image or sprite)
+# imagedel
+# - (removes an image or sprite)
+# spellcheck
+# - (fixes spelling or grammar)
+# experiment
+# - (experimental change)
+# balance
+# - (balance changes)
+# code_imp
+# - (misc internal code change)
+# refactor
+# - (refactors code)
+# config
+# - (makes a change to the config files)
+# admin
+# - (makes changes to administrator tools)
+# server
+# - (miscellaneous changes to server)
+#################################
+
+# Your name.
+author: nauticall
+
+# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
+delete-after: True
+
+# Any changes you've made. See valid prefix list above.
+# INDENT WITH TWO SPACES. NOT TABS. SPACES.
+# SCREW THIS UP AND IT WON'T WORK.
+# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
+# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
+changes:
+ - rscadd: "The sleeper can now dialyze alcohol from an intoxicated patient, albeit slowly. Decreases BAC by about 0.05 per minute (~0.1 per 2 minutes)."
+ - balance: "Ethylredoxrazine has been buffed to now decrease BAC by about 0.07-0.08 every minute (0.1 every ~1.2 minutes)."
diff --git a/tgui/packages/tgui/interfaces/Sleeper.tsx b/tgui/packages/tgui/interfaces/Sleeper.tsx
index ea351bab215..aaf8bfe07f3 100644
--- a/tgui/packages/tgui/interfaces/Sleeper.tsx
+++ b/tgui/packages/tgui/interfaces/Sleeper.tsx
@@ -12,6 +12,7 @@ export type SleeperData = {
blood_pressure: number[];
blood_pressure_level: number;
blood_o2: number;
+ bac: number;
bloodreagents: Reagent[];
hasstomach: BooleanLike;
stomachreagents: Reagent[];
@@ -117,6 +118,11 @@ export const OccupantStatus = (props, context) => {
color={progressClass(data.blood_o2)}>
{Math.round(data.blood_o2)}
+
+ {data.bac}
+
@@ -279,6 +285,18 @@ const progressClass = (value) => {
}
};
+const bacClass = (value) => {
+ if (value < 0.05) {
+ return 'green';
+ } else if (value < 0.1) {
+ return 'yellow';
+ } else if (value < 0.2) {
+ return 'average';
+ } else {
+ return 'bad';
+ }
+};
+
const getPressureClass = (tpressure) => {
switch (tpressure) {
case 1: