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
@@ -19,11 +19,13 @@ Buildable meters
|
||||
item_state = "buildpipe"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
level = 2
|
||||
var/flipped = 0
|
||||
var/is_bent = 0
|
||||
var/flipped = FALSE
|
||||
var/is_bent = FALSE
|
||||
var/piping_layer = PIPING_LAYER_DEFAULT
|
||||
|
||||
var/static/list/pipe_types = list(
|
||||
PIPE_SIMPLE, \
|
||||
PIPE_LAYER_MANIFOLD, \
|
||||
PIPE_MANIFOLD, \
|
||||
PIPE_4WAYMANIFOLD, \
|
||||
PIPE_HE, \
|
||||
@@ -52,40 +54,58 @@ Buildable meters
|
||||
..()
|
||||
to_chat(user, "<span class='notice'>Alt-click to rotate it clockwise.</span>")
|
||||
|
||||
/obj/item/pipe/New(loc, pipe_type, dir, obj/machinery/atmospherics/make_from)
|
||||
..()
|
||||
/obj/item/pipe/Initialize(mapload, _pipe_type, _dir, obj/machinery/atmospherics/make_from)
|
||||
if(make_from)
|
||||
src.setDir(make_from.dir)
|
||||
src.pipename = make_from.name
|
||||
setDir(make_from.dir)
|
||||
pipename = make_from.name
|
||||
add_atom_colour(make_from.color, FIXED_COLOUR_PRIORITY)
|
||||
|
||||
if(make_from.type in pipe_types)
|
||||
src.pipe_type = make_from.type
|
||||
pipe_type = make_from.type
|
||||
setPipingLayer(make_from.piping_layer)
|
||||
else //make pipe_type a value we can work with
|
||||
for(var/P in pipe_types)
|
||||
if(istype(make_from, P))
|
||||
src.pipe_type = P
|
||||
pipe_type = P
|
||||
break
|
||||
|
||||
var/obj/machinery/atmospherics/components/trinary/triP = make_from
|
||||
if(istype(triP) && triP.flipped)
|
||||
src.flipped = 1
|
||||
src.setDir(turn(src.dir, -45))
|
||||
flipped = TRUE
|
||||
setDir(turn(dir, -45))
|
||||
else
|
||||
src.pipe_type = pipe_type
|
||||
src.setDir(dir)
|
||||
pipe_type = _pipe_type
|
||||
setDir(_dir)
|
||||
|
||||
if(src.dir in GLOB.diagonals)
|
||||
is_bent = 1
|
||||
if(_dir in GLOB.diagonals)
|
||||
is_bent = TRUE
|
||||
|
||||
update()
|
||||
src.pixel_x = rand(-5, 5)
|
||||
src.pixel_y = rand(-5, 5)
|
||||
pixel_x = rand(-5, 5)
|
||||
pixel_y = rand(-5, 5)
|
||||
return ..()
|
||||
|
||||
/obj/item/pipe/dropped()
|
||||
if(loc)
|
||||
setPipingLayer(piping_layer)
|
||||
return ..()
|
||||
|
||||
/obj/item/pipe/proc/setPipingLayer(new_layer = PIPING_LAYER_DEFAULT)
|
||||
var/obj/machinery/atmospherics/fakeA = get_pipe_cache(pipe_type)
|
||||
var/nolayer = (fakeA.pipe_flags & PIPING_ALL_LAYER)
|
||||
if(nolayer)
|
||||
new_layer = PIPING_LAYER_DEFAULT
|
||||
piping_layer = new_layer
|
||||
if(pipe_type != PIPE_LAYER_MANIFOLD)
|
||||
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)
|
||||
|
||||
//update the name and icon of the pipe item depending on the type
|
||||
GLOBAL_LIST_INIT(pipeID2State, list(
|
||||
"[PIPE_SIMPLE]" = "simple", \
|
||||
"[PIPE_MANIFOLD]" = "manifold", \
|
||||
"[PIPE_LAYER_MANIFOLD]" = "layer_manifold", \
|
||||
"[PIPE_4WAYMANIFOLD]" = "manifold4w", \
|
||||
"[PIPE_HE]" = "he", \
|
||||
"[PIPE_HE_MANIFOLD]" = "he_manifold", \
|
||||
@@ -114,6 +134,7 @@ GLOBAL_LIST_INIT(pipeID2State, list(
|
||||
"[PIPE_SIMPLE]" = "pipe", \
|
||||
"[PIPE_SIMPLE]_b" = "bent pipe", \
|
||||
"[PIPE_MANIFOLD]" = "manifold", \
|
||||
"[PIPE_LAYER_MANIFOLD]" = "layer manifold", \
|
||||
"[PIPE_4WAYMANIFOLD]" = "4-way manifold", \
|
||||
"[PIPE_HE]" = "h/e pipe", \
|
||||
"[PIPE_HE]_b" = "bent h/e pipe", \
|
||||
@@ -151,7 +172,7 @@ GLOBAL_LIST_INIT(pipeID2State, list(
|
||||
if ( usr.stat || usr.restrained() || !usr.canmove )
|
||||
return
|
||||
|
||||
src.setDir(turn(src.dir, -90))
|
||||
setDir(turn(dir, -90))
|
||||
|
||||
fixdir()
|
||||
|
||||
@@ -166,11 +187,11 @@ GLOBAL_LIST_INIT(pipeID2State, list(
|
||||
return
|
||||
|
||||
if (pipe_type in list(PIPE_GAS_FILTER, PIPE_GAS_MIXER))
|
||||
src.setDir(turn(src.dir, flipped )? 45 : -45)
|
||||
setDir(turn(dir, flipped )? 45 : -45)
|
||||
flipped = !flipped
|
||||
return
|
||||
|
||||
src.setDir(turn(src.dir, -180))
|
||||
setDir(turn(dir, -180))
|
||||
|
||||
fixdir()
|
||||
|
||||
@@ -199,7 +220,7 @@ GLOBAL_LIST_INIT(pipeID2State, list(
|
||||
|
||||
//Helper to clean up dir
|
||||
/obj/item/pipe/proc/fixdir()
|
||||
if((pipe_type in list (PIPE_SIMPLE, PIPE_HE, PIPE_MVALVE, PIPE_DVALVE)) && !is_bent)
|
||||
if((pipe_type in list (PIPE_SIMPLE, PIPE_HE, PIPE_MVALVE, PIPE_DVALVE, PIPE_LAYER_MANIFOLD)) && !is_bent)
|
||||
if(dir==SOUTH)
|
||||
setDir(NORTH)
|
||||
else if(dir==WEST)
|
||||
@@ -208,40 +229,54 @@ GLOBAL_LIST_INIT(pipeID2State, list(
|
||||
/obj/item/pipe/attack_self(mob/user)
|
||||
return rotate()
|
||||
|
||||
/obj/item/pipe/proc/get_pipe_cache(type, direction)
|
||||
var/static/list/obj/machinery/atmospherics/check_cache
|
||||
if(!islist(check_cache))
|
||||
check_cache = list()
|
||||
if(!check_cache[type])
|
||||
check_cache[type] = list()
|
||||
if(!check_cache[type]["[direction]"])
|
||||
check_cache[type]["[direction]"] = new type(null, null, direction)
|
||||
|
||||
return check_cache[type]["[direction]"]
|
||||
|
||||
/obj/item/pipe/attackby(obj/item/W, mob/user, params)
|
||||
if (!istype(W, /obj/item/wrench))
|
||||
return ..()
|
||||
if (!isturf(src.loc))
|
||||
return 1
|
||||
|
||||
if (!isturf(loc))
|
||||
return TRUE
|
||||
add_fingerprint(user)
|
||||
|
||||
fixdir()
|
||||
if(pipe_type in list(PIPE_GAS_MIXER, PIPE_GAS_FILTER))
|
||||
setDir(unflip(dir))
|
||||
|
||||
var/obj/machinery/atmospherics/A = new pipe_type(src.loc)
|
||||
A.setDir(src.dir)
|
||||
A.SetInitDirections()
|
||||
var/obj/machinery/atmospherics/fakeA = get_pipe_cache(pipe_type, dir)
|
||||
|
||||
for(var/obj/machinery/atmospherics/M in src.loc)
|
||||
if(M == A) //we don't want to check to see if it interferes with itself
|
||||
for(var/obj/machinery/atmospherics/M in loc)
|
||||
if((M.pipe_flags & PIPING_ONE_PER_TURF) && (fakeA.pipe_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 & PIPING_ALL_LAYER) || (pipe_type == PIPE_LAYER_MANIFOLD)))
|
||||
continue
|
||||
if(M.GetInitDirections() & A.GetInitDirections()) // matches at least one direction on either type of pipe
|
||||
if(M.GetInitDirections() & fakeA.GetInitDirections()) // 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>")
|
||||
qdel(A)
|
||||
return 1
|
||||
return TRUE
|
||||
// no conflicts found
|
||||
|
||||
var/obj/machinery/atmospherics/A = new pipe_type(loc)
|
||||
A.setDir(dir)
|
||||
A.SetInitDirections()
|
||||
|
||||
if(pipename)
|
||||
A.name = pipename
|
||||
|
||||
var/obj/machinery/atmospherics/components/trinary/T = A
|
||||
if(istype(T))
|
||||
T.flipped = flipped
|
||||
A.on_construction(pipe_type, color)
|
||||
A.on_construction(pipe_type, color, piping_layer)
|
||||
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
user.visible_message( \
|
||||
"[user] fastens \the [src].", \
|
||||
"<span class='notice'>You fasten \the [src].</span>", \
|
||||
@@ -271,16 +306,33 @@ GLOBAL_LIST_INIT(pipeID2State, list(
|
||||
icon_state = "meter"
|
||||
item_state = "buildpipe"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
var/piping_layer = PIPING_LAYER_DEFAULT
|
||||
|
||||
/obj/item/pipe_meter/attackby(obj/item/W, mob/user, params)
|
||||
/obj/item/pipe_meter/attackby(obj/item/I, mob/user, params)
|
||||
..()
|
||||
|
||||
if (!istype(W, /obj/item/wrench))
|
||||
if (!istype(I, /obj/item/wrench))
|
||||
return ..()
|
||||
if(!locate(/obj/machinery/atmospherics/pipe, src.loc))
|
||||
var/obj/machinery/atmospherics/pipe/pipe
|
||||
for(var/obj/machinery/atmospherics/pipe/P in loc)
|
||||
if(P.piping_layer == piping_layer)
|
||||
pipe = P
|
||||
break
|
||||
if(!pipe)
|
||||
to_chat(user, "<span class='warning'>You need to fasten it to a pipe!</span>")
|
||||
return 1
|
||||
new/obj/machinery/meter( src.loc )
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
return TRUE
|
||||
new /obj/machinery/meter(loc, piping_layer)
|
||||
playsound(src, I.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You fasten the meter to the pipe.</span>")
|
||||
qdel(src)
|
||||
|
||||
/obj/item/pipe_meter/dropped()
|
||||
. = ..()
|
||||
if(loc)
|
||||
setAttachLayer(piping_layer)
|
||||
|
||||
/obj/item/pipe_meter/proc/setAttachLayer(new_layer = PIPING_LAYER_DEFAULT)
|
||||
piping_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
|
||||
|
||||
|
||||
@@ -6,18 +6,21 @@
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
var/wait = 0
|
||||
var/piping_layer = PIPING_LAYER_DEFAULT
|
||||
|
||||
/obj/machinery/pipedispenser/attack_paw(mob/user)
|
||||
return src.attack_hand(user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/pipedispenser/attack_hand(mob/user)
|
||||
if(..())
|
||||
return 1
|
||||
var/dat = {"
|
||||
PIPING LAYER: <A href='?src=\ref[src];layer_down=1'>--</A><b>[piping_layer]</b><A href='?src=\ref[src];layer_up=1'>++</A><BR>
|
||||
<b>Pipes:</b><BR>
|
||||
<A href='?src=\ref[src];make=[PIPE_SIMPLE];dir=1'>Pipe</A><BR>
|
||||
<A href='?src=\ref[src];make=[PIPE_SIMPLE];dir=5'>Bent Pipe</A><BR>
|
||||
<A href='?src=\ref[src];make=[PIPE_MANIFOLD];dir=1'>Manifold</A><BR>
|
||||
<A href='?src=\ref[src];make=[PIPE_LAYER_MANIFOLD];dir=1'>Layer Manifold</A><BR>
|
||||
<A href='?src=\ref[src];make=[PIPE_4WAYMANIFOLD];dir=1'>4-Way Manifold</A><BR>
|
||||
<A href='?src=\ref[src];make=[PIPE_MVALVE];dir=1'>Manual Valve</A><BR>
|
||||
<A href='?src=\ref[src];make=[PIPE_DVALVE];dir=1'>Digital Valve</A><BR>
|
||||
@@ -53,18 +56,23 @@
|
||||
usr << browse(null, "window=pipedispenser")
|
||||
return 1
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
add_fingerprint(usr)
|
||||
if(href_list["make"])
|
||||
if(wait < world.time)
|
||||
var/p_type = text2path(href_list["make"])
|
||||
var/p_dir = text2num(href_list["dir"])
|
||||
var/obj/item/pipe/P = new (src.loc, pipe_type=p_type, dir=p_dir)
|
||||
var/obj/item/pipe/P = new (loc, p_type, p_dir)
|
||||
P.setPipingLayer(piping_layer)
|
||||
P.add_fingerprint(usr)
|
||||
wait = world.time + 10
|
||||
if(href_list["makemeter"])
|
||||
if(wait < world.time )
|
||||
new /obj/item/pipe_meter(src.loc)
|
||||
new /obj/item/pipe_meter(loc)
|
||||
wait = world.time + 15
|
||||
if(href_list["layer_up"])
|
||||
piping_layer = Clamp(++piping_layer, PIPING_LAYER_MIN, PIPING_LAYER_MAX)
|
||||
if(href_list["layer_down"])
|
||||
piping_layer = Clamp(--piping_layer, PIPING_LAYER_MIN, PIPING_LAYER_MAX)
|
||||
return
|
||||
|
||||
/obj/machinery/pipedispenser/attackby(obj/item/W, mob/user, params)
|
||||
@@ -75,7 +83,7 @@
|
||||
return
|
||||
else if (istype(W, /obj/item/wrench))
|
||||
if (!anchored && !isinspace())
|
||||
playsound(src.loc, W.usesound, 50, 1)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to fasten \the [src] to the floor...</span>")
|
||||
if (do_after(user, 40*W.toolspeed, target = src))
|
||||
add_fingerprint(user)
|
||||
@@ -88,7 +96,7 @@
|
||||
if (usr.machine==src)
|
||||
usr << browse(null, "window=pipedispenser")
|
||||
else if(anchored)
|
||||
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] from the floor...</span>")
|
||||
if (do_after(user, 20*W.toolspeed, target = src))
|
||||
add_fingerprint(user)
|
||||
@@ -160,11 +168,11 @@ Nah
|
||||
if(..())
|
||||
return 1
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
add_fingerprint(usr)
|
||||
if(href_list["dmake"])
|
||||
if(wait < world.time)
|
||||
var/p_type = text2num(href_list["dmake"])
|
||||
var/obj/structure/disposalconstruct/C = new (src.loc,p_type)
|
||||
var/obj/structure/disposalconstruct/C = new (loc,p_type)
|
||||
|
||||
if(!C.can_place())
|
||||
to_chat(usr, "<span class='warning'>There's not enough room to build that here!</span>")
|
||||
@@ -211,7 +219,7 @@ Nah
|
||||
if(..())
|
||||
return 1
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
add_fingerprint(usr)
|
||||
if(wait < world.time)
|
||||
if(href_list["tube"])
|
||||
var/tube_type = text2num(href_list["tube"])
|
||||
|
||||
@@ -30,10 +30,10 @@ RPD
|
||||
var/selected=0
|
||||
|
||||
/datum/pipe_info/New(pid,direction,dt)
|
||||
src.id=pid
|
||||
src.icon_state=GLOB.pipeID2State["[pid]"]
|
||||
src.dir = direction
|
||||
src.dirtype=dt
|
||||
id=pid
|
||||
icon_state=GLOB.pipeID2State["[pid]"]
|
||||
dir = direction
|
||||
dirtype=dt
|
||||
|
||||
/datum/pipe_info/proc/Render(dispenser,label)
|
||||
return "<li><a href='?src=\ref[dispenser];makepipe=[id];dir=[dir];type=[dirtype]'>[label]</a></li>"
|
||||
@@ -67,10 +67,10 @@ GLOBAL_LIST_INIT(disposalpipeID2State, list(
|
||||
icon_state = "meterX"
|
||||
|
||||
/datum/pipe_info/disposal/New(var/pid,var/dt)
|
||||
src.id=pid
|
||||
src.icon_state=GLOB.disposalpipeID2State[pid+1]
|
||||
src.dir = SOUTH
|
||||
src.dirtype=dt
|
||||
id=pid
|
||||
icon_state=GLOB.disposalpipeID2State[pid+1]
|
||||
dir = SOUTH
|
||||
dirtype=dt
|
||||
if(pid<DISP_END_BIN || pid>DISP_END_CHUTE)
|
||||
icon_state = "con[icon_state]"
|
||||
|
||||
@@ -80,13 +80,14 @@ GLOBAL_LIST_INIT(disposalpipeID2State, list(
|
||||
//find these defines in code\game\machinery\pipe\consruction.dm
|
||||
GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
"Pipes" = list(
|
||||
"Pipe" = new /datum/pipe_info(PIPE_SIMPLE, 1, PIPE_BENDABLE),
|
||||
//"Bent Pipe" = new /datum/pipe_info(PIPE_SIMPLE, 5, PIPE_BENT),
|
||||
"Manifold" = new /datum/pipe_info(PIPE_MANIFOLD, 1, PIPE_TRINARY),
|
||||
"Manual Valve" = new /datum/pipe_info(PIPE_MVALVE, 1, PIPE_BINARY),
|
||||
"Digital Valve" = new /datum/pipe_info(PIPE_DVALVE, 1, PIPE_BINARY),
|
||||
"4-Way Manifold" = new /datum/pipe_info(PIPE_4WAYMANIFOLD, 1, PIPE_QUAD),
|
||||
"Bluespace Pipe" = new /datum/pipe_info(PIPE_BLUESPACE, 1, PIPE_UNARY),
|
||||
"Pipe" = new /datum/pipe_info(PIPE_SIMPLE, 1, PIPE_BENDABLE),
|
||||
//"Bent Pipe" = new /datum/pipe_info(PIPE_SIMPLE, 5, PIPE_BENT),
|
||||
"Manifold" = new /datum/pipe_info(PIPE_MANIFOLD, 1, PIPE_TRINARY),
|
||||
"Manual Valve" = new /datum/pipe_info(PIPE_MVALVE, 1, PIPE_BINARY),
|
||||
"Digital Valve" = new /datum/pipe_info(PIPE_DVALVE, 1, PIPE_BINARY),
|
||||
"4-Way Manifold" = new /datum/pipe_info(PIPE_4WAYMANIFOLD, 1, PIPE_QUAD),
|
||||
"Layer Manifold" = new /datum/pipe_info(PIPE_LAYER_MANIFOLD, 1, PIPE_BINARY),
|
||||
"Bluespace Pipe" = new /datum/pipe_info(PIPE_BLUESPACE, 1, PIPE_UNARY),
|
||||
),
|
||||
"Devices"=list(
|
||||
"Connector" = new /datum/pipe_info(PIPE_CONNECTOR, 1, PIPE_UNARY),
|
||||
@@ -153,6 +154,7 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
)
|
||||
var/paint_color="grey"
|
||||
var/screen = CATEGORY_ATMOS //Starts on the atmos tab.
|
||||
var/piping_layer = PIPING_LAYER_DEFAULT
|
||||
|
||||
/obj/item/pipe_dispenser/New()
|
||||
. = ..()
|
||||
@@ -201,6 +203,14 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
dat += "<span class='linkOn'>Atmospherics</span> <A href='?src=\ref[src];screen=[CATEGORY_DISPOSALS];dmake=0;type=0'>Disposals</A><BR>"
|
||||
else if(screen == CATEGORY_DISPOSALS)
|
||||
dat += "<A href='?src=\ref[src];screen=[CATEGORY_ATMOS];makepipe=0;dir=1;type=0'>Atmospherics</A> <span class='linkOn'>Disposals</span><BR>"
|
||||
var/generated_layer_list = ""
|
||||
var/layers_total = PIPING_LAYER_MAX - PIPING_LAYER_MIN + 1
|
||||
for(var/iter = PIPING_LAYER_MIN, iter <= layers_total, iter++)
|
||||
if(iter == piping_layer)
|
||||
generated_layer_list += "<span class='linkOn'><A href='?src=\ref[src];setlayer=[iter]'>[iter]</A></span>"
|
||||
else
|
||||
generated_layer_list += "<A href='?src=\ref[src];setlayer=[iter]'>[iter]</A>"
|
||||
dat += "Atmospherics Piping Layer: [generated_layer_list]<BR>"
|
||||
dat += "</ul>"
|
||||
|
||||
var/icon/preview=null
|
||||
@@ -459,7 +469,7 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
usr << browse(null, "window=pipedispenser")
|
||||
return
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
add_fingerprint(usr)
|
||||
if(href_list["screen"])
|
||||
screen = text2num(href_list["screen"])
|
||||
show_menu(usr)
|
||||
@@ -469,11 +479,18 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
p_flipped = text2num(href_list["flipped"])
|
||||
show_menu(usr)
|
||||
|
||||
if(href_list["setlayer"])
|
||||
if(!isnum(href_list["setlayer"]))
|
||||
piping_layer = text2num(href_list["setlayer"])
|
||||
else
|
||||
piping_layer = href_list["setlayer"]
|
||||
show_menu(usr)
|
||||
|
||||
if(href_list["eatpipes"])
|
||||
p_class = EATING_MODE
|
||||
p_conntype=-1
|
||||
p_dir=1
|
||||
src.spark_system.start()
|
||||
spark_system.start()
|
||||
playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0)
|
||||
show_menu(usr)
|
||||
|
||||
@@ -481,13 +498,13 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
p_class = PAINT_MODE
|
||||
p_conntype = -1
|
||||
p_dir = 1
|
||||
src.spark_system.start()
|
||||
spark_system.start()
|
||||
playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0)
|
||||
show_menu(usr)
|
||||
|
||||
if(href_list["set_color"])
|
||||
paint_color = href_list["set_color"]
|
||||
src.spark_system.start()
|
||||
spark_system.start()
|
||||
playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0)
|
||||
show_menu(usr)
|
||||
|
||||
@@ -496,7 +513,7 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
p_dir = text2num(href_list["dir"])
|
||||
p_conntype = text2num(href_list["type"])
|
||||
p_class = ATMOS_MODE
|
||||
src.spark_system.start()
|
||||
spark_system.start()
|
||||
playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0)
|
||||
show_menu(usr)
|
||||
|
||||
@@ -504,7 +521,7 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
p_class = METER_MODE
|
||||
p_conntype = -1
|
||||
p_dir = 1
|
||||
src.spark_system.start()
|
||||
spark_system.start()
|
||||
playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0)
|
||||
show_menu(usr)
|
||||
|
||||
@@ -513,7 +530,7 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
p_conntype = text2num(href_list["type"])
|
||||
p_dir = 1
|
||||
p_class = DISPOSALS_MODE
|
||||
src.spark_system.start()
|
||||
spark_system.start()
|
||||
playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0)
|
||||
show_menu(usr)
|
||||
|
||||
@@ -522,10 +539,18 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
if(!user.IsAdvancedToolUser() || istype(A, /turf/open/space/transit))
|
||||
return ..()
|
||||
|
||||
var/atmos_piping_mode = p_class == ATMOS_MODE || p_class == METER_MODE
|
||||
var/temp_piping_layer
|
||||
if(atmos_piping_mode)
|
||||
if(istype(A, /obj/machinery/atmospherics))
|
||||
var/obj/machinery/atmospherics/AM = A
|
||||
temp_piping_layer = AM.piping_layer
|
||||
A = get_turf(user)
|
||||
|
||||
//make sure what we're clicking is valid for the current mode
|
||||
var/is_paintable = (p_class == PAINT_MODE && istype(A, /obj/machinery/atmospherics/pipe))
|
||||
var/is_consumable = (p_class == EATING_MODE && (istype(A, /obj/item/pipe) || istype(A, /obj/item/pipe_meter) || istype(A, /obj/structure/disposalconstruct)))
|
||||
var/can_make_pipe = ((p_class == ATMOS_MODE || p_class == METER_MODE || p_class == DISPOSALS_MODE) && isturf(A))
|
||||
var/can_make_pipe = ((atmos_piping_mode || p_class == DISPOSALS_MODE) && isturf(A))
|
||||
|
||||
if(!is_paintable && !is_consumable && !can_make_pipe)
|
||||
return ..()
|
||||
@@ -540,10 +565,8 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
if(PAINT_MODE) //Paint pipes
|
||||
var/obj/machinery/atmospherics/pipe/P = A
|
||||
playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1)
|
||||
P.add_atom_colour(paint_colors[paint_color], FIXED_COLOUR_PRIORITY)
|
||||
P.pipe_color = paint_colors[paint_color]
|
||||
P.paint(paint_colors[paint_color])
|
||||
user.visible_message("<span class='notice'>[user] paints \the [P] [paint_color].</span>","<span class='notice'>You paint \the [P] [paint_color].</span>")
|
||||
P.update_node_icon()
|
||||
return
|
||||
|
||||
if(EATING_MODE) //Eating pipes
|
||||
@@ -558,21 +581,29 @@ GLOBAL_LIST_INIT(RPD_recipes, list(
|
||||
playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1)
|
||||
if(do_after(user, 2, target = A))
|
||||
activate()
|
||||
var/obj/item/pipe/P = new (A, pipe_type=queued_p_type, dir=queued_p_dir)
|
||||
var/obj/item/pipe/P = new(A, queued_p_type, queued_p_dir)
|
||||
P.flipped = queued_p_flipped
|
||||
P.update()
|
||||
P.add_fingerprint(usr)
|
||||
if(!isnull(temp_piping_layer))
|
||||
P.setPipingLayer(temp_piping_layer)
|
||||
else
|
||||
P.setPipingLayer(piping_layer)
|
||||
|
||||
if(METER_MODE) //Making pipe meters
|
||||
to_chat(user, "<span class='notice'>You start building a meter...</span>")
|
||||
playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1)
|
||||
if(do_after(user, 2, target = A))
|
||||
activate()
|
||||
new /obj/item/pipe_meter(A)
|
||||
var/obj/item/pipe_meter/PM = new /obj/item/pipe_meter(A)
|
||||
if(!isnull(temp_piping_layer))
|
||||
PM.setAttachLayer(temp_piping_layer)
|
||||
else
|
||||
PM.setAttachLayer(piping_layer)
|
||||
|
||||
if(DISPOSALS_MODE) //Making disposals pipes
|
||||
if(isclosedturf(A))
|
||||
to_chat(user, "<span class='warning'>[src]'s error light flickers; there's something in the way!</span>")
|
||||
to_chat(user, "<span class='warning'>\the [src]'s error light flickers; there's something in the way!</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You start building a disposals pipe...</span>")
|
||||
playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1)
|
||||
|
||||
Reference in New Issue
Block a user