Adds Missing Ceiling Overlay + Fixes Space on Roof

On Multi-Z compatible maps, if a tile is missing a ceiling (IE there is an open space above it), it will display an overlay to show this. This makes it easier to know where the hole in the ceiling is without having to go to the ceiling. Overlay sprite by Mechoid.
Also fixes space tiles appearing when meteors/explosions/other fun things occur on the Southern Cross map instead of open space.
This commit is contained in:
Neerti
2018-01-22 14:27:19 -05:00
parent d58b25f1a5
commit d71a610a97
11 changed files with 22 additions and 33 deletions

View File

@@ -1645,7 +1645,6 @@ area/space/atmosalert()
requires_power = 1
always_unpowered = 1
dynamic_lighting = 0
base_turf = /turf/space
auxport
name = "\improper Fore Port Solar Array"

View File

@@ -122,10 +122,7 @@
build_delay = deconstruct ? 50 : 20
build_cost = deconstruct ? 10 : 3
build_type = deconstruct ? "floor" : "wall"
if(F.check_destroy_override(F))
build_turf = deconstruct ? destroy_floor_override_path : /turf/simulated/wall
else
build_turf = deconstruct ? /turf/space : /turf/simulated/wall
build_turf = deconstruct ? get_base_turf_by_area(F) : /turf/simulated/wall
if(!build_type)
working = 0

View File

@@ -62,16 +62,6 @@
/turf/simulated/proc/initialize()
return
/turf/simulated/proc/check_destroy_override()
if(destroy_floor_override) //Don't bother doing the additional checks if we don't have to.
var/area/my_area = get_area(src)
// my_area = my_area.master
if(is_type_in_list(my_area, destroy_floor_override_ignore_areas))
return 0
if(z in destroy_floor_override_z_levels)
return 1
return 0
/turf/simulated/proc/AddTracks(var/typepath,var/bloodDNA,var/comingdir,var/goingdir,var/bloodcolor="#A10808")
var/obj/effect/decal/cleanable/blood/tracks/tracks = locate(typepath) in src
if(!tracks)

View File

@@ -84,6 +84,11 @@ var/list/flooring_cache = list()
continue
F.update_icon()
// Show 'ceilingless' overlay.
var/turf/above = GetAbove(src)
if(above && isopenspace(above) && !istype(src, /turf/simulated/floor/outdoors)) // This won't apply to outdoor turfs since its assumed they don't have a ceiling anyways.
overlays |= image(icon = 'icons/turf/open_space.dmi', icon_state = "no_ceiling", layer = TURF_LAYER + 0.02)
/turf/simulated/floor/proc/get_flooring_overlay(var/cache_key, var/icon_base, var/icon_dir = 0)
if(!flooring_cache[cache_key])
var/image/I = image(icon = flooring.icon, icon_state = icon_base, dir = icon_dir)

View File

@@ -211,10 +211,7 @@
/turf/simulated/wall/ex_act(severity)
switch(severity)
if(1.0)
if(check_destroy_override())
src.ChangeTurf(destroy_floor_override_path)
else
src.ChangeTurf(/turf/space)
src.ChangeTurf(get_base_turf_by_area(src))
if(2.0)
if(prob(75))
take_damage(rand(150, 250))

View File

@@ -12,9 +12,14 @@
// Called after turf replaces old one
/turf/proc/post_change()
levelupdate()
var/turf/simulated/open/T = GetAbove(src)
if(istype(T))
T.update_icon()
var/turf/simulated/open/above = GetAbove(src)
if(istype(above))
above.update_icon()
var/turf/simulated/below = GetBelow(src)
if(istype(below))
below.update_icon() // To add or remove the 'ceiling-less' overlay.
//Creates a new turf
/turf/proc/ChangeTurf(var/turf/N, var/tell_universe=1, var/force_lighting_update = 0)

View File

@@ -38,17 +38,6 @@ var/changelog_hash = ""
var/game_year = (text2num(time2text(world.realtime, "YYYY")) + 544)
var/round_progressing = 1
//On some maps, it does not make sense for space turf to appear when something blows up (e.g. on an asteroid colony, or planetside)
//The turf listed here is what is created after ex_act() and other tile-destroying procs are called on a turf that
//is not already in a blacklisted area.
//Set to 1 to enable it.
var/destroy_floor_override = 1
//Below is the path of turf used in place of space tiles.
var/destroy_floor_override_path = /turf/simulated/mineral/floor
//A list of z-levels to apply the override to. This is so z-levels like tcomms work as they did before.
var/list/destroy_floor_override_z_levels = list(1,4,5)
//Some areas you may want to not turn into the override path you made above, like space or the solars.
var/list/destroy_floor_override_ignore_areas = list(/area/space,/area/solar,/area/shuttle)
var/master_mode = "extended" // "extended"
var/secret_force_mode = "secret" // if this is anything but "secret", the secret rotation will forceably choose this mode.

View File

@@ -52,6 +52,7 @@
below = GetBelow(src)
turf_changed_event.register(below, src, /turf/simulated/open/update_icon)
levelupdate()
below.update_icon() // So the 'ceiling-less' overlay gets added.
for(var/atom/movable/A in src)
A.fall()
OS_controller.add_turf(src, 1)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -7,6 +7,7 @@
#include "polaris-5.dmm"
#include "northern_star_defines.dm"
#include "northern_star_areas.dm"
#include "northern_star_shuttles.dm"
#define USING_MAP_DATUM /datum/map/northern_star

View File

@@ -0,0 +1,5 @@
// Eventually we should move all the Northern Star-centric areas here so future maps can have a less polluted area list but that involves a lot of work and headaches.
// Solars are 'sticking out' from the rock and so shouldn't have rock underneath them.
/area/solar
base_turf = /turf/space