Files
Bubberstation/code/modules/hallucination/fake_plasmaflood.dm
MrMelbertandGitHub 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

105 lines
3.0 KiB
Plaintext

#define FAKE_FLOOD_EXPAND_TIME 20
#define FAKE_FLOOD_MAX_RADIUS 10
/// Plasma starts flooding from the nearby vent
/datum/hallucination/fake_flood
random_hallucination_weight = 7
hallucination_tier = HALLUCINATION_TIER_UNCOMMON
var/list/image/flood_images = list()
var/list/obj/effect/plasma_image_holder/flood_image_holders = list()
var/list/turf/flood_turfs = list()
var/image_icon = 'icons/effects/atmospherics.dmi'
var/image_state = "plasma"
var/radius = 0
var/next_expand = 0
/datum/hallucination/fake_flood/start()
// This hallucination is purely visual, so we don't need to bother for clientless mobs
if(!hallucinator.client)
return FALSE
var/turf/center
for(var/obj/machinery/atmospherics/components/unary/vent_pump/nearby_pump in orange(7, hallucinator))
if(nearby_pump.welded)
continue
center = get_turf(nearby_pump)
break
if(!center)
return FALSE
feedback_details += "Vent Coords: ([center.x], [center.y], [center.z])"
create_new_plasma_image(center)
hallucinator.client?.images |= flood_images
next_expand = world.time + FAKE_FLOOD_EXPAND_TIME
START_PROCESSING(SSobj, src)
return TRUE
/datum/hallucination/fake_flood/process()
if(next_expand > world.time)
return
radius++
if(radius > FAKE_FLOOD_MAX_RADIUS)
qdel(src)
return
expand_flood()
if(get_turf(hallucinator) in flood_turfs)
var/mob/living/carbon/carbon_hallucinator = hallucinator
if(istype(carbon_hallucinator) && !carbon_hallucinator.internal)
hallucinator.cause_hallucination(/datum/hallucination/fake_alert/bad_plasma, "fake plasmaflood hallucination")
next_expand = world.time + FAKE_FLOOD_EXPAND_TIME
/datum/hallucination/fake_flood/proc/expand_flood()
for(var/image/flood_image in flood_images)
flood_image.alpha = min(flood_image.alpha + 50, 255)
for(var/turf/flooded_turf in flood_turfs)
for(var/dir in GLOB.cardinals)
var/turf/nearby_turf = get_step(flooded_turf, dir)
if((nearby_turf in flood_turfs) || !TURFS_CAN_SHARE(nearby_turf, flooded_turf) || isspaceturf(nearby_turf))
continue
create_new_plasma_image(nearby_turf)
hallucinator.client?.images |= flood_images
/datum/hallucination/fake_flood/proc/create_new_plasma_image(turf/to_flood)
flood_turfs += to_flood
var/obj/effect/plasma_image_holder/image_holder = new(to_flood)
flood_image_holders += image_holder
var/image/plasma_image = image(image_icon, image_holder, image_state, FLY_LAYER)
plasma_image.alpha = 50
SET_PLANE_EXPLICIT(plasma_image, ABOVE_GAME_PLANE, to_flood)
flood_images += plasma_image
/datum/hallucination/fake_flood/Destroy()
STOP_PROCESSING(SSobj, src)
hallucinator.client?.images -= flood_images
flood_turfs.Cut() // We don't own these
flood_images.Cut() // We also don't own these, kinda
QDEL_LIST(flood_image_holders) // But we DO own these
return ..()
/obj/effect/plasma_image_holder
icon_state = "nothing"
anchored = TRUE
layer = FLY_LAYER
plane = ABOVE_GAME_PLANE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
#undef FAKE_FLOOD_EXPAND_TIME
#undef FAKE_FLOOD_MAX_RADIUS