diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index 12c304782e1..bd11cc67b31 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -1508,4 +1508,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// Trait given to colorblind mobs #define TRAIT_COLORBLIND "colorblind" +/// Trait that signals to objects on this turf that its open (has UNDERFLOOR_INTERACTIBLE) but still covers them +#define TRAIT_UNCOVERED_TURF "uncovered_turf" + // END TRAIT DEFINES diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 1e796d960d9..c9733faab87 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -772,6 +772,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_SPINNING_WEB_TURF" = TRAIT_SPINNING_WEB_TURF, "TRAIT_TURF_IGNORE_SLIPPERY" = TRAIT_TURF_IGNORE_SLIPPERY, "TRAIT_TURF_IGNORE_SLOWDOWN" = TRAIT_TURF_IGNORE_SLOWDOWN, + "TRAIT_UNCOVERED_TURF" = TRAIT_UNCOVERED_TURF, ), )) diff --git a/code/datums/components/acid.dm b/code/datums/components/acid.dm index 20762c4c945..3aa3a004262 100644 --- a/code/datums/components/acid.dm +++ b/code/datums/components/acid.dm @@ -159,7 +159,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e var/applied_targets = 0 for(var/atom/movable/target_movable as anything in target_turf) // Don't apply acid to things under the turf - if(target_turf.underfloor_accessibility < UNDERFLOOR_INTERACTABLE && HAS_TRAIT(target_movable, TRAIT_T_RAY_VISIBLE)) + if(HAS_TRAIT(target_movable, TRAIT_UNDERFLOOR)) continue // Ignore mobs if turf_acid_ignores_mobs is TRUE if(turf_acid_ignores_mobs && ismob(target_movable)) diff --git a/code/datums/elements/undertile.dm b/code/datums/elements/undertile.dm index 1f79c308fa7..7c1eb85d52a 100644 --- a/code/datums/elements/undertile.dm +++ b/code/datums/elements/undertile.dm @@ -74,8 +74,13 @@ ADD_TRAIT(source, invisibility_trait, ELEMENT_TRAIT(type)) else - SET_PLANE_IMPLICIT(source, initial(source.plane)) - source.layer = initial(source.layer) + if(!HAS_TRAIT(source.loc, TRAIT_UNCOVERED_TURF)) + SET_PLANE_IMPLICIT(source, initial(source.plane)) + source.layer = initial(source.layer) + else + SET_PLANE_IMPLICIT(source, FLOOR_PLANE) + source.layer = BELOW_CATWALK_LAYER + REMOVE_TRAIT(source, TRAIT_UNDERFLOOR, REF(src)) if(invisibility_trait) diff --git a/code/game/objects/effects/anomalies/anomalies_gravity.dm b/code/game/objects/effects/anomalies/anomalies_gravity.dm index 8d90666b821..f2b97862f1b 100644 --- a/code/game/objects/effects/anomalies/anomalies_gravity.dm +++ b/code/game/objects/effects/anomalies/anomalies_gravity.dm @@ -52,14 +52,11 @@ if(!M.mob_negates_gravity()) step_towards(M,src) for(var/obj/O in range(0,src)) - if(!O.anchored) - if(isturf(O.loc)) - var/turf/T = O.loc - if(T.underfloor_accessibility < UNDERFLOOR_INTERACTABLE && HAS_TRAIT(O, TRAIT_T_RAY_VISIBLE)) - continue - var/mob/living/target = locate() in view(4,src) - if(target && !target.stat) - O.throw_at(target, 5, 10) + if(O.anchored || HAS_TRAIT(O, TRAIT_UNDERFLOOR)) + continue + var/mob/living/target = locate() in view(4,src) + if(target && !target.stat) + O.throw_at(target, 5, 10) //anomaly quickly contracts then slowly expands its ring animate(warp, time = seconds_per_tick*3, transform = matrix().Scale(0.5,0.5)) diff --git a/code/game/objects/effects/effect_system/fluid_spread/effects_foam.dm b/code/game/objects/effects/effect_system/fluid_spread/effects_foam.dm index c377b4bc9ce..786672c21d1 100644 --- a/code/game/objects/effects/effect_system/fluid_spread/effects_foam.dm +++ b/code/game/objects/effects/effect_system/fluid_spread/effects_foam.dm @@ -98,7 +98,7 @@ continue if(object.invisibility >= INVISIBILITY_ABSTRACT) // Don't foam landmarks please continue - if(turf_location.underfloor_accessibility < UNDERFLOOR_INTERACTABLE && HAS_TRAIT(object, TRAIT_T_RAY_VISIBLE)) + if(HAS_TRAIT(object, TRAIT_UNDERFLOOR)) continue if (HAS_TRAIT(loc, TRAIT_ELEVATED_TURF) && !HAS_TRAIT(object, TRAIT_ELEVATING_OBJECT)) continue // Do expose tables, don't expose items on tables diff --git a/code/game/objects/effects/effect_system/fluid_spread/effects_smoke.dm b/code/game/objects/effects/effect_system/fluid_spread/effects_smoke.dm index 0ad4df67645..20cabff91be 100644 --- a/code/game/objects/effects/effect_system/fluid_spread/effects_smoke.dm +++ b/code/game/objects/effects/effect_system/fluid_spread/effects_smoke.dm @@ -376,7 +376,7 @@ continue if(thing.invisibility >= INVISIBILITY_ABSTRACT) // Don't smoke landmarks please continue - if(location.underfloor_accessibility < UNDERFLOOR_INTERACTABLE && HAS_TRAIT(thing, TRAIT_T_RAY_VISIBLE)) + if(HAS_TRAIT(thing, TRAIT_UNDERFLOOR)) continue reagents.expose(thing, SMOKE_MACHINE, fraction) diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm index fd58fe5fb0d..1d343314531 100644 --- a/code/game/objects/obj_defense.dm +++ b/code/game/objects/obj_defense.dm @@ -61,12 +61,8 @@ return TRUE /obj/blob_act(obj/structure/blob/B) - if (!..()) + if (!..() || HAS_TRAIT(src, TRAIT_UNDERFLOOR)) return - if(isturf(loc)) - var/turf/T = loc - if(T.underfloor_accessibility < UNDERFLOOR_INTERACTABLE && HAS_TRAIT(src, TRAIT_T_RAY_VISIBLE)) - return take_damage(400, BRUTE, MELEE, 0, get_dir(src, B)) /obj/attack_alien(mob/living/carbon/alien/adult/user, list/modifiers) @@ -127,10 +123,8 @@ ///Called when the obj is exposed to fire. /obj/fire_act(exposed_temperature, exposed_volume) - if(isturf(loc)) - var/turf/our_turf = loc - if(our_turf.underfloor_accessibility < UNDERFLOOR_INTERACTABLE && HAS_TRAIT(src, TRAIT_T_RAY_VISIBLE)) - return + if(HAS_TRAIT(src, TRAIT_UNDERFLOOR)) + return if(exposed_temperature && !(resistance_flags & FIRE_PROOF)) take_damage(clamp(0.02 * exposed_temperature, 0, 20), BURN, FIRE, 0) if(QDELETED(src)) // take_damage() can send our obj to an early grave, let's stop here if that happens diff --git a/code/game/turfs/open/floor/catwalk_plating.dm b/code/game/turfs/open/floor/catwalk_plating.dm index b1f81be75d3..79d616fd02f 100644 --- a/code/game/turfs/open/floor/catwalk_plating.dm +++ b/code/game/turfs/open/floor/catwalk_plating.dm @@ -41,16 +41,23 @@ underfloor_accessibility = UNDERFLOOR_INTERACTABLE layer = LOW_FLOOR_LAYER icon_state = "[catwalk_type]_below" + ADD_TRAIT(src, TRAIT_UNCOVERED_TURF, INNATE_TRAIT) else underfloor_accessibility = UNDERFLOOR_VISIBLE - layer = CATWALK_LAYER icon_state = "[catwalk_type]_above" + layer = initial(layer) + REMOVE_TRAIT(src, TRAIT_UNCOVERED_TURF, INNATE_TRAIT) levelupdate() user.balloon_alert(user, "[!covered ? "cover removed" : "cover added"]") tool.play_tool_sound(src) update_appearance() +/turf/open/floor/catwalk_floor/update_overlays() + . = ..() + if (!covered) + . += mutable_appearance(icon, "[catwalk_type]_overlay", CATWALK_LAYER, src, FLOOR_PLANE, appearance_flags = KEEP_APART) + /turf/open/floor/catwalk_floor/crowbar_act(mob/user, obj/item/crowbar) if(covered) user.balloon_alert(user, "remove cover first!") diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 56ca43ea3e2..f4a1010dd32 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -539,7 +539,7 @@ GLOBAL_LIST_EMPTY(station_turfs) /turf/singularity_act() if(underfloor_accessibility < UNDERFLOOR_INTERACTABLE) for(var/obj/on_top in contents) //this is for deleting things like wires contained in the turf - if(HAS_TRAIT(on_top, TRAIT_T_RAY_VISIBLE)) + if(HAS_TRAIT(on_top, TRAIT_UNDERFLOOR)) on_top.singularity_act() ScrapeAway(flags = CHANGETURF_INHERIT_AIR) return(2) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm index 58e1f619a73..338be57fbbb 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm @@ -27,7 +27,7 @@ /obj/machinery/atmospherics/components/binary/dp_vent_pump/update_icon_nopipes() cut_overlays() - if(showpipe) + if(underfloor_state) var/image/cap = get_pipe_image(icon, "dpvent_cap", dir, pipe_color, piping_layer = piping_layer) cap.appearance_flags |= RESET_COLOR|KEEP_APART add_overlay(cap) diff --git a/code/modules/atmospherics/machinery/components/components_base.dm b/code/modules/atmospherics/machinery/components/components_base.dm index 40abb89921d..a764b29e3f1 100644 --- a/code/modules/atmospherics/machinery/components/components_base.dm +++ b/code/modules/atmospherics/machinery/components/components_base.dm @@ -6,8 +6,8 @@ layer = GAS_PUMP_LAYER ///Is the component welded? var/welded = FALSE - ///Should the component should show the pipe underneath it? - var/showpipe = TRUE + ///Current underfloor_accessibility state, determines if the component should show the pipe underneath it and what plane it renders on. + var/underfloor_state = UNDERFLOOR_INTERACTABLE ///When the component is on a non default layer should we shift everything? Or just the underlay pipe var/shift_underlay_only = TRUE ///Stores the parent pipeline, used in components @@ -57,11 +57,11 @@ return ..() /** - * Called in on_hide(), set the showpipe var to true or false depending on the situation, calls update_icon() + * Called in on_hide(), set the underfloor_state var to true or false depending on the situation, calls update_icon() */ /obj/machinery/atmospherics/components/proc/hide_pipe(underfloor_accessibility) - showpipe = !!underfloor_accessibility - if(showpipe) + underfloor_state = underfloor_accessibility + if(underfloor_state) REMOVE_TRAIT(src, TRAIT_UNDERFLOOR, REF(src)) else ADD_TRAIT(src, TRAIT_UNDERFLOOR, REF(src)) @@ -73,16 +73,17 @@ underlays.Cut() color = null - SET_PLANE_IMPLICIT(src, showpipe ? GAME_PLANE : FLOOR_PLANE) - // Layer is handled in update_layer() + var/uncovered_turf = HAS_TRAIT(loc, TRAIT_UNCOVERED_TURF) + SET_PLANE_IMPLICIT(src, (underfloor_state == UNDERFLOOR_INTERACTABLE && !uncovered_turf) ? GAME_PLANE : FLOOR_PLANE) - if(!showpipe) + // Layer is handled in update_layer() + if(!underfloor_state) return ..() + if(pipe_flags & PIPING_DISTRO_AND_WASTE_LAYERS) return ..() var/connected = 0 //Direction bitset - var/underlay_pipe_layer = shift_underlay_only ? piping_layer : 3 for(var/i in 1 to device_type) //adds intact pieces @@ -92,6 +93,9 @@ var/node_dir = get_dir(src, node) var/mutable_appearance/pipe_appearance = mutable_appearance('icons/obj/pipes_n_cables/pipe_underlays.dmi', "intact_[node_dir]_[underlay_pipe_layer]", appearance_flags = RESET_COLOR|KEEP_APART) pipe_appearance.color = (node.pipe_color == ATMOS_COLOR_OMNI || istype(node, /obj/machinery/atmospherics/pipe/color_adapter)) ? pipe_color : node.pipe_color + if (underfloor_state == UNDERFLOOR_VISIBLE || uncovered_turf) + pipe_appearance.layer = BELOW_CATWALK_LAYER + get_pipe_layer_offset() + SET_PLANE_EXPLICIT(pipe_appearance, FLOOR_PLANE, src) underlays += pipe_appearance connected |= node_dir @@ -99,12 +103,22 @@ if((initialize_directions & direction) && !(connected & direction)) var/mutable_appearance/pipe_appearance = mutable_appearance('icons/obj/pipes_n_cables/pipe_underlays.dmi', "exposed_[direction]_[underlay_pipe_layer]", appearance_flags = RESET_COLOR|KEEP_APART) pipe_appearance.color = pipe_color + if (underfloor_state == UNDERFLOOR_VISIBLE || uncovered_turf) + pipe_appearance.layer = BELOW_CATWALK_LAYER + get_pipe_layer_offset() + SET_PLANE_EXPLICIT(pipe_appearance, FLOOR_PLANE, src) underlays += pipe_appearance if(!shift_underlay_only) PIPING_LAYER_SHIFT(src, piping_layer) return ..() +/obj/machinery/atmospherics/components/get_pipe_image(iconfile, iconstate, direction, color, piping_layer, trinary) + var/mutable_appearance/pipe_appearance = ..() + if (underfloor_state == UNDERFLOOR_VISIBLE || HAS_TRAIT(loc, TRAIT_UNCOVERED_TURF)) + pipe_appearance.layer = BELOW_CATWALK_LAYER + get_pipe_layer_offset() + SET_PLANE_EXPLICIT(pipe_appearance, FLOOR_PLANE, src) + return pipe_appearance + // Pipenet stuff; housekeeping /obj/machinery/atmospherics/components/nullify_node(i) @@ -342,7 +356,16 @@ connect_nodes() /obj/machinery/atmospherics/components/update_layer() - layer = (showpipe ? initial(layer) : BELOW_CATWALK_LAYER) + (piping_layer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_LCHANGE + (GLOB.pipe_colors_ordered[pipe_color] * 0.001) + if (!underfloor_state) + layer = BELOW_CATWALK_LAYER + else if (PLANE_TO_TRUE(plane) == FLOOR_PLANE) + layer = ABOVE_OPEN_TURF_LAYER + else + layer = initial(layer) + layer += get_pipe_layer_offset() + +/obj/machinery/atmospherics/components/proc/get_pipe_layer_offset() + return (piping_layer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_LCHANGE + (GLOB.pipe_colors_ordered[pipe_color] * 0.001) /** * Handles air relocation to the pipenet/environment diff --git a/code/modules/atmospherics/machinery/components/unary_devices/airlock_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/airlock_pump.dm index ada130d9ea0..1cc4c9867a3 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/airlock_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/airlock_pump.dm @@ -89,7 +89,7 @@ /obj/machinery/atmospherics/components/unary/airlock_pump/update_overlays() . = ..() - if(!showpipe) + if(!underfloor_state) return var/mutable_appearance/distro_pipe_appearance = get_pipe_image(icon, "pipe_exposed", dir, COLOR_BLUE, piping_layer = 4) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/bluespace_sender.dm b/code/modules/atmospherics/machinery/components/unary_devices/bluespace_sender.dm index 06b34d684ca..1d5000354f7 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/bluespace_sender.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/bluespace_sender.dm @@ -91,7 +91,7 @@ GLOBAL_LIST_EMPTY_TYPED(bluespace_senders, /obj/machinery/atmospherics/component /obj/machinery/atmospherics/components/unary/bluespace_sender/update_overlays() . = ..() . += get_pipe_image(icon, "pipe", dir, , piping_layer) - if(showpipe) + if(underfloor_state) . += get_pipe_image(icon, "pipe", initialize_directions) /obj/machinery/atmospherics/components/unary/bluespace_sender/process_atmos() diff --git a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm index cdd01efa189..6a402a2ba0b 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm @@ -75,7 +75,7 @@ /obj/machinery/atmospherics/components/unary/outlet_injector/update_icon_nopipes() cut_overlays() - if(showpipe) + if(underfloor_state) // everything is already shifted so don't shift the cap var/image/cap = get_pipe_image(icon, "inje_cap", initialize_directions, pipe_color) cap.appearance_flags |= RESET_COLOR|KEEP_APART diff --git a/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm b/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm index a68876b797f..fc3622b892f 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm @@ -17,7 +17,7 @@ /obj/machinery/atmospherics/components/unary/passive_vent/update_icon_nopipes() cut_overlays() - if(showpipe) + if(underfloor_state) var/image/cap = get_pipe_image(icon, "vent_cap", initialize_directions, pipe_color) cap.appearance_flags |= RESET_COLOR|KEEP_APART add_overlay(cap) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm b/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm index e14d010ab4b..13b76f33826 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm @@ -32,7 +32,7 @@ /obj/machinery/atmospherics/components/unary/portables_connector/update_icon_nopipes() cut_overlays() - if(showpipe) + if(underfloor_state) var/image/cap = get_pipe_image(icon, "connector_cap", initialize_directions, pipe_color) cap.appearance_flags |= RESET_COLOR|KEEP_APART add_overlay(cap) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm index b07d275dffd..cc868e4fa64 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm @@ -189,7 +189,7 @@ /obj/machinery/atmospherics/components/unary/vent_pump/update_icon_nopipes() cut_overlays() - if(showpipe) + if(underfloor_state) var/image/cap = get_pipe_image(icon, "vent_cap", initialize_directions) add_overlay(cap) else diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm index 25ce6ff4e33..6a57c08457a 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm @@ -120,7 +120,7 @@ /obj/machinery/atmospherics/components/unary/vent_scrubber/update_icon_nopipes() cut_overlays() - if(showpipe) + if(underfloor_state) var/image/cap = get_pipe_image(icon, "scrub_cap", initialize_directions) add_overlay(cap) else diff --git a/icons/turf/floors/catwalk_plating.dmi b/icons/turf/floors/catwalk_plating.dmi index 800d0c8dfff..898612b0fcc 100644 Binary files a/icons/turf/floors/catwalk_plating.dmi and b/icons/turf/floors/catwalk_plating.dmi differ