Files
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

169 lines
7.7 KiB
Plaintext

/datum/brain_trauma/special/obsessed
name = "Psychotic Schizophrenia"
desc = "Patient has a subtype of delusional disorder, becoming irrationally attached to someone."
scan_desc = "psychotic schizophrenic delusions"
symptoms = "Exhibits obsessive behaviors towards a specific individual, \
including frequent staring, intrusive thoughts, and an overwhelming desire to be near them. \
This obsession can lead to social withdrawal, anxiety, and impaired daily functioning."
gain_text = "If you see this message, make a github issue report. The trauma initialized wrong."
lose_text = span_warning("The voices in your head fall silent.")
can_gain = TRUE
random_gain = FALSE
resilience = TRAUMA_RESILIENCE_LOBOTOMY
var/mob/living/obsession
var/datum/objective/spendtime/attachedobsessedobj
var/datum/antagonist/obsessed/antagonist
var/viewing = FALSE //it's a lot better to store if the owner is watching the obsession than checking it twice between two procs
var/total_time_creeping = 0 SECONDS //just for round end fun
var/time_spent_away = 0 SECONDS
var/obsession_hug_count = 0
/datum/brain_trauma/special/obsessed/on_gain()
//setup, linking, etc//
if(!obsession)//admins didn't set one
obsession = find_obsession()
if(!obsession)//we didn't find one
lose_text = ""
return FALSE
// BUBBER EDIT ADDITION BEGIN - Antag banned can't roll obsessed
if(is_banned_from(owner.ckey, list(ROLE_SYNDICATE, BAN_ANTAGONIST)))
return FALSE
// BUBBER EDIT ADDITION END - Antag banned can't roll obsessed
gain_text = span_warning("You hear a sickening, raspy voice in your head. It wants one small task of you...")
owner.mind.add_antag_datum(/datum/antagonist/obsessed)
antagonist = owner.mind.has_antag_datum(/datum/antagonist/obsessed)
antagonist.trauma = src
RegisterSignal(obsession, COMSIG_MOB_EYECONTACT, PROC_REF(stare))
. = ..()
//antag stuff//
antagonist.forge_objectives(obsession.mind)
antagonist.greet()
log_game("[key_name(antagonist)] has developed an obsession with [key_name(obsession)].")
RegisterSignal(owner, COMSIG_CARBON_HELPED, PROC_REF(on_hug))
owner.apply_status_effect(/datum/status_effect/desensitized, REF(src), DESENSITIZED_THRESHOLD)
/datum/brain_trauma/special/obsessed/on_life(seconds_per_tick)
if(!obsession || obsession.stat == DEAD)
viewing = FALSE//important, makes sure you no longer stutter when happy if you murdered them while viewing
return
if(get_dist(get_turf(owner), get_turf(obsession)) > 7)
viewing = FALSE //they are further than our view range they are not viewing us
out_of_view()
return//so we're not searching everything in view every tick
if(obsession in view(7, owner))
viewing = TRUE
else
viewing = FALSE
if(viewing)
owner.add_mood_event("creeping", /datum/mood_event/creeping, obsession.name)
total_time_creeping += seconds_per_tick SECONDS
time_spent_away = 0 SECONDS
if(attachedobsessedobj)//if an objective needs to tick down, we can do that since traumas coexist with the antagonist datum
attachedobsessedobj.timer -= seconds_per_tick SECONDS //mob subsystem ticks every 2 seconds(?), remove 20 deciseconds from the timer. sure, that makes sense.
else
out_of_view()
/datum/brain_trauma/special/obsessed/proc/out_of_view()
time_spent_away += 2 SECONDS
if(time_spent_away > 3 MINUTES) //3 minutes
owner.add_mood_event("creeping", /datum/mood_event/notcreepingsevere, obsession.name)
else
owner.add_mood_event("creeping", /datum/mood_event/notcreeping, obsession.name)
/datum/brain_trauma/special/obsessed/on_lose()
..()
if (owner.mind.remove_antag_datum(/datum/antagonist/obsessed))
owner.mind.add_antag_datum(/datum/antagonist/former_obsessed)
owner.clear_mood_event("creeping")
if(obsession)
log_game("[key_name(owner)] is no longer obsessed with [key_name(obsession)].")
UnregisterSignal(obsession, COMSIG_MOB_EYECONTACT)
owner.remove_status_effect(/datum/status_effect/desensitized, REF(src))
/datum/brain_trauma/special/obsessed/handle_speech(datum/source, list/speech_args)
if(!viewing)
return
if(prob(25)) // 25% chances to be nervous and stutter.
if(prob(50)) // 12.5% chance (previous check taken into account) of doing something suspicious.
addtimer(CALLBACK(src, PROC_REF(on_failed_social_interaction)), rand(1 SECONDS, 3 SECONDS))
else if(!owner.has_status_effect(/datum/status_effect/speech/stutter))
to_chat(owner, span_warning("Being near [obsession] makes you nervous and you begin to stutter..."))
owner.set_stutter_if_lower(6 SECONDS)
/// Singal proc for [COMSIG_CARBON_HELPED], when our obsessed helps (hugs) our obsession, increases hug count
/datum/brain_trauma/special/obsessed/proc/on_hug(datum/source, mob/living/hugged)
SIGNAL_HANDLER
if(hugged != obsession)
return
obsession_hug_count++
/datum/brain_trauma/special/obsessed/proc/on_failed_social_interaction()
if(QDELETED(owner) || owner.stat >= UNCONSCIOUS)
return
switch(rand(1, 100))
if(1 to 40)
INVOKE_ASYNC(owner, TYPE_PROC_REF(/mob, emote), pick("blink", "blink_r"))
owner.set_eye_blur_if_lower(20 SECONDS)
to_chat(owner, span_userdanger("You sweat profusely and have a hard time focusing..."))
if(41 to 80)
INVOKE_ASYNC(owner, TYPE_PROC_REF(/mob, emote), "pale")
shake_camera(owner, 15, 1)
owner.adjust_stamina_loss(70)
to_chat(owner, span_userdanger("You feel your heart lurching in your chest..."))
if(81 to 100)
INVOKE_ASYNC(owner, TYPE_PROC_REF(/mob, emote), "cough")
owner.adjust_dizzy(20 SECONDS)
owner.adjust_disgust(5)
to_chat(owner, span_userdanger("You gag and swallow a bit of bile..."))
// if the creep examines first, then the obsession examines them, have a 50% chance to possibly blow their cover. wearing a mask avoids this risk
/datum/brain_trauma/special/obsessed/proc/stare(datum/source, mob/living/examining_mob, triggering_examiner)
SIGNAL_HANDLER
if(examining_mob != owner || !triggering_examiner || prob(50))
return
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(to_chat), obsession, span_warning("You catch [examining_mob] staring at you..."), 3))
return COMSIG_BLOCK_EYECONTACT
/datum/brain_trauma/special/obsessed/proc/find_obsession()
var/list/viable_minds = list() //The first list, which excludes hijinks
var/list/possible_targets = list() //The second list, which filters out silicons and simplemobs
var/static/list/trait_obsessions = list(
JOB_MIME = TRAIT_MIME_FAN,
JOB_CLOWN = TRAIT_CLOWN_ENJOYER,
JOB_CHAPLAIN = TRAIT_SPIRITUAL,
) // Jobs and their corresponding quirks
var/list/special_pool = list() //The special list, for quirk-based
var/chosen_victim //The obsession target
for(var/mob/player as anything in GLOB.player_list)//prevents crew members falling in love with nuke ops they never met, and other annoying hijinks
if(!player.client || !player.mind || isnewplayer(player) || player.stat == DEAD || isbrain(player) || player == owner)
continue
if(!(player.mind.assigned_role.job_flags & JOB_CREW_MEMBER))
continue
// SKYRAT EDIT ADDITION START - Players in the interlink can't be obsession targets
if(SSticker.IsRoundInProgress() && istype(get_area(player), /area/centcom/interlink))
continue
// SKYRAT EDIT END
viable_minds += player.mind
for(var/datum/mind/possible_target as anything in viable_minds)
if(possible_target != owner && ishuman(possible_target.current))
var/job = possible_target.assigned_role.title
if (trait_obsessions[job] != null && HAS_TRAIT(owner, trait_obsessions[job]))
special_pool += possible_target.current
possible_targets += possible_target.current
//Do we have any special target?
if(length(special_pool))
chosen_victim = pick(special_pool)
return chosen_victim
//If not, pick any other ordinary target
if(possible_targets.len > 0)
chosen_victim = pick(possible_targets)
return chosen_victim