mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-19 11:05:50 +01:00
Hallucination Refactor (#17661)
* begone accursed beast
* cleanup and notes
* screen object fix
* varset clear
* don't raw send sounds, spark on door sound, pain hallucination
* lengthen this a bit
* more pain messages, become jittery
* note
* lets clean that up to
* Revert "lets clean that up to"
This reverts commit 2409e41870.
* cleanup and define
* use accessors
* death isn't working so have toxins instead, it's scarier
* don't actually clean these up, because of how xenochi works
* additional protection
* hunger joke
* Use get_component instead of a cache
* empty scope removed
* Updated xenochi code to use hallu component
---------
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Sending images to clients can cause memory leaks if not handled safely.
|
||||
* This is a wrapper for handling it safely. Mostly used by self deleting effects.
|
||||
*/
|
||||
/image/client_only
|
||||
var/list/clients = list()
|
||||
|
||||
/image/client_only/proc/append_client(var/client/C)
|
||||
C.images += src
|
||||
clients.Add(WEAKREF(C))
|
||||
|
||||
/image/client_only/Destroy(force)
|
||||
. = ..()
|
||||
for(var/datum/weakref/CW in clients)
|
||||
var/client/C = CW?.resolve()
|
||||
if(C)
|
||||
C.images -= src
|
||||
|
||||
// Mostly for motion echos, but someone will probably find another use for it... So parent type gets it instead!
|
||||
/image/client_only/proc/place_from_root(var/turf/At)
|
||||
var/rand_limit = 12
|
||||
pixel_x += ((At.x - loc.x) * 32) + rand(-rand_limit,rand_limit)
|
||||
pixel_y += ((At.y - loc.y) * 32) + rand(-rand_limit,rand_limit)
|
||||
@@ -1,27 +1,8 @@
|
||||
/image/motion_echo
|
||||
/image/client_only/motion_echo
|
||||
plane = PLANE_FULLSCREEN
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
appearance_flags = (RESET_COLOR|PIXEL_SCALE|KEEP_APART)
|
||||
var/list/clients = list()
|
||||
|
||||
/image/motion_echo/New(icon, loc, icon_state, layer, dir)
|
||||
/image/client_only/motion_echo/New(icon, loc, icon_state, layer, dir)
|
||||
. = ..()
|
||||
QDEL_IN(src, 2 SECONDS)
|
||||
|
||||
/image/motion_echo/proc/place_from_root(var/turf/At)
|
||||
var/rand_limit = 12
|
||||
pixel_x += ((At.x - loc.x) * 32) + rand(-rand_limit,rand_limit)
|
||||
pixel_y += ((At.y - loc.y) * 32) + rand(-rand_limit,rand_limit)
|
||||
|
||||
/image/motion_echo/proc/append_client(var/datum/weakref/C)
|
||||
var/client/CW = C?.resolve()
|
||||
if(CW)
|
||||
CW.images += src
|
||||
clients.Add(C)
|
||||
|
||||
/image/motion_echo/Destroy(force)
|
||||
. = ..()
|
||||
for(var/datum/weakref/C in clients)
|
||||
var/client/CW = C?.resolve()
|
||||
if(CW)
|
||||
CW.images -= src
|
||||
|
||||
Reference in New Issue
Block a user