ree
This commit is contained in:
@@ -74,74 +74,6 @@
|
||||
built.SetInitDirections()
|
||||
built.on_construction(pipe_color, piping_layer)
|
||||
|
||||
/obj/item/pipe/wrench_act(mob/living/user, obj/item/wrench/W)
|
||||
if(!isturf(loc))
|
||||
return TRUE
|
||||
|
||||
add_fingerprint(user)
|
||||
|
||||
var/obj/machinery/atmospherics/fakeA = pipe_type
|
||||
var/flags = initial(fakeA.pipe_flags)
|
||||
for(var/obj/machinery/atmospherics/M in loc)
|
||||
if((M.pipe_flags & flags & PIPING_ONE_PER_TURF)) //Only one dense/requires density object per tile, eg connectors/cryo/heater/coolers.
|
||||
to_chat(user, "<span class='warning'>Something is hogging the tile!</span>")
|
||||
return TRUE
|
||||
if((M.piping_layer != piping_layer) && !((M.pipe_flags | flags) & PIPING_ALL_LAYER)) //don't continue if either pipe goes across all layers
|
||||
continue
|
||||
if(M.GetInitDirections() & SSair.get_init_dirs(pipe_type, fixed_dir())) // matches at least one direction on either type of pipe
|
||||
to_chat(user, "<span class='warning'>There is already a pipe at that location!</span>")
|
||||
return TRUE
|
||||
// no conflicts found
|
||||
|
||||
var/obj/machinery/atmospherics/A = new pipe_type(loc)
|
||||
build_pipe(A)
|
||||
A.on_construction(color, piping_layer)
|
||||
transfer_fingerprints_to(A)
|
||||
|
||||
W.play_tool_sound(src)
|
||||
user.visible_message( \
|
||||
"[user] fastens \the [src].", \
|
||||
"<span class='notice'>You fasten \the [src].</span>", \
|
||||
"<span class='italics'>You hear ratcheting.</span>")
|
||||
|
||||
qdel(src)
|
||||
|
||||
/obj/item/pipe/proc/build_pipe(obj/machinery/atmospherics/A)
|
||||
A.setDir(fixed_dir())
|
||||
A.SetInitDirections()
|
||||
|
||||
if(pipename)
|
||||
A.name = pipename
|
||||
if(A.on)
|
||||
// Certain pre-mapped subtypes are on by default, we want to preserve
|
||||
// every other aspect of these subtypes (name, pre-set filters, etc.)
|
||||
// but they shouldn't turn on automatically when wrenched.
|
||||
A.on = FALSE
|
||||
|
||||
/obj/effect/network_builder/atmos_pipe/proc/spawn_wires(list/directions)
|
||||
if(!length(directions))
|
||||
return
|
||||
else if(length(directions) == 1)
|
||||
var/knot = (knot == KNOT_FORCED) || ((knot == KNOT_AUTO) && should_auto_knot())
|
||||
if(knot)
|
||||
var/dir = directions[1]
|
||||
new /obj/structure/cable(loc, cable_color, NONE, directions[1])
|
||||
else
|
||||
if(knot == KNOT_FORCED)
|
||||
for(var/d in directions)
|
||||
new /obj/structure/cable(loc, cable_color, NONE, d)
|
||||
else
|
||||
var/knot = (knot == KNOT_FORCED) || ((knot == KNOT_AUTO) && should_auto_knot())
|
||||
var/dirs = length(directions)
|
||||
for(var/i in dirs)
|
||||
var/li = i - 1
|
||||
if(li < 1)
|
||||
li = dirs + li
|
||||
new /obj/structure/cable(loc, cable_color, directions[i], directions[li])
|
||||
if(knot)
|
||||
new /obj/structure/cable(loc, cable_color, NONE, directions[i])
|
||||
knot = FALSE
|
||||
|
||||
/obj/effect/network_builder/atmos_pipe/distro
|
||||
name = "distro line autobuilder"
|
||||
piping_layer = PIPING_LAYER_MIN
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
if(!length(directions))
|
||||
return
|
||||
else if(length(directions) == 1)
|
||||
var/knot = (knot == KNOT_FORCED) || ((knot == KNOT_AUTO) && should_auto_knot())
|
||||
if(knot)
|
||||
var/do_knot = (knot == KNOT_FORCED) || ((knot == KNOT_AUTO) && should_auto_knot())
|
||||
if(do_knot)
|
||||
var/dir = directions[1]
|
||||
new /obj/structure/cable(loc, cable_color, NONE, directions[1])
|
||||
else
|
||||
@@ -52,16 +52,16 @@
|
||||
for(var/d in directions)
|
||||
new /obj/structure/cable(loc, cable_color, NONE, d)
|
||||
else
|
||||
var/knot = (knot == KNOT_FORCED) || ((knot == KNOT_AUTO) && should_auto_knot())
|
||||
var/do_knot = (knot == KNOT_FORCED) || ((knot == KNOT_AUTO) && should_auto_knot())
|
||||
var/dirs = length(directions)
|
||||
for(var/i in dirs)
|
||||
var/li = i - 1
|
||||
if(li < 1)
|
||||
li = dirs + li
|
||||
new /obj/structure/cable(loc, cable_color, directions[i], directions[li])
|
||||
if(knot)
|
||||
if(do_knot)
|
||||
new /obj/structure/cable(loc, cable_color, NONE, directions[i])
|
||||
knot = FALSE
|
||||
do_knot = FALSE
|
||||
|
||||
/obj/effect/network_builder/power_cable/proc/should_auto_knot()
|
||||
return (locate(/obj/machinery/terminal) in loc)
|
||||
|
||||
Reference in New Issue
Block a user