Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAP: Z-mimic space tiles update #3054

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading