Files
Bubberstation/code/modules/reagents/withdrawal/generic_addictions.dm
nevimer 00ccf0c6b5 Merge remote-tracking branch 'tgstation/master' into upstream-feb12-2026
# Conflicts:
#	.github/CODEOWNERS
#	.github/workflows/compile_changelogs.yml
#	.github/workflows/stale.yml
#	SQL/database_changelog.md
#	_maps/map_files/CatwalkStation/CatwalkStation_2023.dmm
#	code/__DEFINES/atom_hud.dm
#	code/__DEFINES/inventory.dm
#	code/__DEFINES/mobs.dm
#	code/__DEFINES/species_clothing_paths.dm
#	code/__DEFINES/subsystems.dm
#	code/__DEFINES/surgery.dm
#	code/__HELPERS/global_lists.dm
#	code/_globalvars/lists/maintenance_loot.dm
#	code/_globalvars/traits/_traits.dm
#	code/controllers/subsystem/minor_mapping.dm
#	code/controllers/subsystem/processing/quirks.dm
#	code/controllers/subsystem/shuttle.dm
#	code/datums/components/palette.dm
#	code/datums/components/surgery_initiator.dm
#	code/datums/diseases/advance/advance.dm
#	code/datums/hud.dm
#	code/datums/mood.dm
#	code/datums/mutations/chameleon.dm
#	code/datums/quirks/negative_quirks/nyctophobia.dm
#	code/datums/status_effects/debuffs/debuffs.dm
#	code/datums/status_effects/debuffs/drunk.dm
#	code/datums/status_effects/debuffs/slime/slime_leech.dm
#	code/datums/weather/weather.dm
#	code/game/data_huds.dm
#	code/game/objects/items.dm
#	code/game/objects/items/devices/scanners/health_analyzer.dm
#	code/game/objects/items/frog_statue.dm
#	code/game/objects/items/rcd/RLD.dm
#	code/game/objects/items/robot/items/hypo.dm
#	code/game/objects/items/stacks/medical.dm
#	code/game/objects/items/stacks/wrap.dm
#	code/game/objects/items/storage/garment.dm
#	code/game/objects/items/tools/medical/defib.dm
#	code/game/objects/items/weaponry.dm
#	code/game/objects/items/weaponry/melee/misc.dm
#	code/game/objects/structures/crates_lockers/closets/secure/security.dm
#	code/game/objects/structures/curtains.dm
#	code/game/objects/structures/dresser.dm
#	code/game/objects/structures/girders.dm
#	code/game/objects/structures/maintenance.dm
#	code/game/objects/structures/mirror.dm
#	code/modules/admin/greyscale_modify_menu.dm
#	code/modules/admin/verbs/light_debug.dm
#	code/modules/antagonists/ashwalker/ashwalker.dm
#	code/modules/antagonists/heretic/knowledge/starting_lore.dm
#	code/modules/antagonists/ninja/ninjaDrainAct.dm
#	code/modules/art/paintings.dm
#	code/modules/client/preferences.dm
#	code/modules/client/verbs/ooc.dm
#	code/modules/clothing/head/wig.dm
#	code/modules/events/disease_outbreak.dm
#	code/modules/holodeck/holo_effect.dm
#	code/modules/jobs/job_types/head_of_security.dm
#	code/modules/jobs/job_types/security_officer.dm
#	code/modules/library/skill_learning/generic_skillchips/point.dm
#	code/modules/mining/lavaland/ash_flora.dm
#	code/modules/mining/lavaland/mining_loot/megafauna/ash_drake.dm
#	code/modules/mob/dead/new_player/new_player.dm
#	code/modules/mob/living/basic/guardian/guardian.dm
#	code/modules/mob/living/basic/space_fauna/space_dragon/space_dragon.dm
#	code/modules/mob/living/carbon/carbon.dm
#	code/modules/mob/living/carbon/human/human.dm
#	code/modules/mob/living/carbon/human/human_defines.dm
#	code/modules/mob/living/carbon/life.dm
#	code/modules/mob/living/living.dm
#	code/modules/mob/living/living_defines.dm
#	code/modules/mob/mob.dm
#	code/modules/mob_spawn/ghost_roles/mining_roles.dm
#	code/modules/mod/mod_control.dm
#	code/modules/mod/modules/modules_general.dm
#	code/modules/modular_computers/computers/item/computer_ui.dm
#	code/modules/paperwork/paper.dm
#	code/modules/paperwork/paperbin.dm
#	code/modules/power/lighting/light.dm
#	code/modules/projectiles/guns/energy/kinetic_accelerator.dm
#	code/modules/projectiles/projectile.dm
#	code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm
#	code/modules/reagents/chemistry/reagents/food_reagents.dm
#	code/modules/reagents/chemistry/reagents/other_reagents.dm
#	code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm
#	code/modules/research/xenobiology/crossbreeding/_clothing.dm
#	code/modules/research/xenobiology/crossbreeding/prismatic.dm
#	code/modules/surgery/advanced/brainwashing.dm
#	code/modules/surgery/advanced/lobotomy.dm
#	code/modules/surgery/amputation.dm
#	code/modules/surgery/blood_filter.dm
#	code/modules/surgery/bodyparts/_bodyparts.dm
#	code/modules/surgery/brain_surgery.dm
#	code/modules/surgery/cavity_implant.dm
#	code/modules/surgery/coronary_bypass.dm
#	code/modules/surgery/gastrectomy.dm
#	code/modules/surgery/healing.dm
#	code/modules/surgery/limb_augmentation.dm
#	code/modules/surgery/organ_manipulation.dm
#	code/modules/surgery/revival.dm
#	code/modules/surgery/sleeper_protocol.dm
#	code/modules/surgery/surgery_helpers.dm
#	code/modules/surgery/surgery_step.dm
#	code/modules/unit_tests/_unit_tests.dm
#	code/modules/unit_tests/designs.dm
#	code/modules/unit_tests/icon_state_worn.dm
#	code/modules/unit_tests/screenshots/screenshot_antag_icons_cultist.png
#	code/modules/unit_tests/screenshots/screenshot_antag_icons_headrevolutionary.png
#	code/modules/unit_tests/screenshots/screenshot_antag_icons_provocateur.png
#	code/modules/unit_tests/screenshots/screenshot_husk_body.png
#	code/modules/unit_tests/screenshots/screenshot_husk_body_missing_limbs.png
#	icons/map_icons/clothing/head/_head.dmi
#	icons/map_icons/clothing/shoes.dmi
#	icons/map_icons/items/_item.dmi
#	icons/mob/huds/hud.dmi
#	icons/mob/inhands/64x64_lefthand.dmi
#	icons/mob/inhands/64x64_righthand.dmi
#	icons/obj/machines/computer.dmi
#	tgui/packages/tgui/interfaces/OperatingComputer.jsx
#	tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferences/MainPage.tsx
#	tgui/packages/tgui/interfaces/PreferencesMenu/types.ts
#	tgui/packages/tgui/interfaces/SurgeryInitiator.tsx
#	tools/icon_cutter/check.py
2026-02-12 23:50:09 -05:00

