Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alcohol tolerance now prevents alcohol from killing you (on its own) #2044

Merged
merged 5 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@
#define set_derpspeech(duration) set_timed_status_effect(duration, /datum/status_effect/speech/stutter/derpspeech)
#define set_derpspeech_if_lower(duration) set_timed_status_effect(duration, /datum/status_effect/speech/stutter/derpspeech, TRUE)

#define adjust_slurring(duration) adjust_timed_status_effect(duration, /datum/status_effect/speech/slurring/drunk)
#define adjust_slurring_up_to(duration, up_to) adjust_timed_status_effect(duration, /datum/status_effect/speech/slurring/drunk, up_to)
#define set_slurring(duration) set_timed_status_effect(duration, /datum/status_effect/speech/slurring/drunk)
#define set_slurring_if_lower(duration) set_timed_status_effect(duration, /datum/status_effect/speech/slurring/drunk, TRUE)
#define adjust_slurring(duration) adjust_timed_status_effect(duration, /datum/status_effect/speech/slurring/generic)
#define adjust_slurring_up_to(duration, up_to) adjust_timed_status_effect(duration, /datum/status_effect/speech/slurring/generic, up_to)
#define set_slurring(duration) set_timed_status_effect(duration, /datum/status_effect/speech/slurring/generic)
#define set_slurring_if_lower(duration) set_timed_status_effect(duration, /datum/status_effect/speech/slurring/generic, TRUE)

#define adjust_dizzy(duration) adjust_timed_status_effect(duration, /datum/status_effect/dizziness)
#define adjust_dizzy_up_to(duration, up_to) adjust_timed_status_effect(duration, /datum/status_effect/dizziness, up_to)
Expand Down
25 changes: 12 additions & 13 deletions code/datums/status_effects/debuffs/drunk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
owner.apply_status_effect(/datum/status_effect/inebriated/tipsy, drunk_value)

/datum/status_effect/inebriated/drunk/on_tick_effects()
var/is_alcoholic = HAS_TRAIT(owner, TRAIT_ALCOHOL_TOLERANCE) // monkestation edit: alcoholism
// Handle the Ballmer Peak.
// If our owner is a scientist (has the trait "TRAIT_BALLMER_SCIENTIST"), there's a 5% chance
// that they'll say one of the special "ballmer message" lines, depending their drunk-ness level.
Expand All @@ -146,17 +147,14 @@
if(drunk_value > BALLMER_PEAK_WINDOWS_ME) // by this point you're into windows ME territory
owner.say(pick_list_replacements(VISTA_FILE, "ballmer_windows_me_msg"), forced = "ballmer")

// There's always a 30% chance to gain some drunken slurring
if(prob(30))
owner.adjust_slurring(4 SECONDS)
// Drunk slurring scales in intensity based on how drunk we are -at 16 you will likely not even notice it,
// but when we start to scale up you definitely will
if(drunk_value >= 16)
owner.adjust_timed_status_effect(4 SECONDS, /datum/status_effect/speech/slurring/drunk, max_duration = 20 SECONDS)

// And drunk people will always lose jitteriness
owner.adjust_jitter(-6 SECONDS)

// Over 11, we will constantly gain slurring up to 10 seconds of slurring.
if(drunk_value >= 11)
owner.adjust_slurring_up_to(2.4 SECONDS, 10 SECONDS)

// Over 41, we have a 30% chance to gain confusion, and we will always have 20 seconds of dizziness.
if(drunk_value >= 41)
if(prob(30))
Expand All @@ -178,26 +176,27 @@
owner.set_eye_blur_if_lower((drunk_value * 2 SECONDS) - 140 SECONDS)

// Over 81, we will gain constant toxloss
if(drunk_value >= 81)
if(!is_alcoholic && drunk_value >= 81) // monkestation edit: alcoholism
owner.adjustToxLoss(1)
if(owner.stat == CONSCIOUS && prob(5))
to_chat(owner, span_warning("Maybe you should lie down for a bit..."))

