From 4d07f3a6208f6e13ce44d58785a6abe56cbe3021 Mon Sep 17 00:00:00 2001
From: Useroth <37159550+Useroth@users.noreply.github.com>
Date: Mon, 9 May 2022 16:05:42 +0200
Subject: [PATCH] Missed mirror (#13460)
* Converts drunkness and dizziness to status effects. Refactors status effect examine text (and, subsequently, stabilized black extracts). (#66340)
* Refactors dizziness into a status effect
* Refactors the dizziness setter to use the new kind
* Drunkness.
- Should drunk continue to work off of a magic value or be swapped to duration? I've not yet decided: For understandability it's preferabale for "drunk" to use a timer (they are drunk for 3 more minutes), but both adding drunk and decreasing drunk currently use weird calculations which would be difficult to carry over.
- Ballmer is a liver trait
* Dizzy was a setter, not an adjuster
* Does all the drunk effects over
- refactors examine text fully
- refactors stabilized blacks because of this
* Removed
* repaths, fixes some issues
* Minor fixes
* Some erroneous changes
* Fixes some dizziness errors
* Consistency thing
* Warning
* Undoes this change, I dont like its implementation
* max_duration
* Max amount
* Should be a negative
* max duration
* drunk doesn't tick on death
* Rework dizziness strength
* Erroneous dizzy change
* Fixes return type
* this should do it?
* well, one more
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
---
.github/guides/AUTODOC.md | 6 +-
code/__DEFINES/alerts.dm | 3 -
code/__DEFINES/traits.dm | 1 +
code/_onclick/hud/alert.dm | 5 -
code/datums/brain_damage/creepy_trauma.dm | 2 +-
code/datums/brain_damage/mild.dm | 2 +-
code/datums/brain_damage/phobia.dm | 2 +-
code/datums/brain_damage/severe.dm | 4 +-
code/datums/components/hazard_area.dm | 4 +-
code/datums/components/tackle.dm | 15 +-
code/datums/diseases/adrenal_crisis.dm | 2 +-
.../datums/diseases/advance/symptoms/dizzy.dm | 3 +-
.../diseases/advance/symptoms/sensory.dm | 6 +-
code/datums/diseases/tuberculosis.dm | 2 +-
code/datums/quirks/good.dm | 15 +-
code/datums/status_effects/_status_effect.dm | 8 +-
code/datums/status_effects/buffs.dm | 10 +-
code/datums/status_effects/debuffs/debuffs.dm | 45 ++--
.../status_effects/debuffs/dizziness.dm | 75 ++++++
code/datums/status_effects/debuffs/drunk.dm | 222 ++++++++++++++++++
code/datums/status_effects/song_effects.dm | 5 +-
code/datums/wounds/bones.dm | 2 +-
code/game/machinery/hypnochair.dm | 6 +-
code/game/objects/effects/landmarks.dm | 2 +-
code/game/objects/items/grenades/hypno.dm | 2 +-
code/game/objects/items/plushes.dm | 6 +-
code/modules/admin/verbs/debug.dm | 11 -
code/modules/antagonists/cult/cult_items.dm | 10 +-
.../antagonists/heretic/items/madness_mask.dm | 2 +-
.../sacrifice_knowledge/sacrifice_buff.dm | 2 +-
.../sacrifice_knowledge.dm | 4 +-
.../heretic/structures/carving_knife.dm | 2 +-
.../antagonists/wizard/equipment/soulstone.dm | 4 +-
code/modules/assembly/flash.dm | 4 +-
.../jobs/job_types/research_director.dm | 2 +-
code/modules/jobs/job_types/scientist.dm | 2 +
code/modules/mob/emote.dm | 6 +-
.../mob/living/carbon/carbon_defines.dm | 2 -
code/modules/mob/living/carbon/human/death.dm | 1 -
.../mob/living/carbon/human/examine.dm | 46 ++--
code/modules/mob/living/carbon/human/human.dm | 1 -
code/modules/mob/living/carbon/life.dm | 103 --------
code/modules/mob/living/living.dm | 2 -
.../mob/living/silicon/robot/examine.dm | 2 +-
.../hostile/megafauna/wendigo.dm | 2 +-
code/modules/mob/living/status_procs.dm | 46 ++++
code/modules/mob/mob.dm | 3 -
code/modules/mob/mob_defines.dm | 2 -
code/modules/mob/status_procs.dm | 12 -
.../projectiles/projectile/special/floral.dm | 2 +-
.../chemistry/reagents/alcohol_reagents.dm | 25 +-
.../reagents/cat2_medicine_reagents.dm | 2 +-
.../chemistry/reagents/drink_reagents.dm | 28 +--
.../chemistry/reagents/drug_reagents.dm | 2 +-
.../chemistry/reagents/food_reagents.dm | 2 +-
.../chemistry/reagents/medicine_reagents.dm | 26 +-
.../chemistry/reagents/other_reagents.dm | 7 +-
.../chemistry/reagents/toxin_reagents.dm | 8 +-
.../reagents/withdrawal/generic_addictions.dm | 2 +-
.../crossbreeding/_status_effects.dm | 156 ++++++++----
code/modules/surgery/organs/heart.dm | 2 +-
.../surgery/organs/stomach/_stomach.dm | 2 +-
.../reagents/withdrawal/generic_addictions.dm | 2 +-
.../code/biohazard_blob_disease.dm | 2 +-
.../contractor/code/datums/contract.dm | 6 +-
.../modules/surgery/organs/ipc.dm | 4 +-
.../modules/medical/code/wounds/bones.dm | 2 +-
.../modules/morenarcotics/code/quaalude.dm | 2 +-
.../modules/morenarcotics/code/thc.dm | 2 +-
tgstation.dme | 2 +
70 files changed, 637 insertions(+), 375 deletions(-)
create mode 100644 code/datums/status_effects/debuffs/dizziness.dm
create mode 100644 code/datums/status_effects/debuffs/drunk.dm
diff --git a/.github/guides/AUTODOC.md b/.github/guides/AUTODOC.md
index 3433c1cc53e..bd63ef4066b 100644
--- a/.github/guides/AUTODOC.md
+++ b/.github/guides/AUTODOC.md
@@ -74,7 +74,7 @@ Finally we give a longer multi paragraph description of the class and it's detai
```
### Documenting a variable/define
-Give a short explanation of what the variable, in the context of the class, or define is.
+Give a short explanation of what the variable, in the context of the class, or define is.
```
/// Type path of item to go in suit slot
var/suit = null
@@ -96,13 +96,13 @@ You can use certain special template variables in DM DOC comments and they will
```
[DEFINE_NAME] - Expands to a link to the define definition if documented
[/mob] - Expands to a link to the docs for the /mob class
- [/mob/proc/Dizzy] - Expands to a link that will take you to the /mob class and anchor you to the dizzy proc docs
+ [/mob/proc/adjust_drunk_effect] - Expands to a link that will take you to the /mob class and anchor you to the adjust_drunk_effect proc docs
[/mob/var/stat] - Expands to a link that will take you to the /mob class and anchor you to the stat var docs
```
You can customise the link name by using `[link name][link shorthand].`
-eg. `[see more about dizzy here] [/mob/proc/Dizzy]`
+eg. `[see more about adjust drunk effect here] [/mob/proc/adjust_drunk_effect]`
This is very useful to quickly link to other parts of the autodoc code to expand
upon a comment made, or reasoning about code
diff --git a/code/__DEFINES/alerts.dm b/code/__DEFINES/alerts.dm
index e942fdc2623..26958fad157 100644
--- a/code/__DEFINES/alerts.dm
+++ b/code/__DEFINES/alerts.dm
@@ -33,9 +33,6 @@
#define ALERT_ETHEREAL_CHARGE "ethereal_charge"
#define ALERT_ETHEREAL_OVERCHARGE "ethereal_overcharge"
-//drunk alerts
-#define ALERT_DRUNK "drunk"
-
/** Alien related */
#define ALERT_XENO_FIRE "alien_fire"
#define ALERT_XENO_PLASMA "alien_plas"
diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm
index 11ed22b2c65..9103114dcc7 100644
--- a/code/__DEFINES/traits.dm
+++ b/code/__DEFINES/traits.dm
@@ -424,6 +424,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_ENGINEER_METABOLISM "engineer_metabolism"
#define TRAIT_ROYAL_METABOLISM "royal_metabolism"
#define TRAIT_PRETENDER_ROYAL_METABOLISM "pretender_royal_metabolism"
+#define TRAIT_BALLMER_SCIENTIST "ballmer_scientist"
/// This mob can strip other mobs.
#define TRAIT_CAN_STRIP "can_strip"
diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm
index 557f2663ecb..6c424d01d8e 100644
--- a/code/_onclick/hud/alert.dm
+++ b/code/_onclick/hud/alert.dm
@@ -244,11 +244,6 @@
return
to_chat(owner, span_mind_control("[command]"))
-/atom/movable/screen/alert/drunk
- name = "Drunk"
- desc = "All that alcohol you've been drinking is impairing your speech, motor skills, and mental cognition. Make sure to act like it."
- icon_state = ALERT_DRUNK
-
/atom/movable/screen/alert/embeddedobject
name = "Embedded Object"
desc = "Something got lodged into your flesh and is causing major bleeding. It might fall out with time, but surgery is the safest way. \
diff --git a/code/datums/brain_damage/creepy_trauma.dm b/code/datums/brain_damage/creepy_trauma.dm
index 8124140451c..4054ab373d0 100644
--- a/code/datums/brain_damage/creepy_trauma.dm
+++ b/code/datums/brain_damage/creepy_trauma.dm
@@ -103,7 +103,7 @@
to_chat(owner, span_userdanger("You feel your heart lurching in your chest..."))
if(81 to 100)
INVOKE_ASYNC(owner, /mob.proc/emote, "cough")
- owner.dizziness += 10
+ owner.adjust_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness)
owner.adjust_disgust(5)
to_chat(owner, span_userdanger("You gag and swallow a bit of bile..."))
diff --git a/code/datums/brain_damage/mild.dm b/code/datums/brain_damage/mild.dm
index f2905f2d01f..3c251d7f88b 100644
--- a/code/datums/brain_damage/mild.dm
+++ b/code/datums/brain_damage/mild.dm
@@ -86,7 +86,7 @@
if(1)
owner.vomit()
if(2,3)
- owner.dizziness += 10
+ owner.adjust_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness)
if(4,5)
owner.add_confusion(10)
owner.blur_eyes(10)
diff --git a/code/datums/brain_damage/phobia.dm b/code/datums/brain_damage/phobia.dm
index 49f8db7ef28..48be78b36c3 100644
--- a/code/datums/brain_damage/phobia.dm
+++ b/code/datums/brain_damage/phobia.dm
@@ -123,7 +123,7 @@
owner.Jitter(5)
owner.blind_eyes(10)
if(4)
- owner.dizziness += 10
+ owner.adjust_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness)
owner.add_confusion(10)
owner.Jitter(10)
owner.adjust_timed_status_effect(20 SECONDS, /datum/status_effect/speech/stutter)
diff --git a/code/datums/brain_damage/severe.dm b/code/datums/brain_damage/severe.dm
index 16c3bb866b9..4cc3fa0f3c4 100644
--- a/code/datums/brain_damage/severe.dm
+++ b/code/datums/brain_damage/severe.dm
@@ -189,12 +189,12 @@
if(2)
if(!high_stress)
to_chat(owner, span_warning("You can't stop shaking..."))
- owner.dizziness += 20
+ owner.adjust_timed_status_effect(40 SECONDS, /datum/status_effect/dizziness)
owner.add_confusion(20)
owner.Jitter(20)
else
to_chat(owner, span_warning("You feel weak and scared! If only you weren't alone..."))
- owner.dizziness += 20
+ owner.adjust_timed_status_effect(40 SECONDS, /datum/status_effect/dizziness)
owner.add_confusion(20)
owner.Jitter(20)
owner.adjustStaminaLoss(50)
diff --git a/code/datums/components/hazard_area.dm b/code/datums/components/hazard_area.dm
index 1e0423ac956..42a988737e1 100644
--- a/code/datums/components/hazard_area.dm
+++ b/code/datums/components/hazard_area.dm
@@ -146,7 +146,6 @@
/// The dedicated status effect for the hazard_area component - use with caution and know what it does!
/datum/status_effect/hazard_area
id = "hazard_area"
- examine_text = "SUBJECTPRONOUN appears to be largely immobilized through unknown means."
status_type = STATUS_EFFECT_UNIQUE
alert_type = /atom/movable/screen/alert/status_effect/hazard_area
@@ -163,6 +162,9 @@
owner.remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/hazard_area, update=TRUE)
owner.remove_actionspeed_modifier(/datum/actionspeed_modifier/status_effect/hazard_area, update=TRUE)
+/datum/status_effect/hazard_area/get_examine_text()
+ return span_notice("[owner.p_they(TRUE)] appear[owner.p_s()] to be largely immobilized through unknown means.")
+
/atom/movable/screen/alert/status_effect/hazard_area
name = "Hazardous Area"
desc = "The area you are currently within is incredibly hazardous to you. Check your surroundings and vacate as soon as possible."
diff --git a/code/datums/components/tackle.dm b/code/datums/components/tackle.dm
index 28991d60341..4e5c6585c03 100644
--- a/code/datums/components/tackle.dm
+++ b/code/datums/components/tackle.dm
@@ -247,10 +247,14 @@
var/attack_mod = 0
// DE-FENSE
- if(target.drunkenness > 60) // drunks are easier to knock off balance
+
+ // Drunks are easier to knock off balance
+ var/target_drunkenness = target.get_drunk_amount()
+ if(target_drunkenness > 60)
defense_mod -= 3
- else if(target.drunkenness > 30)
+ else if(target_drunkenness > 30)
defense_mod -= 1
+
if(HAS_TRAIT(target, TRAIT_CLUMSY))
defense_mod -= 2
if(HAS_TRAIT(target, TRAIT_FAT)) // chonkers are harder to knock over
@@ -291,11 +295,12 @@
// OF-FENSE
var/mob/living/carbon/sacker = parent
-
- if(sacker.drunkenness > 60) // you're far too drunk to hold back!
+ var/sacker_drunkenness = sacker.get_drunk_amount()
+ if(sacker_drunkenness > 60) // you're far too drunk to hold back!
attack_mod += 1
- else if(sacker.drunkenness > 30) // if you're only a bit drunk though, you're just sloppy
+ else if(sacker_drunkenness > 30) // if you're only a bit drunk though, you're just sloppy
attack_mod -= 1
+
if(HAS_TRAIT(sacker, TRAIT_CLUMSY))
attack_mod -= 2
if(HAS_TRAIT(sacker, TRAIT_DWARF))
diff --git a/code/datums/diseases/adrenal_crisis.dm b/code/datums/diseases/adrenal_crisis.dm
index 5fd9a138981..011b76fdda3 100644
--- a/code/datums/diseases/adrenal_crisis.dm
+++ b/code/datums/diseases/adrenal_crisis.dm
@@ -32,7 +32,7 @@
affected_mob.adjust_timed_status_effect(14 SECONDS, /datum/status_effect/speech/slurring/drunk)
if(DT_PROB(7, delta_time))
- affected_mob.Dizzy(10)
+ affected_mob.set_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(DT_PROB(2.5, delta_time))
to_chat(affected_mob, span_warning(pick("You feel pain shoot down your legs!", "You feel like you are going to pass out at any moment.", "You feel really dizzy.")))
diff --git a/code/datums/diseases/advance/symptoms/dizzy.dm b/code/datums/diseases/advance/symptoms/dizzy.dm
index ada4236f823..51145573445 100644
--- a/code/datums/diseases/advance/symptoms/dizzy.dm
+++ b/code/datums/diseases/advance/symptoms/dizzy.dm
@@ -44,7 +44,6 @@
to_chat(M, span_warning("[pick("You feel dizzy.", "Your head spins.")]"))
else
to_chat(M, span_userdanger("A wave of dizziness washes over you!"))
- if(M.dizziness <= 70)
- M.dizziness += 30
+ M.adjust_timed_status_effect(1 MINUTES, /datum/status_effect/dizziness, max_duration = 140 SECONDS)
if(power >= 2)
M.set_timed_status_effect(80 SECONDS, /datum/status_effect/drugginess)
diff --git a/code/datums/diseases/advance/symptoms/sensory.dm b/code/datums/diseases/advance/symptoms/sensory.dm
index a77db168144..22289594112 100644
--- a/code/datums/diseases/advance/symptoms/sensory.dm
+++ b/code/datums/diseases/advance/symptoms/sensory.dm
@@ -43,16 +43,14 @@
if(A.stage >= 3)
- M.dizziness = max(0, M.dizziness - 2)
+ 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)
M.set_confusion(max(0, M.get_confusion() - 2))
if(purge_alcohol)
M.reagents.remove_all_type(/datum/reagent/consumable/ethanol, 3)
- if(ishuman(M))
- var/mob/living/carbon/human/H = M
- H.drunkenness = max(H.drunkenness - 5, 0)
+ M.adjust_drunk_effect(-5)
if(A.stage >= 4)
M.adjust_drowsyness(-2)
diff --git a/code/datums/diseases/tuberculosis.dm b/code/datums/diseases/tuberculosis.dm
index edb45219c84..5f9936efa66 100644
--- a/code/datums/diseases/tuberculosis.dm
+++ b/code/datums/diseases/tuberculosis.dm
@@ -30,7 +30,7 @@
if(4)
if(DT_PROB(1, delta_time))
to_chat(affected_mob, span_userdanger("You see four of everything!"))
- affected_mob.Dizzy(5)
+ affected_mob.set_timed_status_effect(10 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(DT_PROB(1, delta_time))
to_chat(affected_mob, span_danger("You feel a sharp pain from your lower chest!"))
affected_mob.adjustOxyLoss(5, FALSE)
diff --git a/code/datums/quirks/good.dm b/code/datums/quirks/good.dm
index a04f42d8603..9830383f727 100644
--- a/code/datums/quirks/good.dm
+++ b/code/datums/quirks/good.dm
@@ -40,17 +40,16 @@
processing_quirk = TRUE
/datum/quirk/drunkhealing/process(delta_time)
- var/mob/living/carbon/carbon_holder = quirk_holder
- switch(carbon_holder.drunkenness)
+ switch(quirk_holder.get_drunk_amount())
if (6 to 40)
- carbon_holder.adjustBruteLoss(-0.1*delta_time, FALSE)
- carbon_holder.adjustFireLoss(-0.05*delta_time, FALSE)
+ quirk_holder.adjustBruteLoss(-0.1 * delta_time, FALSE)
+ quirk_holder.adjustFireLoss(-0.05 * delta_time)
if (41 to 60)
- carbon_holder.adjustBruteLoss(-0.4*delta_time, FALSE)
- carbon_holder.adjustFireLoss(-0.2*delta_time, FALSE)
+ quirk_holder.adjustBruteLoss(-0.4 * delta_time, FALSE)
+ quirk_holder.adjustFireLoss(-0.2 * delta_time)
if (61 to INFINITY)
- carbon_holder.adjustBruteLoss(-0.8*delta_time, FALSE)
- carbon_holder.adjustFireLoss(-0.4*delta_time, FALSE)
+ quirk_holder.adjustBruteLoss(-0.8 * delta_time, FALSE)
+ quirk_holder.adjustFireLoss(-0.4 * delta_time)
/datum/quirk/empath
name = "Empath"
diff --git a/code/datums/status_effects/_status_effect.dm b/code/datums/status_effects/_status_effect.dm
index 6fd17873519..32ea2eb8153 100644
--- a/code/datums/status_effects/_status_effect.dm
+++ b/code/datums/status_effects/_status_effect.dm
@@ -17,9 +17,6 @@
var/status_type = STATUS_EFFECT_UNIQUE
/// If TRUE, we call [proc/on_remove] when owner is deleted. Otherwise, we call [proc/be_replaced].
var/on_remove_on_mob_delete = FALSE
- /// If defined, this text will appear when the mob is examined
- /// To use he, she etc. use "SUBJECTPRONOUN" and replace it in the examines themselves
- var/examine_text
/// The typepath to the alert thrown by the status effect when created.
/// Status effect "name"s and "description"s are shown to the owner here.
var/alert_type = /atom/movable/screen/alert/status_effect
@@ -93,6 +90,11 @@
/datum/status_effect/proc/on_apply()
return TRUE
+/// Gets and formats examine text associated with our status effect.
+/// Return 'null' to have no examine text appear (default behavior).
+/datum/status_effect/proc/get_examine_text()
+ return null
+
/// Called every tick from process().
/datum/status_effect/proc/tick(delta_time, times_fired)
return
diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm
index bdf6e6861f3..ffc624589f3 100644
--- a/code/datums/status_effects/buffs.dm
+++ b/code/datums/status_effects/buffs.dm
@@ -210,7 +210,6 @@
status_type = STATUS_EFFECT_UNIQUE
duration = -1
tick_interval = 25
- examine_text = "They seem to have an aura of healing and helpfulness about them."
alert_type = null
var/datum/component/aura_healing/aura_healing
@@ -248,6 +247,9 @@
var/datum/atom_hud/med_hud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
med_hud.hide_from(owner)
+/datum/status_effect/hippocratic_oath/get_examine_text()
+ return span_notice("[owner.p_they(TRUE)] seem[owner.p_s()] to have an aura of healing and helpfulness about [owner.p_them()].")
+
/datum/status_effect/hippocratic_oath/tick()
if(owner.stat == DEAD)
if(deathTick < 4)
@@ -316,7 +318,7 @@
/datum/status_effect/good_music/tick()
if(owner.can_hear())
- owner.dizziness = max(0, owner.dizziness - 2)
+ owner.adjust_timed_status_effect(-4 SECONDS, /datum/status_effect/dizziness)
owner.jitteriness = max(0, owner.jitteriness - 2)
owner.set_confusion(max(0, owner.get_confusion() - 1))
SEND_SIGNAL(owner, COMSIG_ADD_MOOD_EVENT, "goodmusic", /datum/mood_event/goodmusic)
@@ -351,7 +353,6 @@
id = "Blessing of Crucible Soul"
status_type = STATUS_EFFECT_REFRESH
duration = 15 SECONDS
- examine_text = "They don't seem to be all here."
alert_type = /atom/movable/screen/alert/status_effect/crucible_soul
var/turf/location
@@ -369,6 +370,9 @@
owner.forceMove(location)
location = null
+/datum/status_effect/crucible_soul/get_examine_text()
+ return span_notice("[owner.p_they(TRUE)] [owner.p_do()]n't seem to be all here.")
+
/datum/status_effect/duskndawn
id = "Blessing of Dusk and Dawn"
status_type = STATUS_EFFECT_REFRESH
diff --git a/code/datums/status_effects/debuffs/debuffs.dm b/code/datums/status_effects/debuffs/debuffs.dm
index 61e27d04c4f..bcb07b3ec1f 100644
--- a/code/datums/status_effects/debuffs/debuffs.dm
+++ b/code/datums/status_effects/debuffs/debuffs.dm
@@ -133,21 +133,6 @@
alert_type = /atom/movable/screen/alert/status_effect/asleep
needs_update_stat = TRUE
tick_interval = 2 SECONDS
- var/mob/living/carbon/carbon_owner
- var/mob/living/carbon/human/human_owner
-
-/datum/status_effect/incapacitating/sleeping/on_creation(mob/living/new_owner)
- . = ..()
- if(.)
- if(iscarbon(owner)) //to avoid repeated istypes
- carbon_owner = owner
- if(ishuman(owner))
- human_owner = owner
-
-/datum/status_effect/incapacitating/sleeping/Destroy()
- carbon_owner = null
- human_owner = null
- return ..()
/datum/status_effect/incapacitating/sleeping/on_apply()
. = ..()
@@ -196,10 +181,14 @@
owner.adjustFireLoss(healing)
owner.adjustToxLoss(healing * 0.5, TRUE, TRUE)
owner.adjustStaminaLoss(healing)
- if(human_owner?.drunkenness)
- human_owner.drunkenness *= 0.997 //reduce drunkenness by 0.3% per tick, 6% per 2 seconds
- if(carbon_owner)
+
+ // Drunkenness gets reduced by 0.3% per tick (6% per 2 seconds)
+ owner.set_drunk_effect(owner.get_drunk_amount() * 0.997)
+
+ if(iscarbon(owner))
+ var/mob/living/carbon/carbon_owner = owner
carbon_owner.handle_dreams()
+
if(prob(2) && owner.health > owner.crit_threshold)
owner.emote("snore")
@@ -274,7 +263,6 @@
//OTHER DEBUFFS
/datum/status_effect/strandling //get it, strand as in durathread strand + strangling = strandling hahahahahahahahahahhahahaha i want to die
id = "strandling"
- examine_text = "SUBJECTPRONOUN seems to be being choked by some durathread strands. You may be able to cut them off."
status_type = STATUS_EFFECT_UNIQUE
alert_type = /atom/movable/screen/alert/status_effect/strandling
@@ -286,6 +274,9 @@
REMOVE_TRAIT(owner, TRAIT_MAGIC_CHOKE, STATUS_EFFECT_TRAIT)
return ..()
+/datum/status_effect/strandling/get_examine_text()
+ return span_warning("[owner.p_they(TRUE)] seem[owner.p_s()] to be being choked by some durathread strands. You may be able to cut them off.")
+
/atom/movable/screen/alert/status_effect/strandling
name = "Choking strand"
desc = "A magical strand of Durathread is wrapped around your neck, preventing you from breathing! Click this icon to remove the strand."
@@ -791,7 +782,6 @@
status_type = STATUS_EFFECT_UNIQUE
duration = 300
tick_interval = 10
- examine_text = span_warning("SUBJECTPRONOUN seems slow and unfocused.")
var/stun = TRUE
alert_type = /atom/movable/screen/alert/status_effect/trance
@@ -802,8 +792,8 @@
/datum/status_effect/trance/tick()
if(stun)
- owner.Stun(60, TRUE)
- owner.dizziness = 20
+ owner.Stun(6 SECONDS, TRUE)
+ owner.set_timed_status_effect(40 SECONDS, /datum/status_effect/dizziness)
/datum/status_effect/trance/on_apply()
if(!iscarbon(owner))
@@ -823,10 +813,13 @@
/datum/status_effect/trance/on_remove()
UnregisterSignal(owner, COMSIG_MOVABLE_HEAR)
REMOVE_TRAIT(owner, TRAIT_MUTE, STATUS_EFFECT_TRAIT)
- owner.dizziness = 0
+ owner.remove_status_effect(/datum/status_effect/dizziness)
owner.remove_client_colour(/datum/client_colour/monochrome/trance)
to_chat(owner, span_warning("You snap out of your trance!"))
+/datum/status_effect/trance/get_examine_text()
+ return span_warning("[owner.p_they(TRUE)] seem[owner.p_s()] slow and unfocused.")
+
/datum/status_effect/trance/proc/hypnotize(datum/source, list/hearing_args)
SIGNAL_HANDLER
@@ -1036,7 +1029,7 @@
if(0 to 10)
human_owner.vomit()
if(20 to 30)
- human_owner.Dizzy(50)
+ human_owner.set_timed_status_effect(100 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
human_owner.Jitter(50)
if(30 to 40)
human_owner.adjustOrganLoss(ORGAN_SLOT_LIVER, 5)
@@ -1120,7 +1113,6 @@
status_type = STATUS_EFFECT_REFRESH
alert_type = /atom/movable/screen/alert/status_effect/ants
duration = 2 MINUTES //Keeping the normal timer makes sure people can't somehow dump 300+ ants on someone at once so they stay there for like 30 minutes. Max w/ 1 dump is 57.6 brute.
- examine_text = span_warning("SUBJECTPRONOUN is covered in ants!")
processing_speed = STATUS_EFFECT_NORMAL_PROCESS
/// Will act as the main timer as well as changing how much damage the ants do.
var/ants_remaining = 0
@@ -1164,6 +1156,9 @@
owner.remove_status_effect(/datum/status_effect/ants)
return COMPONENT_CLEANED
+/datum/status_effect/ants/get_examine_text()
+ return span_warning("[owner.p_they(TRUE)] [owner.p_are()] covered in ants!")
+
/datum/status_effect/ants/tick()
var/mob/living/carbon/human/victim = owner
victim.adjustBruteLoss(max(0.1, round((ants_remaining * 0.004),0.1))) //Scales with # of ants (lowers with time). Roughly 10 brute over 50 seconds.
diff --git a/code/datums/status_effects/debuffs/dizziness.dm b/code/datums/status_effects/debuffs/dizziness.dm
new file mode 100644
index 00000000000..b824bd9c192
--- /dev/null
+++ b/code/datums/status_effects/debuffs/dizziness.dm
@@ -0,0 +1,75 @@
+/datum/status_effect/dizziness
+ id = "dizziness"
+ tick_interval = 2 SECONDS
+ alert_type = null
+
+/datum/status_effect/dizziness/on_creation(mob/living/new_owner, duration = 10 SECONDS)
+ src.duration = duration
+ return ..()
+
+/datum/status_effect/dizziness/on_apply()
+ RegisterSignal(owner, list(COMSIG_LIVING_POST_FULLY_HEAL, COMSIG_LIVING_DEATH), .proc/clear_dizziness)
+ return TRUE
+
+/datum/status_effect/dizziness/on_remove()
+ UnregisterSignal(owner, list(COMSIG_LIVING_POST_FULLY_HEAL, COMSIG_LIVING_DEATH))
+ // In case our client's offset is somewhere wacky from the dizziness effect
+ owner.client?.pixel_x = initial(owner.client?.pixel_x)
+ owner.client?.pixel_y = initial(owner.client?.pixel_y)
+
+/// Signal proc that self deletes our dizziness effect
+/datum/status_effect/dizziness/proc/clear_dizziness(datum/source)
+ SIGNAL_HANDLER
+
+ qdel(src)
+
+/datum/status_effect/dizziness/tick()
+ // How much time is left, in seconds
+ var/amount = (duration - world.time) / 10
+ if(amount <= 0)
+ return
+
+ // How strong the dizziness effect is on us.
+ // If we're resting, the effect is 5x as strong, but also decays 5x fast.
+ // Meaning effectively, 1 tick is actually dizziness_strength ticks of duration
+ var/dizziness_strength = owner.resting ? 5 : 1
+ var/time_between_ticks = initial(tick_interval)
+
+ // How much time will be left, in seconds, next tick
+ var/next_amount = max((amount - (dizziness_strength * time_between_ticks * 0.1)), 0)
+
+ // If we have a dizziness strength > 1, we will subtract ticks off of the total duration
+ duration -= ((dizziness_strength - 1) * time_between_ticks)
+
+ // Now we can do the actual dizzy effects.
+ // Don't bother animating if they're clientless.
+ if(!owner.client)
+ return
+
+ // Want to be able to offset things by the time the animation should be "playing" at
+ var/time = world.time
+ var/delay = 0
+ var/pixel_x_diff = 0
+ var/pixel_y_diff = 0
+
+ // This shit is annoying at high strengthvar/pixel_x_diff = 0
+ var/amplitude = amount * (sin(amount * (time)) + 1)
+ var/x_diff = amplitude * sin(amount * time)
+ var/y_diff = amplitude * cos(amount * time)
+ pixel_x_diff += x_diff
+ pixel_y_diff += y_diff
+ // Brief explanation. We're basically snapping between different pixel_x/ys instantly, with delays between
+ // Doing this with relative changes. This way we don't override any existing pixel_x/y values
+ // We use EASE_OUT here for similar reasons, we want to act at the end of the delay, not at its start
+ // Relative animations are weird, so we do actually need this
+ animate(owner.client, pixel_x = x_diff, pixel_y = y_diff, 3, easing = JUMP_EASING | EASE_OUT, flags = ANIMATION_RELATIVE)
+ delay += 0.3 SECONDS // This counts as a 0.3 second wait, so we need to shift the sine wave by that much
+
+ x_diff = amplitude * sin(next_amount * (time + delay))
+ y_diff = amplitude * cos(next_amount * (time + delay))
+ pixel_x_diff += x_diff
+ pixel_y_diff += y_diff
+ animate(pixel_x = x_diff, pixel_y = y_diff, 3, easing = JUMP_EASING | EASE_OUT, flags = ANIMATION_RELATIVE)
+
+ // Now we reset back to our old pixel_x/y, since these animates are relative
+ animate(pixel_x = -pixel_x_diff, pixel_y = -pixel_y_diff, 3, easing = JUMP_EASING | EASE_OUT, flags = ANIMATION_RELATIVE)
diff --git a/code/datums/status_effects/debuffs/drunk.dm b/code/datums/status_effects/debuffs/drunk.dm
new file mode 100644
index 00000000000..206fa31755a
--- /dev/null
+++ b/code/datums/status_effects/debuffs/drunk.dm
@@ -0,0 +1,222 @@
+// Defines for the ballmer peak.
+#define BALLMER_PEAK_LOW_END 12.9
+#define BALLMER_PEAK_HIGH_END 13.8
+#define BALLMER_PEAK_WINDOWS_ME 26
+
+/// The threshld which determine if someone is tipsy vs drunk
+#define TIPSY_THRESHOLD 6
+
+/**
+ * The drunk status effect.
+ * Slowly decreases in drunk_value over time, causing effects based on that value.
+ */
+/datum/status_effect/inebriated
+ id = "drunk"
+ tick_interval = 2 SECONDS
+ status_type = STATUS_EFFECT_REPLACE
+ /// The level of drunkness we are currently at.
+ var/drunk_value = 0
+
+/datum/status_effect/inebriated/on_creation(mob/living/new_owner, drunk_value = 0)
+ . = ..()
+ set_drunk_value(drunk_value)
+
+/datum/status_effect/inebriated/on_apply()
+ RegisterSignal(owner, COMSIG_LIVING_POST_FULLY_HEAL, .proc/clear_drunkenness)
+ return TRUE
+
+/datum/status_effect/inebriated/on_remove()
+ UnregisterSignal(owner, COMSIG_LIVING_POST_FULLY_HEAL)
+
+/datum/status_effect/inebriated/get_examine_text()
+ // Dead people don't look drunk
+ if(owner.stat == DEAD || HAS_TRAIT(owner, TRAIT_FAKEDEATH))
+ return null
+
+ // Having your face covered conceals your drunkness
+ if(iscarbon(owner))
+ var/mob/living/carbon/carbon_owner = owner
+ if(carbon_owner.wear_mask?.flags_inv & HIDEFACE)
+ return null
+ if(carbon_owner.head?.flags_inv & HIDEFACE)
+ return null
+
+ // .01s are used in case the drunk value ends up to be a small decimal.
+ switch(drunk_value)
+ if(11 to 21)
+ return span_warning("[owner.p_they(TRUE)] [owner.p_are()] slightly flushed.")
+ if(21.01 to 41)
+ return span_warning("[owner.p_they(TRUE)] [owner.p_are()] flushed.")
+ if(41.01 to 51)
+ return span_warning("[owner.p_they(TRUE)] [owner.p_are()] quite flushed and [owner.p_their()] breath smells of alcohol.")
+ if(51.01 to 61)
+ return span_warning("[owner.p_they(TRUE)] [owner.p_are()] very flushed and [owner.p_their()] movements jerky, with breath reeking of alcohol.")
+ if(61.01 to 91)
+ return span_warning("[owner.p_they(TRUE)] look[owner.p_s()] like a drunken mess.")
+ if(91.01 to INFINITY)
+ return span_warning("[owner.p_they(TRUE)] [owner.p_are()] a shitfaced, slobbering wreck.")
+
+ return null
+
+/// Removes all of our drunkenness (self-deletes) on signal.
+/datum/status_effect/inebriated/proc/clear_drunkenness(mob/living/source)
+ SIGNAL_HANDLER
+
+ qdel(src)
+
+/// Sets the drunk value to set_to, deleting if the value drops to 0 or lower
+/datum/status_effect/inebriated/proc/set_drunk_value(set_to)
+ if(!isnum(set_to))
+ CRASH("[type] - invalid value passed to set_drunk_value. (Got: [set_to])")
+
+ drunk_value = set_to
+ if(drunk_value <= 0)
+ qdel(src)
+
+/datum/status_effect/inebriated/tick()
+ // Drunk value does not decrease while dead
+ if(owner.stat == DEAD)
+ return
+
+ // Every tick, the drunk value decrases by
+ // 4% the current drunk_value + 0.01
+ // (until it reaches 0 and terminates)
+ set_drunk_value(drunk_value - (0.01 + drunk_value * 0.04))
+ if(QDELETED(src))
+ return
+
+ on_tick_effects()
+
+/// Side effects done by this level of drunkness on tick.
+/datum/status_effect/inebriated/proc/on_tick_effects()
+ return
+
+/**
+ * Stage 1 of drunk, applied at drunk values between 0 and 6.
+ * Basically is the "drunk but no side effects" stage.
+ */
+/datum/status_effect/inebriated/tipsy
+ alert_type = null
+
+/datum/status_effect/inebriated/tipsy/set_drunk_value(set_to)
+ . = ..()
+ if(QDELETED(src))
+ return
+
+ // Become fully drunk at over than 6 drunk value
+ if(drunk_value >= TIPSY_THRESHOLD)
+ owner.apply_status_effect(/datum/status_effect/inebriated/drunk, drunk_value)
+
+/**
+ * Stage 2 of being drunk, applied at drunk values between 6 and onward.
+ * Has all the main side effects of being drunk, scaling up as they get more drunk.
+ */
+/datum/status_effect/inebriated/drunk
+ alert_type = /atom/movable/screen/alert/status_effect/drunk
+
+/datum/status_effect/inebriated/drunk/on_apply()
+ . = ..()
+ owner.sound_environment_override = SOUND_ENVIRONMENT_PSYCHOTIC
+ SEND_SIGNAL(owner, COMSIG_ADD_MOOD_EVENT, id, /datum/mood_event/drunk)
+
+/datum/status_effect/inebriated/drunk/on_remove()
+ clear_effects()
+ return ..()
+
+// Going from "drunk" to "tipsy" should remove effects like on_remove
+/datum/status_effect/inebriated/drunk/be_replaced()
+ clear_effects()
+ return ..()
+
+/// Clears any side effects we set due to being drunk.
+/datum/status_effect/inebriated/drunk/proc/clear_effects()
+ SEND_SIGNAL(owner, COMSIG_CLEAR_MOOD_EVENT, id)
+
+ if(owner.sound_environment_override == SOUND_ENVIRONMENT_PSYCHOTIC)
+ owner.sound_environment_override = SOUND_ENVIRONMENT_NONE
+
+/datum/status_effect/inebriated/drunk/set_drunk_value(set_to)
+ . = ..()
+ 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)
+
+/datum/status_effect/inebriated/drunk/on_tick_effects()
+ // 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.
+ if(HAS_TRAIT(owner, TRAIT_BALLMER_SCIENTIST) && prob(5))
+ if(drunk_value >= BALLMER_PEAK_LOW_END && drunk_value <= BALLMER_PEAK_HIGH_END)
+ owner.say(pick_list_replacements(VISTA_FILE, "ballmer_good_msg"), forced = "ballmer")
+
+ 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)
+
+ // And drunk people will always lose jitteriness
+ owner.jitteriness = max(owner.jitteriness - 3, 0)
+
+ // 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))
+ owner.add_confusion(2)
+ owner.set_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
+
+ // Over 51, we have a 3% chance to gain a lot of confusion and vomit, and we will always have 50 seconds of dizziness
+ if(drunk_value >= 51)
+ owner.set_timed_status_effect(50 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
+ if(prob(3))
+ owner.add_confusion(15)
+ if(iscarbon(owner))
+ var/mob/living/carbon/carbon_owner = owner
+ carbon_owner.vomit() // Vomiting clears toxloss - consider this a blessing
+
+ // Over 71, we will constantly have blurry eyes
+ if(drunk_value >= 71)
+ owner.blur_eyes(5)
+
+ // Over 81, we will gain constant toxloss
+ if(drunk_value >= 81)
+ 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))
+ // 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)
+
+ // And finally, over 100 - let's be honest, you shouldn't be alive by now.
+ if(drunk_value >= 101)
+ owner.adjustToxLoss(2)
+
+/// Status effect for being fully drunk (not tipsy).
+/atom/movable/screen/alert/status_effect/drunk
+ name = "Drunk"
+ desc = "All that alcohol you've been drinking is impairing your speech, \
+ motor skills, and mental cognition. Make sure to act like it."
+ icon_state = "drunk"
+
+#undef BALLMER_PEAK_LOW_END
+#undef BALLMER_PEAK_HIGH_END
+#undef BALLMER_PEAK_WINDOWS_ME
+
+#undef TIPSY_THRESHOLD
diff --git a/code/datums/status_effects/song_effects.dm b/code/datums/status_effects/song_effects.dm
index 7c6afd34bd2..baf646a2c76 100644
--- a/code/datums/status_effects/song_effects.dm
+++ b/code/datums/status_effects/song_effects.dm
@@ -21,7 +21,6 @@
id = "antimagic"
status_type = STATUS_EFFECT_REFRESH
duration = 10 SECONDS
- examine_text = "They seem to be covered in a dull, grey aura."
aura_desc = "dull"
/datum/status_effect/song/antimagic/on_apply()
@@ -31,3 +30,7 @@
/datum/status_effect/song/antimagic/on_remove()
REMOVE_TRAIT(owner, TRAIT_ANTIMAGIC, MAGIC_TRAIT)
+ return ..()
+
+/datum/status_effect/song/antimagic/get_examine_text()
+ return span_notice("[owner.p_they(TRUE)] seem[owner.p_s()] to be covered in a dull, grey aura.")
diff --git a/code/datums/wounds/bones.dm b/code/datums/wounds/bones.dm
index 14e60d23848..2c2f03e2935 100644
--- a/code/datums/wounds/bones.dm
+++ b/code/datums/wounds/bones.dm
@@ -392,7 +392,7 @@
to_chat(victim, span_userdanger("[user] finishes applying [I] to your [limb.plaintext_zone], and you can feel the bones exploding with pain as they begin melting and reforming!"))
else
var/painkiller_bonus = 0
- if(victim.drunkenness > 10)
+ if(victim.get_drunk_amount() > 10)
painkiller_bonus += 10
if(victim.reagents.has_reagent(/datum/reagent/medicine/morphine))
painkiller_bonus += 20
diff --git a/code/game/machinery/hypnochair.dm b/code/game/machinery/hypnochair.dm
index 9ba728cf48a..fec52064b16 100644
--- a/code/game/machinery/hypnochair.dm
+++ b/code/game/machinery/hypnochair.dm
@@ -155,17 +155,17 @@
switch(time_diff)
if(0 to 100)
victim.add_confusion(10)
- victim.Dizzy(100)
+ victim.set_timed_status_effect(200 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
victim.blur_eyes(5)
if(101 to 200)
victim.add_confusion(15)
- victim.Dizzy(200)
+ victim.set_timed_status_effect(400 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
victim.blur_eyes(10)
if(prob(25))
victim.apply_status_effect(/datum/status_effect/trance, rand(50,150), FALSE)
if(201 to INFINITY)
victim.add_confusion(20)
- victim.Dizzy(300)
+ victim.set_timed_status_effect(600 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
victim.blur_eyes(15)
if(prob(65))
victim.apply_status_effect(/datum/status_effect/trance, rand(50,150), FALSE)
diff --git a/code/game/objects/effects/landmarks.dm b/code/game/objects/effects/landmarks.dm
index 68ca559042c..b17eb252096 100644
--- a/code/game/objects/effects/landmarks.dm
+++ b/code/game/objects/effects/landmarks.dm
@@ -504,7 +504,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/landmark/start/new_player)
if(prob(50))
spawned_carbon.adjust_timed_status_effect(rand(30 SECONDS, 40 SECONDS), /datum/status_effect/drugginess)
else
- spawned_carbon.drunkenness += rand(15, 25)
+ spawned_carbon.adjust_drunk_effect(rand(15, 25))
spawned_carbon.adjust_disgust(rand(5, 55)) //How hungover are you?
if(spawned_carbon.head)
return
diff --git a/code/game/objects/items/grenades/hypno.dm b/code/game/objects/items/grenades/hypno.dm
index 21135f06883..d09c79eb251 100644
--- a/code/game/objects/items/grenades/hypno.dm
+++ b/code/game/objects/items/grenades/hypno.dm
@@ -66,5 +66,5 @@
else
to_chat(target, span_hypnophrase("The light is so pretty..."))
target.add_confusion(min(target.get_confusion() + 10, 20))
- target.dizziness += min(target.dizziness + 10, 20)
target.adjust_drowsyness(min(target.drowsyness + 10, 20))
+ target.adjust_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness, max_duration = 40 SECONDS)
diff --git a/code/game/objects/items/plushes.dm b/code/game/objects/items/plushes.dm
index c6d8880ca1c..555fb0db618 100644
--- a/code/game/objects/items/plushes.dm
+++ b/code/game/objects/items/plushes.dm
@@ -129,10 +129,8 @@
stuffed = FALSE
else
to_chat(user, span_notice("What a fool you are. [src] is a god, how can you kill a god? What a grand and intoxicating innocence."))
- if(iscarbon(user))
- var/mob/living/carbon/C = user
- if(C.drunkenness < 50)
- C.drunkenness = min(C.drunkenness + 20, 50)
+ user.adjust_drunk_effect(20, up_to = 50)
+
var/turf/current_location = get_turf(user)
var/area/current_area = current_location.loc //copied from hand tele code
if(current_location && current_area && (current_area.area_flags & NOTELEPORT))
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index d8dedb32499..619c3803b5d 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -15,17 +15,6 @@
SSblackbox.record_feedback("tally", "admin_verb", 1, "Toggle Debug Two") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
-
-
-/* 21st Sept 2010
-Updated by Skie -- Still not perfect but better!
-Stuff you can't do:
-Call proc /mob/proc/Dizzy() for some player
-Because if you select a player mob as owner it tries to do the proc for
-/mob/living/carbon/human/ instead. And that gives a run-time error.
-But you can call procs that are of type /mob/living/carbon/human/proc/ for that player.
-*/
-
/client/proc/Cell()
set category = "Debug"
set name = "Air Status in Location"
diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm
index 77d5eae5282..e90c43ecd56 100644
--- a/code/modules/antagonists/cult/cult_items.dm
+++ b/code/modules/antagonists/cult/cult_items.dm
@@ -466,7 +466,7 @@ Striking a noncultist, however, will tear their flesh."}
to_chat(user, span_cultlarge("\"I wouldn't advise that.\""))
to_chat(user, span_warning("An overwhelming sense of nausea overpowers you!"))
user.dropItemToGround(src, TRUE)
- user.Dizzy(30)
+ user.set_timed_status_effect(1 MINUTES, /datum/status_effect/dizziness, only_if_higher = TRUE)
user.Paralyze(100)
/obj/item/clothing/suit/hooded/cultrobes/berserker
@@ -488,7 +488,7 @@ Striking a noncultist, however, will tear their flesh."}
to_chat(user, span_cultlarge("\"I wouldn't advise that.\""))
to_chat(user, span_warning("An overwhelming sense of nausea overpowers you!"))
user.dropItemToGround(src, TRUE)
- user.Dizzy(30)
+ user.set_timed_status_effect(1 MINUTES, /datum/status_effect/dizziness, only_if_higher = TRUE)
user.Paralyze(100)
/obj/item/clothing/glasses/hud/health/night/cultblind
@@ -503,7 +503,7 @@ Striking a noncultist, however, will tear their flesh."}
if(user.stat != DEAD && !IS_CULTIST(user) && slot == ITEM_SLOT_EYES)
to_chat(user, span_cultlarge("\"You want to be blind, do you?\""))
user.dropItemToGround(src, TRUE)
- user.Dizzy(30)
+ user.set_timed_status_effect(1 MINUTES, /datum/status_effect/dizziness, only_if_higher = TRUE)
user.Paralyze(100)
user.blind_eyes(30)
@@ -1077,12 +1077,12 @@ Striking a noncultist, however, will tear their flesh."}
if(target.can_block_magic() || IS_CULTIST(target))
target.visible_message(span_warning("[src] bounces off of [target], as if repelled by an unseen force!"))
- return
+ return
if(IS_CULTIST(target) && target.put_in_active_hand(src))
playsound(src, 'sound/weapons/throwtap.ogg', 50)
target.visible_message(span_warning("[target] catches [src] out of the air!"))
return
- if(!..())
+ if(!..())
target.Paralyze(30)
if(D?.thrower)
for(var/mob/living/Next in orange(2, T))
diff --git a/code/modules/antagonists/heretic/items/madness_mask.dm b/code/modules/antagonists/heretic/items/madness_mask.dm
index 694efa69e65..215a5014e8c 100644
--- a/code/modules/antagonists/heretic/items/madness_mask.dm
+++ b/code/modules/antagonists/heretic/items/madness_mask.dm
@@ -71,4 +71,4 @@
human_in_range.adjustStaminaLoss(10)
if(DT_PROB(25, delta_time))
- human_in_range.Dizzy(5)
+ human_in_range.set_timed_status_effect(10 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
diff --git a/code/modules/antagonists/heretic/knowledge/sacrifice_knowledge/sacrifice_buff.dm b/code/modules/antagonists/heretic/knowledge/sacrifice_knowledge/sacrifice_buff.dm
index 4c9ee18fa3d..4b4ffd8d712 100644
--- a/code/modules/antagonists/heretic/knowledge/sacrifice_knowledge/sacrifice_buff.dm
+++ b/code/modules/antagonists/heretic/knowledge/sacrifice_knowledge/sacrifice_buff.dm
@@ -46,7 +46,7 @@
if(owner.health > owner.crit_threshold && prob(4))
owner.Jitter(10)
- owner.Dizzy(5)
+ owner.set_timed_status_effect(10 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
owner.hallucination = min(owner.hallucination + 3, 24)
if(prob(2))
diff --git a/code/modules/antagonists/heretic/knowledge/sacrifice_knowledge/sacrifice_knowledge.dm b/code/modules/antagonists/heretic/knowledge/sacrifice_knowledge/sacrifice_knowledge.dm
index 65d1e75a3b3..56dca4e5c7e 100644
--- a/code/modules/antagonists/heretic/knowledge/sacrifice_knowledge/sacrifice_knowledge.dm
+++ b/code/modules/antagonists/heretic/knowledge/sacrifice_knowledge/sacrifice_knowledge.dm
@@ -312,7 +312,7 @@
sac_target.flash_act()
sac_target.blur_eyes(15)
sac_target.Jitter(10)
- sac_target.Dizzy(10)
+ sac_target.set_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
sac_target.hallucination += 12
sac_target.emote("scream")
@@ -434,7 +434,7 @@
sac_target.add_confusion(60)
sac_target.Jitter(60)
sac_target.blur_eyes(50)
- sac_target.Dizzy(30)
+ sac_target.set_timed_status_effect(1 MINUTES, /datum/status_effect/dizziness, only_if_higher = TRUE)
sac_target.AdjustKnockdown(80)
sac_target.adjustStaminaLoss(120)
diff --git a/code/modules/antagonists/heretic/structures/carving_knife.dm b/code/modules/antagonists/heretic/structures/carving_knife.dm
index 0d5bf3f08d7..19aa19bf342 100644
--- a/code/modules/antagonists/heretic/structures/carving_knife.dm
+++ b/code/modules/antagonists/heretic/structures/carving_knife.dm
@@ -242,7 +242,7 @@
carbon_victim.adjust_timed_status_effect(1 MINUTES, /datum/status_effect/speech/stutter)
carbon_victim.add_confusion(5)
carbon_victim.Jitter(10)
- carbon_victim.Dizzy(20)
+ carbon_victim.set_timed_status_effect(40 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
carbon_victim.blind_eyes(2)
SEND_SIGNAL(carbon_victim, COMSIG_ADD_MOOD_EVENT, "gates_of_mansus", /datum/mood_event/gates_of_mansus)
playsound(src, 'sound/magic/blind.ogg', 75, TRUE)
diff --git a/code/modules/antagonists/wizard/equipment/soulstone.dm b/code/modules/antagonists/wizard/equipment/soulstone.dm
index 886254590b0..da6a503fb62 100644
--- a/code/modules/antagonists/wizard/equipment/soulstone.dm
+++ b/code/modules/antagonists/wizard/equipment/soulstone.dm
@@ -269,7 +269,9 @@
var/obj/item/soulstone/SS = O
if(!IS_CULTIST(user) && !IS_WIZARD(user) && !SS.theme == THEME_HOLY)
to_chat(user, span_danger("An overwhelming feeling of dread comes over you as you attempt to place [SS] into the shell. It would be wise to be rid of this quickly."))
- user.Dizzy(30)
+ if(isliving(user))
+ var/mob/living/living_user = user
+ living_user.set_timed_status_effect(1 MINUTES, /datum/status_effect/dizziness, only_if_higher = TRUE)
return
if(SS.theme == THEME_HOLY && IS_CULTIST(user))
SS.hot_potato(user)
diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm
index 03da7f1710d..f9e9cfc0451 100644
--- a/code/modules/assembly/flash.dm
+++ b/code/modules/assembly/flash.dm
@@ -393,7 +393,7 @@
if(!hypnosis)
to_chat(M, span_hypnophrase("The light makes you feel oddly relaxed..."))
M.add_confusion(min(M.get_confusion() + 10, 20))
- M.dizziness += min(M.dizziness + 10, 20)
+ M.adjust_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness, max_duration = 40 SECONDS)
M.adjust_drowsyness(min(M.drowsyness+10, 20))
M.apply_status_effect(/datum/status_effect/pacify, 100)
else
@@ -407,7 +407,7 @@
else if(M.flash_act())
to_chat(M, span_notice("Such a pretty light..."))
M.add_confusion(min(M.get_confusion() + 4, 20))
- M.dizziness += min(M.dizziness + 4, 20)
+ M.adjust_timed_status_effect(8 SECONDS, /datum/status_effect/dizziness, max_duration = 40 SECONDS)
M.adjust_drowsyness(min(M.drowsyness+4, 20))
M.apply_status_effect(/datum/status_effect/pacify, 40)
diff --git a/code/modules/jobs/job_types/research_director.dm b/code/modules/jobs/job_types/research_director.dm
index 87c0c058f28..36dc023b9ff 100644
--- a/code/modules/jobs/job_types/research_director.dm
+++ b/code/modules/jobs/job_types/research_director.dm
@@ -28,7 +28,7 @@
paycheck = PAYCHECK_COMMAND
paycheck_department = ACCOUNT_SCI
- liver_traits = list(TRAIT_ROYAL_METABOLISM)
+ liver_traits = list(TRAIT_ROYAL_METABOLISM, TRAIT_BALLMER_SCIENTIST)
display_order = JOB_DISPLAY_ORDER_RESEARCH_DIRECTOR
bounty_types = CIV_JOB_SCI
diff --git a/code/modules/jobs/job_types/scientist.dm b/code/modules/jobs/job_types/scientist.dm
index ce2846e831c..99b62de0fa1 100644
--- a/code/modules/jobs/job_types/scientist.dm
+++ b/code/modules/jobs/job_types/scientist.dm
@@ -17,6 +17,8 @@
paycheck = PAYCHECK_CREW
paycheck_department = ACCOUNT_SCI
+ liver_traits = list(TRAIT_BALLMER_SCIENTIST)
+
display_order = JOB_DISPLAY_ORDER_SCIENTIST
bounty_types = CIV_JOB_SCI
departments_list = list(
diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm
index d7b77a4f98d..4cc3fb17cb9 100644
--- a/code/modules/mob/emote.dm
+++ b/code/modules/mob/emote.dm
@@ -5,7 +5,7 @@
///How often a carbon becomes penalized
#define BEYBLADE_DIZZINESS_PROBABILITY 20
///How long the screenshake lasts
-#define BEYBLADE_DIZZINESS_VALUE 10
+#define BEYBLADE_DIZZINESS_DURATION 20 SECONDS
///How much confusion a carbon gets when penalized
#define BEYBLADE_CONFUSION_INCREMENT 10
///A max for how penalized a carbon will be for beyblading
@@ -121,13 +121,13 @@
return
if(prob(BEYBLADE_DIZZINESS_PROBABILITY))
to_chat(user, span_warning("You feel woozy from spinning."))
- user.Dizzy(BEYBLADE_DIZZINESS_VALUE)
+ user.set_timed_status_effect(BEYBLADE_DIZZINESS_DURATION, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(current_confusion < BEYBLADE_CONFUSION_LIMIT)
user.add_confusion(BEYBLADE_CONFUSION_INCREMENT)
#undef BEYBLADE_PUKE_THRESHOLD
#undef BEYBLADE_PUKE_NUTRIENT_LOSS
#undef BEYBLADE_DIZZINESS_PROBABILITY
-#undef BEYBLADE_DIZZINESS_VALUE
+#undef BEYBLADE_DIZZINESS_DURATION
#undef BEYBLADE_CONFUSION_INCREMENT
#undef BEYBLADE_CONFUSION_LIMIT
diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm
index 852546c52e3..4e2e483fc60 100644
--- a/code/modules/mob/living/carbon/carbon_defines.dm
+++ b/code/modules/mob/living/carbon/carbon_defines.dm
@@ -86,8 +86,6 @@
var/next_hallucination = 0
var/damageoverlaytemp = 0
- ///Overall drunkenness
- var/drunkenness = 0
///used to halt stamina regen temporarily
var/stam_regen_start_time = 0
diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm
index 20bbec0665c..22d20a402ca 100644
--- a/code/modules/mob/living/carbon/human/death.dm
+++ b/code/modules/mob/living/carbon/human/death.dm
@@ -27,7 +27,6 @@ GLOBAL_LIST_EMPTY(dead_players_during_shift)
. = ..()
- dizziness = 0
jitteriness = 0
if(client && !suiciding && !(client in GLOB.dead_players_during_shift))
GLOB.dead_players_during_shift += client
diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm
index 79bccec42d2..3060250c9e6 100644
--- a/code/modules/mob/living/carbon/human/examine.dm
+++ b/code/modules/mob/living/carbon/human/examine.dm
@@ -134,7 +134,7 @@
. += EXAMINE_SECTION_BREAK // SKYRAT EDIT ADDITION - hr sections
//Status effects
- var/list/status_examines = status_effect_examines()
+ var/list/status_examines = get_status_effect_examinations()
if (length(status_examines))
. += status_examines
@@ -340,21 +340,6 @@
msg += "[t_He] [t_is]n't responding to anything around [t_him] and seem[p_s()] to be asleep.\n"
if(!appears_dead)
- if(drunkenness && !skipface) //Drunkenness
- switch(drunkenness)
- if(11 to 21)
- msg += "[t_He] [t_is] slightly flushed.\n"
- if(21.01 to 41) //.01s are used in case drunkenness ends up to be a small decimal
- msg += "[t_He] [t_is] flushed.\n"
- if(41.01 to 51)
- msg += "[t_He] [t_is] quite flushed and [t_his] breath smells of alcohol.\n"
- if(51.01 to 61)
- msg += "[t_He] [t_is] very flushed and [t_his] movements jerky, with breath reeking of alcohol.\n"
- if(61.01 to 91)
- msg += "[t_He] look[p_s()] like a drunken mess.\n"
- if(91.01 to INFINITY)
- msg += "[t_He] [t_is] a shitfaced, slobbering wreck.\n"
-
if(src != user)
if(HAS_TRAIT(user, TRAIT_EMPATH))
if (combat_mode)
@@ -528,18 +513,23 @@
//. += "*---------*" SKYRAT EDIT REMOVAL
SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .)
-/mob/living/proc/status_effect_examines(pronoun_replacement) //You can include this in any mob's examine() to show the examine texts of status effects!
- var/list/dat = list()
- if(!pronoun_replacement)
- pronoun_replacement = p_they(TRUE)
- for(var/V in status_effects)
- var/datum/status_effect/E = V
- if(E.examine_text)
- var/new_text = replacetext(E.examine_text, "SUBJECTPRONOUN", pronoun_replacement)
- new_text = replacetext(new_text, "[pronoun_replacement] is", "[pronoun_replacement] [p_are()]") //To make sure something become "They are" or "She is", not "They are" and "She are"
- dat += "[new_text]\n" //dat.Join("\n") doesn't work here, for some reason
- if(dat.len)
- return dat.Join()
+/**
+ * Shows any and all examine text related to any status effects the user has.
+ */
+/mob/living/proc/get_status_effect_examinations()
+ var/list/examine_list = list()
+
+ for(var/datum/status_effect/effect as anything in status_effects)
+ var/effect_text = effect.get_examine_text()
+ if(!effect_text)
+ continue
+
+ examine_list += effect_text
+
+ if(!length(examine_list))
+ return
+
+ return examine_list.Join("\n")
/mob/living/carbon/human/examine_more(mob/user)
. = ..()
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 557ebd59a1d..fc3aca51c4d 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -801,7 +801,6 @@
regenerate_organs()
remove_all_embedded_objects()
set_heartattack(FALSE)
- drunkenness = 0
for(var/datum/mutation/human/HM in dna.mutations)
if(HM.quality != POSITIVE)
dna.remove_mutation(HM.name)
diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm
index f26270d98af..128961f9ac8 100644
--- a/code/modules/mob/living/carbon/life.dm
+++ b/code/modules/mob/living/carbon/life.dm
@@ -462,39 +462,6 @@ All effects don't start immediately, but rather get worse over time; the rate is
var/restingpwr = 0.5 + 2 * resting
- //Dizziness
- if(dizziness)
- var/old_dizzy = dizziness
- dizziness = max(dizziness - (restingpwr * delta_time), 0)
-
- if(client)
- //Want to be able to offset things by the time the animation should be "playing" at
- var/time = world.time
- var/delay = 0
- var/pixel_x_diff = 0
- var/pixel_y_diff = 0
-
- var/amplitude = old_dizzy*(sin(old_dizzy * (time)) + 1) // This shit is annoying at high strengthvar/pixel_x_diff = 0
- var/x_diff = amplitude * sin(old_dizzy * time)
- var/y_diff = amplitude * cos(old_dizzy * time)
- pixel_x_diff += x_diff
- pixel_y_diff += y_diff
- // Brief explanation. We're basically snapping between different pixel_x/ys instantly, with delays between
- // Doing this with relative changes. This way we don't override any existing pixel_x/y values
- // We use EASE_OUT here for similar reasons, we want to act at the end of the delay, not at its start
- // Relative animations are weird, so we do actually need this
- animate(client, pixel_x = x_diff, pixel_y = y_diff, 3, easing = JUMP_EASING | EASE_OUT, flags = ANIMATION_RELATIVE)
- delay += 0.3 SECONDS // This counts as a 0.3 second wait, so we need to shift the sine wave by that much
-
- x_diff = amplitude * sin(dizziness * (time + delay))
- y_diff = amplitude * cos(dizziness * (time + delay))
- pixel_x_diff += x_diff
- pixel_y_diff += y_diff
- animate(pixel_x = x_diff, pixel_y = y_diff, 3, easing = JUMP_EASING | EASE_OUT, flags = ANIMATION_RELATIVE)
-
- // Now we reset back to our old pixel_x/y, since these animates are relative
- animate(pixel_x = -pixel_x_diff, pixel_y = -pixel_y_diff, 3, easing = JUMP_EASING | EASE_OUT, flags = ANIMATION_RELATIVE)
-
if(drowsyness)
adjust_drowsyness(-1 * restingpwr * delta_time)
blur_eyes(1 * delta_time)
@@ -515,76 +482,6 @@ All effects don't start immediately, but rather get worse over time; the rate is
if(hallucination)
handle_hallucinations(delta_time, times_fired)
- if(drunkenness)
- //drunkenness = max(drunkenness - ((0.005 + (drunkenness * 0.02)) * delta_time), 0) //ORIGINAL
- drunkenness = max(drunkenness - (drunkenness * 0.01) - 0.01, 0) //SKYRAT EDIT CHANGE - booze
- if(drunkenness >= 6)
- SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "drunk", /datum/mood_event/drunk)
- if(DT_PROB(16, delta_time))
- adjust_timed_status_effect(4 SECONDS, /datum/status_effect/speech/slurring/drunk)
- jitteriness = max(jitteriness - (1.5 * delta_time), 0)
- throw_alert(ALERT_DRUNK, /atom/movable/screen/alert/drunk)
- sound_environment_override = SOUND_ENVIRONMENT_PSYCHOTIC
- else
- SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "drunk")
- clear_alert(ALERT_DRUNK)
- sound_environment_override = SOUND_ENVIRONMENT_NONE
- REMOVE_TRAIT(src, TRAIT_NUMBED, src) //SKYRAT EDIT START - ANESTHETIC EFFECT REMOVAL
- clear_alert("numbed") //SKYRAT EDIT END
-
- if(drunkenness >= 11)
- var/datum/status_effect/speech/slurring/drunk/already_slurring = has_status_effect(/datum/status_effect/speech/slurring/drunk)
- if(!already_slurring || already_slurring.duration - world.time <= 10 SECONDS)
- adjust_timed_status_effect(1.2 SECONDS * delta_time, /datum/status_effect/speech/slurring/drunk)
-
- if(mind && (is_scientist_job(mind.assigned_role) || is_research_director_job(mind.assigned_role)))
- if(SSresearch.science_tech)
- if(drunkenness >= 12.9 && drunkenness <= 13.8)
- drunkenness = round(drunkenness, 0.01)
- if(DT_PROB(2.5, delta_time))
- say(pick_list_replacements(VISTA_FILE, "ballmer_good_msg"), forced = "ballmer")
- if(drunkenness > 26) // by this point you're into windows ME territory
- if(DT_PROB(2.5, delta_time))
- say(pick_list_replacements(VISTA_FILE, "ballmer_windows_me_msg"), forced = "ballmer")
-
- if(drunkenness >= 41)
- if(DT_PROB(16, delta_time))
- add_confusion(2)
- Dizzy(5 * delta_time)
- ADD_TRAIT(src, TRAIT_NUMBED, src) //SKYRAT EDIT START - ANESTHETIC EFFECT ADDITION
- throw_alert("numbed", /atom/movable/screen/alert/numbed) //SKYRAT EDIT END
-
- if(drunkenness >= 51)
- if(DT_PROB(1.5, delta_time))
- add_confusion(15)
- vomit() // vomiting clears toxloss, consider this a blessing
- Dizzy(12.5 * delta_time)
-
- if(drunkenness >= 61)
- if(DT_PROB(30, delta_time))
- blur_eyes(5)
-
- if(drunkenness >= 71)
- blur_eyes(2.5 * delta_time)
-
- if(drunkenness >= 81)
- adjustToxLoss(0.5 * delta_time)
- if(!stat && DT_PROB(2.5, delta_time))
- to_chat(src, span_warning("Maybe you should lie down for a bit..."))
-
- if(drunkenness >= 91)
- adjustToxLoss(0.5 * delta_time)
- adjustOrganLoss(ORGAN_SLOT_BRAIN, 0.2 * delta_time)
- if(DT_PROB(10, delta_time) && !stat)
- if(SSshuttle.emergency.mode == SHUTTLE_DOCKED && is_station_level(z)) //QoL mainly
- to_chat(src, span_warning("You're so tired... but you can't miss that shuttle..."))
- else
- to_chat(src, span_warning("Just a quick nap..."))
- Sleeping(900)
-
- if(drunkenness >= 101)
- adjustToxLoss(1 * delta_time) //Let's be honest you shouldn't be alive by now
-
/// Base carbon environment handler, adds natural stabilization
/mob/living/carbon/handle_environment(datum/gas_mixture/environment, delta_time, times_fired)
var/areatemp = get_temperature(environment)
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 28c4e66f013..ce5ed66c384 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -880,7 +880,6 @@
bodytemperature = get_body_temp_normal(apply_change=FALSE)
set_blindness(0)
set_blurriness(0)
- set_dizziness(0)
cure_nearsighted()
cure_blind()
cure_husk()
@@ -888,7 +887,6 @@
heal_overall_damage(INFINITY, INFINITY, INFINITY, null, TRUE) //heal brute and burn dmg on both organic and robotic limbs, and update health right away.
extinguish_mob()
set_confusion(0)
- dizziness = 0
set_drowsyness(0)
jitteriness = 0
stop_sound_channel(CHANNEL_HEARTBEAT)
diff --git a/code/modules/mob/living/silicon/robot/examine.dm b/code/modules/mob/living/silicon/robot/examine.dm
index bcaeca24c50..dff385641b8 100644
--- a/code/modules/mob/living/silicon/robot/examine.dm
+++ b/code/modules/mob/living/silicon/robot/examine.dm
@@ -6,7 +6,7 @@
var/obj/act_module = get_active_held_item()
if(act_module)
. += "It is holding [icon2html(act_module, user)] \a [act_module]."
- . += status_effect_examines()
+ . += get_status_effect_examinations()
if (getBruteLoss())
if (getBruteLoss() < maxHealth*0.5)
. += span_warning("It looks slightly dented.")
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/wendigo.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/wendigo.dm
index 12d5c58a25b..f1559082ef9 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/wendigo.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/wendigo.dm
@@ -211,7 +211,7 @@ Difficulty: Hard
animate(src, pixel_z = rand(5, 15), time = 1, loop = 20)
animate(pixel_z = 0, time = 1)
for(var/mob/living/dizzy_target in get_hearers_in_view(7, src) - src)
- dizzy_target.Dizzy(6)
+ dizzy_target.set_timed_status_effect(12 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
to_chat(dizzy_target, span_danger("The wendigo screams loudly!"))
SLEEP_CHECK_DEATH(1 SECONDS, src)
spiral_attack()
diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm
index 2f20fd13510..93cd0056acd 100644
--- a/code/modules/mob/living/status_procs.dm
+++ b/code/modules/mob/living/status_procs.dm
@@ -727,3 +727,49 @@
else if(duration > 0)
apply_status_effect(effect, duration)
+
+/**
+ * Adjust the "drunk value" the mob is currently experiencing,
+ * or applies a drunk effect if the mob isn't currently drunk (or tipsy)
+ *
+ * The drunk effect doesn't have a set duration, like dizziness or drugginess,
+ * but instead relies on a value that decreases every status effect tick (2 seconds) by:
+ * 4% the current drunk_value + 0.01
+ *
+ * A "drunk value" of 6 is the border between "tipsy" and "drunk".
+ *
+ * amount - the amount of "drunkness" to apply to the mob.
+ * down_to - the lower end of the clamp, when adding the value
+ * up_to - the upper end of the clamp, when adding the value
+ */
+/mob/living/proc/adjust_drunk_effect(amount, down_to = 0, up_to = INFINITY)
+ if(!isnum(amount))
+ CRASH("adjust_drunk_effect: called with an invalid amount. (Got: [amount])")
+
+ var/datum/status_effect/inebriated/inebriation = has_status_effect(/datum/status_effect/inebriated)
+ if(inebriation)
+ inebriation.set_drunk_value(clamp(inebriation.drunk_value + amount, down_to, up_to))
+ else if(amount > 0)
+ apply_status_effect(/datum/status_effect/inebriated/tipsy, amount)
+
+
+/**
+ * Directly sets the "drunk value" the mob is currently experiencing to the passed value,
+ * or applies a drunk effect with the passed value if the mob isn't currently drunk
+ *
+ * set_to - the amount of "drunkness" to set on the mob.
+ */
+/mob/living/proc/set_drunk_effect(set_to)
+ if(!isnum(set_to) || set_to < 0)
+ CRASH("set_drunk_effect: called with an invalid value. (Got: [set_to])")
+
+ var/datum/status_effect/inebriated/inebriation = has_status_effect(/datum/status_effect/inebriated)
+ if(inebriation)
+ inebriation.set_drunk_value(set_to)
+ else if(set_to > 0)
+ apply_status_effect(/datum/status_effect/inebriated/tipsy, set_to)
+
+/// Helper to get the amount of drunkness the mob's currently experiencing.
+/mob/living/proc/get_drunk_amount()
+ var/datum/status_effect/inebriated/inebriation = has_status_effect(/datum/status_effect/inebriated)
+ return inebriation?.drunk_value || 0
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index c60b5938688..41cb532bee3 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -1366,9 +1366,6 @@
if(NAMEOF(src, stat))
set_stat(var_value)
. = TRUE
- if(NAMEOF(src, dizziness))
- set_dizziness(var_value)
- . = TRUE
if(NAMEOF(src, eye_blind))
set_blindness(var_value)
. = TRUE
diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm
index dfac35d7e58..ee74b9a8bc8 100644
--- a/code/modules/mob/mob_defines.dm
+++ b/code/modules/mob/mob_defines.dm
@@ -108,8 +108,6 @@
var/old_bodytemperature = 0
/// Drowsyness level of the mob
var/drowsyness = 0//Carbon
- /// Dizziness level of the mob
- var/dizziness = 0//Carbon
/// Jitteryness level of the mob
var/jitteriness = 0//Carbon
/// Hunger level of the mob
diff --git a/code/modules/mob/status_procs.dm b/code/modules/mob/status_procs.dm
index f6959a249a4..36de97a319b 100644
--- a/code/modules/mob/status_procs.dm
+++ b/code/modules/mob/status_procs.dm
@@ -7,18 +7,6 @@
/mob/proc/Jitter(amount)
jitteriness = max(jitteriness,amount,0)
-/**
- * Set the dizzyness of a mob to a passed in amount
- *
- * Except if dizziness is already higher in which case it does nothing
- */
-/mob/proc/Dizzy(amount)
- dizziness = max(dizziness,amount,0)
-
-///FOrce set the dizzyness of a mob
-/mob/proc/set_dizziness(amount)
- dizziness = max(amount, 0)
-
/**
* Set drowsyness of a mob to passed value
*/
diff --git a/code/modules/projectiles/projectile/special/floral.dm b/code/modules/projectiles/projectile/special/floral.dm
index fa1259bcb79..ceb939f1049 100644
--- a/code/modules/projectiles/projectile/special/floral.dm
+++ b/code/modules/projectiles/projectile/special/floral.dm
@@ -57,6 +57,6 @@
var/mob/living/L = target
if(L.mob_biotypes & MOB_PLANT)
L.show_message(span_notice("The radiation beam leaves you feeling disoriented!"))
- L.Dizzy(15)
+ L.set_timed_status_effect(30 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
L.emote("flip")
L.emote("spin")
diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
index 94fe9dacc19..7cbbaed9926 100644
--- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm
@@ -45,13 +45,14 @@ All effects don't start immediately, but rather get worse over time; the rate is
return ..()
/datum/reagent/consumable/ethanol/on_mob_life(mob/living/carbon/drinker, delta_time, times_fired)
- if(drinker.drunkenness < volume * boozepwr * ALCOHOL_THRESHOLD_MODIFIER || boozepwr < 0)
+ if(drinker.get_drunk_amount() < volume * boozepwr * ALCOHOL_THRESHOLD_MODIFIER || boozepwr < 0)
var/booze_power = boozepwr
if(HAS_TRAIT(drinker, TRAIT_ALCOHOL_TOLERANCE)) //we're an accomplished drinker
booze_power *= 0.7
if(HAS_TRAIT(drinker, TRAIT_LIGHT_DRINKER))
booze_power *= 2
- drinker.drunkenness = max((drinker.drunkenness + (sqrt(volume) * booze_power * ALCOHOL_RATE * REM * delta_time)), 0) //Volume, power, and server alcohol rate effect how quickly one gets drunk
+ // Volume, power, and server alcohol rate effect how quickly one gets drunk
+ drinker.adjust_drunk_effect(sqrt(volume) * booze_power * ALCOHOL_RATE * REM * delta_time)
if(boozepwr > 0)
var/obj/item/organ/liver/liver = drinker.getorganslot(ORGAN_SLOT_LIVER)
if (istype(liver))
@@ -168,7 +169,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/consumable/ethanol/kahlua/on_mob_life(mob/living/carbon/drinker, delta_time, times_fired)
- drinker.dizziness = max(drinker.dizziness - (5 * REM * delta_time), 0)
+ drinker.set_timed_status_effect(10 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
drinker.adjust_drowsyness(-3 * REM * delta_time)
drinker.AdjustSleeping(-40 * REM * delta_time)
if(!HAS_TRAIT(drinker, TRAIT_ALCOHOL_TOLERANCE))
@@ -1502,7 +1503,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
drinker.set_timed_status_effect(100 SECONDS * REM * delta_time, /datum/status_effect/drugginess)
if(!HAS_TRAIT(drinker, TRAIT_ALCOHOL_TOLERANCE))
drinker.set_confusion(max(drinker.get_confusion() + (2 * REM * delta_time),0))
- drinker.Dizzy(10 * REM * delta_time)
+ drinker.set_timed_status_effect(20 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
drinker.adjust_timed_status_effect(6 SECONDS * REM * delta_time, /datum/status_effect/speech/slurring/drunk)
switch(current_cycle)
if(51 to 200)
@@ -1527,7 +1528,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/consumable/ethanol/gargle_blaster/on_mob_life(mob/living/carbon/drinker, delta_time, times_fired)
- drinker.dizziness += 1.5 * REM * delta_time
+ drinker.adjust_timed_status_effect(3 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
switch(current_cycle)
if(15 to 45)
drinker.adjust_timed_status_effect(3 SECONDS * REM * delta_time, /datum/status_effect/speech/slurring/drunk)
@@ -1560,7 +1561,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
/datum/reagent/consumable/ethanol/neurotoxin/on_mob_life(mob/living/carbon/drinker, delta_time, times_fired)
drinker.set_timed_status_effect(100 SECONDS * REM * delta_time, /datum/status_effect/drugginess)
- drinker.dizziness += 2 * REM * delta_time
+ drinker.adjust_timed_status_effect(4 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
drinker.adjustOrganLoss(ORGAN_SLOT_BRAIN, 1 * REM * delta_time, 150)
if(DT_PROB(10, delta_time))
drinker.adjustStaminaLoss(10)
@@ -1608,25 +1609,25 @@ All effects don't start immediately, but rather get worse over time; the rate is
switch(current_cycle)
if(1 to 5)
- drinker.Dizzy(10 * REM * delta_time)
+ drinker.set_timed_status_effect(20 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
drinker.set_timed_status_effect(1 MINUTES * REM * delta_time, /datum/status_effect/drugginess)
if(DT_PROB(5, delta_time))
drinker.emote(pick("twitch","giggle"))
if(5 to 10)
drinker.Jitter(20 * REM * delta_time)
- drinker.Dizzy(20 * REM * delta_time)
+ drinker.set_timed_status_effect(40 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
drinker.set_timed_status_effect(1.5 MINUTES * REM * delta_time, /datum/status_effect/drugginess)
if(DT_PROB(10, delta_time))
drinker.emote(pick("twitch","giggle"))
if (10 to 200)
drinker.Jitter(40 * REM * delta_time)
- drinker.Dizzy(40 * REM * delta_time)
+ drinker.set_timed_status_effect(80 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
drinker.set_timed_status_effect(2 MINUTES * REM * delta_time, /datum/status_effect/drugginess)
if(DT_PROB(16, delta_time))
drinker.emote(pick("twitch","giggle"))
if(200 to INFINITY)
drinker.Jitter(60 * REM * delta_time)
- drinker.Dizzy(60 * REM * delta_time)
+ drinker.set_timed_status_effect(120 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
drinker.set_timed_status_effect(2.5 MINUTES * REM * delta_time, /datum/status_effect/drugginess)
if(DT_PROB(23, delta_time))
drinker.emote(pick("twitch","giggle"))
@@ -2360,7 +2361,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
/datum/reagent/consumable/ethanol/turbo/on_mob_life(mob/living/carbon/drinker, delta_time, times_fired)
if(DT_PROB(2, delta_time))
to_chat(drinker, span_notice("[pick("You feel disregard for the rule of law.", "You feel pumped!", "Your head is pounding.", "Your thoughts are racing..")]"))
- drinker.adjustStaminaLoss(-0.25 * drinker.drunkenness * REM * delta_time)
+ drinker.adjustStaminaLoss(-0.25 * drinker.get_drunk_amount() * REM * delta_time)
return ..()
/datum/reagent/consumable/ethanol/old_timer
@@ -2459,7 +2460,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
var/stored_teleports = 0
/datum/reagent/consumable/ethanol/blazaam/on_mob_life(mob/living/carbon/drinker, delta_time, times_fired)
- if(drinker.drunkenness > 40)
+ if(drinker.get_drunk_amount() > 40)
if(stored_teleports)
do_teleport(drinker, get_turf(drinker), rand(1,3), channel = TELEPORT_CHANNEL_WORMHOLE)
stored_teleports--
diff --git a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm
index 1a331133088..d695d4eadf3 100644
--- a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm
@@ -542,7 +542,7 @@
H.adjustOrganLoss(ORGAN_SLOT_HEART, max(volume/10, 1) * REM * delta_time) // your heart is barely keeping up!
H.Jitter(rand(0, 2) * REM * delta_time)
- H.Dizzy(rand(0, 2) * REM * delta_time)
+ H.set_timed_status_effect(rand(0 SECONDS, 4 SECONDS) * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(DT_PROB(18, delta_time))
to_chat(H,span_danger("Your body is trying to give up, but your heart is still beating!"))
diff --git a/code/modules/reagents/chemistry/reagents/drink_reagents.dm b/code/modules/reagents/chemistry/reagents/drink_reagents.dm
index 1a7df06a4f4..d493ee8ab42 100644
--- a/code/modules/reagents/chemistry/reagents/drink_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/drink_reagents.dm
@@ -288,7 +288,7 @@
..()
/datum/reagent/consumable/coffee/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
- M.dizziness = max(M.dizziness - (5 * REM * delta_time), 0)
+ M.adjust_timed_status_effect(-10 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-3 * REM * delta_time)
M.AdjustSleeping(-40 * REM * delta_time)
//310.15 is the normal bodytemp.
@@ -311,7 +311,7 @@
glass_price = DRINK_PRICE_STOCK
/datum/reagent/consumable/tea/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
- M.dizziness = max(M.dizziness - (2 * REM * delta_time), 0)
+ M.adjust_timed_status_effect(-4 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-1 * REM * delta_time)
M.jitteriness = max(M.jitteriness - (3 * REM * delta_time), 0)
M.AdjustSleeping(-20 * REM * delta_time)
@@ -363,7 +363,7 @@
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/consumable/icecoffee/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
- M.dizziness = max(M.dizziness - (5 * REM * delta_time), 0)
+ M.adjust_timed_status_effect(-10 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-3 * REM * delta_time)
M.AdjustSleeping(-40 * REM * delta_time)
M.adjust_bodytemperature(-5 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, M.get_body_temp_normal())
@@ -383,7 +383,7 @@
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/consumable/hot_ice_coffee/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
- M.dizziness = max(M.dizziness - (5 * REM * delta_time), 0)
+ M.adjust_timed_status_effect(-10 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-3 * REM * delta_time)
M.AdjustSleeping(-60 * REM * delta_time)
M.adjust_bodytemperature(-7 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, M.get_body_temp_normal())
@@ -404,7 +404,7 @@
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/consumable/icetea/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
- M.dizziness = max(M.dizziness - (2 * REM * delta_time), 0)
+ M.adjust_timed_status_effect(-4 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-1 * REM * delta_time)
M.AdjustSleeping(-40 * REM * delta_time)
if(M.getToxLoss() && DT_PROB(10, delta_time))
@@ -467,7 +467,7 @@
/datum/reagent/consumable/nuka_cola/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.Jitter(20 * REM * delta_time)
M.set_timed_status_effect(1 MINUTES * REM * delta_time, /datum/status_effect/drugginess)
- M.dizziness += 1.5 * REM * delta_time
+ M.adjust_timed_status_effect(3 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.set_drowsyness(0)
M.AdjustSleeping(-40 * REM * delta_time)
M.adjust_bodytemperature(-5 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, M.get_body_temp_normal())
@@ -506,9 +506,9 @@
M.Jitter(2 * REM * delta_time)
if(prob(50))
- M.dizziness += 1 * REM * delta_time
+ M.adjust_timed_status_effect(2 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
if(current_cycle > 10)
- M.dizziness += 1.5 * REM * delta_time
+ M.adjust_timed_status_effect(3 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
..()
. = TRUE
@@ -534,7 +534,7 @@
/datum/reagent/consumable/grey_bull/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.Jitter(20 * REM * delta_time)
- M.dizziness += 1 * REM * delta_time
+ M.adjust_timed_status_effect(2 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.set_drowsyness(0)
M.AdjustSleeping(-40 * REM * delta_time)
M.adjust_bodytemperature(-5 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, M.get_body_temp_normal())
@@ -661,7 +661,7 @@
mytray.adjust_plant_health(round(chems.get_reagent_amount(type) * 0.1))
/datum/reagent/consumable/sodawater/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
- M.dizziness = max(M.dizziness - (5 * REM * delta_time), 0)
+ M.adjust_timed_status_effect(-10 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-3 * REM * delta_time)
M.adjust_bodytemperature(-5 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, M.get_body_temp_normal())
..()
@@ -677,7 +677,7 @@
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/consumable/tonic/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
- M.dizziness = max(M.dizziness - (5 * REM * delta_time), 0)
+ M.adjust_timed_status_effect(10 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-3 * REM * delta_time)
M.AdjustSleeping(-40 * REM * delta_time)
M.adjust_bodytemperature(-5 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, M.get_body_temp_normal())
@@ -697,7 +697,7 @@
/datum/reagent/consumable/monkey_energy/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.Jitter(40 * REM * delta_time)
- M.dizziness += 1 * REM * delta_time
+ M.adjust_timed_status_effect(2 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.set_drowsyness(0)
M.AdjustSleeping(-40 * REM * delta_time)
M.adjust_bodytemperature(-5 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, M.get_body_temp_normal())
@@ -745,7 +745,7 @@
glass_price = DRINK_PRICE_EASY
/datum/reagent/consumable/soy_latte/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
- M.dizziness = max(M.dizziness - (5 * REM * delta_time), 0)
+ M.adjust_timed_status_effect(-10 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-3 *REM * delta_time)
M.SetSleeping(0)
M.adjust_bodytemperature(5 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, 0, M.get_body_temp_normal())
@@ -768,7 +768,7 @@
glass_price = DRINK_PRICE_EASY
/datum/reagent/consumable/cafe_latte/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
- M.dizziness = max(M.dizziness - (5 * REM * delta_time), 0)
+ M.adjust_timed_status_effect(-10 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.adjust_drowsyness(-6 * REM * delta_time)
M.SetSleeping(0)
M.adjust_bodytemperature(5 * REM * TEMPERATURE_DAMAGE_COEFFICIENT * delta_time, 0, M.get_body_temp_normal())
diff --git a/code/modules/reagents/chemistry/reagents/drug_reagents.dm b/code/modules/reagents/chemistry/reagents/drug_reagents.dm
index 3039db16bf0..71d5e3c77a0 100644
--- a/code/modules/reagents/chemistry/reagents/drug_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/drug_reagents.dm
@@ -295,7 +295,7 @@
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "happiness_drug", /datum/mood_event/happiness_drug_good_od)
if(2)
M.emote("sway")
- M.Dizzy(25)
+ M.set_timed_status_effect(50 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(3)
M.emote("frown")
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "happiness_drug", /datum/mood_event/happiness_drug_bad_od)
diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm
index 1809fd9876b..a867b971c87 100644
--- a/code/modules/reagents/chemistry/reagents/food_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm
@@ -380,7 +380,7 @@
if(prob(10))
victim.blur_eyes(1)
if(prob(10))
- victim.Dizzy(1)
+ victim.set_timed_status_effect(2 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(prob(5))
victim.vomit()
diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm
index 9361ecef18d..a2b579ba9a2 100644
--- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm
@@ -80,7 +80,7 @@
M.SetSleeping(0)
M.silent = FALSE
- M.dizziness = 0
+ M.remove_status_effect(/datum/status_effect/dizziness)
M.disgust = 0
M.drowsyness = 0
// Remove all speech related status effects
@@ -252,7 +252,7 @@
/datum/reagent/medicine/rezadone/overdose_process(mob/living/M, delta_time, times_fired)
M.adjustToxLoss(1 * REM * delta_time, 0)
- M.Dizzy(5 * REM * delta_time)
+ M.set_timed_status_effect(10 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
M.Jitter(5 * REM * delta_time)
..()
. = TRUE
@@ -640,7 +640,7 @@
/datum/reagent/medicine/morphine/overdose_process(mob/living/M, delta_time, times_fired)
if(DT_PROB(18, delta_time))
M.drop_all_held_items()
- M.Dizzy(2)
+ M.set_timed_status_effect(4 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
M.Jitter(2)
..()
@@ -784,14 +784,14 @@
. = TRUE
M.losebreath = 0
if(DT_PROB(10, delta_time))
- M.Dizzy(5)
+ M.set_timed_status_effect(10 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
M.Jitter(5)
..()
/datum/reagent/medicine/atropine/overdose_process(mob/living/M, delta_time, times_fired)
M.adjustToxLoss(0.5 * REM * delta_time, 0)
. = TRUE
- M.Dizzy(1 * REM * delta_time)
+ M.set_timed_status_effect(2 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
M.Jitter(1 * REM * delta_time)
..()
@@ -1002,15 +1002,13 @@
inverse_chem = /datum/reagent/inverse/antihol
/datum/reagent/medicine/antihol/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
- M.dizziness = 0
+ M.remove_status_effect(/datum/status_effect/dizziness)
M.set_drowsyness(0)
M.remove_status_effect(/datum/status_effect/speech/slurring/drunk)
M.set_confusion(0)
M.reagents.remove_all_type(/datum/reagent/consumable/ethanol, 3 * REM * delta_time * normalise_creation_purity(), FALSE, TRUE)
M.adjustToxLoss(-0.2 * REM * delta_time, 0)
- if(ishuman(M))
- var/mob/living/carbon/human/H = M
- H.drunkenness = max(H.drunkenness - (10 * REM * delta_time * normalise_creation_purity()), 0)
+ M.adjust_drunk_effect(-10 * REM * delta_time * normalise_creation_purity())
..()
. = TRUE
@@ -1229,7 +1227,7 @@
metabolizer.AdjustAllImmobility(-20 * REM * delta_time)
metabolizer.adjustStaminaLoss(-10 * REM * delta_time, 0)
metabolizer.Jitter(10 * REM * delta_time)
- metabolizer.Dizzy(10 * REM * delta_time)
+ metabolizer.set_timed_status_effect(20 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
return TRUE
/datum/reagent/medicine/changelingadrenaline/on_mob_metabolize(mob/living/L)
@@ -1243,7 +1241,7 @@
REMOVE_TRAIT(L, TRAIT_SLEEPIMMUNE, type)
REMOVE_TRAIT(L, TRAIT_STUNRESISTANCE, type)
L.remove_movespeed_mod_immunities(type, /datum/movespeed_modifier/damage_slowdown)
- L.Dizzy(0)
+ L.remove_status_effect(/datum/status_effect/dizziness)
L.Jitter(0)
/datum/reagent/medicine/changelingadrenaline/overdose_process(mob/living/metabolizer, delta_time, times_fired)
@@ -1356,7 +1354,7 @@
if(1 to 40)
M.jitteriness = min(M.jitteriness + (1 * REM * delta_time), 10)
M.adjust_timed_status_effect(2 SECONDS * REM * delta_time, /datum/status_effect/speech/stutter, max_duration = 20 SECONDS)
- M.Dizzy(5 * REM * delta_time)
+ M.set_timed_status_effect(10 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(DT_PROB(30, delta_time))
M.losebreath++
if(41 to 80)
@@ -1364,7 +1362,7 @@
M.adjustStaminaLoss(0.1 * REM * delta_time, 0)
M.jitteriness = min(M.jitteriness + (1 * REM * delta_time), 20)
M.adjust_timed_status_effect(2 SECONDS * REM * delta_time, /datum/status_effect/speech/stutter, max_duration = 40 SECONDS)
- M.Dizzy(10 * REM * delta_time)
+ M.set_timed_status_effect(20 SECONDS * REM * delta_time, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(DT_PROB(30, delta_time))
M.losebreath++
if(DT_PROB(10, delta_time))
@@ -1402,7 +1400,7 @@
/datum/reagent/medicine/psicodine/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.jitteriness = max(M.jitteriness - (6 * REM * delta_time), 0)
- M.dizziness = max(M.dizziness - (6 * REM * delta_time), 0)
+ M.adjust_timed_status_effect(-12 SECONDS * REM * delta_time, /datum/status_effect/dizziness)
M.set_confusion(max(M.get_confusion() - (6 * REM * delta_time), 0))
M.disgust = max(M.disgust - (6 * REM * delta_time), 0)
var/datum/component/mood/mood = M.GetComponent(/datum/component/mood)
diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm
index 9013abb5e69..bf2b1e8ac49 100644
--- a/code/modules/reagents/chemistry/reagents/other_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm
@@ -293,7 +293,7 @@
qdel(BS)
if(data["misc"] >= (25 SECONDS)) // 10 units
M.adjust_timed_status_effect(4 SECONDS * delta_time, /datum/status_effect/speech/stutter, max_duration = 20 SECONDS)
- M.Dizzy(5)
+ M.set_timed_status_effect(10 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(IS_CULTIST(M) && DT_PROB(10, delta_time))
M.say(pick("Av'te Nar'Sie","Pa'lid Mors","INO INO ORA ANA","SAT ANA!","Daim'niodeis Arc'iai Le'eones","R'ge Na'sie","Diabo us Vo'iscum","Eld' Mon Nobis"), forced = "holy water")
if(prob(10))
@@ -1235,7 +1235,7 @@
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
/datum/reagent/cryptobiolin/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
- M.Dizzy(1)
+ M.set_timed_status_effect(2 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
M.set_confusion(clamp(M.get_confusion(), 1, 20))
..()
@@ -2505,8 +2505,7 @@
/datum/reagent/peaceborg/confuse/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
if(M.get_confusion() < 6)
M.set_confusion(clamp(M.get_confusion() + (3 * REM * delta_time), 0, 5))
- if(M.dizziness < 6)
- M.dizziness = clamp(M.dizziness + (3 * REM * delta_time), 0, 5)
+ M.adjust_timed_status_effect(6 SECONDS * REM * delta_time, /datum/status_effect/dizziness, max_duration = 12 SECONDS)
if(DT_PROB(10, delta_time))
to_chat(M, "You feel confused and disoriented.")
..()
diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
index 6bb3f820535..c1c93d011c9 100644
--- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
@@ -1176,7 +1176,13 @@
/datum/reagent/toxin/bungotoxin/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.adjustOrganLoss(ORGAN_SLOT_HEART, 3 * REM * delta_time)
- M.set_confusion(M.dizziness) //add a tertiary effect here if this is isn't an effective poison.
+
+ //add a tertiary effect here if this is isn't an effective poison.
+ var/datum/status_effect/dizziness/mob_dizziness = M.has_status_effect(/datum/status_effect/dizziness)
+ if(mob_dizziness)
+ // Gain confusion = (seconds remaining in dizziness) / 2
+ M.set_confusion((mob_dizziness.duration - world.time) / 20)
+
if(current_cycle >= 12 && DT_PROB(4, delta_time))
var/tox_message = pick("You feel your heart spasm in your chest.", "You feel faint.","You feel you need to catch your breath.","You feel a prickle of pain in your chest.")
to_chat(M, span_notice("[tox_message]"))
diff --git a/code/modules/reagents/withdrawal/generic_addictions.dm b/code/modules/reagents/withdrawal/generic_addictions.dm
index b080e5986a2..5d165af4dda 100644
--- a/code/modules/reagents/withdrawal/generic_addictions.dm
+++ b/code/modules/reagents/withdrawal/generic_addictions.dm
@@ -137,7 +137,7 @@
var/lums = T.get_lumcount()
if(lums > 0.5)
SEND_SIGNAL(affected_human, COMSIG_ADD_MOOD_EVENT, "too_bright", /datum/mood_event/bright_light)
- affected_human.dizziness = min(40, affected_human.dizziness + 3)
+ affected_human.adjust_timed_status_effect(6 SECONDS, /datum/status_effect/dizziness, max_duration = 80 SECONDS)
affected_human.set_confusion(min(affected_human.get_confusion() + (0.5 * delta_time), 20))
else
SEND_SIGNAL(affected_carbon, COMSIG_CLEAR_MOOD_EVENT, "too_bright")
diff --git a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm
index e8ae975293e..efc557c93c5 100644
--- a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm
+++ b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm
@@ -503,24 +503,36 @@
/datum/status_effect/stabilized/purple
id = "stabilizedpurple"
colour = "purple"
+ /// Whether we healed from our last tick
+ var/healed_last_tick = FALSE
/datum/status_effect/stabilized/purple/tick()
- var/is_healing = FALSE
+ healed_last_tick = FALSE
+
if(owner.getBruteLoss() > 0)
owner.adjustBruteLoss(-0.2)
- is_healing = TRUE
+ healed_last_tick = TRUE
+
if(owner.getFireLoss() > 0)
owner.adjustFireLoss(-0.2)
- is_healing = TRUE
+ healed_last_tick = TRUE
+
if(owner.getToxLoss() > 0)
- owner.adjustToxLoss(-0.2, forced = TRUE) //Slimepeople should also get healed.
- is_healing = TRUE
- if(is_healing)
- examine_text = "SUBJECTPRONOUN is regenerating slowly, purplish goo filling in small injuries!"
+ // Forced, so slimepeople are healed as well.
+ owner.adjustToxLoss(-0.2, forced = TRUE)
+ healed_last_tick = TRUE
+
+ // Technically, "healed this tick" by now.
+ if(healed_last_tick)
new /obj/effect/temp_visual/heal(get_turf(owner), "#FF0000")
- else
- examine_text = null
- ..()
+
+ return ..()
+
+/datum/status_effect/stabilized/purple/get_examine_text()
+ if(healed_last_tick)
+ return span_warning("[owner.p_they(TRUE)] [owner.p_are()] regenerating slowly, purplish goo filling in small injuries!")
+
+ return null
/datum/status_effect/stabilized/blue
id = "stabilizedblue"
@@ -562,7 +574,9 @@
colour = "yellow"
var/cooldown = 10
var/max_cooldown = 10
- examine_text = "Nearby electronics seem just a little more charged wherever SUBJECTPRONOUN goes."
+
+/datum/status_effect/stabilized/yellow/get_examine_text()
+ return span_warning("Nearby electronics seem just a little more charged wherever [owner.p_they()] go[owner.p_es()].")
/datum/status_effect/stabilized/yellow/tick()
if(cooldown > 0)
@@ -590,7 +604,6 @@
id = "stabilizeddarkpurple"
colour = "dark purple"
var/obj/item/hothands/fire
- examine_text = "Their fingertips burn brightly!"
/datum/status_effect/stabilized/darkpurple/on_apply()
ADD_TRAIT(owner, TRAIT_RESISTHEATHANDS, "slimestatus")
@@ -599,17 +612,20 @@
/datum/status_effect/stabilized/darkpurple/tick()
var/obj/item/item = owner.get_active_held_item()
- if(IS_EDIBLE(item))
- if(item.microwave_act())
+ if(item)
+ if(IS_EDIBLE(item) && item.microwave_act())
to_chat(owner, span_warning("[linked_extract] flares up brightly, and your hands alone are enough cook [item]!"))
- else
- item.attackby(fire, owner)
+ else
+ item.attackby(fire, owner)
return ..()
/datum/status_effect/stabilized/darkpurple/on_remove()
REMOVE_TRAIT(owner, TRAIT_RESISTHEATHANDS, "slimestatus")
qdel(fire)
+/datum/status_effect/stabilized/darkpurple/get_examine_text()
+ return span_notice("[owner.p_their(TRUE)] fingertips burn brightly!")
+
/datum/status_effect/stabilized/darkblue
id = "stabilizeddarkblue"
colour = "dark blue"
@@ -797,12 +813,12 @@
H.dna.update_dna_identity()
return ..()
-/datum/status_effect/stabilized/green/tick() //Only occasionally give examiners a warning.
+// Only occasionally give examiners a warning.
+/datum/status_effect/stabilized/green/get_examine_text()
if(prob(50))
- examine_text = "SUBJECTPRONOUN looks a bit green and gooey..."
- else
- examine_text = null
- return ..()
+ return span_warning("[owner.p_they(TRUE)] look[owner.p_s()] a bit green and gooey...")
+
+ return null
/datum/status_effect/stabilized/green/on_remove()
to_chat(owner, span_notice("You feel more like yourself."))
@@ -878,47 +894,87 @@
/datum/status_effect/stabilized/oil
id = "stabilizedoil"
colour = "oil"
- examine_text = "SUBJECTPRONOUN smells of sulfer and oil!"
/datum/status_effect/stabilized/oil/tick()
if(owner.stat == DEAD)
explosion(owner, devastation_range = 1, heavy_impact_range = 2, light_impact_range = 4, flame_range = 5, explosion_cause = src)
return ..()
+/datum/status_effect/stabilized/oil/get_examine_text()
+ return span_warning("[owner.p_they(TRUE)] smell[owner.p_s()] of sulfer and oil!")
+
+/// How much damage is dealt per healing done for the stabilized back.
+/// This multiplier is applied to prevent two people from converting each other's damage away.
+#define DRAIN_DAMAGE_MULTIPLIER 1.2
+
/datum/status_effect/stabilized/black
id = "stabilizedblack"
colour = "black"
- var/messagedelivered = FALSE
+ /// How much we heal per tick (also how much we damage per tick times DRAIN_DAMAGE_MULTIPLIER).
var/heal_amount = 1
+ /// Weakref to the mob we're currently draining every tick.
+ var/datum/weakref/draining_ref
+
+/datum/status_effect/stabilized/black/on_apply()
+ RegisterSignal(owner, COMSIG_MOVABLE_SET_GRAB_STATE, .proc/on_grab)
+ return ..()
+
+/datum/status_effect/stabilized/black/on_remove()
+ UnregisterSignal(owner, COMSIG_MOVABLE_SET_GRAB_STATE)
+ return ..()
+
+/// Whenever we grab someone by the neck, set "draining" to a weakref of them.
+/datum/status_effect/stabilized/black/proc/on_grab(mob/living/source, new_state)
+ SIGNAL_HANDLER
+
+ if(new_state < GRAB_KILL || !isliving(source.pulling))
+ draining_ref = null
+ return
+
+ var/mob/living/draining = source.pulling
+ if(draining.stat == DEAD)
+ return
+
+ draining_ref = WEAKREF(draining)
+ to_chat(owner, span_boldnotice("You feel your hands melt around [draining]'s neck as you start to drain [draining.p_them()] of [draining.p_their()] life!"))
+ to_chat(draining, span_userdanger("[owner]'s hands melt around your neck as you can feel your life starting to drain away!"))
+
+/datum/status_effect/stabilized/black/get_examine_text()
+ var/mob/living/draining = draining_ref?.resolve()
+ if(!draining)
+ return null
+
+ return span_warning("[owner.p_they(TRUE)] [owner.p_are()] draining health from [draining]!")
/datum/status_effect/stabilized/black/tick()
- if(owner.pulling && isliving(owner.pulling) && owner.grab_state == GRAB_KILL)
- var/mob/living/M = owner.pulling
- if(M.stat == DEAD)
- return
- if(!messagedelivered)
- to_chat(owner,span_notice("You feel your hands melt around [M]'s neck and start to drain [M.p_them()] of life."))
- to_chat(owner.pulling, span_userdanger("[owner]'s hands melt around your neck, and you can feel your life starting to drain away!"))
- messagedelivered = TRUE
- examine_text = "SUBJECTPRONOUN is draining health from [owner.pulling]!"
- var/list/healing_types = list()
- if(owner.getBruteLoss() > 0)
- healing_types += BRUTE
- if(owner.getFireLoss() > 0)
- healing_types += BURN
- if(owner.getToxLoss() > 0)
- healing_types += TOX
- if(owner.getCloneLoss() > 0)
- healing_types += CLONE
- if(length(healing_types))
- owner.apply_damage_type(-heal_amount, damagetype=pick(healing_types))
- owner.adjust_nutrition(3)
- M.adjustCloneLoss(heal_amount * 1.2) //This way, two people can't just convert each other's damage away.
- else
- messagedelivered = FALSE
- examine_text = null
+ if(owner.grab_state < GRAB_KILL || !IS_WEAKREF_OF(owner.pulling, draining_ref))
+ return
+
+ var/mob/living/drained = draining_ref.resolve()
+ if(drained.stat == DEAD)
+ to_chat(owner, span_warning("[drained] is dead, you cannot drain anymore life from them!"))
+ draining_ref = null
+ return
+
+ var/list/healing_types = list()
+ if(owner.getBruteLoss() > 0)
+ healing_types += BRUTE
+ if(owner.getFireLoss() > 0)
+ healing_types += BURN
+ if(owner.getToxLoss() > 0)
+ healing_types += TOX
+ if(owner.getCloneLoss() > 0)
+ healing_types += CLONE
+
+ if(length(healing_types))
+ owner.apply_damage_type(-heal_amount, damagetype = pick(healing_types))
+
+ owner.adjust_nutrition(3)
+ drained.adjustCloneLoss(heal_amount * DRAIN_DAMAGE_MULTIPLIER)
return ..()
+#undef DRAIN_DAMAGE_MULTIPLIER
+
/datum/status_effect/stabilized/lightpink
id = "stabilizedlightpink"
colour = "light pink"
@@ -942,7 +998,9 @@
/datum/status_effect/stabilized/adamantine
id = "stabilizedadamantine"
colour = "adamantine"
- examine_text = "SUBJECTPRONOUN has a strange metallic coating on their skin."
+
+/datum/status_effect/stabilized/adamantine/get_examine_text()
+ return span_warning("[owner.p_they(TRUE)] [owner.p_have()] strange metallic coating on [owner.p_their()] skin.")
/datum/status_effect/stabilized/gold
id = "stabilizedgold"
diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm
index 7a72ff79f4f..2b00fc069e4 100644
--- a/code/modules/surgery/organs/heart.dm
+++ b/code/modules/surgery/organs/heart.dm
@@ -215,7 +215,7 @@
if(. & EMP_PROTECT_SELF)
return
if(!COOLDOWN_FINISHED(src, severe_cooldown)) //So we cant just spam emp to kill people.
- owner.Dizzy(10)
+ owner.set_timed_status_effect(20 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
owner.losebreath += 10
COOLDOWN_START(src, severe_cooldown, 20 SECONDS)
if(prob(emp_vulnerability/severity)) //Chance of permanent effects
diff --git a/code/modules/surgery/organs/stomach/_stomach.dm b/code/modules/surgery/organs/stomach/_stomach.dm
index 4a9ce2253fc..947df04331c 100644
--- a/code/modules/surgery/organs/stomach/_stomach.dm
+++ b/code/modules/surgery/organs/stomach/_stomach.dm
@@ -226,7 +226,7 @@
disgusted.add_confusion(2.5)
disgusted.adjust_timed_status_effect(2 SECONDS, /datum/status_effect/speech/stutter)
disgusted.vomit(10, 0, 1, 0, 1, 0)
- disgusted.Dizzy(5)
+ disgusted.set_timed_status_effect(10 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(disgust >= DISGUST_LEVEL_DISGUSTED)
if(DT_PROB(13, delta_time))
disgusted.blur_eyes(3) //We need to add more shit down here
diff --git a/modular_skyrat/master_files/code/modules/reagents/withdrawal/generic_addictions.dm b/modular_skyrat/master_files/code/modules/reagents/withdrawal/generic_addictions.dm
index f62f2eec2e1..49101b42624 100644
--- a/modular_skyrat/master_files/code/modules/reagents/withdrawal/generic_addictions.dm
+++ b/modular_skyrat/master_files/code/modules/reagents/withdrawal/generic_addictions.dm
@@ -19,7 +19,7 @@
if(8)
if(strength >= 2)
to_chat(affected_carbon, span_warning("You feel a little dizzy."))
- affected_carbon.Dizzy(3 * strength)
+ affected_carbon.set_timed_status_effect(strength * 6 SECONDS, /datum/status_effect/dizziness)
if(8 to 10)
to_chat(affected_carbon, span_warning("You feel tired."))
affected_carbon.adjustStaminaLoss(6 * strength)
diff --git a/modular_skyrat/modules/biohazard_blob/code/biohazard_blob_disease.dm b/modular_skyrat/modules/biohazard_blob/code/biohazard_blob_disease.dm
index e4367e32be5..1ae2e3be5c4 100644
--- a/modular_skyrat/modules/biohazard_blob/code/biohazard_blob_disease.dm
+++ b/modular_skyrat/modules/biohazard_blob/code/biohazard_blob_disease.dm
@@ -29,7 +29,7 @@
if(3,4)
if(DT_PROB(2, delta_time))
to_chat(affected_mob, span_userdanger("You see four of everything!"))
- affected_mob.Dizzy(5)
+ affected_mob.set_timed_status_effect(10 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
if(DT_PROB(2, delta_time))
to_chat(affected_mob, span_danger("You suddenly feel exhausted."))
affected_mob.adjustStaminaLoss(30, FALSE)
diff --git a/modular_skyrat/modules/contractor/code/datums/contract.dm b/modular_skyrat/modules/contractor/code/datums/contract.dm
index 6f6b130a9c4..97e9b2a11cc 100644
--- a/modular_skyrat/modules/contractor/code/datums/contract.dm
+++ b/modular_skyrat/modules/contractor/code/datums/contract.dm
@@ -191,7 +191,7 @@
to_chat(target, span_warning("You feel strange..."))
sleep(6 SECONDS)
to_chat(target, span_warning("That pod did something to you..."))
- target.Dizzy(35)
+ target.set_timed_status_effect(70 SECONDS, /datum/status_effect/dizziness)
sleep(6 SECONDS)
to_chat(target, span_warning("Your head pounds... It feels like it's going to burst out your skull!"))
target.flash_act()
@@ -206,7 +206,7 @@
we thank you for providing them. Your value is expended, and you will be ransomed back to your station. We always get paid, \
so it's only a matter of time before we ship you back...\"")))
target.blur_eyes(10)
- target.Dizzy(15)
+ target.set_timed_status_effect(30 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
target.add_confusion(20)
/// We're returning the victim
@@ -246,7 +246,7 @@
target.flash_act()
target.blur_eyes(30)
- target.Dizzy(35)
+ target.set_timed_status_effect(70 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
target.add_confusion(20)
new /obj/effect/pod_landingzone(possible_drop_loc[pod_rand_loc], return_pod)
diff --git a/modular_skyrat/modules/customization/modules/surgery/organs/ipc.dm b/modular_skyrat/modules/customization/modules/surgery/organs/ipc.dm
index 2b0544ff085..8b8f94a8c37 100644
--- a/modular_skyrat/modules/customization/modules/surgery/organs/ipc.dm
+++ b/modular_skyrat/modules/customization/modules/surgery/organs/ipc.dm
@@ -70,13 +70,13 @@
switch(severity)
if(1)
owner.Jitter(30)
- owner.Dizzy(30)
+ owner.set_timed_status_effect(60 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
owner.Knockdown(80)
deaf = 30
to_chat(owner, span_warning("Your system reports a complete lack of input from your auditory sensors."))
if(2)
owner.Jitter(15)
- owner.Dizzy(15)
+ owner.set_timed_status_effect(30 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
owner.Knockdown(40)
to_chat(owner, span_warning("Your system reports anomalous feedback from your auditory sensors."))
diff --git a/modular_skyrat/modules/medical/code/wounds/bones.dm b/modular_skyrat/modules/medical/code/wounds/bones.dm
index 6f7ab7faaf6..bf2ca1748bd 100644
--- a/modular_skyrat/modules/medical/code/wounds/bones.dm
+++ b/modular_skyrat/modules/medical/code/wounds/bones.dm
@@ -377,7 +377,7 @@
to_chat(victim, span_userdanger("[user] finishes applying [I] to your [parse_zone(limb.body_zone)], and you can feel the bones exploding with pain as they begin melting and reforming!"))
else
var/painkiller_bonus = 0
- if(victim.drunkenness > 10)
+ if(victim.get_drunk_amount() > 10)
painkiller_bonus += 10
if(victim.reagents.has_reagent(/datum/reagent/medicine/morphine))
painkiller_bonus += 20
diff --git a/modular_skyrat/modules/morenarcotics/code/quaalude.dm b/modular_skyrat/modules/morenarcotics/code/quaalude.dm
index 784494e3544..e3888d6bfdf 100644
--- a/modular_skyrat/modules/morenarcotics/code/quaalude.dm
+++ b/modular_skyrat/modules/morenarcotics/code/quaalude.dm
@@ -22,7 +22,7 @@
game_plane_master_controller.add_filter("quaalude_wave", 10, wave_filter(300, 300, 3, 0, WAVE_SIDEWAYS))
M.set_timed_status_effect(1 MINUTES * REM * delta_time, /datum/status_effect/drugginess)
M.adjust_timed_status_effect(1 MINUTES, /datum/status_effect/speech/slurring/drunk)
- M.Dizzy(5 * REM * delta_time)
+ M.set_timed_status_effect(5 * REM * delta_time * 2 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
M.adjustStaminaLoss(-5 * REM * delta_time, 0)
if(DT_PROB(3.5, delta_time))
M.emote(pick("laugh","drool"))
diff --git a/modular_skyrat/modules/morenarcotics/code/thc.dm b/modular_skyrat/modules/morenarcotics/code/thc.dm
index e731f27990b..46ae26f0568 100644
--- a/modular_skyrat/modules/morenarcotics/code/thc.dm
+++ b/modular_skyrat/modules/morenarcotics/code/thc.dm
@@ -56,7 +56,7 @@
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "stoned", /datum/mood_event/stoned, name)
M.throw_alert("stoned", /atom/movable/screen/alert/stoned)
M.sound_environment_override = SOUND_ENVIRONMENT_DRUGGED
- M.Dizzy(5 * REM * delta_time)
+ M.set_timed_status_effect(5 * REM * delta_time * 2 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE)
M.adjust_nutrition(-1 * REM * delta_time) //munchies
if(DT_PROB(3.5, delta_time))
M.emote(pick("laugh","giggle"))
diff --git a/tgstation.dme b/tgstation.dme
index 080dd32197c..258080d9d5e 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -1185,7 +1185,9 @@
#include "code\datums\status_effects\stacking_effect.dm"
#include "code\datums\status_effects\wound_effects.dm"
#include "code\datums\status_effects\debuffs\debuffs.dm"
+#include "code\datums\status_effects\debuffs\dizziness.dm"
#include "code\datums\status_effects\debuffs\drugginess.dm"
+#include "code\datums\status_effects\debuffs\drunk.dm"
#include "code\datums\status_effects\debuffs\fire_stacks.dm"
#include "code\datums\status_effects\debuffs\speech_debuffs.dm"
#include "code\datums\votes\_vote_datum.dm"