Files
Yogstation/code/datums/brain_damage/creepy_trauma.dm
Molti df51b30a0c Deletes all gamemodes in favor of storytellers (#22661)
* storytellers

* Update _base_event.dm

* Update _base_event.dm

* storytellers and midround events

* work

* antags

* last

* Update vote.dm

* fixes

* Update backrooms.dm

* so long gay dynamic

* Update vote.dm

* dynamic unit test

* cleanup

* delete minimum pop

* fix

* storyteller tweaks

* traitor awakening

* Update traitor.dm

* Update _basemap.dm

* Update ghost.dm

* oh god so much stuff

* Update _logging.dm

* buh bye events

* Update nuclearbomb.dm

* Update collections.ts

* Revert "Update collections.ts"

This reverts commit ff93cf170a.

* maybe

* fix

* fix

* Update game_mode.dm

* fixes

* fixes and more logging

* oh good gravy

* Update portal_storm.dm

* bring them back

* Update gamemode_subsystem.dm

* Update admin_verbs.dm

* Update force_event.dm

* damnit

* Update _base_event.dm

* fixes

* more

* it compiles :)

* more

* passes linter

* Update radiation_leak.dm

* Update dolphin_migration.dm

* Update brother.dm

* Update gamemode_subsystem.dm

* Update _base_event.dm

* Update _base_event.dm

* updates

* fixup

* add vampire remove prompt

* Update vampire.dm

* Update vampire.dm

* Update vampire.dm

* Update _base_event.dm

* Update gamemode_subsystem.dm

* Update gamemode_subsystem.dm

* Update dolphin_migration.dm

* fix migration

* title icon

* fixes

* formatting

* Update gamemode_subsystem.dm

* Update tzimisce.dm

* Update tzimisce.dm

* Update gamemode_subsystem.dm

* Update storytellers.dm

* tweak for our pop

* Update darkspawn.dm

* Update gamemode_subsystem.dm

* tweaks and fixes

* more and less roundstart

* Update ghost.dm

* lol lets just port the voting system

* Update scrubber_overflow.dm

* fix scrubber

* bye gamemode

* cleanup

* Update clown_operative.dm

* Update clown_operative.dm

* Update _base_event.dm

* probably fixed

* Update supermatter_surge.dm

* buh bye

* Update brain_trauma.dm

* more

* new pseudogamemode vote

* tweaks

* Update gamemode_subsystem.dm

* Update high_priority_bounty.dm

* Update gamemode_subsystem.dm

* Update storytellers.dm

* Update high_priority_bounty.dm

* tweaks

* Update high_priority_bounty.dm

* Update high_priority_bounty.dm

* fixes

* fixes

* tweak

* Update obsessed.dm

* so long pal

* Update battleroyale.dm

* deletions

* Update implant_dusting.dm

* bye

* uplinks fix

* Update uplink_items.dm

* Update uplink_items.dm

* delete more gamemodes

* more

* lol one ctrl f change

* hm what

* Update antagonists.dm

* Revert "Update antagonists.dm"

This reverts commit c3c2ee192e.

* Revert "hm what"

This reverts commit 43dbbcebcf.

* Revert "lol one ctrl f change"

This reverts commit 95e28f5221.

* cleanup

* more stuff

* more deletion

* this one gone too

* you and only you i shall save

* Update revolution.dm

* hold this please

* it's done

* bye admin stuff

* Update uplink.dm

* Update alert.dm

* should be fine

* fixes

* tweaks

* fixes

* fixes

* Update ticker.dm

* this is important

* Update heretic.dm

* Update clown_operative.dm

* rewrite

* fixes

* Update clockwork_cult.dm

* fixes

* Update uplink_items.dm

* reorganize

* Update objective.dm

* rewrite nightmare

* Update storytellers.dm

* tweak

* tweaks

* Update stray_cargo.dm

* Update stray_cargo.dm

* Update stray_cargo.dm

* delete unneeded tgui

* Update ticker.dm

* Update roundend.dm

* Update anomaly_grav.dm

* Update gamemode_subsystem.dm

* Update statpanel.dm

* Update statpanel.dm

* no additional delay

* clean up

* Update _base_event.dm

* Update _event.dm

* antag token and brothers

* no token picked

* Update _base_event.dm

---------

Co-authored-by: Byemoh <baiomurang@gmail.com>
2024-10-18 17:20:14 -05:00

143 lines
5.6 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"
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_SURGERY
var/mob/living/obsession
var/datum/mind/obsessedmind
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 //just for roundend fun
var/time_spent_away = 0
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 = ""
qdel(src)
return
obsessedmind = obsession.mind
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()
/datum/brain_trauma/special/obsessed/on_life()
if(obsessedmind.current != obsession) //ensure we keep our target body up to date
obsession = obsessedmind.current
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 viewrange 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)
SEND_SIGNAL(owner, COMSIG_ADD_MOOD_EVENT, "creeping", /datum/mood_event/creeping, obsession.name)
total_time_creeping += 20
time_spent_away = 0
if(attachedobsessedobj)//if an objective needs to tick down, we can do that since traumas coexist with the antagonist datum
attachedobsessedobj.timer -= 20 //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 += 20
if(time_spent_away > 1800) //3 minutes
SEND_SIGNAL(owner, COMSIG_ADD_MOOD_EVENT, "creeping", /datum/mood_event/notcreepingsevere, obsession.name)
else
SEND_SIGNAL(owner, COMSIG_ADD_MOOD_EVENT, "creeping", /datum/mood_event/notcreeping, obsession.name)
/datum/brain_trauma/special/obsessed/on_lose()
..()
owner.mind.remove_antag_datum(/datum/antagonist/obsessed)
UnregisterSignal(obsession, COMSIG_MOB_EYECONTACT)
/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, 3) SECONDS)
if(owner.set_stutter_if_lower(3 SECONDS))
to_chat(owner, span_warning("Being near [obsession] makes you nervous and you begin to stutter..."))
/datum/brain_trauma/special/obsessed/on_hug(mob/living/hugger, mob/living/hugged)
if(hugged == obsession)
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.adjust_eye_blur(10)
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.adjustStaminaLoss(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)
owner.adjust_disgust(5)
to_chat(owner, span_userdanger("You gag and swallow a bit of bile..."))
/datum/brain_trauma/special/obsessed/proc/stare(datum/source, mob/living/examining_mob, triggering_examiner)
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/chosen_victim
var/list/possible_targets = list()
var/list/viable_minds = list()
for(var/mob/player in GLOB.player_list)//prevents crewmembers falling in love with nuke ops they never met, and other annoying hijinks
if(!player.mind)
continue
if(player.stat == DEAD)
continue
if(isnewplayer(player))
continue
if(isbrain(player))
continue
if(!player.client)
continue
if(player == owner)
continue
if(!SSjob.GetJob(player.mind.assigned_role))
continue
if(player.mind.quiet_round)
continue
viable_minds += player.mind
for(var/datum/mind/possible_target in viable_minds)
if(possible_target != owner && ishuman(possible_target.current))
possible_targets += possible_target.current
if(possible_targets.len > 0)
chosen_victim = pick(possible_targets)
return chosen_victim