Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PTBF] Adds custom hallucination descriptions #27651

Merged
merged 15 commits into from
Jan 10, 2025
Merged
1 change: 1 addition & 0 deletions code/__HELPERS/trait_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_MINDFLAYER_NULLIFIED "flayer_nullified" //The mindflayer will not be able to activate their abilities, or drain swarms from people
#define TRAIT_FLYING "flying"
#define TRAIT_CRYO_DESPAWNING "cryo_despawning" // dont adminbus this please
#define TRAIT_EXAMINE_HALLUCINATING "examine_hallucinating"

//***** MIND TRAITS *****/
#define TRAIT_HOLY "is_holy" // The mob is holy in regards to religion
Expand Down
3 changes: 2 additions & 1 deletion code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_NON_INFECTIOUS_ZOMBIE" = TRAIT_NON_INFECTIOUS_ZOMBIE,
"TRAIT_CANNOT_PULL" = TRAIT_CANNOT_PULL,
"TRAIT_BSG_IMMUNE" = TRAIT_BSG_IMMUNE,
"TRAIT_FLYING" = TRAIT_FLYING
"TRAIT_FLYING" = TRAIT_FLYING,
"TRAIT_EXAMINE_HALLUCINATING" = TRAIT_EXAMINE_HALLUCINATING

),

Expand Down
17 changes: 17 additions & 0 deletions code/modules/hallucinations/effects/common.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,20 @@
/obj/effect/hallucination/chaser/attacker/proc/on_knockdown()
target.visible_message("<span class='warning'>[target] recoils as if hit by something, before suddenly collapsing!</span>",
"<span class='userdanger'>[src]'s blow was too much for you, causing you to collapse!</span>")

/**
* # 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 ..()
27 changes: 27 additions & 0 deletions code/modules/mob/living/carbon/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
return ""

/mob/living/carbon/examine(mob/user)
var/hallucinating = HAS_TRAIT(user, TRAIT_EXAMINE_HALLUCINATING)
var/skipgloves = FALSE
var/skipsuitstorage = FALSE
var/skipjumpsuit = FALSE
Expand Down Expand Up @@ -161,6 +162,32 @@
// add any extra info on the limbs themselves
msg += examine_handle_individual_limb(limb_name)

// hallucinating?
if(hallucinating && prob(25))
// 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)] walk[p_s()] past, [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()].",
Accinator50 marked this conversation as resolved.
Show resolved Hide resolved
"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))
Expand Down
Loading