[PTBF] Adds custom hallucination descriptions (#27651)

* adds custom hallucination descriptions

* removes useless code comments

* fixes indentation

* a couple of fixes

* Fixes pronoun helper

* more code fixes

* forgot something...

* updates a sentence

* hallucination can actually roll now, increases probability

* fixes indentation

* removes empty line

* resolves merge conflict

---------

Signed-off-by: MisterMovie <44909173+Accinator50@users.noreply.github.com>
This commit is contained in:
MisterMovie
2025-01-10 03:33:46 +01:00
committed by GitHub
parent f63e40231e
commit 57c3b9b960
5 changed files with 51 additions and 1 deletions
@@ -196,3 +196,21 @@
target?.health_hud_override = HEALTH_HUD_OVERRIDE_NONE
target?.update_health_hud()
return ..()
/**
* # Hallucination - Examine Hallucination
*
* A generic hallucination that causes the target to see unique examine descriptions
*/
/obj/effect/hallucination/examine_hallucination
var/trait_applied = TRAIT_EXAMINE_HALLUCINATING
duration = list(40 SECONDS, 60 SECONDS)
/obj/effect/hallucination/examine_hallucination/Initialize(mapload, mob/living/carbon/hallucination_target)
. = ..()
ADD_TRAIT(hallucination_target, trait_applied, UNIQUE_TRAIT_SOURCE(src))
/obj/effect/hallucination/examine_hallucination/Destroy()
REMOVE_TRAIT(target, trait_applied, UNIQUE_TRAIT_SOURCE(src))
return ..()
@@ -6,6 +6,7 @@ GLOBAL_LIST_INIT(hallucinations, list(
/obj/effect/hallucination/speech = 15,
/obj/effect/hallucination/audio = 25,
/obj/effect/hallucination/audio/localized = 25,
/obj/effect/hallucination/examine_hallucination = 25,
),
HALLUCINATE_MODERATE = list(
/obj/effect/hallucination/delusion = 5,
+28
View File
@@ -90,6 +90,7 @@
/mob/living/carbon/examine(mob/user)
if(HAS_TRAIT(src, TRAIT_UNKNOWN))
return list("<span class='notice'>You're struggling to make out any details...</span>")
var/skipgloves = FALSE
var/skipsuitstorage = FALSE
var/skipjumpsuit = FALSE
@@ -98,6 +99,7 @@
var/skipears = FALSE
var/skipeyes = FALSE
var/skipface = FALSE
var/hallucinating = HAS_TRAIT(user, TRAIT_EXAMINE_HALLUCINATING)
//exosuits and helmets obscure our view and stuff.
if(wear_suit)
@@ -165,6 +167,32 @@
// add any extra info on the limbs themselves
msg += examine_handle_individual_limb(limb_name)
// hallucinating?
if(hallucinating && prob(50))
// List of hallucination messages
var/list/hallucination_texts = list(
"You blink, and for a moment, [p_their()] body shimmers like a mirage, [p_their()] gaze unsettlingly intense.",
"[p_they(TRUE)] appear[p_s()] to be surrounded by a swarm of tiny, glowing butterflies.",
"[p_they(TRUE)] [p_are()] wearing a crown made of spaghetti. Wait, no... it's gone now.",
"[p_they(TRUE)] look[p_s()] suspicious, as if plotting a jelly heist.",
"[p_they(TRUE)] begin[p_s()] to hum a tune, but the sound seems to echo from all directions at once.",
"[p_they(TRUE)] smile [p_s()], and for a second, [p_their()] face twists into a thousand tiny reflections.",
"[p_they(TRUE)] seem[p_s()] to float slightly above the ground, [p_their()] feet just brushing against the floor.",
"[p_their(TRUE)] hands flicker like holograms, shifting between different gestures before returning to normal.",
"[p_they(TRUE)] seems to be cloaked in a faint, swirling fog that disappears the moment you focus on it.",
"You glance at [p_them()], and for an instant, [p_their()] shadow stretches unnaturally long, as if reaching for something just out of view. Did that shadow have a face?",
"You glance at [p_them()], and for a moment, [p_their()] eyes seem to flash with a strange, metallic gleam. You could have sworn it was gold... or was it red?",
"[p_they(TRUE)] seem[p_s()] to be walking straight towards you, [p_their()] silhouette stretching longer than it should. Were [p_their()] footsteps too quiet? Or is it just you? There's something off about the way [p_they()] move[p_s()].",
"For a moment, [p_they()] snap[p_s()] to an odd position, [p_their()] head and legs stiff and unwavering. [p_their(TRUE)] arms are outstretched to [p_their()] sides, and you see black where [p_their()] eyes should be.",
"[p_they(TRUE)] [p_have()] no face. There's an impossibly dark layer of nothingness where it should be. [p_their(TRUE)] sclerae are the only indication [p_they()] still [p_have()] eyes.",
"You swear you just saw [p_them()] sobbing and begging!",
"[p_they(TRUE)] [p_are()] bleeding profusely! [p_their(TRUE)] blood is crawling its way back in!",
"[p_their(TRUE)] head violently jerks to meet your gaze."
)
// Pick a random hallucination description
var/random_text = pick(hallucination_texts)
msg += "<span class='warning'>[random_text]</span>\n"
//handcuffed?
if(handcuffed)
if(istype(handcuffed, /obj/item/restraints/handcuffs/cable/zipties))