Atmospherics Multilayer Pipes (#30972)
* 1 * rpd * 3 * 4 * 5 * 6 * 7 * 8 * wew * src. and underlays * update * woops * misspelled params * reviews * fixes * fixes * better checks and layer crap * Update RPD.dm * Update pipe_construction.dm * 3 layers, fixes * woops i didn't update defines correctly * dunc * Fixes * Fixes * fixes * fixes some more bullshit * fixes * fixes * not needed * makes attachment sprites prettier or uglier i dunno * Unary flag * sprite fix?? * fixes... * sprite fixes
This commit is contained in:
committed by
CitadelStationBot
parent
cc96777b6b
commit
a41725a955
@@ -25,6 +25,8 @@ Pipelines + Other Objects -> Pipe network
|
||||
var/can_unwrench = 0
|
||||
var/initialize_directions = 0
|
||||
var/pipe_color
|
||||
var/piping_layer = PIPING_LAYER_DEFAULT
|
||||
var/pipe_flags = NONE
|
||||
|
||||
var/global/list/iconsetids = list()
|
||||
var/global/list/pipeimages = list()
|
||||
@@ -39,7 +41,11 @@ Pipelines + Other Objects -> Pipe network
|
||||
if(is_type_in_list(src, GLOB.ventcrawl_machinery) && user.ventcrawler)
|
||||
to_chat(user, "<span class='notice'>Alt-click to crawl through it.</span>")
|
||||
|
||||
/obj/machinery/atmospherics/New(loc, process = TRUE)
|
||||
/obj/machinery/atmospherics/New(loc, process = TRUE, setdir)
|
||||
if(!isnull(setdir))
|
||||
setDir(setdir)
|
||||
if(pipe_flags & PIPING_CARDINAL_AUTONORMALIZE)
|
||||
normalize_cardinal_directions()
|
||||
nodes = new(device_type)
|
||||
if (!armor)
|
||||
armor = list(melee = 25, bullet = 10, laser = 10, energy = 100, bomb = 0, bio = 100, rad = 100, fire = 100, acid = 70)
|
||||
@@ -61,6 +67,13 @@ Pipelines + Other Objects -> Pipe network
|
||||
return ..()
|
||||
//return QDEL_HINT_FINDREFERENCE
|
||||
|
||||
/obj/machinery/atmospherics/proc/destroy_network()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/build_network()
|
||||
// Called to build a network from this node
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/nullifyNode(I)
|
||||
if(NODE_I)
|
||||
var/obj/machinery/atmospherics/N = NODE_I
|
||||
@@ -80,6 +93,11 @@ Pipelines + Other Objects -> Pipe network
|
||||
break
|
||||
return node_connects
|
||||
|
||||
/obj/machinery/atmospherics/proc/normalize_cardinal_directions()
|
||||
if(dir==SOUTH)
|
||||
setDir(NORTH)
|
||||
else if(dir==WEST)
|
||||
setDir(EAST)
|
||||
|
||||
//this is called just after the air controller sets up turfs
|
||||
/obj/machinery/atmospherics/proc/atmosinit(var/list/node_connects)
|
||||
@@ -91,12 +109,37 @@ Pipelines + Other Objects -> Pipe network
|
||||
if(can_be_node(target, I))
|
||||
NODE_I = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/proc/setPipingLayer(new_layer)
|
||||
if(pipe_flags & PIPING_DEFAULT_LAYER_ONLY)
|
||||
new_layer = PIPING_LAYER_DEFAULT
|
||||
piping_layer = new_layer
|
||||
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)
|
||||
|
||||
/obj/machinery/atmospherics/proc/can_be_node(obj/machinery/atmospherics/target)
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
return connection_check(target, piping_layer)
|
||||
|
||||
//Find a connecting /obj/machinery/atmospherics in specified direction
|
||||
/obj/machinery/atmospherics/proc/findConnecting(direction, prompted_layer)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src, direction))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
if(connection_check(target, prompted_layer))
|
||||
return target
|
||||
|
||||
/obj/machinery/atmospherics/proc/connection_check(obj/machinery/atmospherics/target, given_layer)
|
||||
if(isConnectable(target, given_layer) && target.isConnectable(src, given_layer) && (target.initialize_directions & get_dir(target,src)))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/atmospherics/proc/isConnectable(obj/machinery/atmospherics/target, given_layer)
|
||||
if(isnull(given_layer))
|
||||
given_layer = piping_layer
|
||||
if((target.piping_layer == given_layer) || (target.pipe_flags & PIPING_ALL_LAYER))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/atmospherics/proc/pipeline_expansion()
|
||||
return nodes
|
||||
@@ -119,14 +162,10 @@ Pipelines + Other Objects -> Pipe network
|
||||
/obj/machinery/atmospherics/proc/replacePipenet()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/build_network()
|
||||
// Called to build a network from this node
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference)
|
||||
if(istype(reference, /obj/machinery/atmospherics/pipe))
|
||||
var/obj/machinery/atmospherics/pipe/P = reference
|
||||
qdel(P.parent)
|
||||
P.destroy_network()
|
||||
var/I = nodes.Find(reference)
|
||||
NODE_I = null
|
||||
update_icon()
|
||||
@@ -135,12 +174,17 @@ Pipelines + Other Objects -> Pipe network
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/pipe)) //lets you autodrop
|
||||
var/obj/item/pipe/pipe = W
|
||||
if(user.dropItemToGround(pipe))
|
||||
pipe.setPipingLayer(piping_layer) //align it with us
|
||||
return TRUE
|
||||
if(istype(W, /obj/item/wrench))
|
||||
if(can_unwrench(user))
|
||||
var/turf/T = get_turf(src)
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
to_chat(user, "<span class='warning'>You must remove the plating first!</span>")
|
||||
return 1
|
||||
return TRUE
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.return_air()
|
||||
add_fingerprint(user)
|
||||
@@ -148,7 +192,7 @@ Pipelines + Other Objects -> Pipe network
|
||||
var/unsafe_wrenching = FALSE
|
||||
var/internal_pressure = int_air.return_pressure()-env_air.return_pressure()
|
||||
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
if (internal_pressure > 2*ONE_ATMOSPHERE)
|
||||
to_chat(user, "<span class='warning'>As you begin unwrenching \the [src] a gush of air blows in your face... maybe you should reconsider?</span>")
|
||||
@@ -193,7 +237,8 @@ Pipelines + Other Objects -> Pipe network
|
||||
/obj/machinery/atmospherics/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
if(can_unwrench)
|
||||
var/obj/item/pipe/stored = new(loc, make_from=src)
|
||||
var/obj/item/pipe/stored = new(loc, piping_layer, dir, src)
|
||||
stored.setPipingLayer(piping_layer)
|
||||
if(!disassembled)
|
||||
stored.obj_integrity = stored.max_integrity * 0.5
|
||||
transfer_fingerprints_to(stored)
|
||||
@@ -224,10 +269,11 @@ Pipelines + Other Objects -> Pipe network
|
||||
if(unconnected & direction)
|
||||
underlays += getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', "pipe_exposed", direction)
|
||||
|
||||
/obj/machinery/atmospherics/on_construction(pipe_type, obj_color)
|
||||
/obj/machinery/atmospherics/on_construction(pipe_type, obj_color, set_layer)
|
||||
if(can_unwrench)
|
||||
add_atom_colour(obj_color, FIXED_COLOUR_PRIORITY)
|
||||
pipe_color = obj_color
|
||||
setPipingLayer(set_layer)
|
||||
var/turf/T = get_turf(src)
|
||||
level = T.intact ? 2 : 1
|
||||
atmosinit()
|
||||
@@ -237,18 +283,16 @@ Pipelines + Other Objects -> Pipe network
|
||||
A.addMember(src)
|
||||
build_network()
|
||||
|
||||
/obj/machinery/atmospherics/Entered(atom/movable/AM)
|
||||
if(istype(AM, /mob/living))
|
||||
var/mob/living/L = AM
|
||||
L.ventcrawl_layer = piping_layer
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/singularity_pull(S, current_size)
|
||||
..()
|
||||
if(current_size >= STAGE_FIVE)
|
||||
deconstruct(FALSE)
|
||||
|
||||
|
||||
//Find a connecting /obj/machinery/atmospherics in specified direction
|
||||
/obj/machinery/atmospherics/proc/findConnecting(direction)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src, direction))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
return target
|
||||
|
||||
return ..()
|
||||
|
||||
#define VENT_SOUND_DELAY 30
|
||||
|
||||
@@ -259,7 +303,7 @@ Pipelines + Other Objects -> Pipe network
|
||||
if(user in buckled_mobs)// fixes buckle ventcrawl edgecase fuck bug
|
||||
return
|
||||
|
||||
var/obj/machinery/atmospherics/target_move = findConnecting(direction)
|
||||
var/obj/machinery/atmospherics/target_move = findConnecting(direction, user.ventcrawl_layer)
|
||||
if(target_move)
|
||||
if(target_move.can_crawl_through())
|
||||
if(is_type_in_typecache(target_move, GLOB.ventcrawl_machinery))
|
||||
@@ -269,14 +313,14 @@ Pipelines + Other Objects -> Pipe network
|
||||
var/list/pipenetdiff = returnPipenets() ^ target_move.returnPipenets()
|
||||
if(pipenetdiff.len)
|
||||
user.update_pipe_vision(target_move)
|
||||
user.loc = target_move
|
||||
user.forceMove(target_move)
|
||||
user.client.eye = target_move //Byond only updates the eye every tick, This smooths out the movement
|
||||
if(world.time - user.last_played_vent > VENT_SOUND_DELAY)
|
||||
user.last_played_vent = world.time
|
||||
playsound(src, 'sound/machines/ventcrawl.ogg', 50, 1, -3)
|
||||
else
|
||||
if((direction & initialize_directions) || is_type_in_typecache(src, GLOB.ventcrawl_machinery) && can_crawl_through()) //if we move in a way the pipe can connect, but doesn't - or we're in a vent
|
||||
user.forceMove(src.loc)
|
||||
user.forceMove(loc)
|
||||
user.visible_message("<span class='notice'>You hear something squeezing through the ducts...</span>","<span class='notice'>You climb out the ventilation system.")
|
||||
user.canmove = 0
|
||||
spawn(1)
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
var/status = 0
|
||||
|
||||
var/last_pressure_delta = 0
|
||||
pipe_flags = PIPING_ONE_PER_TURF
|
||||
|
||||
anchored = TRUE
|
||||
density = TRUE
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
use_power = IDLE_POWER_USE
|
||||
device_type = TRINARY
|
||||
layer = GAS_FILTER_LAYER
|
||||
pipe_flags = PIPING_ONE_PER_TURF
|
||||
|
||||
var/flipped = FALSE
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
layer = ABOVE_WINDOW_LAYER
|
||||
state_open = FALSE
|
||||
circuit = /obj/item/circuitboard/machine/cryo_tube
|
||||
pipe_flags = PIPING_ONE_PER_TURF | PIPING_DEFAULT_LAYER_ONLY
|
||||
|
||||
var/on = FALSE
|
||||
var/autoeject = FALSE
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
use_power = NO_POWER_USE
|
||||
level = 0
|
||||
layer = GAS_FILTER_LAYER
|
||||
pipe_flags = PIPING_ONE_PER_TURF
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/portables_connector/New()
|
||||
..()
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
density = TRUE
|
||||
var/gas_type = 0
|
||||
layer = ABOVE_WINDOW_LAYER
|
||||
pipe_flags = PIPING_ONE_PER_TURF
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/New()
|
||||
..()
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
armor = list(melee = 0, bullet = 0, laser = 0, energy = 100, bomb = 0, bio = 100, rad = 100, fire = 80, acid = 30)
|
||||
layer = OBJ_LAYER
|
||||
circuit = /obj/item/circuitboard/machine/thermomachine
|
||||
pipe_flags = PIPING_ONE_PER_TURF | PIPING_DEFAULT_LAYER_ONLY
|
||||
|
||||
var/on = FALSE
|
||||
var/min_temperature = 0
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH
|
||||
device_type = UNARY
|
||||
pipe_flags = PIPING_ONE_PER_TURF
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/SetInitDirections()
|
||||
initialize_directions = dir
|
||||
|
||||
@@ -13,19 +13,33 @@
|
||||
active_power_usage = 4
|
||||
max_integrity = 150
|
||||
armor = list(melee = 0, bullet = 0, laser = 0, energy = 100, bomb = 0, bio = 100, rad = 100, fire = 40, acid = 0)
|
||||
|
||||
|
||||
/obj/machinery/meter/Initialize(mapload)
|
||||
. = ..()
|
||||
SSair.atmos_machinery += src
|
||||
if (!target)
|
||||
target = locate(/obj/machinery/atmospherics/pipe) in loc
|
||||
var/target_layer = PIPING_LAYER_DEFAULT
|
||||
|
||||
/obj/machinery/meter/Destroy()
|
||||
SSair.atmos_machinery -= src
|
||||
src.target = null
|
||||
target = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/meter/Initialize(mapload, new_piping_layer)
|
||||
if(!isnull(new_piping_layer))
|
||||
target_layer = new_piping_layer
|
||||
SSair.atmos_machinery += src
|
||||
if(mapload && !target)
|
||||
reattach_to_layer()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/meter/proc/reattach_to_layer()
|
||||
for(var/obj/machinery/atmospherics/pipe/pipe in loc)
|
||||
if(pipe.piping_layer == target_layer)
|
||||
target = pipe
|
||||
setAttachLayer(pipe.piping_layer)
|
||||
break
|
||||
|
||||
/obj/machinery/meter/proc/setAttachLayer(var/new_layer)
|
||||
target_layer = new_layer
|
||||
pixel_x = (new_layer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_P_X
|
||||
pixel_y = (new_layer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_P_Y
|
||||
|
||||
/obj/machinery/meter/process_atmos()
|
||||
if(!target)
|
||||
icon_state = "meterX"
|
||||
@@ -75,7 +89,7 @@
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
/obj/machinery/meter/proc/status()
|
||||
if (src.target)
|
||||
if (target)
|
||||
var/datum/gas_mixture/environment = target.return_air()
|
||||
if(environment)
|
||||
. = "The pressure gauge reads [round(environment.return_pressure(), 0.01)] kPa; [round(environment.temperature,0.01)] K ([round(environment.temperature-T0C,0.01)]°C)."
|
||||
@@ -91,23 +105,23 @@
|
||||
|
||||
/obj/machinery/meter/attackby(obj/item/W, mob/user, params)
|
||||
if (istype(W, /obj/item/wrench))
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
if (do_after(user, 40*W.toolspeed, target = src))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"<span class='notice'>You unfasten \the [src].</span>", \
|
||||
"<span class='italics'>You hear ratchet.</span>")
|
||||
new /obj/item/pipe_meter(src.loc)
|
||||
new /obj/item/pipe_meter(loc)
|
||||
qdel(src)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/meter/attack_ai(mob/user)
|
||||
return src.attack_hand(user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/meter/attack_paw(mob/user)
|
||||
return src.attack_hand(user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/meter/attack_hand(mob/user)
|
||||
|
||||
@@ -129,4 +143,4 @@
|
||||
|
||||
/obj/machinery/meter/turf/Initialize()
|
||||
. = ..()
|
||||
src.target = loc
|
||||
target = loc
|
||||
|
||||
@@ -29,7 +29,7 @@ GLOBAL_LIST_EMPTY(bluespace_pipes)
|
||||
/obj/machinery/atmospherics/pipe/bluespace/pipeline_expansion()
|
||||
return ..() + GLOB.bluespace_pipes - src
|
||||
|
||||
/obj/machinery/atmospherics/components/pipe/bluespace/hide()
|
||||
/obj/machinery/atmospherics/pipe/bluespace/hide()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/bluespace/update_icon(showpipe)
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
/obj/machinery/atmospherics/pipe/layer_manifold
|
||||
name = "pipe-layer manifold"
|
||||
icon = 'icons/obj/atmospherics/pipes/manifold.dmi'
|
||||
icon_state = "manifoldlayer"
|
||||
desc = "A special pipe to bridge pipe layers with."
|
||||
dir = SOUTH
|
||||
initialize_directions = NORTH|SOUTH
|
||||
pipe_flags = PIPING_ALL_LAYER | PIPING_DEFAULT_LAYER_ONLY | PIPING_CARDINAL_AUTONORMALIZE
|
||||
piping_layer = PIPING_LAYER_DEFAULT
|
||||
device_type = 0
|
||||
volume = 260
|
||||
var/list/front_nodes
|
||||
var/list/back_nodes
|
||||
|
||||
/obj/machinery/atmospherics/pipe/layer_manifold/Initialize()
|
||||
front_nodes = list()
|
||||
back_nodes = list()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/layer_manifold/Destroy()
|
||||
nullifyAllNodes()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/layer_manifold/proc/nullifyAllNodes()
|
||||
var/list/obj/machinery/atmospherics/needs_nullifying = get_all_connected_nodes()
|
||||
front_nodes = null
|
||||
back_nodes = null
|
||||
nodes = list()
|
||||
for(var/obj/machinery/atmospherics/A in needs_nullifying)
|
||||
A.disconnect(src)
|
||||
A.build_network()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/layer_manifold/proc/get_all_connected_nodes()
|
||||
var/list/obj/machinery/atmospherics/all_connected = list()
|
||||
for(var/obj/machinery/atmospherics/I in front_nodes)
|
||||
all_connected[I] = I
|
||||
for(var/obj/machinery/atmospherics/I in back_nodes)
|
||||
all_connected[I] = I
|
||||
for(var/obj/machinery/atmospherics/I in nodes)
|
||||
all_connected[I] = I
|
||||
var/list/obj/machinery/atmospherics/returnlist = list()
|
||||
for(var/obj/machinery/atmospherics/A in all_connected)
|
||||
returnlist += all_connected[A]
|
||||
return returnlist
|
||||
|
||||
/obj/machinery/atmospherics/pipe/layer_manifold/update_icon() //HEAVILY WIP FOR UPDATE ICONS!!
|
||||
layer = (initial(layer) + (PIPING_LAYER_MAX * PIPING_LAYER_LCHANGE)) //This is above everything else.
|
||||
var/invis = invisibility ? "-f" : ""
|
||||
icon_state = "[initial(icon_state)][invis]"
|
||||
cut_overlays()
|
||||
for(var/obj/machinery/atmospherics/A in front_nodes)
|
||||
add_attached_image(A)
|
||||
for(var/obj/machinery/atmospherics/A in back_nodes)
|
||||
add_attached_image(A)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/layer_manifold/proc/add_attached_image(obj/machinery/atmospherics/A)
|
||||
var/invis = A.invisibility ? "-f" : ""
|
||||
if(istype(A, /obj/machinery/atmospherics/pipe/layer_manifold))
|
||||
for(var/i = PIPING_LAYER_MIN, i <= PIPING_LAYER_MAX, i++)
|
||||
var/image/I = getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full_layer_long[invis]", get_dir(src, A), A.pipe_color)
|
||||
I.pixel_x = (i - PIPING_LAYER_DEFAULT) * PIPING_LAYER_P_X
|
||||
I.pixel_y = (i - PIPING_LAYER_DEFAULT) * PIPING_LAYER_P_Y
|
||||
I.layer = layer - 0.01
|
||||
add_overlay(I)
|
||||
else
|
||||
var/image/I = getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full_layer_long[invis]", get_dir(src, A), A.pipe_color)
|
||||
I.pixel_x = A.pixel_x
|
||||
I.pixel_y = A.pixel_y
|
||||
I.layer = layer - 0.01
|
||||
add_overlay(I)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/layer_manifold/SetInitDirections()
|
||||
switch(dir)
|
||||
if(NORTH || SOUTH)
|
||||
initialize_directions = NORTH|SOUTH
|
||||
if(EAST || WEST)
|
||||
initialize_directions = EAST|WEST
|
||||
|
||||
/obj/machinery/atmospherics/pipe/layer_manifold/isConnectable(obj/machinery/atmospherics/target, given_layer)
|
||||
if(!given_layer)
|
||||
return TRUE
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/layer_manifold/proc/findAllConnections()
|
||||
front_nodes = list()
|
||||
back_nodes = list()
|
||||
var/list/new_nodes = list()
|
||||
for(var/iter in PIPING_LAYER_MIN to PIPING_LAYER_MAX)
|
||||
var/obj/machinery/atmospherics/foundfront = findConnecting(dir, iter)
|
||||
var/obj/machinery/atmospherics/foundback = findConnecting(turn(dir, 180), iter)
|
||||
front_nodes += foundfront
|
||||
back_nodes += foundback
|
||||
if(foundfront && !QDELETED(foundfront))
|
||||
new_nodes += foundfront
|
||||
if(foundback && !QDELETED(foundback))
|
||||
new_nodes += foundback
|
||||
update_icon()
|
||||
return new_nodes
|
||||
|
||||
/obj/machinery/atmospherics/pipe/layer_manifold/atmosinit()
|
||||
normalize_cardinal_directions()
|
||||
findAllConnections()
|
||||
var/turf/T = loc // hide if turf is not intact
|
||||
hide(T.intact)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/layer_manifold/setPipingLayer()
|
||||
piping_layer = PIPING_LAYER_DEFAULT
|
||||
|
||||
/obj/machinery/atmospherics/pipe/layer_manifold/pipeline_expansion()
|
||||
return get_all_connected_nodes()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/layer_manifold/disconnect(obj/machinery/atmospherics/reference)
|
||||
if(istype(reference, /obj/machinery/atmospherics/pipe))
|
||||
var/obj/machinery/atmospherics/pipe/P = reference
|
||||
P.destroy_network()
|
||||
while(reference in get_all_connected_nodes())
|
||||
if(reference in nodes)
|
||||
var/I = nodes.Find(reference)
|
||||
NODE_I = null
|
||||
if(reference in front_nodes)
|
||||
var/I = front_nodes.Find(reference)
|
||||
front_nodes[I] = null
|
||||
if(reference in back_nodes)
|
||||
var/I = back_nodes.Find(reference)
|
||||
back_nodes[I] = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/layer_manifold/relaymove(mob/living/user, dir)
|
||||
if(initialize_directions & dir)
|
||||
return ..()
|
||||
if((NORTH|EAST) & dir)
|
||||
user.ventcrawl_layer = Clamp(user.ventcrawl_layer + 1, PIPING_LAYER_MIN, PIPING_LAYER_MAX)
|
||||
if((SOUTH|WEST) & dir)
|
||||
user.ventcrawl_layer = Clamp(user.ventcrawl_layer - 1, PIPING_LAYER_MIN, PIPING_LAYER_MAX)
|
||||
to_chat(user, "You align yourself with the [user.ventcrawl_layer]\th output.")
|
||||
@@ -125,7 +125,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold/orange/hidden
|
||||
level = PIPE_HIDDEN_LEVEL
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold/purple
|
||||
pipe_color=rgb(128,0,182)
|
||||
color=rgb(128,0,182)
|
||||
|
||||
@@ -24,6 +24,14 @@
|
||||
if(oldN)
|
||||
oldN.build_network()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/destroy_network()
|
||||
QDEL_NULL(parent)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/build_network()
|
||||
if(QDELETED(parent))
|
||||
parent = new
|
||||
parent.build_pipeline(src)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/update_icon() //overridden by manifolds
|
||||
if(NODE1&&NODE2)
|
||||
icon_state = "intact[invisibility ? "-f" : "" ]"
|
||||
@@ -51,14 +59,13 @@
|
||||
/obj/machinery/atmospherics/pipe/return_air()
|
||||
return parent.air
|
||||
|
||||
/obj/machinery/atmospherics/pipe/build_network()
|
||||
if(!parent)
|
||||
parent = new /datum/pipeline()
|
||||
parent.build_pipeline(src)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/device/analyzer))
|
||||
atmosanalyzer_scan(parent.air, user)
|
||||
if(istype(W, /obj/item/pipe_meter))
|
||||
var/obj/item/pipe_meter/meter = W
|
||||
user.dropItemToGround(meter)
|
||||
meter.setAttachLayer(piping_layer)
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -81,9 +88,7 @@
|
||||
qdel(meter)
|
||||
. = ..()
|
||||
|
||||
if(parent && !QDELETED(parent))
|
||||
qdel(parent)
|
||||
parent = null
|
||||
QDEL_NULL(parent)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/proc/update_node_icon()
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
|
||||
@@ -12,10 +12,12 @@ The regular pipe you see everywhere, including bent ones.
|
||||
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH
|
||||
pipe_flags = PIPING_CARDINAL_AUTONORMALIZE
|
||||
|
||||
device_type = BINARY
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/SetInitDirections()
|
||||
normalize_cardinal_directions()
|
||||
if(dir in GLOB.diagonals)
|
||||
initialize_directions = dir
|
||||
switch(dir)
|
||||
@@ -24,20 +26,6 @@ The regular pipe you see everywhere, including bent ones.
|
||||
if(EAST,WEST)
|
||||
initialize_directions = EAST|WEST
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/atmosinit()
|
||||
normalize_dir()
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/proc/normalize_dir()
|
||||
if(dir==SOUTH)
|
||||
setDir(NORTH)
|
||||
else if(dir==WEST)
|
||||
setDir(EAST)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/update_icon()
|
||||
normalize_dir()
|
||||
..()
|
||||
|
||||
//Colored pipes, use these for mapping
|
||||
/obj/machinery/atmospherics/pipe/simple/general
|
||||
|
||||
|
||||
@@ -45,11 +45,11 @@
|
||||
/obj/machinery/portable_atmospherics/proc/connect(obj/machinery/atmospherics/components/unary/portables_connector/new_port)
|
||||
//Make sure not already connected to something else
|
||||
if(connected_port || !new_port || new_port.connected_device)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
//Make sure are close enough for a valid connection
|
||||
if(new_port.loc != get_turf(src))
|
||||
return 0
|
||||
return TRUE
|
||||
|
||||
//Perform the connection
|
||||
connected_port = new_port
|
||||
@@ -58,7 +58,9 @@
|
||||
connected_port_parent.reconcile_air()
|
||||
|
||||
anchored = TRUE //Prevent movement
|
||||
return 1
|
||||
pixel_x = new_port.pixel_x
|
||||
pixel_y = new_port.pixel_y
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/Move()
|
||||
. = ..()
|
||||
@@ -67,11 +69,11 @@
|
||||
|
||||
/obj/machinery/portable_atmospherics/proc/disconnect()
|
||||
if(!connected_port)
|
||||
return 0
|
||||
return FALSE
|
||||
anchored = FALSE
|
||||
connected_port.connected_device = null
|
||||
connected_port = null
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/portable_atmospherics/portableConnectorReturnAir()
|
||||
return air_contents
|
||||
|
||||
@@ -143,3 +143,5 @@
|
||||
var/list/can_ride_typecache = list()
|
||||
|
||||
var/list/mousemove_intercept_objects
|
||||
|
||||
var/ventcrawl_layer = PIPING_LAYER_DEFAULT
|
||||
|
||||
Reference in New Issue
Block a user