// Over 91, we gain even more toxloss, brain damage, and have a chance of dropping into a long sleep
if(drunk_value >= 91)
owner.adjustToxLoss(1)
owner.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.4)
if(owner.stat == CONSCIOUS && prob(20))
if(!is_alcoholic) // monkestation edit: alcoholism
owner.adjustToxLoss(1)
owner.adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.4)
if(owner.stat == CONSCIOUS && prob(is_alcoholic ? 5 : 20)) // monkestation edit: alcoholism
// Don't put us in a deep sleep if the shuttle's here. QoL, mainly.
if(SSshuttle.emergency.mode == SHUTTLE_DOCKED && is_station_level(owner.z))
to_chat(owner, span_warning("You're so tired... but you can't miss that shuttle..."))

else
to_chat(owner, span_warning("Just a quick nap..."))
owner.Sleeping(90 SECONDS)
owner.Sleeping(is_alcoholic ? rand(25 SECONDS, 45 SECONDS) : (90 SECONDS)) // monkestation edit: alcoholism

// And finally, over 100 - let's be honest, you shouldn't be alive by now.
if(drunk_value >= 101)
if(!is_alcoholic && drunk_value >= 101) // monkestation edit: alcoholism
owner.adjustToxLoss(2)

/// Status effect for being fully drunk (not tipsy).
Expand Down
28 changes: 25 additions & 3 deletions code/datums/status_effects/debuffs/speech_debuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,36 @@

return modified_char

/datum/status_effect/speech/slurring/drunk
id = "drunk_slurring"
/datum/status_effect/speech/slurring/generic
id = "generic_slurring"
common_prob = 33
uncommon_prob = 5
uncommon_prob = 0
replacement_prob = 5
doubletext_prob = 10
text_modification_file = "slurring_drunk_text.json"

/datum/status_effect/speech/slurring/drunk
id = "drunk_slurring"
// These defaults are updated when speech event occur.
common_prob = -1
uncommon_prob = -1
replacement_prob = -1
doubletext_prob = -1
text_modification_file = "slurring_drunk_text.json"

/datum/status_effect/speech/slurring/drunk/handle_message(datum/source, list/message_args)
var/current_drunkness = owner.get_drunk_amount()
// These numbers are arbitarily picked
// Common replacements start at about 20, and maxes out at about 85
common_prob = clamp((current_drunkness * 0.8) - 16, 0, 50)
// Uncommon replacements (burping) start at 50 and max out at 110 (when you are dying)
uncommon_prob = clamp((current_drunkness * 0.2) - 10, 0, 12)
// Replacements start at 20 and max out at about 60
replacement_prob = clamp((current_drunkness * 0.4) - 8, 0, 12)
// Double texting start out at about 25 and max out at about 60
doubletext_prob = clamp((current_drunkness * 0.5) - 12, 0, 20)
return ..()

/datum/status_effect/speech/slurring/cult
id = "cult_slurring"
common_prob = 50
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
if(boozepwr > 0 && !HAS_TRAIT(drinker, TRAIT_LIVING_DRUNK))
var/obj/item/organ/internal/liver/liver = drinker.get_organ_slot(ORGAN_SLOT_LIVER)
if (istype(liver))
liver.apply_organ_damage(((max(sqrt(volume) * (boozepwr ** ALCOHOL_EXPONENT) * liver.alcohol_tolerance * seconds_per_tick, 0))/150))
liver.apply_organ_damage(((max(sqrt(volume) * (boozepwr ** ALCOHOL_EXPONENT) * liver.alcohol_tolerance * seconds_per_tick, 0))/150), maximum = HAS_TRAIT(drinker, TRAIT_ALCOHOL_TOLERANCE) ? (STANDARD_ORGAN_THRESHOLD - 10) : null)
return ..()

/datum/reagent/consumable/ethanol/expose_obj(obj/exposed_obj, reac_volume)
Expand Down
Loading