Pipe fixes

This commit is contained in:
Markolie
2015-09-27 04:15:57 +02:00
parent 69f71268b8
commit ee130ccbbe
10 changed files with 33 additions and 40 deletions
+6 -3
View File
@@ -41,11 +41,14 @@ Pipelines + Other Objects -> Pipe network
if(!pipe_color_check(pipe_color))
pipe_color = null
..()
/obj/machinery/atmospherics/initialize()
..()
if(can_unwrench)
stored = new(src, make_from = src)
..()
/obj/machinery/atmospherics/Destroy()
for(var/mob/living/M in src) //ventcrawling is serious business
M.remove_ventcrawl()
@@ -210,7 +213,7 @@ Pipelines + Other Objects -> Pipe network
dir = D
initialize_directions = P
var/turf/T = loc
level = T.intact ? 2 : 1
level = T.intact ? 2 : 1
initialize()
var/list/nodes = pipeline_expansion()
for(var/obj/machinery/atmospherics/A in nodes)
@@ -42,6 +42,7 @@
return ..()
/obj/machinery/atmospherics/binary/initialize()
..()
var/node2_connect = dir
var/node1_connect = turn(dir, 180)
@@ -57,6 +57,7 @@
return ..()
/obj/machinery/atmospherics/omni/initialize()
..()
for(var/datum/omni_port/P in ports)
if(P.node || P.mode == 0)
continue
@@ -67,7 +67,7 @@
return ..()
/obj/machinery/atmospherics/trinary/initialize()
..()
//Mixer:
//1 and 2 is input
//Node 3 is output
@@ -78,10 +78,6 @@
//Node 2 is filtered output
//Node 3 is rest output
//If we flip the filter, 1 and 3 shall exchange positions
if(can_unwrench) // Overridden here to avoid having to snowflake the flipped/icon_state on the construction
qdel(stored)
stored = new(src, make_from = src)
var/node1_connect = turn(dir, -180)
var/node2_connect = turn(dir, -90)
@@ -23,6 +23,7 @@
return ..()
/obj/machinery/atmospherics/unary/initialize()
..()
for(var/obj/machinery/atmospherics/target in get_step(src, dir))
if(target.initialize_directions & get_dir(target,src))
var/c = check_connect_types(target,src)
+1
View File
@@ -62,6 +62,7 @@
overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "cap" + icon_connect_type)
/obj/machinery/atmospherics/pipe/cap/initialize()
..()
for(var/obj/machinery/atmospherics/target in get_step(src, dir))
if(target.initialize_directions & get_dir(target,src))
var/c = check_connect_types(target,src)
+1
View File
@@ -33,6 +33,7 @@
icon = null
/obj/machinery/atmospherics/pipe/manifold/initialize()
..()
for(var/D in cardinal)
if(D == dir)
continue
+1
View File
@@ -152,6 +152,7 @@
update_icon()
/obj/machinery/atmospherics/pipe/manifold4w/initialize()
..()
for(var/D in cardinal)
for(var/obj/machinery/atmospherics/target in get_step(src, D))
if(target.initialize_directions & get_dir(target,src))
@@ -44,6 +44,7 @@
initialize_directions = SOUTH|WEST
/obj/machinery/atmospherics/pipe/simple/initialize()
..()
normalize_dir()
var/N = 2
for(var/D in cardinal)
+19 -32
View File
@@ -164,7 +164,7 @@
src.color = PIPE_COLOR_RED
else if (pipe_type == PIPE_UNIVERSAL)
connect_types = list(1,2,3)
//src.pipe_dir = get_pipe_dir()
update(make_from)
src.pixel_x = rand(-5, 5)
src.pixel_y = rand(-5, 5)
@@ -275,14 +275,8 @@
src.dir = turn(src.dir, -90)
if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_UNIVERSAL, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE, PIPE_DVALVE))
if(dir==2)
dir = 1
else if(dir==8)
dir = 4
else if (pipe_type in list (PIPE_MANIFOLD4W, PIPE_SUPPLY_MANIFOLD4W, PIPE_SCRUBBERS_MANIFOLD4W))
dir = 2
//src.pipe_dir = get_pipe_dir()
fixdir()
return
/obj/item/pipe/verb/flip()
@@ -406,22 +400,6 @@
//Helper to clean up dir
/obj/item/pipe/proc/fixdir()
if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE, PIPE_DVALVE))
if(dir==2)
dir = 1
else if(dir==8)
dir = 4
/obj/item/pipe/attack_self(mob/user as mob)
return rotate()
/obj/item/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
..()
//*
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if (!isturf(src.loc))
return 1
if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE, PIPE_DVALVE))
if(dir==2)
dir = 1
@@ -429,13 +407,27 @@
dir = 4
else if (pipe_type in list(PIPE_MANIFOLD4W, PIPE_SUPPLY_MANIFOLD4W, PIPE_SCRUBBERS_MANIFOLD4W, PIPE_OMNI_MIXER, PIPE_OMNI_FILTER))
dir = 2
/obj/item/pipe/attack_self(mob/user as mob)
return rotate()
/obj/item/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
..()
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if (!isturf(src.loc))
return 1
fixdir()
var/pipe_dir = get_pipe_dir()
for(var/obj/machinery/atmospherics/M in src.loc)
if((M.initialize_directions & pipe_dir) && M.check_connect_types_construction(M,src)) // matches at least one direction on either type of pipe
user << "\red There is already a pipe of the same type at this location."
user << "<span class='warning'>There is already a pipe of the same type at this location.</span>"
return 1
// no conflicts found
var/obj/machinery/atmospherics/machineReference = null //If somebody wants to overhaul that switch statement below, be my guest. Easier to set a reference here and then transfer logs after the switch statement.
@@ -603,11 +595,6 @@
qdel(src) // remove the pipe item
return
//TODO: DEFERRED
// ensure that setterm() is called for a newly connected pipeline
/obj/item/pipe_meter
name = "meter"