Skip to content

Commit

Permalink
Map cleanup
Browse files Browse the repository at this point in the history
Copies some stuff from Spookerton old PR
  • Loading branch information
LordNest committed Jan 2, 2025
1 parent 3a6b42e commit 0223ef6
Show file tree
Hide file tree
Showing 3 changed files with 158,686 additions and 158,599 deletions.
20 changes: 15 additions & 5 deletions code/modules/multiz/basic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,23 @@ var/global/list/z_levels = list()// Each bit re... haha just kidding this is a l
return null
return HasBelow(turf.z) ? get_step(turf, DOWN) : null

/proc/GetConnectedZlevels(z)
//[SIERRA-EDIT] - logic for turf/space/open by Spookerton
/proc/GetAboveZlevels(z)
RETURN_TYPE(/list)
. = list(z)
for(var/level = z, HasBelow(level), level--)
. |= level-1
. = list()
for(var/level = z, HasAbove(level), level++)
. |= level+1
. |= level + 1

/proc/GetBelowZlevels(z)
RETURN_TYPE(/list)
. = list()
for(var/level = z, HasBelow(level), level--)
. |= level - 1

/proc/GetConnectedZlevels(z)
RETURN_TYPE(/list)
return list(z) + GetAboveZlevels(z) + GetBelowZlevels(z)
// [/SIERRA-EDIT]

/proc/GetConnectedZlevelsSet(z)
RETURN_TYPE(/list)
Expand Down
46 changes: 46 additions & 0 deletions maps/sierra/sierra_turfs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,49 @@

/turf/simulated/floor/shuttle_ceiling/sierra/air
initial_gas = list("oxygen" = MOLES_O2STANDARD, "nitrogen" = MOLES_N2STANDARD)

/*
* Z-mimic space turf part
*/

/turf/space/Initialize()
. = ..()
update_starlight()

set_extension(src, /datum/extension/support_lattice)

if (z_eventually_space)
appearance = SSskybox.space_appearance_cache[(((x + y) ^ ~(x * y) + z) % 25) + 1]

if(!HasBelow(z))
return
var/turf/below = GetBelow(src)

if(istype(below, /turf/space))
return
var/area/A = below.loc

if(!below.density && (A.area_flags & AREA_FLAG_EXTERNAL))
return

return INITIALIZE_HINT_LATELOAD // oh no! we need to switch to being a different kind of turf!

// Turfs for the non-bottom layers of multi-z space areas
/turf/space/open
icon_state = ""
z_flags = ZM_MIMIC_DEFAULTS | ZM_MIMIC_OVERWRITE | ZM_MIMIC_NO_AO
z_eventually_space = 0


/turf/space/open/Initialize()
for (var/level in GetBelowZlevels(z))
var/turf/below = locate(x, y, level)
if (!istype(below, /turf/space))
z_eventually_space = FALSE
break
if (below.z_eventually_space != 0)
z_eventually_space = below.z_eventually_space
break
if (!z_eventually_space == 0)
z_eventually_space = TRUE
return ..()
Loading

0 comments on commit 0223ef6

Please sign in to comment.