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

Drunk slurring scales based on how drunk you are (#75459) #460

Merged
merged 1 commit into from
Aug 4, 2023
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
5 changes: 4 additions & 1 deletion code/datums/diseases/advance/symptoms/sensory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@
if(A.stage >= 3)
M.adjust_timed_status_effect(-4 SECONDS, /datum/status_effect/dizziness)
M.adjust_drowsyness(-2)
M.adjust_timed_status_effect(-1 SECONDS, /datum/status_effect/speech/slurring/drunk)
// All slurring effects get reduced down a bit
for(var/datum/status_effect/speech/slurring/slur in M.status_effects)
slur.remove_duration(1 SECONDS)

M.adjust_timed_status_effect(-2 SECONDS, /datum/status_effect/confusion)
if(purge_alcohol)
M.reagents.remove_all_type(/datum/reagent/consumable/ethanol, 3)
Expand Down
12 changes: 12 additions & 0 deletions code/datums/status_effects/_status_effect.dm
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,18 @@
/datum/status_effect/proc/nextmove_adjust()
return 0

/// Remove [seconds] of duration from the status effect, qdeling / ending if we eclipse the current world time.
/datum/status_effect/proc/remove_duration(seconds)
if(duration == -1) // Infinite duration
return FALSE

duration -= seconds
if(duration <= world.time)
qdel(src)
return TRUE

return FALSE

/// Alert base type for status effect alerts
/atom/movable/screen/alert/status_effect
name = "Curse of Mundanity"
Expand Down
11 changes: 4 additions & 7 deletions code/datums/status_effects/debuffs/drunk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,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_timed_status_effect(4 SECONDS, /datum/status_effect/speech/slurring/drunk)
// 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_timed_status_effect(-6 SECONDS, /datum/status_effect/jitter)

// Over 11, we will constantly gain slurring up to 10 seconds of slurring.
if(drunk_value >= 11)
owner.adjust_timed_status_effect(2.4 SECONDS, /datum/status_effect/speech/slurring/drunk, max_duration = 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 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 @@ -200,14 +200,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
Loading