Files
Bubberstation/code/modules/power/multiz.dm
Bloop b674e72ef1 [MISSED MIRROR] Macros multi-z code, removes the false premise of manual offsets (#76248) (#22531)
* Macros multi-z code, removes the false premise of manual offsets (#76248)

## About The Pull Request

[Removes the pretense of relative multiz
levels](0293fdc2bd)

Our multiz system does not support having a z level that is only
connected one way, or which goes down backwards or anything like that.

That's a fiction of the trait system, the actual backend has never
really supported this.

This pr removes the assumptions we were making backend around this, and
uses that to save cpu time.

I am also converting multiz_levels from an assoc list to a pure one,
which saves significantly on access times and cleans up the code
somewhat.

Also I'm making the get_below/get_above procs into macros, for the sake
of cpu time.

[Converts the starlight disease to use BYOND's directional defines
instead of our
own](7d698f02d9)

To some extent spurred on by
https://github.com/DaedalusDock/daedalusdock/pull/298, tho it was known
before

## Why It's Good For The Game

Faster multiz code, faster init, etc etc etc

* modular files how very dare you

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2023-07-18 02:28:15 +00:00

19 lines
983 B
Plaintext

/obj/structure/cable/multilayer/multiz //This bridges powernets betwen Z levels
name = "multi z layer cable hub"
desc = "A flexible, superconducting insulated multi Z layer hub for heavy-duty multi Z power transfer."
icon = 'icons/obj/pipes_n_cables/structures.dmi'
icon_state = "cablerelay-on"
cable_layer = CABLE_LAYER_1|CABLE_LAYER_2|CABLE_LAYER_3
/obj/structure/cable/multilayer/multiz/get_cable_connections(powernetless_only)
. = ..()
var/turf/T = get_turf(src)
. += locate(/obj/structure/cable/multilayer/multiz) in (GET_TURF_BELOW(T))
. += locate(/obj/structure/cable/multilayer/multiz) in (GET_TURF_ABOVE(T))
/obj/structure/cable/multilayer/multiz/examine(mob/user)
. = ..()
var/turf/T = get_turf(src)
. += span_notice("[locate(/obj/structure/cable/multilayer/multiz) in (GET_TURF_BELOW(T)) ? "Detected" : "Undetected"] hub UP.")
. += span_notice("[locate(/obj/structure/cable/multilayer/multiz) in (GET_TURF_ABOVE(T)) ? "Detected" : "Undetected"] hub DOWN.")