Defficiency rework:

- Added pipe layer adapters, for less ugly-looking pipe layering.
 - SME room seriously overhauled
 - Reworked atmospherics piping.  Considering completely deleting atmos and restarting anew.

why is this not working

Fix bugs in adapters.

fuck

changelog

Set boxstation as active map. Oops.

Fix doublestacked pipe in atmos.
This commit is contained in:
Rob Nelson
2015-08-29 11:58:18 -07:00
parent fd373d3157
commit d7ff819fdb
12 changed files with 11146 additions and 10797 deletions

View File

@@ -34,6 +34,7 @@ Buildable meters
#define PIPE_INSUL_MANIFOLD 27
#define PIPE_INSUL_MANIFOLD4W 28
#define PIPE_LAYER_MANIFOLD 29
#define PIPE_LAYER_ADAPTER 30
//Disposal piping numbers - do NOT hardcode these, use the defines
#define DISP_PIPE_STRAIGHT 0
@@ -188,6 +189,8 @@ var/global/list/unstackable_pipes = list(PIPE_LAYER_MANIFOLD)
src.pipe_type = PIPE_DP_VENT
else if(istype(make_from, /obj/machinery/atmospherics/unary/vent))
src.pipe_type = PIPE_PASV_VENT
else if(istype(make_from, /obj/machinery/atmospherics/pipe/layer_adapter))
src.pipe_type = PIPE_LAYER_ADAPTER
setPipingLayer(make_from.piping_layer)
else
@@ -200,7 +203,7 @@ var/global/list/unstackable_pipes = list(PIPE_LAYER_MANIFOLD)
/obj/item/pipe/proc/setPipingLayer(new_layer = PIPING_LAYER_DEFAULT)
piping_layer = new_layer
if(pipe_type != PIPE_LAYER_MANIFOLD)
if(pipe_type != PIPE_LAYER_MANIFOLD && pipe_type != PIPE_LAYER_ADAPTER)
pixel_x = (piping_layer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_P_X
pixel_y = (piping_layer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_P_Y
layer = initial(layer) + ((piping_layer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_LCHANGE)
@@ -237,7 +240,8 @@ var/global/list/pipeID2State = list(
"dtvalve",
"insulated_manifold",
"insulated_manifold4w",
"manifoldlayer"
"manifoldlayer",
"layeradapter",
)
var/global/list/nlist = list( \
"pipe", \
@@ -269,15 +273,20 @@ var/global/list/nlist = list( \
"digital t-valve", \
"insulated manifold", \
"insulated 4-way manifold", \
"pipe alignment converter"
"pipe alignment converter", \
"pipe alignment adapter",
)
/obj/item/pipe/proc/update()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/obj/item/pipe/proc/update() called tick#: [world.time]")
name = nlist[pipe_type+1] + " fitting"
icon = 'icons/obj/pipe-item.dmi'
icon_state = pipeID2State[pipe_type + 1]
if(pipe_type == PIPE_LAYER_ADAPTER)
icon_state="adapter_[piping_layer]"
icon = 'icons/obj/atmospherics/pipe_adapter.dmi'
else
icon = 'icons/obj/pipe-item.dmi'
icon_state = pipeID2State[pipe_type + 1]
//called when a turf is attacked with a pipe item
// place the pipe on the turf, setting pipe level to 1 (underfloor) if the turf is not intact
@@ -332,7 +341,8 @@ var/global/list/nlist = list( \
PIPE_MVALVE, \
PIPE_DVALVE, \
PIPE_DP_VENT, \
PIPE_LAYER_MANIFOLD
PIPE_LAYER_MANIFOLD, \
PIPE_LAYER_ADAPTER
)
return dir|flip
if(PIPE_SIMPLE_BENT, PIPE_INSULATED_BENT, PIPE_HE_BENT)
@@ -491,6 +501,10 @@ var/global/list/nlist = list( \
if(PIPE_LAYER_MANIFOLD)
P =new /obj/machinery/atmospherics/pipe/layer_manifold(src.loc)
if(PIPE_LAYER_ADAPTER)
testing("src.loc = [src.loc]")
P =new /obj/machinery/atmospherics/pipe/layer_adapter(src.loc)
P.setPipingLayer(src.piping_layer)
if(P.buildFrom(usr,src))
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)

View File

@@ -52,6 +52,7 @@
<li><a href='?src=\ref[src];make=[PIPE_DTVALVE];dir=1'>Digital T-Valve</a></li>
<li><a href='?src=\ref[src];make=[PIPE_DTVALVE];dir=9'>Digital T-Valve \[M]</a></li>
<li><a href='?src=\ref[src];make=[PIPE_LAYER_MANIFOLD];dir=1'>Layer Manifold</a></li>
<li><a href='?src=\ref[src];make=[PIPE_LAYER_ADAPTER];dir=1'>Layer Adapter</a></li>
</ul>
<b>Devices:</b>
<ul>

View File

@@ -925,6 +925,11 @@
/obj/machinery/atmospherics/pipe/layer_manifold/New()
for(var/pipelayer = PIPING_LAYER_MIN; pipelayer <= PIPING_LAYER_MAX; pipelayer += PIPING_LAYER_INCREMENT)
layer_nodes.Add(null)
switch(dir)
if(NORTH,SOUTH)
initialize_directions = NORTH|SOUTH
if(EAST,WEST)
initialize_directions = EAST|WEST
..()
/obj/machinery/atmospherics/pipe/layer_manifold/setPipingLayer(var/new_layer = PIPING_LAYER_DEFAULT)
@@ -1086,3 +1091,171 @@
return 1
else
return ..()
/obj/machinery/atmospherics/pipe/layer_adapter
name = "pipe-layer adapter"
icon = 'icons/obj/atmospherics/pipe_adapter.dmi'
icon_state = "adapter_1"
baseicon = "adapter"
dir = SOUTH
initialize_directions = NORTH|SOUTH
volume = 260 //6 averaged pipe segments
pipe_flags = ALL_LAYER
var/obj/machinery/atmospherics/layer_node = null
var/obj/machinery/atmospherics/mid_node = null
/obj/machinery/atmospherics/pipe/layer_adapter/New()
..()
switch(dir)
if(NORTH,SOUTH)
initialize_directions = NORTH|SOUTH
if(EAST,WEST)
initialize_directions = EAST|WEST
/obj/machinery/atmospherics/pipe/layer_adapter/setPipingLayer(var/new_layer = PIPING_LAYER_DEFAULT)
piping_layer = new_layer
/obj/machinery/atmospherics/pipe/layer_adapter/buildFrom(var/mob/usr,var/obj/item/pipe/pipe)
dir = pipe.dir
initialize_directions = pipe.get_pipe_dir()
var/turf/T = loc
level = T.intact ? 2 : 1
initialize(1)
if(!mid_node && !layer_node)
usr << "<span class='warning'>There's nothing to connect this adapter to! A pipe segment must be connected to at least one other object!</span>"
return 0
update_icon()
build_network()
if (mid_node)
mid_node.initialize()
mid_node.build_network()
if (layer_node)
layer_node.initialize()
layer_node.build_network()
return 1
/obj/machinery/atmospherics/pipe/layer_adapter/hide(var/i)
if(level == 1 && istype(loc, /turf/simulated))
invisibility = i ? 101 : 0
update_icon()
/obj/machinery/atmospherics/pipe/layer_adapter/pipeline_expansion()
return list(layer_node, mid_node)
/obj/machinery/atmospherics/pipe/layer_adapter/process()
if(!parent)
. = ..()
atmos_machines.Remove(src)
/obj/machinery/atmospherics/pipe/layer_adapter/Destroy()
if(mid_node)
mid_node.disconnect(src)
if(layer_node)
layer_node.disconnect(src)
..()
/obj/machinery/atmospherics/pipe/layer_adapter/disconnect(var/obj/machinery/atmospherics/reference)
if(reference == mid_node)
if(istype(mid_node, /obj/machinery/atmospherics/pipe))
returnToDPool(parent)
mid_node = null
if(reference == layer_node)
if(istype(layer_node, /obj/machinery/atmospherics/pipe))
returnToDPool(parent)
layer_node = null
update_icon()
..()
/obj/machinery/atmospherics/pipe/layer_adapter/update_icon()
overlays.len = 0
alpha = invisibility ? 128 : 255
icon_state = "[baseicon]_[piping_layer]"
if(layer_node)
var/layer_diff = piping_layer - PIPING_LAYER_DEFAULT
var/image/con = image(icon(src.icon,"layer_con",turn(src.dir,180)))
con.pixel_x = layer_diff * PIPING_LAYER_P_X
con.pixel_y = layer_diff * PIPING_LAYER_P_Y
overlays += con
if(!mid_node && !layer_node)
qdel(src)
return
/obj/machinery/atmospherics/pipe/layer_adapter/initialize(var/skip_update_icon=0)
findAllConnections(initialize_directions)
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
if(!skip_update_icon)
update_icon()
/obj/machinery/atmospherics/pipe/layer_adapter/findAllConnections(var/connect_dirs)
for(var/direction in cardinal)
if(connect_dirs & direction)
if(direction == dir) //we're facing this
var/obj/machinery/atmospherics/found
var/node_type=getNodeType(direction)
switch(node_type)
if(PIPE_TYPE_STANDARD)
found = findConnecting(direction, PIPING_LAYER_DEFAULT)
if(PIPE_TYPE_HE)
found = findConnectingHE(direction, PIPING_LAYER_DEFAULT)
else
error("UNKNOWN RESPONSE FROM [src.type]/getNodeType([direction]): [node_type]")
if(!found)
continue
mid_node = found
else
var/obj/machinery/atmospherics/found
var/node_type=getNodeType(direction)
switch(node_type)
if(PIPE_TYPE_STANDARD)
found = findConnecting(direction, piping_layer) //we pass the layer to find the pipe
if(PIPE_TYPE_HE)
found = findConnectingHE(direction, piping_layer)
else
error("UNKNOWN RESPONSE FROM [src.type]/getNodeType([piping_layer]): [node_type]")
return
if(!found)
continue
layer_node = found
/obj/machinery/atmospherics/pipe/layer_adapter/isConnectable(var/obj/machinery/atmospherics/target, var/direction, var/given_layer)
if(direction == dir)
return (given_layer == PIPING_LAYER_DEFAULT)
return ..()
/obj/machinery/atmospherics/pipe/layer_adapter/getNodeType()
return PIPE_TYPE_STANDARD
//We would normally set layer here, but I don't want to
/obj/machinery/atmospherics/pipe/layer_adapter/Entered()
return
/obj/machinery/atmospherics/pipe/layer_adapter/relaymove(mob/living/user, direction)
if(!(direction & initialize_directions)) //can't go in a way we aren't connecting to
var/on_offset_layer = user.ventcrawl_layer == layer_node.piping_layer
on_offset_layer = !on_offset_layer
if(on_offset_layer)
user.ventcrawl_layer = layer_node.piping_layer
else
user.ventcrawl_layer = mid_node.piping_layer
user << "You align yourself with the [user.ventcrawl_layer]\th layer." // ????
return 1
else
return ..()

View File

@@ -165,6 +165,13 @@
trace_gas.moles = 9*4000
air.update_values()
/turf/simulated/floor/engine/nitrogen
name = "nitrogen floor"
icon_state = "engine"
oxygen=0
nitrogen = MOLES_O2STANDARD+MOLES_N2STANDARD // So it totals to the same pressure
temperature = TCMB
/turf/simulated/floor/engine/vacuum
name = "vacuum floor"
icon_state = "engine"

View File

@@ -4,7 +4,7 @@
icon_state = "rpd"
starting_materials = list(MAT_IRON = 75000, MAT_GLASS = 37500)
schematics = list(
/* Utilities */
@@ -22,6 +22,7 @@
/datum/rcd_schematic/pipe/mtvalve,
/datum/rcd_schematic/pipe/dtvalve,
/datum/rcd_schematic/pipe/layer_manifold,
/datum/rcd_schematic/pipe/layer_adapter,
/* Devices */
/datum/rcd_schematic/pipe/connector,

View File

@@ -448,6 +448,26 @@ var/global/list/disposalpipeID2State = list(
pipe_id = PIPE_LAYER_MANIFOLD
pipe_type = PIPE_UNARY
/datum/rcd_schematic/pipe/layer_adapter
name = "Layer Adapter"
pipe_id = PIPE_LAYER_ADAPTER
pipe_type = PIPE_UNARY
/datum/rcd_schematic/pipe/layer_adapter/register_icon(var/dir)
register_asset("RPD_[pipe_id]_[dir]_[layer].png", new/icon('icons/obj/atmospherics/pipe_adapter.dmi', "adapter_[layer]", dir))
/datum/rcd_schematic/pipe/layer_adapter/send_icon(var/client/client, var/dir)
send_asset(client, "RPD_[pipe_id]_[dir]_[layer].png")
/datum/rcd_schematic/pipe/layer_adapter/render_dir_image(var/dir, var/title)
var/selected = ""
if(selected_dir == dir)
selected = " class='selected'"
return "<a href='?src=\ref[master.interface];set_dir=[dir]'[selected] title='[title]'><img src='RPD_[pipe_id]_[dir]_[layer].png'/></a>"
//DEVICES.
/datum/rcd_schematic/pipe/connector

View File

@@ -1,2 +1,5 @@
author: N3X15
changes: []
changes:
- rscadd: "Layer Adapter Pipe: Allows you to link a single layered pipe with a non-layered pipe. Doesn't look as ugly as a manifold, but is not as flexible."
- bugfix: "Defficiency's Supermatter Engine has been overhauled. Gasses have been added, piping re-routed, and the control room actually works, among other fixes. Still requires work to get running, but not as much as before."
- bugfix: "Defficiency's Atmospherics has been reworked a bit to use layered piping in some rather crowded areas. A broken three-way valve has also been fixed."

Binary file not shown.

After

Width:  |  Height:  |  Size: 831 B

View File

@@ -26,4 +26,6 @@
)
////////////////////////////////////////////////////////////////
#include "defficiency/pipes.dm" // Atmos layered pipes.
#include "defficiency.dmm"

File diff suppressed because it is too large Load Diff

82
maps/defficiency/pipes.dm Normal file
View File

@@ -0,0 +1,82 @@
#define DEF_PIPELAYER_SUPPLY 2
#define DEF_PIXELX_SUPPLY (DEF_PIPELAYER_SUPPLY - PIPING_LAYER_DEFAULT) * PIPING_LAYER_P_X
#define DEF_PIXELY_SUPPLY (DEF_PIPELAYER_SUPPLY - PIPING_LAYER_DEFAULT) * PIPING_LAYER_P_Y
#define DEF_PIPELAYER_SCRUBBERS 4
#define DEF_PIXELX_SCRUBBERS (DEF_PIPELAYER_SCRUBBERS - PIPING_LAYER_DEFAULT) * PIPING_LAYER_P_X
#define DEF_PIXELY_SCRUBBERS (DEF_PIPELAYER_SCRUBBERS - PIPING_LAYER_DEFAULT) * PIPING_LAYER_P_Y
/obj/machinery/atmospherics/pipe/simple/scrubbers/visible/layered
piping_layer=DEF_PIPELAYER_SCRUBBERS
pixel_x=DEF_PIXELX_SCRUBBERS
pixel_y=DEF_PIXELY_SCRUBBERS
/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden/layered
piping_layer=DEF_PIPELAYER_SCRUBBERS
pixel_x=DEF_PIXELX_SCRUBBERS
pixel_y=DEF_PIXELY_SCRUBBERS
/obj/machinery/atmospherics/pipe/manifold/scrubbers/visible/layered
piping_layer=DEF_PIPELAYER_SCRUBBERS
pixel_x=DEF_PIXELX_SCRUBBERS
pixel_y=DEF_PIXELY_SCRUBBERS
/obj/machinery/atmospherics/pipe/manifold/scrubbers/hidden/layered
piping_layer=DEF_PIPELAYER_SCRUBBERS
pixel_x=DEF_PIXELX_SCRUBBERS
pixel_y=DEF_PIXELY_SCRUBBERS
/obj/machinery/atmospherics/pipe/manifold4w/scrubbers/visible/layered
piping_layer=DEF_PIPELAYER_SCRUBBERS
pixel_x=DEF_PIXELX_SCRUBBERS
pixel_y=DEF_PIXELY_SCRUBBERS
/obj/machinery/atmospherics/pipe/manifold4w/scrubbers/hidden/layered
piping_layer=DEF_PIPELAYER_SCRUBBERS
pixel_x=DEF_PIXELX_SCRUBBERS
pixel_y=DEF_PIXELY_SCRUBBERS
/obj/machinery/atmospherics/unary/vent_scrubber/layered
piping_layer=DEF_PIPELAYER_SCRUBBERS
pixel_x=DEF_PIXELX_SCRUBBERS
pixel_y=DEF_PIXELY_SCRUBBERS
/obj/machinery/atmospherics/pipe/layer_adapter/scrubbers
piping_layer=DEF_PIPELAYER_SCRUBBERS
icon_state="adapter_4"
name = "scrubbers pipe"
color=PIPE_COLOR_RED
/obj/machinery/atmospherics/pipe/layer_adapter/scrubbers/visible
level = 2
/obj/machinery/atmospherics/pipe/layer_adapter/scrubbers/hidden
level = 1
alpha=128
/obj/machinery/atmospherics/pipe/simple/supply/visible/layered
piping_layer=DEF_PIPELAYER_SUPPLY
pixel_x=DEF_PIXELX_SUPPLY
pixel_y=DEF_PIXELY_SUPPLY
/obj/machinery/atmospherics/pipe/simple/supply/hidden/layered
piping_layer=DEF_PIPELAYER_SUPPLY
pixel_x=DEF_PIXELX_SUPPLY
pixel_y=DEF_PIXELY_SUPPLY
/obj/machinery/atmospherics/pipe/manifold/supply/visible/layered
piping_layer=DEF_PIPELAYER_SUPPLY
pixel_x=DEF_PIXELX_SUPPLY
pixel_y=DEF_PIXELY_SUPPLY
/obj/machinery/atmospherics/pipe/manifold/supply/hidden/layered
piping_layer=DEF_PIPELAYER_SUPPLY
pixel_x=DEF_PIXELX_SUPPLY
pixel_y=DEF_PIXELY_SUPPLY
/obj/machinery/atmospherics/pipe/manifold4w/supply/visible/layered
piping_layer=DEF_PIPELAYER_SUPPLY
pixel_x=DEF_PIXELX_SUPPLY
pixel_y=DEF_PIXELY_SUPPLY
/obj/machinery/atmospherics/pipe/manifold4w/supply/hidden/layered
piping_layer=DEF_PIPELAYER_SUPPLY
pixel_x=DEF_PIXELX_SUPPLY
pixel_y=DEF_PIXELY_SUPPLY
/obj/machinery/atmospherics/pipe/layer_adapter/supply
piping_layer=DEF_PIPELAYER_SUPPLY
icon_state="adapter_2"
name = "\improper Air supply pipe"
color=PIPE_COLOR_BLUE
/obj/machinery/atmospherics/pipe/layer_adapter/supply/visible
level = 2
/obj/machinery/atmospherics/pipe/layer_adapter/supply/hidden
level = 1
alpha=128

View File

@@ -1837,6 +1837,7 @@
#include "interface\skin.dmf"
#include "maps\_map.dm"
#include "maps\tgstation.dm"
#include "maps\defficiency\pipes.dm"
#include "maps\RandomZLevels\Academy.dm"
#include "maps\RandomZLevels\challenge.dm"
#include "maps\RandomZLevels\stationCollision.dm"