Added the z-level manager system from TG (#19532)

Added the z-level manager system from TG, mostly
This commit is contained in:
Fluffy
2024-07-22 13:00:38 +00:00
committed by GitHub
parent 0a9176841c
commit 1345beac4b
90 changed files with 614 additions and 245 deletions
@@ -2264,7 +2264,8 @@
reset_view(null)
QDEL_NULL(z_eye)
return
var/turf/above = GetAbove(src)
var/turf/T = get_turf(src)
var/turf/above = GET_TURF_ABOVE(T)
if(TURF_IS_MIMICING(above))
z_eye = new /atom/movable/z_observer/z_up(src, src)
visible_message(SPAN_NOTICE("[src] looks up."), SPAN_NOTICE("You look up."))
@@ -2285,14 +2286,14 @@
QDEL_NULL(z_eye)
return
var/turf/T = get_turf(src)
if(TURF_IS_MIMICING(T) && HasBelow(T.z))
if(TURF_IS_MIMICING(T) && GET_TURF_BELOW(T))
z_eye = new /atom/movable/z_observer/z_down(src, src)
visible_message(SPAN_NOTICE("[src] looks below."), SPAN_NOTICE("You look below."))
reset_view(z_eye)
return
else
T = get_step(T, dir)
if(TURF_IS_MIMICING(T) && HasBelow(T.z))
if(TURF_IS_MIMICING(T) && GET_TURF_BELOW(T))
z_eye = new /atom/movable/z_observer/z_down(src, src, TRUE)
visible_message(SPAN_NOTICE("[src] leans over to look below."), SPAN_NOTICE("You lean over to look below."))
reset_view(z_eye)
@@ -395,7 +395,8 @@
else
visible_message(SPAN_DANGER("[H] pushes [src] forward!"), SPAN_DANGER("[H] pushes you forward!"))
apply_effect(5, WEAKEN)
forceMove(GetAbove(z_eye)) //We use GetAbove so people can't cheese it by turning their sprite.
var/turf/current_turf = get_turf(z_eye)
forceMove(GET_TURF_ABOVE(current_turf)) //We use GET_TURF_ABOVE so people can't cheese it by turning their sprite.
return
if(randn <= 25)
@@ -150,7 +150,7 @@
footsound = T.footstep_sound
if (client)
var/turf/B = GetAbove(T)
var/turf/B = GET_TURF_ABOVE(T)
if(up_hint)
up_hint.icon_state = "uphint[(B ? !!B.is_hole : 0)]"
@@ -27,11 +27,11 @@
var/turf/T = get_turf(target)
var/damage_mod = 1
var/from_above = FALSE
if(H.can_fall(GET_BELOW(T)))
if(H.can_fall(GET_TURF_BELOW(T)))
from_above = TRUE
if(isopenspace(T))
while(isopenspace(T))
T = GET_BELOW(T)
T = GET_TURF_BELOW(T)
damage_mod += 1
if(isturf(T))
T.visible_message(SPAN_DANGER("[H] lands on \the [T] with a quake!"))
@@ -66,7 +66,8 @@
to_chat(cleaned_human, SPAN_WARNING("\The [src] runs its bottom mounted bristles all over you!"))
if(client)
var/turf/B = GetAbove(get_turf(src))
var/turf/T = get_turf(src)
var/turf/B = GET_TURF_ABOVE(T)
if(up_hint)
up_hint.icon_state = "uphint[(B ? !!B.is_hole : 0)]"
+2 -2
View File
@@ -1492,12 +1492,12 @@
if(!T.is_outside())
// For non-multiz we'll give everyone some nice ambience.
if(!HasAbove(T.z))
if(!GET_TURF_ABOVE(T))
return WEATHER_ROOFED
// For multi-z, check the actual weather on the turf above.
// TODO: maybe make this a property of the z-level marker.
var/turf/above = GetAbove(T)
var/turf/above = GET_TURF_ABOVE(T)
if(above.weather)
return WEATHER_ROOFED