diff --git a/code/_macros.dm b/code/_macros.dm index 1038b6a2e46..463a7da26d9 100644 --- a/code/_macros.dm +++ b/code/_macros.dm @@ -42,6 +42,8 @@ #define isxeno(A) istype(A, /mob/living/simple_animal/xeno) +#define isopenspace(A) istype(A, /turf/simulated/open) + #define isweakref(A) istype(A, /weakref) #define RANDOM_BLOOD_TYPE pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+") diff --git a/code/modules/multiz/basic.dm b/code/modules/multiz/basic.dm index e76c6516aa7..24d24b10497 100644 --- a/code/modules/multiz/basic.dm +++ b/code/modules/multiz/basic.dm @@ -11,25 +11,35 @@ var/z_levels = 0 // Each bit represents a connection between adjacent levels. S qdel(src) // The storage of connections between adjacent levels means some bitwise magic is needed. -proc/HasAbove(var/z) +/proc/HasAbove(var/z) if(z >= world.maxz || z > 16 || z < 1) return 0 return z_levels & (1 << (z - 1)) -proc/HasBelow(var/z) +/proc/HasBelow(var/z) if(z > world.maxz || z > 17 || z < 2) return 0 return z_levels & (1 << (z - 2)) // Thankfully, no bitwise magic is needed here. -proc/GetAbove(var/atom/atom) +/proc/GetAbove(var/atom/atom) var/turf/turf = get_turf(atom) if(!turf) return null return HasAbove(turf.z) ? get_step(turf, UP) : null -proc/GetBelow(var/atom/atom) +/proc/GetBelow(var/atom/atom) var/turf/turf = get_turf(atom) if(!turf) return null return HasBelow(turf.z) ? get_step(turf, DOWN) : null + +/proc/GetConnectedZlevels(z) + . = list(z) + for(var/level = z, HasBelow(level), level--) + . |= level-1 + for(var/level = z, HasAbove(level), level++) + . |= level+1 + +proc/AreConnectedZLevels(var/zA, var/zB) + return zA == zB || (zB in GetConnectedZlevels(zA)) diff --git a/code/modules/multiz/pipes.dm b/code/modules/multiz/pipes.dm index 1cb5b9b4da7..6b6b24c4705 100644 --- a/code/modules/multiz/pipes.dm +++ b/code/modules/multiz/pipes.dm @@ -13,6 +13,9 @@ obj/machinery/atmospherics/pipe/zpipe dir = SOUTH initialize_directions = SOUTH + // node1 is the connection on the same Z + // node2 is the connection on the other Z + var/minimum_temperature_difference = 300 var/thermal_conductivity = 0 //WALL_HEAT_TRANSFER_COEFFICIENT No diff --git a/code/modules/multiz/structures.dm b/code/modules/multiz/structures.dm index 57278082764..18bb91a9e46 100644 --- a/code/modules/multiz/structures.dm +++ b/code/modules/multiz/structures.dm @@ -122,10 +122,6 @@ allowed_directions = UP|DOWN icon_state = "ladder11" - - - - /obj/structure/stairs name = "Stairs" desc = "Stairs leading to another deck. Not too useful if the gravity goes out." diff --git a/code/modules/multiz/turf.dm b/code/modules/multiz/turf.dm index 8389df7112b..caa859f3695 100644 --- a/code/modules/multiz/turf.dm +++ b/code/modules/multiz/turf.dm @@ -82,7 +82,7 @@ return var/obj/item/stack/rods/R = C if (R.use(1)) - user << "Constructing support lattice ..." + to_chat(user, "Constructing support lattice ...") playsound(src, 'sound/weapons/Genhit.ogg', 50, 1) ReplaceWithLattice() return @@ -99,7 +99,7 @@ ChangeTurf(/turf/simulated/floor/airless) return else - user << "The plating is going to need some support." + to_chat(user, "The plating is going to need some support.") //To lay cable. if(istype(C, /obj/item/stack/cable_coil))