// // Base type of pipes // /obj/machinery/atmospherics/pipe var/datum/gas_mixture/air_temporary // used when reconstructing a pipeline that broke var/datum/pipeline/parent var/volume = 0 layer = 2.4 //under wires with their 2.44 use_power = 0 var/alert_pressure = 80*ONE_ATMOSPHERE //minimum pressure before check_pressure(...) should be called can_buckle = 1 buckle_require_restraints = 1 buckle_lying = -1 /obj/machinery/atmospherics/pipe/drain_power() return -1 /obj/machinery/atmospherics/pipe/New() if(istype(get_turf(src), /turf/simulated/wall) || istype(get_turf(src), /turf/simulated/shuttle/wall) || istype(get_turf(src), /turf/unsimulated/wall)) level = 1 ..() /obj/machinery/atmospherics/pipe/hides_under_flooring() return level != 2 /obj/machinery/atmospherics/pipe/proc/pipeline_expansion() return null /obj/machinery/atmospherics/pipe/proc/check_pressure(pressure) //Return 1 if parent should continue checking other pipes //Return null if parent should stop checking other pipes. Recall: qdel(src) will by default return null return 1 /obj/machinery/atmospherics/pipe/return_air() if(!parent) parent = new /datum/pipeline() parent.build_pipeline(src) return parent.air /obj/machinery/atmospherics/pipe/build_network() if(!parent) parent = new /datum/pipeline() parent.build_pipeline(src) return parent.return_network() /obj/machinery/atmospherics/pipe/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference) if(!parent) parent = new /datum/pipeline() parent.build_pipeline(src) return parent.network_expand(new_network, reference) /obj/machinery/atmospherics/pipe/return_network(obj/machinery/atmospherics/reference) if(!parent) parent = new /datum/pipeline() parent.build_pipeline(src) return parent.return_network(reference) /obj/machinery/atmospherics/pipe/Destroy() qdel_null(parent) if(air_temporary) loc.assume_air(air_temporary) . = ..() /obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) if (istype(src, /obj/machinery/atmospherics/pipe/tank)) return ..() if(istype(W,/obj/item/device/pipe_painter)) return 0 if (!istype(W, /obj/item/weapon/wrench)) return ..() var/turf/T = src.loc if (level==1 && isturf(T) && !T.is_plating()) to_chat(user, "You must remove the plating first.") return 1 if(!can_unwrench()) to_chat(user, "You cannot unwrench \the [src], it is too exerted due to internal pressure.") add_fingerprint(user) return 1 playsound(src, W.usesound, 50, 1) to_chat(user, "You begin to unfasten \the [src]...") if (do_after(user, 40 * W.toolspeed)) user.visible_message( \ "\The [user] unfastens \the [src].", \ "You have unfastened \the [src].", \ "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) for (var/obj/machinery/meter/meter in T) if (meter.target == src) new /obj/item/pipe_meter(T) qdel(meter) qdel(src) /obj/machinery/atmospherics/pipe/proc/change_color(var/new_color) //only pass valid pipe colors please ~otherwise your pipe will turn invisible if(!pipe_color_check(new_color)) return pipe_color = new_color update_icon() /obj/machinery/atmospherics/pipe/color_cache_name(var/obj/machinery/atmospherics/node) if(istype(src, /obj/machinery/atmospherics/pipe/tank)) return ..() if(istype(node, /obj/machinery/atmospherics/pipe/manifold) || istype(node, /obj/machinery/atmospherics/pipe/manifold4w)) if(pipe_color == node.pipe_color) return node.pipe_color else return null else if(istype(node, /obj/machinery/atmospherics/pipe/simple)) return node.pipe_color else return pipe_color /obj/machinery/atmospherics/pipe/hide(var/i) if(istype(loc, /turf/simulated)) invisibility = i ? 101 : 0 update_icon() /obj/machinery/atmospherics/pipe/process() if(!parent) //This should cut back on the overhead calling build_network thousands of times per cycle ..() else . = PROCESS_KILL