mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-02-08 15:19:48 +00:00
- 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.
62 lines
2.4 KiB
Plaintext
62 lines
2.4 KiB
Plaintext
//
|
|
// Frame construction
|
|
//
|
|
|
|
// Frame construction states
|
|
#define FRAME_PLACED 0 // Has been placed (can be anchored or not).
|
|
#define FRAME_UNFASTENED 1 // Circuit added.
|
|
#define FRAME_FASTENED 2 // Circuit fastened.
|
|
#define FRAME_WIRED 3 // Frame wired.
|
|
#define FRAME_PANELED 4 // Glass panel added.
|
|
|
|
// The frame classes define a sequence of construction steps.
|
|
#define FRAME_CLASS_ALARM "alarm"
|
|
#define FRAME_CLASS_COMPUTER "computer"
|
|
#define FRAME_CLASS_DISPLAY "display"
|
|
#define FRAME_CLASS_MACHINE "machine"
|
|
|
|
// Does the frame get built on the floor or a wall?
|
|
#define FRAME_STYLE_FLOOR "floor"
|
|
#define FRAME_STYLE_WALL "wall"
|
|
|
|
//
|
|
// Pipe Construction
|
|
//
|
|
|
|
//Construction Orientation Types - Each of these categories has a different selection of how pipes can rotate and flip. Used for RPD.
|
|
#define PIPE_STRAIGHT 0 //2 directions: N/S, E/W
|
|
#define PIPE_BENDABLE 1 //6 directions: N/S, E/W, N/E, N/W, S/E, S/W
|
|
#define PIPE_TRINARY 2 //4 directions: N/E/S, E/S/W, S/W/N, W/N/E
|
|
#define PIPE_TRIN_M 3 //8 directions: N->S+E, S->N+E, N->S+W, S->N+W, E->W+S, W->E+S, E->W+N, W->E+N
|
|
#define PIPE_DIRECTIONAL 4 //4 directions: N, S, E, W
|
|
#define PIPE_ONEDIR 5 //1 direction: N/S/E/W
|
|
#define PIPE_UNARY_FLIPPABLE 6 //8 directions: N, S, E, W, N-flipped, S-flipped, E-flipped, W-flipped
|
|
#define PIPE_TRIN_T 7 //8 directions: N->S+E, S->N+E, N->S+W, S->N+W, E->W+S, W->E+S, E->W+N, W->E+N
|
|
|
|
// Pipe connectivity bit flags
|
|
#define CONNECT_TYPE_REGULAR 1
|
|
#define CONNECT_TYPE_SUPPLY 2
|
|
#define CONNECT_TYPE_SCRUBBER 4
|
|
#define CONNECT_TYPE_HE 8
|
|
|
|
// We are based on the three named layers of supply, regular, and scrubber.
|
|
#define PIPING_LAYER_SUPPLY 1
|
|
#define PIPING_LAYER_REGULAR 2
|
|
#define PIPING_LAYER_SCRUBBER 3
|
|
#define PIPING_LAYER_DEFAULT PIPING_LAYER_REGULAR
|
|
|
|
// Pipe flags
|
|
#define PIPING_ALL_LAYER 1 //intended to connect with all layers, check for all instead of just one.
|
|
#define PIPING_ONE_PER_TURF 2 //can only be built if nothing else with this flag is on the tile already.
|
|
#define PIPING_DEFAULT_LAYER_ONLY 4 //can only exist at PIPING_LAYER_DEFAULT
|
|
#define PIPING_CARDINAL_AUTONORMALIZE 8 //north/south east/west doesn't matter, auto normalize on build.
|
|
|
|
// Macro for easy use of boilerplate code for searching for a valid node connection.
|
|
#define STANDARD_ATMOS_CHOOSE_NODE(node_num, direction) \
|
|
for(var/obj/machinery/atmospherics/target in get_step(src, direction)) { \
|
|
if(can_be_node(target, node_num)) { \
|
|
node##node_num = target; \
|
|
break; \
|
|
} \
|
|
}
|