mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-18 13:36:33 +01:00
tl;dr level collections that can easily be logically restructured/moved as necessary will eventually be used for radio and overmaps location resolution. this is the last part of https://github.com/Citadel-Station-13/Citadel-Station-13-RP/pull/4841 that has not yet been integrated. this will be a draft for a while. --------- Co-authored-by: LetterN <24603524+LetterN@users.noreply.github.com>
40 lines
1.2 KiB
Plaintext
40 lines
1.2 KiB
Plaintext
/**
|
|
* stuff that really just didn't fit anywhere
|
|
* unlike most "legacy" citrp files, things in here are allowed to be used and will be optimized & maintained.
|
|
*/
|
|
|
|
/**
|
|
* get all turfs of a given type or typecache on a zlevel
|
|
*/
|
|
/datum/controller/subsystem/mapping/proc/z_turfs_of_type(z, list/type_or_cache)
|
|
. = list()
|
|
if(ispath(type_or_cache))
|
|
for(var/turf/T as anything in block(locate(1, 1, z), locate(world.maxx, world.maxy, z)))
|
|
if(istype(T, type_or_cache))
|
|
. += T
|
|
else if(islist(type_or_cache))
|
|
for(var/turf/T as anything in block(locate(1, 1, z), locate(world.maxx, world.maxy, z)))
|
|
if(type_or_cache[T.type])
|
|
. += T
|
|
else
|
|
CRASH("What?")
|
|
|
|
/**
|
|
* throws things, i guess.
|
|
*/
|
|
/datum/controller/subsystem/mapping/proc/throw_movables_on_z_turfs_of_type(z, list/type_or_cache, dir)
|
|
ASSERT(dir in GLOB.cardinal)
|
|
var/list/throwing = list()
|
|
for(var/turf/T as anything in z_turfs_of_type(z, type_or_cache))
|
|
for(var/atom/movable/AM as anything in T)
|
|
if(AM.anchored)
|
|
continue
|
|
if((AM.atom_flags & ATOM_ABSTRACT))
|
|
continue
|
|
if(istype(AM, /obj/effect/decal))
|
|
qdel(AM)
|
|
continue
|
|
throwing += AM
|
|
for(var/atom/movable/AM as anything in throwing)
|
|
AM.throw_at_old(get_step(AM, dir), 5, 1)
|