Fixed the multi z pipe adapter (#53829)

So yeah the multi-z pipe adapter was showing the big gmod error.

This fixes it and adds multiple directions and layers for the adapter.

Also RPD now can produce said manifold.

Also this reworks the painting mechanism so that it uses a variable+proc instead of checking for subtypes .
This commit is contained in:
nicbn
2020-09-25 14:30:58 -07:00
committed by GitHub
parent 07b613efac
commit 88257cd02f
14 changed files with 166 additions and 107 deletions
+66 -58
View File
@@ -319,8 +319,8 @@
/area/engine/atmos)
"bm" = (
/obj/machinery/atmospherics/components/binary/valve/on{
icon_state = "mvalve_map-2";
dir = 4
dir = 4;
icon_state = "mvalve_map-2"
},
/turf/open/floor/plating,
/area/engine/atmos)
@@ -1098,8 +1098,8 @@
/area/hallway/secondary/service)
"eQ" = (
/obj/structure/railing{
icon_state = "railing";
dir = 4
dir = 4;
icon_state = "railing"
},
/turf/open/floor/plating,
/area/engine/storage)
@@ -1109,8 +1109,8 @@
/area/engine/storage)
"eX" = (
/obj/effect/turf_decal/stripes/white/line{
icon_state = "warningline_white";
dir = 4
dir = 4;
icon_state = "warningline_white"
},
/turf/open/floor/plating,
/area/engine/storage)
@@ -1143,8 +1143,8 @@
/area/engine/storage)
"gK" = (
/obj/machinery/atmospherics/components/unary/portables_connector/visible{
icon_state = "connector_map-2";
dir = 8
dir = 8;
icon_state = "connector_map-2"
},
/obj/machinery/portable_atmospherics/canister/toxins,
/turf/open/floor/plating,
@@ -1162,8 +1162,8 @@
/area/hallway/primary/central)
"hi" = (
/obj/machinery/atmospherics/components/unary/outlet_injector/on{
icon_state = "inje_map-2";
dir = 4
dir = 4;
icon_state = "inje_map-2"
},
/turf/open/floor/plating,
/area/construction)
@@ -1203,8 +1203,8 @@
"iH" = (
/obj/effect/turf_decal/stripes/white/line,
/obj/structure/railing/corner{
icon_state = "railing_corner";
dir = 4
dir = 4;
icon_state = "railing_corner"
},
/turf/open/floor/plating,
/area/engine/storage)
@@ -1214,13 +1214,13 @@
},
/area/hallway/secondary/service)
"jb" = (
/obj/machinery/atmospherics/pipe/simple/multiz,
/obj/machinery/atmospherics/pipe/multiz,
/turf/open/floor/plating,
/area/hallway/secondary/service)
"jA" = (
/obj/effect/turf_decal/stripes/white/line{
icon_state = "warningline_white";
dir = 8
dir = 8;
icon_state = "warningline_white"
},
/obj/effect/spawner/structure/window/reinforced,
/turf/open/floor/plating,
@@ -1231,14 +1231,20 @@
},
/turf/open/floor/plating,
/area/construction)
"jL" = (
/obj/machinery/atmospherics/pipe/multiz{
dir = 1
},
/turf/open/floor/plating,
/area/hallway/secondary/service)
"jT" = (
/obj/machinery/airalarm/directional/north,
/turf/open/floor/plating,
/area/construction)
"jV" = (
/obj/effect/turf_decal/stripes/white/line{
icon_state = "warningline_white";
dir = 6
dir = 6;
icon_state = "warningline_white"
},
/turf/open/floor/plating,
/area/engine/storage)
@@ -1353,12 +1359,12 @@
/area/construction)
"qR" = (
/obj/effect/turf_decal/stripes/white/line{
icon_state = "warningline_white";
dir = 9
dir = 9;
icon_state = "warningline_white"
},
/obj/structure/railing/corner{
icon_state = "railing_corner";
dir = 1
dir = 1;
icon_state = "railing_corner"
},
/turf/open/floor/plating,
/area/engine/storage)
@@ -1386,26 +1392,26 @@
/area/construction)
"su" = (
/obj/structure/railing{
icon_state = "railing";
dir = 8
dir = 8;
icon_state = "railing"
},
/turf/open/floor/plating,
/area/hallway/secondary/service)
"sE" = (
/obj/effect/turf_decal/stripes/white/line{
icon_state = "warningline_white";
dir = 4
dir = 4;
icon_state = "warningline_white"
},
/obj/structure/railing{
icon_state = "railing";
dir = 8
dir = 8;
icon_state = "railing"
},
/turf/open/floor/plating,
/area/engine/storage)
"td" = (
/obj/effect/turf_decal/stripes/white/line{
icon_state = "warningline_white";
dir = 8
dir = 8;
icon_state = "warningline_white"
},
/turf/open/floor/plating,
/area/engine/storage)
@@ -1461,8 +1467,8 @@
/area/construction)
"xB" = (
/obj/effect/turf_decal/stripes/white/line{
icon_state = "warningline_white";
dir = 1
dir = 1;
icon_state = "warningline_white"
},
/turf/open/floor/plating,
/area/engine/storage)
@@ -1503,12 +1509,12 @@
/area/storage/primary)
"zd" = (
/obj/structure/railing{
icon_state = "railing";
dir = 4
dir = 4;
icon_state = "railing"
},
/obj/structure/railing{
icon_state = "railing";
dir = 8
dir = 8;
icon_state = "railing"
},
/turf/open/floor/plating,
/area/hallway/secondary/service)
@@ -1519,8 +1525,8 @@
/area/construction)
"zZ" = (
/obj/structure/disposalpipe/trunk{
icon_state = "pipe-t";
dir = 1
dir = 1;
icon_state = "pipe-t"
},
/obj/machinery/disposal/bin,
/turf/open/floor/plating,
@@ -1531,8 +1537,8 @@
/area/engine/storage)
"Ai" = (
/obj/structure/railing/corner{
icon_state = "railing_corner";
dir = 8
dir = 8;
icon_state = "railing_corner"
},
/turf/open/floor/plating,
/area/hallway/secondary/service)
@@ -1611,8 +1617,8 @@
"Eb" = (
/obj/effect/turf_decal/stripes/white/line,
/obj/structure/railing{
icon_state = "railing";
dir = 1
dir = 1;
icon_state = "railing"
},
/turf/open/floor/plating,
/area/engine/storage)
@@ -1622,12 +1628,12 @@
/area/construction)
"EH" = (
/obj/effect/turf_decal/stripes/white/line{
icon_state = "warningline_white";
dir = 1
dir = 1;
icon_state = "warningline_white"
},
/obj/effect/turf_decal/stripes/white/line{
icon_state = "warningline_white";
dir = 4
dir = 4;
icon_state = "warningline_white"
},
/turf/open/floor/plating,
/area/engine/storage)
@@ -1642,8 +1648,8 @@
"FL" = (
/obj/effect/spawner/structure/window/reinforced,
/obj/machinery/atmospherics/pipe/simple/green/hidden{
icon_state = "pipe11-2";
dir = 4
dir = 4;
icon_state = "pipe11-2"
},
/turf/open/floor/plating,
/area/construction)
@@ -1655,7 +1661,9 @@
/turf/open/floor/plating,
/area/hallway/secondary/service)
"Hk" = (
/obj/machinery/atmospherics/pipe/simple/multiz,
/obj/machinery/atmospherics/pipe/multiz{
dir = 1
},
/turf/open/floor/plating,
/area/construction)
"Hp" = (
@@ -1675,8 +1683,8 @@
"IL" = (
/obj/structure/railing/corner,
/obj/structure/railing/corner{
icon_state = "railing_corner";
dir = 8
dir = 8;
icon_state = "railing_corner"
},
/turf/open/floor/plating,
/area/hallway/secondary/service)
@@ -1723,8 +1731,8 @@
/area/maintenance/department/bridge)
"Lu" = (
/obj/structure/railing{
icon_state = "railing";
dir = 4
dir = 4;
icon_state = "railing"
},
/turf/open/floor/plating,
/area/hallway/secondary/service)
@@ -1772,8 +1780,8 @@
/area/engine/storage)
"Qo" = (
/obj/structure/disposalpipe/trunk/multiz/down{
icon_state = "pipe-down";
dir = 1
dir = 1;
icon_state = "pipe-down"
},
/turf/open/floor/plating,
/area/hallway/secondary/service)
@@ -1826,7 +1834,7 @@
/turf/open/floor/plating,
/area/engine/storage)
"UH" = (
/obj/machinery/atmospherics/pipe/simple/multiz,
/obj/machinery/atmospherics/pipe/multiz,
/turf/open/floor/plating,
/area/engine/storage)
"Vm" = (
@@ -1883,8 +1891,8 @@
/area/construction)
"ZQ" = (
/obj/effect/turf_decal/stripes/white/line{
icon_state = "warningline_white";
dir = 5
dir = 5;
icon_state = "warningline_white"
},
/obj/effect/spawner/structure/window/reinforced,
/turf/open/floor/plating,
@@ -5813,7 +5821,7 @@ Gb
jb
LE
IC
jb
jL
Gb
XN
iu
+3
View File
@@ -20,6 +20,8 @@ Buildable meters
w_class = WEIGHT_CLASS_NORMAL
var/piping_layer = PIPING_LAYER_DEFAULT
var/RPD_type
/// Whether it can be painted
var/paintable = FALSE
/obj/item/pipe/directional
RPD_type = PIPE_UNARY
@@ -56,6 +58,7 @@ Buildable meters
pipename = make_from.name
add_atom_colour(make_from.color, FIXED_COLOUR_PRIORITY)
pipe_type = make_from.type
paintable = make_from.paintable
/obj/item/pipe/trinary/flippable/make_from_existing(obj/machinery/atmospherics/components/trinary/make_from)
..()
+14 -13
View File
@@ -18,7 +18,8 @@ GLOBAL_LIST_INIT(atmos_pipe_recipes, list(
new /datum/pipe_info/pipe("Pipe", /obj/machinery/atmospherics/pipe/simple, TRUE),
new /datum/pipe_info/pipe("Manifold", /obj/machinery/atmospherics/pipe/manifold, TRUE),
new /datum/pipe_info/pipe("4-Way Manifold", /obj/machinery/atmospherics/pipe/manifold4w, TRUE),
new /datum/pipe_info/pipe("Layer Manifold", /obj/machinery/atmospherics/pipe/layer_manifold, TRUE),
new /datum/pipe_info/pipe("Layer Adapter", /obj/machinery/atmospherics/pipe/layer_manifold, TRUE),
new /datum/pipe_info/pipe("Multi-Deck Adapter", /obj/machinery/atmospherics/pipe/multiz, TRUE),
),
"Devices" = list(
new /datum/pipe_info/pipe("Connector", /obj/machinery/atmospherics/components/unary/portables_connector, TRUE),
@@ -359,21 +360,21 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
return
if((mode & PAINT_MODE))
if(istype(A, /obj/machinery/atmospherics/pipe) && !istype(A, /obj/machinery/atmospherics/pipe/layer_manifold))
var/obj/machinery/atmospherics/pipe/P = A
to_chat(user, "<span class='notice'>You start painting \the [P] [paint_color]...</span>")
var/obj/machinery/atmospherics/M = A
if(istype(M) && M.paintable)
to_chat(user, "<span class='notice'>You start painting \the [M] [paint_color]...</span>")
playsound(get_turf(src), 'sound/machines/click.ogg', 50, TRUE)
if(do_after(user, paint_speed, target = A))
P.paint(GLOB.pipe_paint_colors[paint_color]) //paint the pipe
user.visible_message("<span class='notice'>[user] paints \the [P] [paint_color].</span>","<span class='notice'>You paint \the [P] [paint_color].</span>")
if(do_after(user, paint_speed, target = M))
M.paint(GLOB.pipe_paint_colors[paint_color]) //paint the pipe
user.visible_message("<span class='notice'>[user] paints \the [M] [paint_color].</span>","<span class='notice'>You paint \the [M] [paint_color].</span>")
return
var/obj/item/pipe/P = A
if(istype(P) && findtext("[P.pipe_type]", "/obj/machinery/atmospherics/pipe") && !findtext("[P.pipe_type]", "layer_manifold"))
to_chat(user, "<span class='notice'>You start painting \the [A] [paint_color]...</span>")
var/obj/item/pipe/I = A
if(istype(I) && I.paintable)
to_chat(user, "<span class='notice'>You start painting \the [I] [paint_color]...</span>")
playsound(get_turf(src), 'sound/machines/click.ogg', 50, TRUE)
if(do_after(user, paint_speed, target = A))
A.add_atom_colour(GLOB.pipe_paint_colors[paint_color], FIXED_COLOUR_PRIORITY) //paint the pipe
user.visible_message("<span class='notice'>[user] paints \the [A] [paint_color].</span>","<span class='notice'>You paint \the [A] [paint_color].</span>")
if(do_after(user, paint_speed, target = I))
I.add_atom_colour(GLOB.pipe_paint_colors[paint_color], FIXED_COLOUR_PRIORITY) //paint the pipe
user.visible_message("<span class='notice'>[user] paints \the [I] [paint_color].</span>","<span class='notice'>You paint \the [I] [paint_color].</span>")
return
if(mode & BUILD_MODE)
@@ -41,6 +41,9 @@
var/pipe_state //icon_state as a pipe item
var/on = FALSE
/// Whether it can be painted
var/paintable = FALSE
/obj/machinery/atmospherics/examine(mob/user)
. = ..()
if(is_type_in_list(src, GLOB.ventcrawl_machinery) && isliving(user))
@@ -339,3 +342,6 @@
/obj/machinery/atmospherics/proc/update_layer()
layer = initial(layer) + (piping_layer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_LCHANGE
/obj/machinery/atmospherics/proc/paint(paint_color)
return FALSE
@@ -11,6 +11,7 @@
volume = 260
construction_type = /obj/item/pipe/binary
pipe_state = "manifoldlayer"
paintable = FALSE
var/list/front_nodes
var/list/back_nodes
@@ -37,7 +38,7 @@
/obj/machinery/atmospherics/pipe/layer_manifold/proc/get_all_connected_nodes()
return front_nodes + back_nodes + nodes
/obj/machinery/atmospherics/pipe/layer_manifold/update_icon() //HEAVILY WIP FOR UPDATE ICONS!!
/obj/machinery/atmospherics/pipe/layer_manifold/update_icon()
cut_overlays()
layer = initial(layer) + (PIPING_LAYER_MAX * PIPING_LAYER_LCHANGE) //This is above everything else.
@@ -81,3 +81,16 @@ HELPER_NAMED(supplymain, "main air supply pipe", rgb(130, 43, 255))
#undef HELPER
#undef HELPER_PARTIAL_NAMED
#undef HELPER_PARTIAL
/obj/machinery/atmospherics/pipe/multiz/layer1
piping_layer = 1
icon_state = "adapter-1"
/obj/machinery/atmospherics/pipe/multiz/layer2
piping_layer = 2
icon_state = "adapter-2"
/obj/machinery/atmospherics/pipe/multiz/layer4
piping_layer = 4
icon_state = "adapter-4"
/obj/machinery/atmospherics/pipe/multiz/layer5
piping_layer = 5
icon_state = "adapter-5"
@@ -0,0 +1,53 @@
/// This is an atmospherics pipe which can relay air up/down a deck.
/obj/machinery/atmospherics/pipe/multiz
name = "multi deck pipe adapter"
desc = "An adapter which allows pipes to connect to other pipenets on different decks."
icon_state = "adapter-3"
icon = 'icons/obj/atmospherics/pipes/multiz.dmi'
dir = SOUTH
initialize_directions = SOUTH
layer = HIGH_OBJ_LAYER
device_type = UNARY
paintable = FALSE
construction_type = /obj/item/pipe/directional
pipe_state = "multiz"
var/mutable_appearance/center = null
var/mutable_appearance/pipe = null
var/obj/machinery/atmospherics/front_node = null
/* We use New() instead of Initialize() because these values are used in update_icon()
* in the mapping subsystem init before Initialize() is called in the atoms subsystem init.
* This is true for the other manifolds (the 4 ways and the heat exchanges) too.
*/
/obj/machinery/atmospherics/pipe/multiz/New()
icon_state = ""
center = mutable_appearance(icon, "adapter_center", layer = HIGH_OBJ_LAYER)
pipe = mutable_appearance(icon, "pipe-[piping_layer]")
return ..()
/obj/machinery/atmospherics/pipe/multiz/SetInitDirections()
initialize_directions = dir
/obj/machinery/atmospherics/pipe/multiz/update_icon()
cut_overlays()
pipe.color = front_node ? front_node.pipe_color : rgb(255, 255, 255)
pipe.icon_state = "pipe-[piping_layer]"
center.pixel_x = PIPING_LAYER_P_X * (piping_layer - PIPING_LAYER_DEFAULT)
add_overlay(pipe)
add_overlay(center)
///Attempts to locate a multiz pipe that's above us, if it finds one it merges us into its pipenet
/obj/machinery/atmospherics/pipe/multiz/pipeline_expansion()
var/turf/T = get_turf(src)
var/obj/machinery/atmospherics/pipe/multiz/above = locate(/obj/machinery/atmospherics/pipe/multiz) in(SSmapping.get_turf_above(T))
var/obj/machinery/atmospherics/pipe/multiz/below = locate(/obj/machinery/atmospherics/pipe/multiz) in(SSmapping.get_turf_below(T))
if(below)
below.pipeline_expansion() //If we've got one below us, force it to add us on facebook
if(above)
nodes += above
above.nodes += src //Two way travel :)
return ..()
@@ -7,6 +7,8 @@
can_unwrench = 1
var/datum/pipeline/parent = null
paintable = TRUE
//Buckling
can_buckle = TRUE
buckle_requires_restraints = TRUE
@@ -90,8 +92,9 @@
/obj/machinery/atmospherics/pipe/returnPipenets()
. = list(parent)
/obj/machinery/atmospherics/pipe/proc/paint(paint_color)
add_atom_colour(paint_color, FIXED_COLOUR_PRIORITY)
pipe_color = paint_color
update_node_icon()
return TRUE
/obj/machinery/atmospherics/pipe/paint(paint_color)
if(paintable)
add_atom_colour(paint_color, FIXED_COLOUR_PRIORITY)
pipe_color = paint_color
update_node_icon()
return paintable
-29
View File
@@ -1,29 +0,0 @@
/obj/machinery/atmospherics/pipe/simple/multiz ///This is an atmospherics pipe which can relay air up a deck (Z+1). It currently only supports being on pipe layer 1
name = "multi deck pipe adapter"
desc = "An adapter which allows pipes to connect to other pipenets on different decks."
icon_state = "multiz_pipe"
icon = 'icons/obj/atmos.dmi'
/obj/machinery/atmospherics/pipe/simple/multiz/update_icon()
. = ..()
cut_overlays() //This adds the overlay showing it's a multiz pipe. This should go above turfs and such
var/image/multiz_overlay_node = new(src) //If we have a firing state, light em up!
multiz_overlay_node.icon = 'icons/obj/atmos.dmi'
multiz_overlay_node.icon_state = "multiz_pipe"
multiz_overlay_node.layer = HIGH_OBJ_LAYER
add_overlay(multiz_overlay_node)
///Attempts to locate a multiz pipe that's above us, if it finds one it merges us into its pipenet
/obj/machinery/atmospherics/pipe/simple/multiz/pipeline_expansion()
icon = 'icons/obj/atmos.dmi' //Just to refresh.
var/turf/T = get_turf(src)
var/obj/machinery/atmospherics/pipe/simple/multiz/above = locate(/obj/machinery/atmospherics/pipe/simple/multiz) in(SSmapping.get_turf_above(T))
var/obj/machinery/atmospherics/pipe/simple/multiz/below = locate(/obj/machinery/atmospherics/pipe/simple/multiz) in(SSmapping.get_turf_below(T))
if(below)
below.pipeline_expansion() //If we've got one below us, force it to add us on facebook
if(above)
nodes += above
above.nodes += src //Two way travel :)
return ..()
else
return ..()
Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 27 KiB

+1 -1
View File
@@ -1580,7 +1580,6 @@
#include "code\modules\asset_cache\asset_list_items.dm"
#include "code\modules\asset_cache\transports\asset_transport.dm"
#include "code\modules\asset_cache\transports\webroot_transport.dm"
#include "code\modules\atmospherics\multiz.dm"
#include "code\modules\atmospherics\environmental\LINDA_fire.dm"
#include "code\modules\atmospherics\environmental\LINDA_system.dm"
#include "code\modules\atmospherics\environmental\LINDA_turf_tile.dm"
@@ -1621,6 +1620,7 @@
#include "code\modules\atmospherics\machinery\pipes\manifold.dm"
#include "code\modules\atmospherics\machinery\pipes\manifold4w.dm"
#include "code\modules\atmospherics\machinery\pipes\mapping.dm"
#include "code\modules\atmospherics\machinery\pipes\multiz.dm"
#include "code\modules\atmospherics\machinery\pipes\pipes.dm"
#include "code\modules\atmospherics\machinery\pipes\simple.dm"
#include "code\modules\atmospherics\machinery\pipes\heat_exchange\he_pipes.dm"