mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-03 14:02:49 +00:00
Adds a new process-based effects system with the goal of reducing insane lag from sparks. Currently only supports sparks, but should be easily extendable to other types of effects. Also fixes a bug with airlocks where the light from bolts wasn't updating. Refactors bears slightly to reduce duplicated code & pointless spark object creation and destruction. Lighting profiler will now log /turf locations & names correctly. Doors will no longer trigger way more visibility checks than they need to.
28 lines
721 B
Plaintext
28 lines
721 B
Plaintext
// -- Effect System --
|
|
// The base type for the new processor-driven effect system.
|
|
/datum/effect_system
|
|
var/atom/movable/holder // The object this effect is attached to. If this is set, the effect will not be qdel()'d at end of processing.
|
|
|
|
/datum/effect_system/New(var/queue = TRUE)
|
|
. = ..()
|
|
if (queue)
|
|
src.queue()
|
|
|
|
/datum/effect_system/Destroy()
|
|
if (holder)
|
|
holder = null
|
|
..()
|
|
|
|
// Queues an effect.
|
|
/datum/effect_system/proc/queue()
|
|
if (effect_master)
|
|
effect_master.queue(src)
|
|
return TRUE
|
|
return FALSE
|
|
|
|
/datum/effect_system/proc/process()
|
|
return holder ? EFFECT_HALT : EFFECT_DESTROY // Terminate effect if it's not attached to something.
|
|
|
|
/datum/effect_system/proc/bind(var/target)
|
|
holder = target
|