Merge pull request #16525 from S34NW/glass_floors_2

Glass floors attempt 2
This commit is contained in:
variableundefined
2021-09-06 19:10:44 -05:00
committed by GitHub
39 changed files with 262 additions and 45 deletions
@@ -71,10 +71,13 @@ Pipelines + Other Objects -> Pipe network
// Icons/overlays/underlays
/obj/machinery/atmospherics/update_icon()
var/turf/T = get_turf(loc)
if(!T || level == 2 || !T.intact)
plane = GAME_PLANE
else
if(T.transparent_floor)
plane = FLOOR_PLANE
else
if(!T || level == 2 || !T.intact)
plane = GAME_PLANE
else
plane = FLOOR_PLANE
/obj/machinery/atmospherics/proc/update_pipe_image()
pipe_image = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir) //the 20 puts it above Byond's darkness (not its opacity view)
@@ -95,15 +98,18 @@ Pipelines + Other Objects -> Pipe network
/obj/machinery/atmospherics/proc/add_underlay(turf/T, obj/machinery/atmospherics/node, direction, icon_connect_type)
if(node)
if(T.intact && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
if(T.intact && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe) && !T.transparent_floor)
//underlays += SSair.icon_manager.get_atmos_icon("underlay_down", direction, color_cache_name(node))
underlays += SSair.icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "down" + icon_connect_type)
else
//underlays += SSair.icon_manager.get_atmos_icon("underlay_intact", direction, color_cache_name(node))
underlays += SSair.icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "intact" + icon_connect_type)
else
//underlays += SSair.icon_manager.get_atmos_icon("underlay_exposed", direction, pipe_color)
underlays += SSair.icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "exposed" + icon_connect_type)
if(T.transparent_floor) //we want to keep pipes under transparent floors connected normally
underlays += SSair.icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "intact" + icon_connect_type)
else
//underlays += SSair.icon_manager.get_atmos_icon("underlay_exposed", direction, pipe_color)
underlays += SSair.icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "exposed" + icon_connect_type)
/obj/machinery/atmospherics/proc/update_underlays()
if(check_icon_cache())
@@ -166,11 +172,14 @@ Pipelines + Other Objects -> Pipe network
//(De)construction
/obj/machinery/atmospherics/attackby(obj/item/W, mob/user)
var/turf/T = get_turf(src)
if(can_unwrench && istype(W, /obj/item/wrench))
var/turf/T = get_turf(src)
if(T.transparent_floor && istype(src, /obj/machinery/atmospherics/pipe) && layer != GAS_PIPE_VISIBLE_LAYER) //pipes on GAS_PIPE_VISIBLE_LAYER are above the transparent floor and should be interactable
to_chat(user, "<span class='danger'>You can't interact with something that's under the floor!</span>")
return
if(level == 1 && isturf(T) && T.intact)
to_chat(user, "<span class='danger'>You must remove the plating first.</span>")
return 1
return
var/datum/gas_mixture/int_air = return_air()
var/datum/gas_mixture/env_air = loc.return_air()
add_fingerprint(user)
@@ -184,14 +193,14 @@ Pipelines + Other Objects -> Pipe network
playsound(src.loc, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
if(internal_pressure > 2*ONE_ATMOSPHERE)
to_chat(user, "<span class='warning'>As you begin unwrenching \the [src] a gush of air blows in your face... maybe you should reconsider?</span>")
to_chat(user, "<span class='warning'>As you begin unwrenching \the [src] a gust of air blows in your face... maybe you should reconsider?</span>")
unsafe_wrenching = TRUE //Oh dear oh dear
if(do_after(user, 40 * W.toolspeed, target = src) && !QDELETED(src))
user.visible_message( \
"[user] unfastens \the [src].", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"<span class='italics'>You hear ratchet.</span>")
"<span class='italics'>You hear ratcheting.</span>")
investigate_log("was <span class='warning'>REMOVED</span> by [key_name(usr)]", "atmos")
for(var/obj/item/clothing/shoes/magboots/usermagboots in user.get_equipped_items())
@@ -206,6 +215,9 @@ Pipelines + Other Objects -> Pipe network
unsafe_pressure_release(user,internal_pressure)
deconstruct(TRUE)
else
if(T.transparent_floor)
to_chat(user, "<span class='danger'>You can't interact with something that's under the floor!</span>")
return TRUE
return ..()
//Called when an atmospherics object is unwrenched while having a large pressure difference
@@ -240,7 +252,12 @@ Pipelines + Other Objects -> Pipe network
dir = D
initialize_directions = P
var/turf/T = loc
level = T.intact ? 2 : 1
if(!T.transparent_floor)
level = T.intact ? 2 : 1
else
level = 2
plane = GAME_PLANE
layer = GAS_PIPE_VISIBLE_LAYER
add_fingerprint(usr)
if(!SSair.initialized) //If there's no atmos subsystem, we can't really initialize pipenets
SSair.machinery_to_construct.Add(src)
@@ -337,12 +354,15 @@ Pipelines + Other Objects -> Pipe network
/obj/machinery/atmospherics/proc/add_underlay_adapter(turf/T, obj/machinery/atmospherics/node, direction, icon_connect_type) //modified from add_underlay, does not make exposed underlays
if(node)
if(T.intact && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
if(T.intact && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe) && !T.transparent_floor)
underlays += SSair.icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "down" + icon_connect_type)
else
underlays += SSair.icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "intact" + icon_connect_type)
else
underlays += SSair.icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "retracted" + icon_connect_type)
if(T.transparent_floor) //we want to keep pipes under transparent floors connected normally
underlays += SSair.icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "intact" + icon_connect_type)
else
underlays += SSair.icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "retracted" + icon_connect_type)
/obj/machinery/atmospherics/singularity_pull(S, current_size)
if(current_size >= STAGE_FIVE)
@@ -2,6 +2,7 @@
icon = 'icons/atmos/vent_pump.dmi'
icon_state = "map_vent"
plane = FLOOR_PLANE
layer = GAS_SCRUBBER_LAYER
name = "passive vent"
desc = "A large air vent"
@@ -1,7 +1,7 @@
/obj/machinery/atmospherics/unary/tank
icon = 'icons/atmos/tank.dmi'
icon_state = "air_map"
layer = GAS_PIPE_VISIBLE_LAYER
name = "pressure tank"
desc = "A large vessel containing pressurized gas."
@@ -159,9 +159,9 @@
var/cache_name = state
for(var/D in GLOB.cardinal)
var/image/I = image(icon('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D))
var/image/I = image(icon('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D), layer = GAS_PIPE_HIDDEN_LAYER)
underlays[cache_name + "[D]"] = I
for(var/pipe_color in GLOB.pipe_colors)
I = image(icon('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D))
I = image(icon('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D), layer = GAS_PIPE_HIDDEN_LAYER)
I.color = GLOB.pipe_colors[pipe_color]
underlays[state + "[D]" + "[GLOB.pipe_colors[pipe_color]]"] = I
@@ -79,7 +79,8 @@
break
var/turf/T = get_turf(src) // hide if turf is not intact
if(!istype(T)) return
if(!istype(T) || T.transparent_floor)
return
hide(T.intact)
update_icon()
@@ -57,6 +57,8 @@
node3 = target
break
var/turf/T = src.loc // hide if turf is not intact
if(T.transparent_floor)
return
hide(T.intact)
update_icon()
@@ -165,7 +165,8 @@
break
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
if(!T.transparent_floor)
hide(T.intact)
update_icon()
/obj/machinery/atmospherics/pipe/manifold4w/visible
@@ -46,10 +46,6 @@
if(istype(W, /obj/item/analyzer))
atmosanalyzer_scan(parent.air, user)
return
if(istype(W, /obj/item/painter))
return
return ..()
/obj/machinery/atmospherics/proc/pipeline_expansion()
@@ -68,7 +68,8 @@
break
var/turf/T = loc // hide if turf is not intact
hide(T.intact)
if(!T.transparent_floor)
hide(T.intact)
update_icon()
/obj/machinery/atmospherics/pipe/simple/check_pressure(pressure)
+10 -5
View File
@@ -35,6 +35,7 @@ By design, d1 is the smallest direction and d2 is the highest
icon_state = "0-1"
var/d1 = 0
var/d2 = 1
plane = FLOOR_PLANE
layer = WIRE_LAYER //Just below unary stuff, which is at 2.45 and above pipes, which are at 2.4
color = COLOR_RED
@@ -68,9 +69,11 @@ By design, d1 is the smallest direction and d2 is the highest
d2 = text2num(copytext( icon_state, dash+1 ))
var/turf/T = get_turf(src) // hide if turf is not intact
LAZYADD(GLOB.cable_list, src) //add it to the global cable list
if(T.transparent_floor)
return
if(level == 1)
hide(T.intact)
LAZYADD(GLOB.cable_list, src) //add it to the global cable list
/obj/structure/cable/Destroy() // called when a cable is deleted
if(powernet)
@@ -162,7 +165,8 @@ By design, d1 is the smallest direction and d2 is the highest
//
/obj/structure/cable/attackby(obj/item/W, mob/user)
var/turf/T = get_turf(src)
if(T.intact)
if(T.transparent_floor || T.intact)
to_chat(user, "<span class='danger'>You can't interact with something that's under the floor!</span>")
return
else if(istype(W, /obj/item/stack/cable_coil))
@@ -204,7 +208,8 @@ By design, d1 is the smallest direction and d2 is the highest
/obj/structure/cable/wirecutter_act(mob/user, obj/item/I)
. = TRUE
var/turf/T = get_turf(src)
if(T.intact)
if(T.transparent_floor || T.intact)
to_chat(user, "<span class='danger'>You can't interact with something that's under the floor!</span>")
return
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
@@ -703,7 +708,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
var/turf/T = get_turf(C)
if(!isturf(T) || T.intact) // sanity checks, also stop use interacting with T-scanner revealed cable
if(!isturf(T) || T.intact || T.transparent_floor) // sanity checks, also stop use interacting with T-scanner revealed cable
return
if(get_dist(C, user) > 1) // make sure it's close enough
@@ -719,7 +724,7 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe/cable_restrain
// one end of the clicked cable is pointing towards us
if(C.d1 == dirn || C.d2 == dirn)
if(U.intact) // can't place a cable if the floor is complete
if(U.intact || U.transparent_floor) // can't place a cable if the floor is complete
to_chat(user, "<span class='warning'>You can't lay cable there unless the floor tiles are removed!</span>")
return
else
+2
View File
@@ -15,6 +15,8 @@
/obj/machinery/power/terminal/Initialize(mapload)
. = ..()
var/turf/T = get_turf(src)
if(T.transparent_floor)
return
if(level == 1)
hide(T.intact)
+12 -3
View File
@@ -691,6 +691,7 @@
armor = list("melee" = 25, "bullet" = 10, "laser" = 10, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 90, "acid" = 30)
damage_deflection = 10
flags_2 = RAD_PROTECT_CONTENTS_2 | RAD_NO_CONTAMINATE_2
plane = FLOOR_PLANE
layer = DISPOSAL_PIPE_LAYER // slightly lower than wires and other pipes
var/base_icon_state // initial icon state on map
@@ -757,6 +758,9 @@
// update the icon_state to reflect hidden status
/obj/structure/disposalpipe/proc/update()
var/turf/T = get_turf(src)
if(T.transparent_floor)
update_icon()
return
hide(T.intact && !istype(T, /turf/space)) // space never hides pipes
update_icon()
@@ -889,15 +893,20 @@
/obj/structure/disposalpipe/attackby(obj/item/I, mob/user, params)
var/turf/T = get_turf(src)
if(T.intact)
return // prevent interaction with T-scanner revealed pipes
if(T.intact || T.transparent_floor)
to_chat(user, "<span class='danger'>You can't interact with something that's under the floor!</span>")
return // prevent interaction with T-scanner revealed pipes and pipes under glass
add_fingerprint(user)
/obj/structure/disposalpipe/welder_act(mob/user, obj/item/I)
. = TRUE
var/turf/T = get_turf(src)
if(!I.tool_use_check(user, 0))
return
if(T.transparent_floor)
to_chat(user, "<span class='danger'>You can't interact with something that's under the floor!</span>")
return
WELDER_ATTEMPT_SLICING_MESSAGE
if(!I.use_tool(src, user, 30, volume = I.tool_volume))
return
@@ -1201,7 +1210,7 @@
return
var/turf/T = src.loc
if(T.intact)
if(T.intact || T.transparent_floor)
return // prevent interaction with T-scanner revealed pipes
src.add_fingerprint(user)