From d71a610a97879c542a1865fe5b83a2241df3bf79 Mon Sep 17 00:00:00 2001 From: Neerti Date: Mon, 22 Jan 2018 14:27:19 -0500 Subject: [PATCH 1/2] 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. --- code/game/area/Space Station 13 areas.dm | 1 - code/game/objects/items/weapons/RCD.dm | 5 +---- code/game/turfs/simulated.dm | 10 ---------- code/game/turfs/simulated/floor_icon.dm | 5 +++++ code/game/turfs/simulated/walls.dm | 5 +---- code/game/turfs/turf_changing.dm | 11 ++++++++--- code/global.dm | 11 ----------- code/modules/multiz/turf.dm | 1 + icons/turf/open_space.dmi | Bin 288 -> 1031 bytes maps/northern_star/northern_star.dm | 1 + maps/northern_star/northern_star_areas.dm | 5 +++++ 11 files changed, 22 insertions(+), 33 deletions(-) create mode 100644 maps/northern_star/northern_star_areas.dm diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index 49d87ed1a66..2c75c0d255b 100755 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -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" diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm index df744d1df39..8f5719b8e82 100644 --- a/code/game/objects/items/weapons/RCD.dm +++ b/code/game/objects/items/weapons/RCD.dm @@ -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 diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm index a47590d55d2..aac979ff5c7 100644 --- a/code/game/turfs/simulated.dm +++ b/code/game/turfs/simulated.dm @@ -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) diff --git a/code/game/turfs/simulated/floor_icon.dm b/code/game/turfs/simulated/floor_icon.dm index 4bc4911f2ea..ed116d1bf4e 100644 --- a/code/game/turfs/simulated/floor_icon.dm +++ b/code/game/turfs/simulated/floor_icon.dm @@ -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) diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 376fb8e452a..fcd0a31479b 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -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)) diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm index 78946ff832c..84d832b45c0 100644 --- a/code/game/turfs/turf_changing.dm +++ b/code/game/turfs/turf_changing.dm @@ -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) diff --git a/code/global.dm b/code/global.dm index 69d5642f10a..3bf111ef4fd 100644 --- a/code/global.dm +++ b/code/global.dm @@ -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. diff --git a/code/modules/multiz/turf.dm b/code/modules/multiz/turf.dm index 636918c5e8a..9d07df45081 100644 --- a/code/modules/multiz/turf.dm +++ b/code/modules/multiz/turf.dm @@ -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) diff --git a/icons/turf/open_space.dmi b/icons/turf/open_space.dmi index 8c5810fffc6c59bab278f9ae861bac9b81e2c6a6..4b3ba1fb67176324278fa5499f5d22d4228946a8 100644 GIT binary patch literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGo>#9N`N?cNllZ!G7N;32F7#J$% zOzqvsb;v-(_4%Il6%%6ewP-WglwS*~=^Fg)FmDV;v$MC07Wvoh}LKX`Jb zLiSMaAO9=ui7Kzx?B_Z7(*DEy3|61X!TeKBoNk)l${?1xF)lw%UCMWZbmqrzolW&O zigJEQygOzvz%_@h<@cXb?R>S1ZL-ekI^)l~ z*Zn?v=Knz+d!9g-(^D82URXtQ27Z~y$@!yyYD?VD29}!Ce9q=ijGPsz`keEC^oPw` zTP6Z&iF9pF;it?(24{B*rJZ6|Ntm})hzUq5^eh!(It`@f1aNYL#3hS`#HR6k94I=b zvPMIGLPIH!>KYw+hDW_-FMnU0zF||1gFAyPXGFL4+dV%ws4-?s%=>(Qf&!zr%PeLB5q&zEhj z+y0%r&-vRfqjSB5x6ZZo-3F4J3d)Qr^O&~ndeHLV^sQG-(oLz?WUQD@crZYuR2q6% zCQM{75^`|EA!x%I;pgyUla9K=jmu)SB~aCAMMin&FYXceCgaPKxTEgA)ibME(bZQ< zWm7G_78{7^-LA6uUSqdEr&(3cI&apqY0F-w{!_mF=-B4hyY@Y)%#-~u<6mzhcjc@5 zoB#3$)J_{^{rfDH@N-hr=6s>Df_-}wlPl$XE`KqalCV)&#)e_1!5cyiE*d|0q;uX!^JD;!WA^CL8IQ9*=QSD&y1a$F zgG6&gr%c&l5p2}m1!VH<%#Sq?gN|JX3S&zt>Os zj0V07CJyWwQVW<(crP%{Vtc{h%Usg1jM2*BGK1`bOx)7NjHwdLPu8FH-w3ph!PC{x JWt~$(695H5Z^r-t diff --git a/maps/northern_star/northern_star.dm b/maps/northern_star/northern_star.dm index fe95bbaeb64..ece26300960 100644 --- a/maps/northern_star/northern_star.dm +++ b/maps/northern_star/northern_star.dm @@ -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 diff --git a/maps/northern_star/northern_star_areas.dm b/maps/northern_star/northern_star_areas.dm new file mode 100644 index 00000000000..836ebc5aaa1 --- /dev/null +++ b/maps/northern_star/northern_star_areas.dm @@ -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 \ No newline at end of file From c2670a2bd5ed12c7ab1904286fee4279a79eebb0 Mon Sep 17 00:00:00 2001 From: Neerti Date: Mon, 22 Jan 2018 16:12:05 -0500 Subject: [PATCH 2/2] Makes Overlay Hidden w/o Mesons --- code/__defines/_planes+layers.dm | 3 +++ code/__defines/mobs.dm | 4 +++- code/game/turfs/flooring/flooring_decals.dm | 2 +- code/game/turfs/simulated/floor_icon.dm | 11 ++++++++++- code/modules/clothing/glasses/glasses.dm | 2 +- code/modules/mob/mob_planes.dm | 2 ++ 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/code/__defines/_planes+layers.dm b/code/__defines/_planes+layers.dm index baff5ad5773..3000776d86e 100644 --- a/code/__defines/_planes+layers.dm +++ b/code/__defines/_planes+layers.dm @@ -58,6 +58,8 @@ What is the naming convention for planes or layers? //////////////////////////////////////////////////////////////////////////////////////// //#define TURF_LAYER 2 //For easy recordkeeping; this is a byond define + #define DECALS_LAYER 2.01 + #define OVERTURF_LAYER 2.1 #define DOOR_OPEN_LAYER 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6 //#define OBJ_LAYER 3 //For easy recordkeeping; this is a byond define #define DOOR_CLOSED_LAYER 3.1 //Above most items if closed @@ -91,6 +93,7 @@ What is the naming convention for planes or layers? #define PLANE_CH_SPECIAL 23 //Special role icon (revhead or w/e) #define PLANE_CH_STATUS_OOC 24 //OOC status hud for spooks +#define PLANE_MESONS 30 //Stuff seen with mesons, like open ceilings. This is 30 for downstreams. //Fullscreen overlays under inventory #define PLANE_FULLSCREEN 90 //Blindness, mesons, druggy, etc diff --git a/code/__defines/mobs.dm b/code/__defines/mobs.dm index cb0ecc37f52..c3f367b7665 100644 --- a/code/__defines/mobs.dm +++ b/code/__defines/mobs.dm @@ -252,4 +252,6 @@ #define VIS_ADMIN2 17 #define VIS_ADMIN3 18 -#define VIS_COUNT 18 //Must be highest number from above. \ No newline at end of file +#define VIS_MESONS 19 + +#define VIS_COUNT 19 //Must be highest number from above. \ No newline at end of file diff --git a/code/game/turfs/flooring/flooring_decals.dm b/code/game/turfs/flooring/flooring_decals.dm index 86a7ac1a323..9c1968fd3cc 100644 --- a/code/game/turfs/flooring/flooring_decals.dm +++ b/code/game/turfs/flooring/flooring_decals.dm @@ -6,7 +6,7 @@ var/list/floor_decals = list() /obj/effect/floor_decal name = "floor decal" icon = 'icons/turf/flooring/decals.dmi' - layer = TURF_LAYER + 0.01 + layer = DECALS_LAYER var/supplied_dir /obj/effect/floor_decal/New(var/newloc, var/newdir, var/newcolour) diff --git a/code/game/turfs/simulated/floor_icon.dm b/code/game/turfs/simulated/floor_icon.dm index ed116d1bf4e..b2992e4a2ff 100644 --- a/code/game/turfs/simulated/floor_icon.dm +++ b/code/game/turfs/simulated/floor_icon.dm @@ -1,5 +1,14 @@ var/list/flooring_cache = list() +var/image/no_ceiling_image = null + +/hook/startup/proc/setup_no_ceiling_image() + cache_no_ceiling_image() + +/proc/cache_no_ceiling_image() + no_ceiling_image = image(icon = 'icons/turf/open_space.dmi', icon_state = "no_ceiling", layer = OVERTURF_LAYER) + no_ceiling_image.plane = PLANE_MESONS + /turf/simulated/floor/update_icon(var/update_neighbors) if(lava) @@ -87,7 +96,7 @@ var/list/flooring_cache = list() // 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) + overlays |= no_ceiling_image /turf/simulated/floor/proc/get_flooring_overlay(var/cache_key, var/icon_base, var/icon_dir = 0) if(!flooring_cache[cache_key]) diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index f7806ad2458..87aef448514 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -70,7 +70,7 @@ BLIND // can't see anything origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2) toggleable = 1 vision_flags = SEE_TURFS - enables_planes = (VIS_FULLBRIGHT) + enables_planes = list(VIS_FULLBRIGHT, VIS_MESONS) /obj/item/clothing/glasses/meson/New() ..() diff --git a/code/modules/mob/mob_planes.dm b/code/modules/mob/mob_planes.dm index 25c494c2e80..5f7beceafe6 100644 --- a/code/modules/mob/mob_planes.dm +++ b/code/modules/mob/mob_planes.dm @@ -33,6 +33,8 @@ plane_masters[VIS_D_COLORBLIND] = new /obj/screen/plane_master/colorblindness //Colorblindness (affects world) plane_masters[VIS_D_COLORBLINDI]= new /obj/screen/plane_master/colorblindness/items //Colorblindness (items in HUD, subplane of above, don't toggle) + plane_masters[VIS_MESONS] = new /obj/screen/plane_master{plane = PLANE_MESONS} //Meson-specific things like open ceilings. + ..() /datum/plane_holder/Destroy()