Drunk moodlet updates as you get drunk (#89851)

## About The Pull Request

Inspired by Zomboid, as you get drunker, the moodlet you gain from being
drunk will give more of a bonus, and its message will update.

## Why It's Good For The Game

Lets you get the vibe of just how drunk you are.

## Changelog

🆑 Melbert
add: Your mood will increase further the more drunk you are. Until you
crash out.
/🆑
This commit is contained in:
MrMelbert
2025-03-07 11:34:51 +01:00
committed by GitHub
parent dc82f2dcfb
commit 753e063dcb
2 changed files with 31 additions and 3 deletions
+25 -1
View File
@@ -4,12 +4,36 @@
/// The blush overlay to display when the owner is drunk
var/datum/bodypart_overlay/simple/emote/blush_overlay
/datum/mood_event/drunk/add_effects(param)
/datum/mood_event/drunk/add_effects(drunkness)
update_change(drunkness)
if(!ishuman(owner))
return
var/mob/living/carbon/human/human_owner = owner
blush_overlay = human_owner.give_emote_overlay(/datum/bodypart_overlay/simple/emote/blush)
/// Updates the description and value of the moodlet according to the passed drunkness value
/// (Does not add to or remove from the current level - it will sets it directly to the new value)
/datum/mood_event/drunk/proc/update_change(drunkness = 0)
var/old_mood = mood_change
switch(drunkness)
if(0 to 30)
mood_change = 3
description = "Everything just feels better after a drink or two."
if(30 to 45)
mood_change = 4
description = "Is it getting hotter, or is it just me? I need another drink to cool down."
if(45 to 60)
mood_change = 5
description = "Who keeps moving the floor? I'm going to talk to them... after this drink."
if(60 to 90)
mood_change = 6
description = "I'm noooot drunk, you're drunk! In fact... I need another drink!"
if(90 to INFINITY)
mood_change = 3 // crash out
description = "You're my BESSST frien'... You and me agains' th' world, buddy. Le's get another drink."
if(old_mood != mood_change)
owner.mob_mood.update_mood()
/datum/mood_event/drunk/remove_effects()
QDEL_NULL(blush_overlay)
+6 -2
View File
@@ -106,7 +106,7 @@
/datum/status_effect/inebriated/drunk/on_apply()
. = ..()
owner.sound_environment_override = SOUND_ENVIRONMENT_PSYCHOTIC
owner.add_mood_event(id, /datum/mood_event/drunk)
owner.add_mood_event(id, /datum/mood_event/drunk, drunk_value)
RegisterSignal(owner, COMSIG_MOB_FIRED_GUN, PROC_REF(drunk_gun_fired))
/datum/status_effect/inebriated/drunk/on_remove()
@@ -143,10 +143,14 @@
. = ..()
if(QDELETED(src))
return
// Return to "tipsyness" when we're below 6.
if(drunk_value < TIPSY_THRESHOLD)
owner.apply_status_effect(/datum/status_effect/inebriated/tipsy, drunk_value)
return
var/datum/mood_event/drunk/moodlet = owner.mob_mood.mood_events[id]
if(istype(moodlet))
moodlet.update_change(drunk_value)
/datum/status_effect/inebriated/drunk/on_tick_effects()
// Handle the Ballmer Peak.