314 lines
14 KiB
Plaintext

///Opioids
/datum/addiction/opioids
name = "opioid"
description = "Patient has developed a dependence on opioid substances."
symptoms = "Expresses a desire for painkillers, and when in withdrawl, experiences drowsiness, high blood pressure, and nausea."
withdrawal_stage_messages = list("I feel aches in my bodies..", "I need some pain relief...", "It aches all over...I need some opioids!")
/datum/addiction/opioids/withdrawal_stage_1_process(mob/living/carbon/affected_carbon, seconds_per_tick)
. = ..()
if(SPT_PROB(10, seconds_per_tick))
affected_carbon.emote("yawn")
/datum/addiction/opioids/withdrawal_enters_stage_2(mob/living/carbon/affected_carbon)
. = ..()
affected_carbon.apply_status_effect(/datum/status_effect/high_blood_pressure)
/datum/addiction/opioids/withdrawal_stage_3_process(mob/living/carbon/affected_carbon, seconds_per_tick)
. = ..()
if(affected_carbon.disgust < DISGUST_LEVEL_DISGUSTED && SPT_PROB(7.5, seconds_per_tick))
affected_carbon.adjust_disgust(12.5 * seconds_per_tick)
/datum/addiction/opioids/end_withdrawal(mob/living/carbon/affected_carbon)
. = ..()
affected_carbon.remove_status_effect(/datum/status_effect/high_blood_pressure)
affected_carbon.set_disgust(affected_carbon.disgust * 0.5) //half their disgust to help
///Stimulants
/datum/addiction/stimulants
name = "stimulant"
description = "Patient has developed a dependence on stimulant substances."
symptoms = "Expresses a desire for stimulants, and when in withdrawal, experiences fatigue, slowness, and difficulty concentrating."
withdrawal_stage_messages = list("You feel a bit tired...You could really use a pick me up.", "You are getting a bit woozy...", "So...Tired...")
/datum/addiction/stimulants/withdrawal_enters_stage_1(mob/living/carbon/affected_carbon)
. = ..()
affected_carbon.add_actionspeed_modifier(/datum/actionspeed_modifier/stimulants)
/datum/addiction/stimulants/withdrawal_enters_stage_2(mob/living/carbon/affected_carbon)
. = ..()
affected_carbon.apply_status_effect(/datum/status_effect/woozy)
/datum/addiction/stimulants/withdrawal_enters_stage_3(mob/living/carbon/affected_carbon)
. = ..()
affected_carbon.add_movespeed_modifier(/datum/movespeed_modifier/stimulants)
/datum/addiction/stimulants/end_withdrawal(mob/living/carbon/affected_carbon)
. = ..()
affected_carbon.remove_actionspeed_modifier(ACTIONSPEED_ID_STIMULANTS)
affected_carbon.remove_status_effect(/datum/status_effect/woozy)
affected_carbon.remove_movespeed_modifier(MOVESPEED_ID_STIMULANTS)
///Alcohol
/datum/addiction/alcohol
name = "alcohol"
description = "Patient has developed a dependence on alcohol."
symptoms = "Expresses a desire for alcoholic beverages, and when in withdrawal, experiences jitteriness, hallucinations, and potentially seizures."
withdrawal_stage_messages = list("I could use a drink...", "Maybe the bar is still open?..", "God I need a drink!")
/datum/addiction/alcohol/withdrawal_stage_1_process(mob/living/carbon/affected_carbon, seconds_per_tick)
. = ..()
affected_carbon.set_jitter_if_lower(10 SECONDS * seconds_per_tick)
/datum/addiction/alcohol/withdrawal_stage_2_process(mob/living/carbon/affected_carbon, seconds_per_tick)
. = ..()
affected_carbon.set_jitter_if_lower(20 SECONDS * seconds_per_tick)
affected_carbon.set_hallucinations_if_lower(10 SECONDS)
/datum/addiction/alcohol/withdrawal_stage_3_process(mob/living/carbon/affected_carbon, seconds_per_tick)
. = ..()
affected_carbon.set_jitter_if_lower(30 SECONDS * seconds_per_tick)
affected_carbon.set_hallucinations_if_lower(10 SECONDS)
if(SPT_PROB(4, seconds_per_tick) && !HAS_TRAIT(affected_carbon, TRAIT_ANTICONVULSANT))
affected_carbon.apply_status_effect(/datum/status_effect/seizure)
/datum/addiction/hallucinogens
name = "hallucinogen"
description = "Patient has developed a dependence on hallucinogenic substances."
symptoms = "Expresses a desire for hallucinogens, and when in withdrawal, experiences feelings of emptiness, difficulty seeing, and disconnection from reality."
withdrawal_stage_messages = list("I feel so empty...", "I wonder what the machine elves are up to?..", "I need to see the beautiful colors again!!")
/datum/addiction/hallucinogens/withdrawal_enters_stage_2(mob/living/carbon/affected_carbon)
. = ..()
var/atom/movable/plane_master_controller/game_plane_master_controller = affected_carbon.hud_used.plane_master_controllers[PLANE_MASTERS_GAME]
game_plane_master_controller.add_filter("hallucinogen_blur", 10, angular_blur_filter(0, 0, 3))
game_plane_master_controller.add_filter("hallucinogen_wave", 10, wave_filter(300, 300, 3, 0, WAVE_SIDEWAYS))
/datum/addiction/hallucinogens/withdrawal_enters_stage_3(mob/living/carbon/affected_carbon)
. = ..()
affected_carbon.apply_status_effect(/datum/status_effect/trance, 40 SECONDS, TRUE)
/datum/addiction/hallucinogens/end_withdrawal(mob/living/carbon/affected_carbon)
. = ..()
var/atom/movable/plane_master_controller/game_plane_master_controller = affected_carbon.hud_used.plane_master_controllers[PLANE_MASTERS_GAME]
game_plane_master_controller.remove_filter("hallucinogen_blur")
game_plane_master_controller.remove_filter("hallucinogen_wave")
affected_carbon.remove_status_effect(/datum/status_effect/trance, 40 SECONDS, TRUE)
/datum/addiction/maintenance_drugs
name = "maintenance drug"
description = "Patient has developed a dependence on maintenance drugs."
symptoms = "Expresses a desire for maintenance drugs, and when in withdrawal, experiences various adaptions \
such as light sensitivity, numbness, changes to taste, enhanced hair growth, and greater low light vision."
withdrawal_stage_messages = list("", "", "")
/datum/addiction/maintenance_drugs/withdrawal_enters_stage_1(mob/living/carbon/affected_carbon)
. = ..()
affected_carbon.apply_status_effect(/datum/status_effect/grouped/screwy_hud/fake_healthy, type)
/datum/addiction/maintenance_drugs/withdrawal_stage_1_process(mob/living/carbon/affected_carbon, seconds_per_tick)
. = ..()
if(SPT_PROB(7.5, seconds_per_tick))
affected_carbon.emote("growls")
/datum/addiction/maintenance_drugs/withdrawal_enters_stage_2(mob/living/carbon/affected_carbon)
. = ..()
if(!ishuman(affected_carbon))
return
var/mob/living/carbon/human/affected_human = affected_carbon
if(affected_human.gender == MALE)
to_chat(affected_human, span_warning("Your chin itches."))
affected_human.set_facial_hairstyle("Beard (Full)", update = TRUE)
//Only like gross food
var/obj/item/organ/tongue/tongue = affected_carbon.get_organ_slot(ORGAN_SLOT_TONGUE)
if(!tongue)
return
tongue.liked_foodtypes = GROSS
tongue.disliked_foodtypes = NONE
tongue.toxic_foodtypes = ~GROSS
/datum/addiction/maintenance_drugs/withdrawal_enters_stage_3(mob/living/carbon/affected_carbon)
. = ..()
if(!ishuman(affected_carbon))
return
to_chat(affected_carbon, span_warning("You feel yourself adapt to the darkness."))
var/mob/living/carbon/human/affected_human = affected_carbon
var/obj/item/organ/eyes/empowered_eyes = affected_human.get_organ_by_type(/obj/item/organ/eyes)
if(empowered_eyes)
ADD_TRAIT(affected_human, TRAIT_NIGHT_VISION, "maint_drug_addiction")
empowered_eyes?.refresh()
/datum/addiction/maintenance_drugs/withdrawal_stage_3_process(mob/living/carbon/affected_carbon, seconds_per_tick)
if(!ishuman(affected_carbon))
return
var/mob/living/carbon/human/affected_human = affected_carbon
var/turf/T = get_turf(affected_human)
var/lums = T.get_lumcount()
if(lums > 0.5)
affected_human.add_mood_event("too_bright", /datum/mood_event/bright_light)
affected_human.adjust_dizzy_up_to(6 SECONDS, 80 SECONDS)
affected_human.adjust_confusion_up_to(0.5 SECONDS * seconds_per_tick, 20 SECONDS)
else
affected_carbon.clear_mood_event("too_bright")
/datum/addiction/maintenance_drugs/end_withdrawal(mob/living/carbon/affected_carbon)
. = ..()
affected_carbon.remove_status_effect(/datum/status_effect/grouped/screwy_hud/fake_healthy, type)
//restore tongue's tastes
var/obj/item/organ/tongue/tongue = affected_carbon.get_organ_slot(ORGAN_SLOT_TONGUE)
if(tongue)
tongue.liked_foodtypes = initial(tongue.liked_foodtypes)
tongue.disliked_foodtypes = initial(tongue.disliked_foodtypes)
tongue.toxic_foodtypes = initial(tongue.toxic_foodtypes)
if(!ishuman(affected_carbon))
return
var/mob/living/carbon/human/affected_human = affected_carbon
REMOVE_TRAIT(affected_human, TRAIT_NIGHT_VISION, "maint_drug_addiction")
var/obj/item/organ/eyes/eyes = affected_human.get_organ_by_type(/obj/item/organ/eyes)
eyes?.refresh()
///Makes you a hypochondriac - I'd like to call it hypochondria, but "I could use some hypochondria" doesn't work
/datum/addiction/medicine
name = "medicine"
description = "Patient has developed a dependence on medicine, similar to that of Hypochondria."
symptoms = "Expresses a need for medication despite being otherwise healthy, and when in withdrawal, \
experiences coughing fits, hallucinations, and distorted health perceptions."
withdrawal_stage_messages = list("", "", "")
/// Weakref to the "fake alert" hallucination we're giving to the addicted
var/datum/weakref/fake_alert_ref
/// Weakref to the "health doll screwup" hallucination we're giving to the addicted
var/datum/weakref/health_doll_ref
/datum/addiction/medicine/withdrawal_enters_stage_1(mob/living/carbon/affected_carbon)
. = ..()
if(!ishuman(affected_carbon))
return
var/datum/hallucination/health_doll = affected_carbon.cause_hallucination( \
/datum/hallucination/fake_health_doll, \
"medicine addiction", \
severity = 1, \
duration = 120 MINUTES, \
)
if(!health_doll)
return
health_doll_ref = WEAKREF(health_doll)
/datum/addiction/medicine/withdrawal_stage_1_process(mob/living/carbon/affected_carbon, seconds_per_tick)
. = ..()
if(SPT_PROB(1, seconds_per_tick))
affected_carbon.emote("cough")
/datum/addiction/medicine/withdrawal_enters_stage_2(mob/living/carbon/affected_carbon)
. = ..()
var/list/possibilities = list()
if(!HAS_TRAIT(affected_carbon, TRAIT_RESISTHEAT))
possibilities += /datum/hallucination/fake_alert/hot
if(!HAS_TRAIT(affected_carbon, TRAIT_RESISTCOLD))
possibilities += /datum/hallucination/fake_alert/cold
var/obj/item/organ/lungs/lungs = affected_carbon.get_organ_slot(ORGAN_SLOT_LUNGS)
if(lungs)
if(lungs.safe_oxygen_min)
possibilities += /datum/hallucination/fake_alert/need_oxygen
if(lungs.safe_oxygen_max)
possibilities += /datum/hallucination/fake_alert/bad_oxygen
if(!length(possibilities))
return
var/datum/hallucination/fake_alert = affected_carbon.cause_hallucination( \
pick(possibilities), \
"medicine addiction", \
duration = 120 MINUTES, \
)
if(!fake_alert)
return
fake_alert_ref = WEAKREF(fake_alert)
/datum/addiction/medicine/withdrawal_stage_2_process(mob/living/carbon/affected_carbon, seconds_per_tick)
. = ..()
if(SPT_PROB(2, seconds_per_tick))
affected_carbon.emote("cough")
var/datum/hallucination/fake_health_doll/hallucination = health_doll_ref?.resolve()
if(QDELETED(hallucination))
health_doll_ref = null
return
if(SPT_PROB(10, seconds_per_tick))
hallucination.add_fake_limb(severity = 1)
return
if(SPT_PROB(5, seconds_per_tick))
hallucination.increment_fake_damage()
return
/datum/addiction/medicine/withdrawal_enters_stage_3(mob/living/carbon/affected_carbon)
. = ..()
affected_carbon.apply_status_effect(/datum/status_effect/grouped/screwy_hud/fake_crit, type)
/datum/addiction/medicine/withdrawal_stage_3_process(mob/living/carbon/affected_carbon, seconds_per_tick)
. = ..()
if(SPT_PROB(5, seconds_per_tick))
affected_carbon.emote("cough")
var/datum/hallucination/fake_health_doll/hallucination = health_doll_ref?.resolve()
if(!QDELETED(hallucination) && SPT_PROB(5, seconds_per_tick))
hallucination.increment_fake_damage()
return
if(SPT_PROB(65, seconds_per_tick))
return
if(affected_carbon.stat >= SOFT_CRIT)
return
var/obj/item/organ/organ = pick(affected_carbon.organs)
if(organ.low_threshold)
to_chat(affected_carbon, organ.low_threshold_passed)
return
else if (organ.high_threshold_passed)
to_chat(affected_carbon, organ.high_threshold_passed)
return
to_chat(affected_carbon, span_warning("You feel a dull pain in your [organ.name]."))
/datum/addiction/medicine/end_withdrawal(mob/living/carbon/affected_carbon)
. = ..()
affected_carbon.remove_status_effect(/datum/status_effect/grouped/screwy_hud/fake_crit, type)
QDEL_NULL(fake_alert_ref)
QDEL_NULL(health_doll_ref)
/* SKYRAT EDIT REMOVAL START - MOVED TO MODULAR.
///Nicotine
/datum/addiction/nicotine
name = "nicotine"
description = "Patient has developed a dependence on nicotine."
symptoms = "Expresses a desire for nicotine products, and when in withdrawal, experiences jitteriness, coughing, and difficulty concentrating."
addiction_relief_treshold = MIN_NICOTINE_ADDICTION_REAGENT_AMOUNT //much less because your intake is probably from ciggies
withdrawal_stage_messages = list("Feel like having a smoke...", "Getting antsy. Really need a smoke now.", "I can't take it! Need a smoke NOW!")
medium_withdrawal_moodlet = /datum/mood_event/nicotine_withdrawal_moderate
severe_withdrawal_moodlet = /datum/mood_event/nicotine_withdrawal_severe
/datum/addiction/nicotine/withdrawal_enters_stage_1(mob/living/carbon/affected_carbon, seconds_per_tick)
. = ..()
affected_carbon.set_jitter_if_lower(10 SECONDS * seconds_per_tick)
/datum/addiction/nicotine/withdrawal_stage_2_process(mob/living/carbon/affected_carbon, seconds_per_tick)
. = ..()
affected_carbon.set_jitter_if_lower(20 SECONDS * seconds_per_tick)
if(SPT_PROB(2, seconds_per_tick))
affected_carbon.emote("cough")
/datum/addiction/nicotine/withdrawal_stage_3_process(mob/living/carbon/affected_carbon, seconds_per_tick)
. = ..()
affected_carbon.set_jitter_if_lower(30 SECONDS * seconds_per_tick)
if(SPT_PROB(5, seconds_per_tick))
affected_carbon.emote("cough")
*/ // SKYRAT EDIT REMOVAL END