mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
Completely refactors hallucinations, and also adds a few (#69706)
* Refactors hallucinations slightly, organizes them * Refactors hallucination into a status effect * Further hallucination proper refactoring * Refactors battle hallucinations * Refactors "fake item other" hallucination * Gets it a bit closer to working state * Refactors screwydoll and fake alerts * Refactors fake inhand items * Refactors a few more. - Fake death - Fake messages - Fake sounds - Projectiles * Refactoring delusions, hallucination effects * Furthering the hallucination status effect - removes copypaste of hallucination pulses * Almost finalizes the changeover to status effect * Last staus effect stuff * Delusion business * Airlocks, fire, and more delusion stuff * Finishes screwyhud. It compiles now! * Swaps screwyhud over to a grouped status effect * Removes hal_screwyhud * Comment * Bugfixing * image cleaning * Get rid of this it came back * What if I finished this branch? * Oops * Messing with the randomness * Mass hallucination tweaks * + * Some more mass tweaks * Review * Updates * Unit tests hallucination icons * More tweaks * Move folder * Another re-name * Minor tweaks * Anomaly unity * Mass hallucination buffs * t * Sig * Merge * Lints * Unit test already coming in clutch * Another failure * Use named args for cause_hallucination via some define trickery * Some cleanup * This is better * adds some hallucinations * Oops * More sounds * Tweaks * Some additional documentation * Flash * Fixes mass hallucination * Json changes * Updates documentation * Json conflicts * Makes it work * Missed that one too * Helpers * More signalization (WIP) * Fixes bump * Missed a helper use * Dumb
This commit is contained in:
@@ -1,8 +1,4 @@
|
||||
//Anomalies, used for events. Note that these DO NOT work by themselves; their procs are called by the event datum.
|
||||
|
||||
/// Chance of taking a step per second
|
||||
#define ANOMALY_MOVECHANCE 45
|
||||
|
||||
/obj/effect/anomaly
|
||||
name = "anomaly"
|
||||
desc = "A mysterious anomaly, seen commonly only in the region of space that the station orbits..."
|
||||
@@ -521,6 +517,13 @@
|
||||
var/ticks = 0
|
||||
/// How many seconds between each small hallucination pulses
|
||||
var/release_delay = 5
|
||||
/// Messages sent to people feeling the pulses
|
||||
var/static/list/messages = list(
|
||||
span_warning("You feel your conscious mind fall apart!"),
|
||||
span_warning("Reality warps around you!"),
|
||||
span_warning("Something's wispering around you!"),
|
||||
span_warning("You are going insane!"),
|
||||
)
|
||||
|
||||
/obj/effect/anomaly/hallucination/anomalyEffect(delta_time)
|
||||
. = ..()
|
||||
@@ -528,36 +531,28 @@
|
||||
if(ticks < release_delay)
|
||||
return
|
||||
ticks -= release_delay
|
||||
var/turf/open/our_turf = get_turf(src)
|
||||
if(istype(our_turf))
|
||||
hallucination_pulse(our_turf, 5)
|
||||
if(!isturf(loc))
|
||||
return
|
||||
|
||||
visible_hallucination_pulse(
|
||||
center = get_turf(src),
|
||||
radius = 5,
|
||||
hallucination_duration = 50 SECONDS,
|
||||
hallucination_max_duration = 300 SECONDS,
|
||||
optional_messages = messages,
|
||||
)
|
||||
|
||||
/obj/effect/anomaly/hallucination/detonate()
|
||||
var/turf/open/our_turf = get_turf(src)
|
||||
if(istype(our_turf))
|
||||
hallucination_pulse(our_turf, 10)
|
||||
if(!isturf(loc))
|
||||
return
|
||||
|
||||
/obj/effect/anomaly/hallucination/proc/hallucination_pulse(turf/open/location, range)
|
||||
for(var/mob/living/carbon/human/near in view(location, range))
|
||||
// If they are immune to hallucinations.
|
||||
if (HAS_TRAIT(near, TRAIT_MADNESS_IMMUNE) || (near.mind && HAS_TRAIT(near.mind, TRAIT_MADNESS_IMMUNE)))
|
||||
continue
|
||||
|
||||
// Blind people don't get hallucinations.
|
||||
if (near.is_blind())
|
||||
continue
|
||||
|
||||
// Everyone else gets hallucinations.
|
||||
var/dist = sqrt(1 / max(1, get_dist(near, location)))
|
||||
near.hallucination += 50 * dist
|
||||
near.hallucination = clamp(near.hallucination, 0, 150)
|
||||
var/list/messages = list(
|
||||
"You feel your conscious mind fall apart!",
|
||||
"Reality warps around you!",
|
||||
"Something's wispering around you!",
|
||||
"You are going insane!",
|
||||
)
|
||||
to_chat(near, span_warning(pick(messages)))
|
||||
visible_hallucination_pulse(
|
||||
center = get_turf(src),
|
||||
radius = 10,
|
||||
hallucination_duration = 50 SECONDS,
|
||||
hallucination_max_duration = 300 SECONDS,
|
||||
optional_messages = messages,
|
||||
)
|
||||
|
||||
/////////////////////
|
||||
|
||||
@@ -641,5 +636,3 @@
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "shield-flash"
|
||||
duration = 3
|
||||
|
||||
#undef ANOMALY_MOVECHANCE
|
||||
|
||||
Reference in New Issue
Block a user