- Moved pipe construction defines into __defines/construction.dm

- Unified pipe *unwrenching* by creating a standard proc along with the `construction_type` var.
- Eliminated the pipe fitting name & icon_state lookup tables by adding `pipe_state` var on atmos machinery and referencing that.
    - Each pipe which can be made from a fitting object should override `pipe_state` with the icon state to be used on the pipe fitting object.
- Eliminated the giant switch statement of doom in pipe construction by delegating that work to `on_construction` proc.
    - To make this work, every pipe must implement `get_neighbor_nodes_for_init` which returns a list of nodes which should be re-initialized on that pipe's construction.
- Combined the SCRUBBERS, SUPPLY and REGULAR pipe fitting classes together by storing the `piping_layer` variable and using the `setPipingLayer` procs
- Standardized the code for searching for node neighbors into the `can_be_node` proc.
    - This proc is also improved in that is a mutual check, `check_connectable` is called on BOTH objects, so they have to mutually agree to connect as nodes. Eliminates lots of special edge case logic.
    - Updated all the `amos_init` procs to use `can_be_node`.  In the most common cases, even that boilerplate code is consolidated into the `STANDARD_ATMOS_CHOOSE_NODE` macro.
- Implemented `pipe_flags` which lets pipes declare (or override) certain requirements.
- Adds a "pipe_recipe" datum to help out things that construct pipes.  By taking it out of the dispenser, we open the road for multiple dispenser types.  No, no RPD yet.  Soon.
    - Enhances the pipe dispenser to operate on pipe recipe datums instead of hard coded lists of pipes it can construct.   These datums are also (partially) initialized from the pipe machine types themselves, reducing having to define stuff in multiple places.
    - Switched pipe dispenser UI to use browse().   Not a NanoUI, but makes it a bit prettier with low effort.
    - Changed pipe dispenser to use a button selector to switch between Regular/Scrubbers/Supply instead of having separate list items.
- Added icon states to HE pipes to support the "connected on neither side" state.
This commit is contained in:
Leshana
2018-03-04 14:40:16 -05:00
parent 2123255667
commit 63a1dd0143
45 changed files with 718 additions and 1519 deletions

View File

@@ -4,6 +4,7 @@
/obj/machinery/atmospherics/omni/atmos_filter
name = "omni gas filter"
icon_state = "map_filter"
pipe_state = "omni_filter"
var/list/atmos_filters = new()
var/datum/omni_port/input

View File

@@ -4,6 +4,7 @@
/obj/machinery/atmospherics/omni/mixer
name = "omni gas mixer"
icon_state = "map_mixer"
pipe_state = "omni_mixer"
use_power = 1
idle_power_usage = 150 //internal circuitry, friction losses and stuff

View File

@@ -7,6 +7,7 @@
icon_state = "base"
use_power = 1
initialize_directions = 0
construction_type = /obj/item/pipe/quaternary
level = 1
var/configuring = 0
@@ -93,8 +94,7 @@
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"You hear a ratchet.")
new /obj/item/pipe(loc, make_from=src)
qdel(src)
deconstruct()
/obj/machinery/atmospherics/omni/can_unwrench()
var/int_pressure = 0
@@ -222,6 +222,11 @@
// Housekeeping and pipe network stuff below
/obj/machinery/atmospherics/omni/get_neighbor_nodes_for_init()
var/list/neighbor_nodes = list()
for(var/datum/omni_port/P in ports)
neighbor_nodes += P.node
return neighbor_nodes
/obj/machinery/atmospherics/omni/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
for(var/datum/omni_port/P in ports)
@@ -252,10 +257,9 @@
if(P.node || P.mode == 0)
continue
for(var/obj/machinery/atmospherics/target in get_step(src, P.dir))
if(target.initialize_directions & get_dir(target,src))
if (check_connect_types(target,src))
P.node = target
break
if(can_be_node(target, 1))
P.node = target
break
for(var/datum/omni_port/P in ports)
P.update = 1