Files
Bubberstation/code/modules/hallucination/bubblegum_attack.dm
MrMelbert eb0e842320 Hallucination revamps and additions (#89865)
## About The Pull Request

1. Hallucination effects are now tiered

Hallucinations now all have tiers, ranging from common to special. 
If you are just hallucinating a teeny bit, you will not experience the
more extreme hallucinations, like bubblegum or your mom.
But if you're hallucinating off your butt, you will be a bit more likely
to experience them.

2. Hallucination rate has been tweaked

Default hallucination cooldown is now 20-80 seconds, up from 10-60
seconds.
However the cooldown will *also* vary depending on just how much you're
hallucinating, going down to 10-40 seconds.

3. RDS is now capped a bit lower (meaning you don't see the higher tiers
like bubblegum).

But I added a preference to uncap it. For the people who actually like
bubblegum visits.

4. If a hallucination fails to trigger, the cooldown will partially
reset. (by 75%)

5. "Fake chat" hallucination will pick more viable subjects.

Fake chat will try to find someone who can actually speak your language,
rather than make a monkey speak mothic or something.
(I may revisit this so if you're super-hallucinating it reverts to old
behavior though.)

6. Adds a hallucination: Fake blood

You hallucinate that you start bleeding, very simple.

7. Adds a hallucination: Fake telepathy

You hallucinate a random telepathic message, similar to fake chat.

8. Adds a hallucination: Eyes in the Dark

A nearby dark turf will have a set of glowing red eyes shine through the
dark. A classic.

9. Adds some new sub-hallucination: PDA ringtone (fake sound), summon
guns/magic (fake item)

Funny prank.

10. Makes mindbreaker a bit more effective at combating RDS.

Pretty much does nothing right now unless you gulp like 50u.

## Why It's Good For The Game

Hallucinations are pretty one note if you experience them for longer
than 10 minutes.

This is due to two fold:
- Many hallucinations are goofy, and not subtle
- Hallucinations trigger very rapidly

You will never fall for a hallucination because in between "You see John
Greytide put the blueprints away", you get your mom yelling at you,
everyone looking like syndies (again), and bubblegum

This pr addresses it by
- Limiting the wacky hallucinations for when you're really off your
gourd
- Reducing the period between triggers
- Adding a few hallucinations

If the wackier hallucinations are reserved for when you're really off
your rocker, this lets the more subtle ones sink in over time, leaves
more room for second guessing

## Changelog

🆑 Melbert
add: Adds 4-5 new hallucinations. Collect them all.
balance: If you are only hallucinating a little bit, the game will
prefer to pick more subtle hallucinations. If you are hallucinating a
ton, it will prefer the more wacky hallucinations.
balance: If you are only hallucinating a little bit, the cooldown
between hallucinations is longer. If you are hallucinating a ton, it
will be shorter.
balance: If a hallucination fails to trigger (such as a deaf person
getting a sound hallucination) the next one will be a lot sooner.
balance: RDS hallucination amount is capped at mid tier hallucinations.
This means bubblegum and co. will be a lot rarer, or will even never
show. HOWEVER, there is now a preference allowing you to uncap your RDS
hallucinations.
balance: Mindbreaker toxin is more effective at suppressing RDS.
balance: Some hallucinations effects have been tweaked up or down
according to the new thresholds. Madness mask as an example.
fix: "Fake Fire" Hallucination works again, and now has a unique message
for if you stop-drop-roll that other people see.
/🆑
2025-03-20 21:36:56 +00:00

103 lines
3.8 KiB
Plaintext

/// Sends a fake bubblegum charging through a nearby wall to our target.
/datum/hallucination/oh_yeah
random_hallucination_weight = 1
hallucination_tier = HALLUCINATION_TIER_RARE
/// An image overlayed to the wall bubblegum comes out of, to look destroyed.
var/image/fake_broken_wall
/// An image put where bubblegum is expected to land, to mimic his charge "rune" icon.
var/image/fake_rune
/// if TRUE, we will also send one of the hallucination lines when we start.
var/haunt_them = FALSE
/// if haunt_them is TRUE, they will also be shown one of these lines when the hallucination occurs
var/static/list/hallucination_lines = BUBBLEGUM_HALLUCINATION_LINES
/datum/hallucination/oh_yeah/New(mob/living/hallucinator, source = "an external source", haunt_them = FALSE)
src.haunt_them = haunt_them
return ..()
/datum/hallucination/oh_yeah/Destroy()
if(fake_broken_wall)
hallucinator.client?.images -= fake_broken_wall
fake_broken_wall = null
if(fake_rune)
hallucinator.client?.images -= fake_rune
fake_rune = null
return ..()
/datum/hallucination/oh_yeah/start()
var/turf/closed/wall/wall_source = locate() in range(7, hallucinator)
if(!wall_source)
return FALSE
feedback_details += "Source: ([wall_source.x], [wall_source.y], [wall_source.z])"
var/turf/target_landing_turf = get_turf(hallucinator)
var/turf/target_landing_image_turf = get_step(target_landing_turf, SOUTHWEST) // The icon is 3x3, so we shift down+left
if(hallucinator.client)
fake_broken_wall = image('icons/turf/floors.dmi', wall_source, "plating", layer = LOW_FLOOR_LAYER)
SET_PLANE_EXPLICIT(fake_broken_wall, FLOOR_PLANE, wall_source)
fake_broken_wall.override = TRUE
fake_rune = image('icons/effects/96x96.dmi', target_landing_image_turf, "landing", layer = ABOVE_OPEN_TURF_LAYER)
SET_PLANE_EXPLICIT(fake_rune, FLOOR_PLANE, wall_source)
hallucinator.client?.images |= fake_broken_wall
hallucinator.client?.images |= fake_rune
hallucinator.playsound_local(wall_source, 'sound/effects/meteorimpact.ogg', 150, TRUE)
if(haunt_them)
to_chat(hallucinator, pick(hallucination_lines))
var/obj/effect/client_image_holder/hallucination/bubblegum/fake_bubbles = new(wall_source, hallucinator, src)
addtimer(CALLBACK(src, PROC_REF(charge_loop), fake_bubbles, target_landing_turf), 1 SECONDS)
return TRUE
/**
* Recursive function that operates as a "fake charge" of our effect towards the target turf.
*/
/datum/hallucination/oh_yeah/proc/charge_loop(obj/effect/client_image_holder/hallucination/bubblegum/fake_bubbles, turf/landing_turf)
if(QDELETED(src))
return
if(QDELETED(hallucinator) \
|| QDELETED(fake_bubbles) \
|| !landing_turf \
|| fake_bubbles.z != hallucinator.z \
|| fake_bubbles.z != landing_turf.z \
)
qdel(src)
return
if(get_turf(fake_bubbles) == landing_turf || hallucinator.stat == DEAD)
QDEL_IN(src, 3 SECONDS)
return
fake_bubbles.forceMove(get_step_towards(fake_bubbles, landing_turf))
fake_bubbles.setDir(get_dir(fake_bubbles, landing_turf))
hallucinator.playsound_local(get_turf(fake_bubbles), 'sound/effects/meteorimpact.ogg', 150, TRUE)
shake_camera(hallucinator, 2, 1)
if(fake_bubbles.Adjacent(hallucinator))
hallucinator.Paralyze(8 SECONDS)
hallucinator.adjustStaminaLoss(40)
step_away(hallucinator, fake_bubbles)
shake_camera(hallucinator, 4, 3)
hallucinator.visible_message(
span_warning("[hallucinator] jumps backwards, falling on the ground!"),
span_userdanger("[fake_bubbles] slams into you!"),
)
QDEL_IN(src, 3 SECONDS)
else
addtimer(CALLBACK(src, PROC_REF(charge_loop), fake_bubbles, landing_turf), 0.2 SECONDS)
/// Fake bubblegum hallucination effect for the oh yeah hallucination
/obj/effect/client_image_holder/hallucination/bubblegum
name = "Bubblegum"
image_icon = 'icons/mob/simple/lavaland/96x96megafauna.dmi'
image_state = "bubblegum"
image_pixel_x = -32