July 5th TG sync (#1883)

July 5th TG sync
This commit is contained in:
Poojawa
2017-07-05 22:14:19 -05:00
committed by GitHub
parent 454b9c3d68
commit b1b4826c0c
1264 changed files with 149689 additions and 570309 deletions
+275 -275
View File
@@ -1,281 +1,281 @@
/*CONTENTS
Buildable pipes
Buildable meters
*/
//construction defines are in __defines/pipe_construction.dm
//update those defines ANY TIME an atmos path is changed...
//...otherwise construction will stop working
/obj/item/pipe
name = "pipe"
desc = "A pipe"
var/pipe_type = 0
var/pipename
force = 7
throwforce = 7
icon = 'icons/obj/atmospherics/pipes/pipe_item.dmi'
icon_state = "simple"
item_state = "buildpipe"
w_class = WEIGHT_CLASS_NORMAL
level = 2
var/flipped = 0
var/is_bent = 0
var/static/list/pipe_types = list(
PIPE_SIMPLE, \
PIPE_MANIFOLD, \
PIPE_4WAYMANIFOLD, \
PIPE_HE, \
PIPE_HE_MANIFOLD, \
PIPE_HE_4WAYMANIFOLD, \
PIPE_JUNCTION, \
\
PIPE_CONNECTOR, \
PIPE_UVENT, \
PIPE_SCRUBBER, \
/*CONTENTS
Buildable pipes
Buildable meters
*/
//construction defines are in __defines/pipe_construction.dm
//update those defines ANY TIME an atmos path is changed...
//...otherwise construction will stop working
/obj/item/pipe
name = "pipe"
desc = "A pipe"
var/pipe_type = 0
var/pipename
force = 7
throwforce = 7
icon = 'icons/obj/atmospherics/pipes/pipe_item.dmi'
icon_state = "simple"
item_state = "buildpipe"
w_class = WEIGHT_CLASS_NORMAL
level = 2
var/flipped = 0
var/is_bent = 0
var/static/list/pipe_types = list(
PIPE_SIMPLE, \
PIPE_MANIFOLD, \
PIPE_4WAYMANIFOLD, \
PIPE_HE, \
PIPE_HE_MANIFOLD, \
PIPE_HE_4WAYMANIFOLD, \
PIPE_JUNCTION, \
\
PIPE_CONNECTOR, \
PIPE_UVENT, \
PIPE_SCRUBBER, \
PIPE_INJECTOR, \
PIPE_HEAT_EXCHANGE, \
\
PIPE_PUMP, \
PIPE_PASSIVE_GATE, \
PIPE_VOLUME_PUMP, \
PIPE_MVALVE, \
PIPE_DVALVE, \
\
PIPE_GAS_FILTER, \
PIPE_GAS_MIXER, \
)
/obj/item/pipe/examine(mob/user)
..()
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)
..()
if(make_from)
src.setDir(make_from.dir)
src.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
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
break
var/obj/machinery/atmospherics/components/trinary/triP = make_from
if(istype(triP) && triP.flipped)
src.flipped = 1
src.setDir(turn(src.dir, -45))
else
src.pipe_type = pipe_type
src.setDir(dir)
if(src.dir in GLOB.diagonals)
is_bent = 1
update()
src.pixel_x = rand(-5, 5)
src.pixel_y = rand(-5, 5)
//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_4WAYMANIFOLD]" = "manifold4w", \
"[PIPE_HE]" = "he", \
"[PIPE_HE_MANIFOLD]" = "he_manifold", \
"[PIPE_HE_4WAYMANIFOLD]" = "he_manifold4w", \
"[PIPE_JUNCTION]" = "junction", \
\
"[PIPE_CONNECTOR]" = "connector", \
"[PIPE_UVENT]" = "uvent", \
"[PIPE_SCRUBBER]" = "scrubber", \
PIPE_HEAT_EXCHANGE, \
\
PIPE_PUMP, \
PIPE_PASSIVE_GATE, \
PIPE_VOLUME_PUMP, \
PIPE_MVALVE, \
PIPE_DVALVE, \
\
PIPE_GAS_FILTER, \
PIPE_GAS_MIXER, \
)
/obj/item/pipe/examine(mob/user)
..()
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)
..()
if(make_from)
src.setDir(make_from.dir)
src.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
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
break
var/obj/machinery/atmospherics/components/trinary/triP = make_from
if(istype(triP) && triP.flipped)
src.flipped = 1
src.setDir(turn(src.dir, -45))
else
src.pipe_type = pipe_type
src.setDir(dir)
if(src.dir in GLOB.diagonals)
is_bent = 1
update()
src.pixel_x = rand(-5, 5)
src.pixel_y = rand(-5, 5)
//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_4WAYMANIFOLD]" = "manifold4w", \
"[PIPE_HE]" = "he", \
"[PIPE_HE_MANIFOLD]" = "he_manifold", \
"[PIPE_HE_4WAYMANIFOLD]" = "he_manifold4w", \
"[PIPE_JUNCTION]" = "junction", \
\
"[PIPE_CONNECTOR]" = "connector", \
"[PIPE_UVENT]" = "uvent", \
"[PIPE_SCRUBBER]" = "scrubber", \
"[PIPE_INJECTOR]" = "injector", \
"[PIPE_HEAT_EXCHANGE]" = "heunary", \
\
"[PIPE_PUMP]" = "pump", \
"[PIPE_PASSIVE_GATE]" = "passivegate", \
"[PIPE_VOLUME_PUMP]" = "volumepump", \
"[PIPE_MVALVE]" = "mvalve", \
"[PIPE_DVALVE]" = "dvalve", \
\
"[PIPE_GAS_FILTER]" = "filter", \
"[PIPE_GAS_MIXER]" = "mixer", \
))
/obj/item/pipe/proc/update()
var/list/nlist = list(\
"[PIPE_SIMPLE]" = "pipe", \
"[PIPE_SIMPLE]_b" = "bent pipe", \
"[PIPE_MANIFOLD]" = "manifold", \
"[PIPE_4WAYMANIFOLD]" = "4-way manifold", \
"[PIPE_HE]" = "h/e pipe", \
"[PIPE_HE]_b" = "bent h/e pipe", \
"[PIPE_HE_MANIFOLD]" = "h/e manifold", \
"[PIPE_HE_4WAYMANIFOLD]"= "h/e 4-way manifold", \
"[PIPE_JUNCTION]" = "junction", \
\
"[PIPE_CONNECTOR]" = "connector", \
"[PIPE_UVENT]" = "vent", \
"[PIPE_SCRUBBER]" = "scrubber", \
"[PIPE_HEAT_EXCHANGE]" = "heunary", \
\
"[PIPE_PUMP]" = "pump", \
"[PIPE_PASSIVE_GATE]" = "passivegate", \
"[PIPE_VOLUME_PUMP]" = "volumepump", \
"[PIPE_MVALVE]" = "mvalve", \
"[PIPE_DVALVE]" = "dvalve", \
\
"[PIPE_GAS_FILTER]" = "filter", \
"[PIPE_GAS_MIXER]" = "mixer", \
))
/obj/item/pipe/proc/update()
var/list/nlist = list(\
"[PIPE_SIMPLE]" = "pipe", \
"[PIPE_SIMPLE]_b" = "bent pipe", \
"[PIPE_MANIFOLD]" = "manifold", \
"[PIPE_4WAYMANIFOLD]" = "4-way manifold", \
"[PIPE_HE]" = "h/e pipe", \
"[PIPE_HE]_b" = "bent h/e pipe", \
"[PIPE_HE_MANIFOLD]" = "h/e manifold", \
"[PIPE_HE_4WAYMANIFOLD]"= "h/e 4-way manifold", \
"[PIPE_JUNCTION]" = "junction", \
\
"[PIPE_CONNECTOR]" = "connector", \
"[PIPE_UVENT]" = "vent", \
"[PIPE_SCRUBBER]" = "scrubber", \
"[PIPE_INJECTOR]" = "injector", \
"[PIPE_HEAT_EXCHANGE]" = "heat exchanger", \
\
"[PIPE_PUMP]" = "pump", \
"[PIPE_PASSIVE_GATE]" = "passive gate", \
"[PIPE_VOLUME_PUMP]" = "volume pump", \
"[PIPE_MVALVE]" = "manual valve", \
"[PIPE_DVALVE]" = "digital valve", \
\
"[PIPE_GAS_FILTER]" = "gas filter", \
"[PIPE_GAS_MIXER]" = "gas mixer", \
)
//fix_pipe_type()
name = nlist["[pipe_type][is_bent ? "_b" : ""]"] + " fitting"
icon_state = GLOB.pipeID2State["[pipe_type]"]
// rotate the pipe item clockwise
/obj/item/pipe/verb/rotate()
set category = "Object"
set name = "Rotate Pipe"
set src in view(1)
if ( usr.stat || usr.restrained() || !usr.canmove )
return
src.setDir(turn(src.dir, -90))
fixdir()
return
/obj/item/pipe/verb/flip()
set category = "Object"
set name = "Flip Pipe"
set src in view(1)
if ( usr.stat || usr.restrained() || !usr.canmove )
return
if (pipe_type in list(PIPE_GAS_FILTER, PIPE_GAS_MIXER))
src.setDir(turn(src.dir, flipped )? 45 : -45)
flipped = !flipped
return
src.setDir(turn(src.dir, -180))
fixdir()
return
/obj/item/pipe/AltClick(mob/user)
..()
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(!in_range(src, user))
return
else
rotate()
/obj/item/pipe/Move()
var/old_dir = dir
..()
setDir(old_dir )//pipes changing direction when moved is just annoying and buggy
/obj/item/pipe/proc/unflip(direction)
if(direction in GLOB.diagonals)
return turn(direction, 45)
return direction
//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(dir==SOUTH)
setDir(NORTH)
else if(dir==WEST)
setDir(EAST)
/obj/item/pipe/attack_self(mob/user)
return rotate()
/obj/item/pipe/attackby(obj/item/weapon/W, mob/user, params)
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if (!isturf(src.loc))
return 1
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()
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
continue
if(M.GetInitDirections() & A.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
// no conflicts found
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)
playsound(src.loc, W.usesound, 50, 1)
user.visible_message( \
"[user] fastens \the [src].", \
"<span class='notice'>You fasten \the [src].</span>", \
"<span class='italics'>You hear ratchet.</span>")
qdel(src)
/obj/item/pipe/suicide_act(mob/user)
if(pipe_type in list(PIPE_PUMP, PIPE_PASSIVE_GATE, PIPE_VOLUME_PUMP))
user.visible_message("<span class='suicide'>[user] shoves the [src] in [user.p_their()] mouth and turns it on! It looks like [user.p_theyre()] trying to commit suicide!</span>")
if(istype(user, /mob/living/carbon))
var/mob/living/carbon/C = user
for(var/i=1 to 20)
"[PIPE_HEAT_EXCHANGE]" = "heat exchanger", \
\
"[PIPE_PUMP]" = "pump", \
"[PIPE_PASSIVE_GATE]" = "passive gate", \
"[PIPE_VOLUME_PUMP]" = "volume pump", \
"[PIPE_MVALVE]" = "manual valve", \
"[PIPE_DVALVE]" = "digital valve", \
\
"[PIPE_GAS_FILTER]" = "gas filter", \
"[PIPE_GAS_MIXER]" = "gas mixer", \
)
//fix_pipe_type()
name = nlist["[pipe_type][is_bent ? "_b" : ""]"] + " fitting"
icon_state = GLOB.pipeID2State["[pipe_type]"]
// rotate the pipe item clockwise
/obj/item/pipe/verb/rotate()
set category = "Object"
set name = "Rotate Pipe"
set src in view(1)
if ( usr.stat || usr.restrained() || !usr.canmove )
return
src.setDir(turn(src.dir, -90))
fixdir()
return
/obj/item/pipe/verb/flip()
set category = "Object"
set name = "Flip Pipe"
set src in view(1)
if ( usr.stat || usr.restrained() || !usr.canmove )
return
if (pipe_type in list(PIPE_GAS_FILTER, PIPE_GAS_MIXER))
src.setDir(turn(src.dir, flipped )? 45 : -45)
flipped = !flipped
return
src.setDir(turn(src.dir, -180))
fixdir()
return
/obj/item/pipe/AltClick(mob/user)
..()
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(!in_range(src, user))
return
else
rotate()
/obj/item/pipe/Move()
var/old_dir = dir
..()
setDir(old_dir )//pipes changing direction when moved is just annoying and buggy
/obj/item/pipe/proc/unflip(direction)
if(direction in GLOB.diagonals)
return turn(direction, 45)
return direction
//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(dir==SOUTH)
setDir(NORTH)
else if(dir==WEST)
setDir(EAST)
/obj/item/pipe/attack_self(mob/user)
return rotate()
/obj/item/pipe/attackby(obj/item/weapon/W, mob/user, params)
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if (!isturf(src.loc))
return 1
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()
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
continue
if(M.GetInitDirections() & A.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
// no conflicts found
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)
playsound(src.loc, W.usesound, 50, 1)
user.visible_message( \
"[user] fastens \the [src].", \
"<span class='notice'>You fasten \the [src].</span>", \
"<span class='italics'>You hear ratchet.</span>")
qdel(src)
/obj/item/pipe/suicide_act(mob/user)
if(pipe_type in list(PIPE_PUMP, PIPE_PASSIVE_GATE, PIPE_VOLUME_PUMP))
user.visible_message("<span class='suicide'>[user] shoves the [src] in [user.p_their()] mouth and turns it on! It looks like [user.p_theyre()] trying to commit suicide!</span>")
if(iscarbon(user))
var/mob/living/carbon/C = user
for(var/i=1 to 20)
C.vomit(0, TRUE, FALSE, 4, FALSE)
if(prob(20))
C.spew_organ()
sleep(5)
C.blood_volume = 0
return(OXYLOSS|BRUTELOSS)
else
return ..()
/obj/item/pipe_meter
name = "meter"
desc = "A meter that can be laid on pipes"
icon = 'icons/obj/atmospherics/pipes/pipe_item.dmi'
icon_state = "meter"
item_state = "buildpipe"
w_class = WEIGHT_CLASS_BULKY
/obj/item/pipe_meter/attackby(obj/item/weapon/W, mob/user, params)
..()
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if(!locate(/obj/machinery/atmospherics/pipe, src.loc))
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)
to_chat(user, "<span class='notice'>You fasten the meter to the pipe.</span>")
qdel(src)
sleep(5)
C.blood_volume = 0
return(OXYLOSS|BRUTELOSS)
else
return ..()
/obj/item/pipe_meter
name = "meter"
desc = "A meter that can be laid on pipes"
icon = 'icons/obj/atmospherics/pipes/pipe_item.dmi'
icon_state = "meter"
item_state = "buildpipe"
w_class = WEIGHT_CLASS_BULKY
/obj/item/pipe_meter/attackby(obj/item/weapon/W, mob/user, params)
..()
if (!istype(W, /obj/item/weapon/wrench))
return ..()
if(!locate(/obj/machinery/atmospherics/pipe, src.loc))
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)
to_chat(user, "<span class='notice'>You fasten the meter to the pipe.</span>")
qdel(src)
+231 -231
View File
@@ -1,239 +1,239 @@
/obj/machinery/pipedispenser
name = "pipe dispenser"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "pipe_d"
density = 1
anchored = 1
var/wait = 0
/obj/machinery/pipedispenser/attack_paw(mob/user)
return src.attack_hand(user)
/obj/machinery/pipedispenser/attack_hand(mob/user)
if(..())
return 1
var/dat = {"
<b>Regular 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_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>
<b>Devices:</b><BR>
<A href='?src=\ref[src];make=[PIPE_CONNECTOR];dir=1'>Connector</A><BR>
<A href='?src=\ref[src];make=[PIPE_UVENT];dir=1'>Vent</A><BR>
<A href='?src=\ref[src];make=[PIPE_PUMP];dir=1'>Gas Pump</A><BR>
<A href='?src=\ref[src];make=[PIPE_PASSIVE_GATE];dir=1'>Passive Gate</A><BR>
<A href='?src=\ref[src];make=[PIPE_VOLUME_PUMP];dir=1'>Volume Pump</A><BR>
<A href='?src=\ref[src];make=[PIPE_SCRUBBER];dir=1'>Scrubber</A><BR>
<A href='?src=\ref[src];makemeter=1'>Meter</A><BR>
<A href='?src=\ref[src];make=[PIPE_GAS_FILTER];dir=1'>Gas Filter</A><BR>
<A href='?src=\ref[src];make=[PIPE_GAS_MIXER];dir=1'>Gas Mixer</A><BR>
<b>Heat exchange:</b><BR>
<A href='?src=\ref[src];make=[PIPE_HE];dir=1'>Pipe</A><BR>
<A href='?src=\ref[src];make=[PIPE_HE];dir=5'>Bent Pipe</A><BR>
<A href='?src=\ref[src];make=[PIPE_HE_MANIFOLD];dir=1'>Manifold</A><BR>
<A href='?src=\ref[src];make=[PIPE_HE_4WAYMANIFOLD];dir=1'>4-Way Manifold</A><BR>
<A href='?src=\ref[src];make=[PIPE_JUNCTION];dir=1'>Junction</A><BR>
<A href='?src=\ref[src];make=[PIPE_HEAT_EXCHANGE];dir=1'>Heat Exchanger</A><BR>
"}
user << browse("<HEAD><TITLE>[src]</TITLE></HEAD><TT>[dat]</TT>", "window=pipedispenser")
onclose(user, "pipedispenser")
return
/obj/machinery/pipedispenser/Topic(href, href_list)
if(..())
return 1
if(!anchored|| !usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
usr << browse(null, "window=pipedispenser")
return 1
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["make"])
/obj/machinery/pipedispenser
name = "pipe dispenser"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "pipe_d"
density = 1
anchored = 1
var/wait = 0
/obj/machinery/pipedispenser/attack_paw(mob/user)
return src.attack_hand(user)
/obj/machinery/pipedispenser/attack_hand(mob/user)
if(..())
return 1
var/dat = {"
<b>Regular 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_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>
<b>Devices:</b><BR>
<A href='?src=\ref[src];make=[PIPE_CONNECTOR];dir=1'>Connector</A><BR>
<A href='?src=\ref[src];make=[PIPE_UVENT];dir=1'>Vent</A><BR>
<A href='?src=\ref[src];make=[PIPE_PUMP];dir=1'>Gas Pump</A><BR>
<A href='?src=\ref[src];make=[PIPE_PASSIVE_GATE];dir=1'>Passive Gate</A><BR>
<A href='?src=\ref[src];make=[PIPE_VOLUME_PUMP];dir=1'>Volume Pump</A><BR>
<A href='?src=\ref[src];make=[PIPE_SCRUBBER];dir=1'>Scrubber</A><BR>
<A href='?src=\ref[src];makemeter=1'>Meter</A><BR>
<A href='?src=\ref[src];make=[PIPE_GAS_FILTER];dir=1'>Gas Filter</A><BR>
<A href='?src=\ref[src];make=[PIPE_GAS_MIXER];dir=1'>Gas Mixer</A><BR>
<b>Heat exchange:</b><BR>
<A href='?src=\ref[src];make=[PIPE_HE];dir=1'>Pipe</A><BR>
<A href='?src=\ref[src];make=[PIPE_HE];dir=5'>Bent Pipe</A><BR>
<A href='?src=\ref[src];make=[PIPE_HE_MANIFOLD];dir=1'>Manifold</A><BR>
<A href='?src=\ref[src];make=[PIPE_HE_4WAYMANIFOLD];dir=1'>4-Way Manifold</A><BR>
<A href='?src=\ref[src];make=[PIPE_JUNCTION];dir=1'>Junction</A><BR>
<A href='?src=\ref[src];make=[PIPE_HEAT_EXCHANGE];dir=1'>Heat Exchanger</A><BR>
"}
user << browse("<HEAD><TITLE>[src]</TITLE></HEAD><TT>[dat]</TT>", "window=pipedispenser")
onclose(user, "pipedispenser")
return
/obj/machinery/pipedispenser/Topic(href, href_list)
if(..())
return 1
if(!anchored|| !usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
usr << browse(null, "window=pipedispenser")
return 1
usr.set_machine(src)
src.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)
P.add_fingerprint(usr)
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)
P.add_fingerprint(usr)
wait = world.time + 10
if(href_list["makemeter"])
if(href_list["makemeter"])
if(wait < world.time )
new /obj/item/pipe_meter(src.loc)
new /obj/item/pipe_meter(src.loc)
wait = world.time + 15
return
/obj/machinery/pipedispenser/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
if (istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter))
to_chat(usr, "<span class='notice'>You put [W] back into [src].</span>")
if(!user.drop_item())
return
qdel(W)
return
else if (istype(W, /obj/item/weapon/wrench))
if (!anchored && !isinspace())
playsound(src.loc, 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)
user.visible_message( \
"[user] fastens \the [src].", \
"<span class='notice'>You fasten \the [src]. Now it can dispense pipes.</span>", \
"<span class='italics'>You hear ratchet.</span>")
anchored = 1
stat &= MAINT
if (usr.machine==src)
usr << browse(null, "window=pipedispenser")
else if(anchored)
playsound(src.loc, 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)
user.visible_message( \
"[user] unfastens \the [src].", \
"<span class='notice'>You unfasten \the [src]. Now it can be pulled somewhere else.</span>", \
"<span class='italics'>You hear ratchet.</span>")
anchored = 0
stat |= ~MAINT
power_change()
else
return ..()
/obj/machinery/pipedispenser/disposal
name = "disposal pipe dispenser"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "pipe_d"
density = 1
anchored = 1
/*
//Allow you to push disposal pipes into it (for those with density 1)
/obj/machinery/pipedispenser/disposal/Crossed(var/obj/structure/disposalconstruct/pipe as obj)
if(istype(pipe) && !pipe.anchored)
qdel(pipe)
Nah
*/
//Allow you to drag-drop disposal pipes and transit tubes into it
/obj/machinery/pipedispenser/disposal/MouseDrop_T(obj/structure/pipe, mob/usr)
if(!usr.canmove || usr.stat || usr.restrained())
return
if (!istype(pipe, /obj/structure/disposalconstruct) && !istype(pipe, /obj/structure/c_transit_tube) && !istype(pipe, /obj/structure/c_transit_tube_pod))
return
if (get_dist(usr, src) > 1 || get_dist(src,pipe) > 1 )
return
if (pipe.anchored)
return
qdel(pipe)
/obj/machinery/pipedispenser/disposal/attack_hand(mob/user)
if(..())
return 1
var/dat = {"<b>Disposal Pipes</b><br><br>
<A href='?src=\ref[src];dmake=[DISP_PIPE_STRAIGHT]'>Pipe</A><BR>
<A href='?src=\ref[src];dmake=[DISP_PIPE_BENT]'>Bent Pipe</A><BR>
<A href='?src=\ref[src];dmake=[DISP_JUNCTION]'>Junction</A><BR>
<A href='?src=\ref[src];dmake=[DISP_YJUNCTION]'>Y-Junction</A><BR>
<A href='?src=\ref[src];dmake=[DISP_END_TRUNK]'>Trunk</A><BR>
<A href='?src=\ref[src];dmake=[DISP_END_BIN]'>Bin</A><BR>
<A href='?src=\ref[src];dmake=[DISP_END_OUTLET]'>Outlet</A><BR>
<A href='?src=\ref[src];dmake=[DISP_END_CHUTE]'>Chute</A><BR>
<A href='?src=\ref[src];dmake=[DISP_SORTJUNCTION]'>Sort Junction</A><BR>
"}
user << browse("<HEAD><TITLE>[src]</TITLE></HEAD><TT>[dat]</TT>", "window=pipedispenser")
return
/obj/machinery/pipedispenser/disposal/Topic(href, href_list)
if(..())
return 1
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["dmake"])
return
/obj/machinery/pipedispenser/attackby(obj/item/W, mob/user, params)
add_fingerprint(user)
if (istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter))
to_chat(usr, "<span class='notice'>You put [W] back into [src].</span>")
if(!user.drop_item())
return
qdel(W)
return
else if (istype(W, /obj/item/weapon/wrench))
if (!anchored && !isinspace())
playsound(src.loc, 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)
user.visible_message( \
"[user] fastens \the [src].", \
"<span class='notice'>You fasten \the [src]. Now it can dispense pipes.</span>", \
"<span class='italics'>You hear ratchet.</span>")
anchored = 1
stat &= MAINT
if (usr.machine==src)
usr << browse(null, "window=pipedispenser")
else if(anchored)
playsound(src.loc, 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)
user.visible_message( \
"[user] unfastens \the [src].", \
"<span class='notice'>You unfasten \the [src]. Now it can be pulled somewhere else.</span>", \
"<span class='italics'>You hear ratchet.</span>")
anchored = 0
stat |= ~MAINT
power_change()
else
return ..()
/obj/machinery/pipedispenser/disposal
name = "disposal pipe dispenser"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "pipe_d"
density = 1
anchored = 1
/*
//Allow you to push disposal pipes into it (for those with density 1)
/obj/machinery/pipedispenser/disposal/Crossed(var/obj/structure/disposalconstruct/pipe as obj)
if(istype(pipe) && !pipe.anchored)
qdel(pipe)
Nah
*/
//Allow you to drag-drop disposal pipes and transit tubes into it
/obj/machinery/pipedispenser/disposal/MouseDrop_T(obj/structure/pipe, mob/usr)
if(!usr.canmove || usr.stat || usr.restrained())
return
if (!istype(pipe, /obj/structure/disposalconstruct) && !istype(pipe, /obj/structure/c_transit_tube) && !istype(pipe, /obj/structure/c_transit_tube_pod))
return
if (get_dist(usr, src) > 1 || get_dist(src,pipe) > 1 )
return
if (pipe.anchored)
return
qdel(pipe)
/obj/machinery/pipedispenser/disposal/attack_hand(mob/user)
if(..())
return 1
var/dat = {"<b>Disposal Pipes</b><br><br>
<A href='?src=\ref[src];dmake=[DISP_PIPE_STRAIGHT]'>Pipe</A><BR>
<A href='?src=\ref[src];dmake=[DISP_PIPE_BENT]'>Bent Pipe</A><BR>
<A href='?src=\ref[src];dmake=[DISP_JUNCTION]'>Junction</A><BR>
<A href='?src=\ref[src];dmake=[DISP_YJUNCTION]'>Y-Junction</A><BR>
<A href='?src=\ref[src];dmake=[DISP_END_TRUNK]'>Trunk</A><BR>
<A href='?src=\ref[src];dmake=[DISP_END_BIN]'>Bin</A><BR>
<A href='?src=\ref[src];dmake=[DISP_END_OUTLET]'>Outlet</A><BR>
<A href='?src=\ref[src];dmake=[DISP_END_CHUTE]'>Chute</A><BR>
<A href='?src=\ref[src];dmake=[DISP_SORTJUNCTION]'>Sort Junction</A><BR>
"}
user << browse("<HEAD><TITLE>[src]</TITLE></HEAD><TT>[dat]</TT>", "window=pipedispenser")
return
/obj/machinery/pipedispenser/disposal/Topic(href, href_list)
if(..())
return 1
usr.set_machine(src)
src.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)
if(!C.can_place())
to_chat(usr, "<span class='warning'>There's not enough room to build that here!</span>")
qdel(C)
return
C.add_fingerprint(usr)
C.update_icon()
var/p_type = text2num(href_list["dmake"])
var/obj/structure/disposalconstruct/C = new (src.loc,p_type)
if(!C.can_place())
to_chat(usr, "<span class='warning'>There's not enough room to build that here!</span>")
qdel(C)
return
C.add_fingerprint(usr)
C.update_icon()
wait = world.time + 15
return
//transit tube dispenser
//inherit disposal for the dragging proc
/obj/machinery/pipedispenser/disposal/transit_tube
name = "transit tube dispenser"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "pipe_d"
density = 1
anchored = 1
/obj/machinery/pipedispenser/disposal/transit_tube/attack_hand(mob/user)
if(..())
return 1
var/dat = {"<B>Transit Tubes:</B><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_STRAIGHT]'>Straight Tube</A><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_STRAIGHT_CROSSING]'>Straight Tube with Crossing</A><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_CURVED]'>Curved Tube</A><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_DIAGONAL]'>Diagonal Tube</A><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_DIAGONAL_CROSSING]'>Diagonal Tube with Crossing</A><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_JUNCTION]'>Junction</A><BR>
<b>Station Equipment:</b><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_STATION]'>Through Tube Station</A><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_TERMINUS]'>Terminus Tube Station</A><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_POD]'>Transit Tube Pod</A><BR>
"}
user << browse("<HEAD><TITLE>[src]</TITLE></HEAD><TT>[dat]</TT>", "window=pipedispenser")
return
/obj/machinery/pipedispenser/disposal/transit_tube/Topic(href, href_list)
if(..())
return 1
usr.set_machine(src)
src.add_fingerprint(usr)
return
//transit tube dispenser
//inherit disposal for the dragging proc
/obj/machinery/pipedispenser/disposal/transit_tube
name = "transit tube dispenser"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "pipe_d"
density = 1
anchored = 1
/obj/machinery/pipedispenser/disposal/transit_tube/attack_hand(mob/user)
if(..())
return 1
var/dat = {"<B>Transit Tubes:</B><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_STRAIGHT]'>Straight Tube</A><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_STRAIGHT_CROSSING]'>Straight Tube with Crossing</A><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_CURVED]'>Curved Tube</A><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_DIAGONAL]'>Diagonal Tube</A><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_DIAGONAL_CROSSING]'>Diagonal Tube with Crossing</A><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_JUNCTION]'>Junction</A><BR>
<b>Station Equipment:</b><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_STATION]'>Through Tube Station</A><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_TERMINUS]'>Terminus Tube Station</A><BR>
<A href='?src=\ref[src];tube=[TRANSIT_TUBE_POD]'>Transit Tube Pod</A><BR>
"}
user << browse("<HEAD><TITLE>[src]</TITLE></HEAD><TT>[dat]</TT>", "window=pipedispenser")
return
/obj/machinery/pipedispenser/disposal/transit_tube/Topic(href, href_list)
if(..())
return 1
usr.set_machine(src)
src.add_fingerprint(usr)
if(wait < world.time)
if(href_list["tube"])
var/tube_type = text2num(href_list["tube"])
var/obj/structure/C
switch(tube_type)
if(TRANSIT_TUBE_STRAIGHT)
C = new /obj/structure/c_transit_tube(loc)
if(TRANSIT_TUBE_STRAIGHT_CROSSING)
C = new /obj/structure/c_transit_tube/crossing(loc)
if(TRANSIT_TUBE_CURVED)
C = new /obj/structure/c_transit_tube/curved(loc)
if(TRANSIT_TUBE_DIAGONAL)
C = new /obj/structure/c_transit_tube/diagonal(loc)
if(TRANSIT_TUBE_DIAGONAL_CROSSING)
C = new /obj/structure/c_transit_tube/diagonal/crossing(loc)
if(TRANSIT_TUBE_JUNCTION)
C = new /obj/structure/c_transit_tube/junction(loc)
if(TRANSIT_TUBE_STATION)
C = new /obj/structure/c_transit_tube/station(loc)
if(TRANSIT_TUBE_TERMINUS)
C = new /obj/structure/c_transit_tube/station/reverse(loc)
if(TRANSIT_TUBE_POD)
C = new /obj/structure/c_transit_tube_pod(loc)
if(C)
C.add_fingerprint(usr)
if(href_list["tube"])
var/tube_type = text2num(href_list["tube"])
var/obj/structure/C
switch(tube_type)
if(TRANSIT_TUBE_STRAIGHT)
C = new /obj/structure/c_transit_tube(loc)
if(TRANSIT_TUBE_STRAIGHT_CROSSING)
C = new /obj/structure/c_transit_tube/crossing(loc)
if(TRANSIT_TUBE_CURVED)
C = new /obj/structure/c_transit_tube/curved(loc)
if(TRANSIT_TUBE_DIAGONAL)
C = new /obj/structure/c_transit_tube/diagonal(loc)
if(TRANSIT_TUBE_DIAGONAL_CROSSING)
C = new /obj/structure/c_transit_tube/diagonal/crossing(loc)
if(TRANSIT_TUBE_JUNCTION)
C = new /obj/structure/c_transit_tube/junction(loc)
if(TRANSIT_TUBE_STATION)
C = new /obj/structure/c_transit_tube/station(loc)
if(TRANSIT_TUBE_TERMINUS)
C = new /obj/structure/c_transit_tube/station/reverse(loc)
if(TRANSIT_TUBE_POD)
C = new /obj/structure/c_transit_tube_pod(loc)
if(C)
C.add_fingerprint(usr)
wait = world.time + 15
return
return