mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Pipes bugfix:
- trowing pipes correctly rotates them; - meters unwrenching; - pipe dispenser can be unwrenched and pulled, wrench back to use; - unused pipes can be returned to dispenser; - Probably fixed bug with non-working connectors; Windows now are always shown above grilles. Pipes now are always shown above lattice. Some other things. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@830 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -196,5 +196,5 @@ obj/machinery/atmospherics/binary/pump
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/weapon/pipe(loc, make_from=src)
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
@@ -134,6 +134,8 @@
|
||||
if (connected_device)
|
||||
user << "\red You cannot unwrench this [src], dettach [connected_device] first."
|
||||
return 1
|
||||
if (locate(/obj/machinery/portable_atmospherics, src.loc))
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
@@ -151,5 +153,5 @@
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/weapon/pipe(loc, make_from=src)
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
@@ -274,5 +274,5 @@
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/weapon/pipe(loc, make_from=src)
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
@@ -213,5 +213,5 @@
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/weapon/pipe(loc, make_from=src)
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
@@ -131,7 +131,7 @@ obj/machinery/atmospherics/valve
|
||||
initialize()
|
||||
if(node1 && node2) return
|
||||
|
||||
var/connect_directions
|
||||
/* var/connect_directions
|
||||
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
@@ -162,7 +162,16 @@ obj/machinery/atmospherics/valve
|
||||
node2 = target
|
||||
break
|
||||
if(node1)
|
||||
break
|
||||
break*/
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node1 = target
|
||||
break
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,turn(dir,180)))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node2 = target
|
||||
break
|
||||
|
||||
build_network()
|
||||
if(!network_node1 && node1)
|
||||
@@ -283,5 +292,5 @@ obj/machinery/atmospherics/valve
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/weapon/pipe(loc, make_from=src)
|
||||
new /obj/item/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
@@ -155,6 +155,9 @@ obj/machinery/atmospherics/pipe
|
||||
proc/burst()
|
||||
src.visible_message("\red \bold [src] bursts!");
|
||||
playsound(src.loc, 'bang.ogg', 25, 1)
|
||||
var/datum/effects/system/harmless_smoke_spread/smoke = new
|
||||
smoke.set_up(1,0, src.loc, 0)
|
||||
smoke.start()
|
||||
del(src)
|
||||
|
||||
Del()
|
||||
@@ -187,35 +190,33 @@ obj/machinery/atmospherics/pipe
|
||||
//dir = node1_direction|node2_direction
|
||||
|
||||
else
|
||||
if(!node1&&!node2)
|
||||
del(src) //TODO: silent deleting looks weird
|
||||
var/have_node1 = node1?1:0
|
||||
var/have_node2 = node2?1:0
|
||||
icon_state = "exposed[have_node1][have_node2][invisibility ? "-f" : "" ]"
|
||||
|
||||
if(!node1&&!node2)
|
||||
del(src)
|
||||
|
||||
initialize()
|
||||
var/connect_directions = initialize_directions
|
||||
for(var/direction in cardinal)
|
||||
if(direction&connect_directions)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,direction))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node1 = target
|
||||
connect_directions &= ~direction
|
||||
break
|
||||
if (node1)
|
||||
break
|
||||
|
||||
var/node1_dir
|
||||
var/node2_dir
|
||||
|
||||
for(var/direction in cardinal)
|
||||
if(direction&connect_directions)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,direction))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node2 = target
|
||||
connect_directions &= ~direction
|
||||
break
|
||||
if(node2)
|
||||
break
|
||||
if(direction&initialize_directions)
|
||||
if (!node1_dir)
|
||||
node1_dir = direction
|
||||
else if (!node2_dir)
|
||||
node2_dir = direction
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node1 = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node2_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node2 = target
|
||||
break
|
||||
|
||||
|
||||
var/turf/T = src.loc // hide if turf is not intact
|
||||
hide(T.intact)
|
||||
@@ -268,16 +269,14 @@ obj/machinery/atmospherics/pipe
|
||||
del(src)
|
||||
|
||||
initialize()
|
||||
if(!node1)
|
||||
for(var/obj/machinery/atmospherics/pipe/simple/target in get_step(src,initialize_directions))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node1 = target
|
||||
break
|
||||
if(!node2)
|
||||
for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,initialize_directions_he))
|
||||
if(target.initialize_directions_he & get_dir(target,src))
|
||||
node2 = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,initialize_directions))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node1 = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,initialize_directions_he))
|
||||
if(target.initialize_directions_he & get_dir(target,src))
|
||||
node2 = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
|
||||
@@ -291,26 +290,25 @@ obj/machinery/atmospherics/pipe
|
||||
thermal_conductivity = WINDOW_HEAT_TRANSFER_COEFFICIENT
|
||||
|
||||
initialize()
|
||||
var/connect_directions = initialize_directions_he
|
||||
for(var/direction in cardinal)
|
||||
if(direction&connect_directions)
|
||||
for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,direction))
|
||||
if(target.initialize_directions_he & get_dir(target,src))
|
||||
node1 = target
|
||||
connect_directions &= ~direction
|
||||
break
|
||||
if (node1)
|
||||
break
|
||||
var/node1_dir
|
||||
var/node2_dir
|
||||
|
||||
for(var/direction in cardinal)
|
||||
if(direction&connect_directions)
|
||||
for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,direction))
|
||||
if(target.initialize_directions_he & get_dir(target,src))
|
||||
node2 = target
|
||||
connect_directions &= ~direction
|
||||
break
|
||||
if (node2)
|
||||
break
|
||||
if(direction&initialize_directions_he)
|
||||
if (!node1_dir)
|
||||
node1_dir = direction
|
||||
else if (!node2_dir)
|
||||
node2_dir = direction
|
||||
|
||||
for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,node1_dir))
|
||||
if(target.initialize_directions_he & get_dir(target,src))
|
||||
node1 = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,node2_dir))
|
||||
if(target.initialize_directions_he & get_dir(target,src))
|
||||
node2 = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
|
||||
|
||||
@@ -711,9 +709,9 @@ obj/machinery/atmospherics/pipe
|
||||
update_icon()
|
||||
|
||||
obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (istype(W, /obj/machinery/atmospherics/pipe/tank))
|
||||
if (istype(src, /obj/machinery/atmospherics/pipe/tank))
|
||||
return ..()
|
||||
if (istype(W, /obj/machinery/atmospherics/pipe/vent))
|
||||
if (istype(src, /obj/machinery/atmospherics/pipe/vent))
|
||||
return ..()
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
@@ -734,5 +732,9 @@ obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/u
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/weapon/pipe(loc, make_from=src)
|
||||
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)
|
||||
del(meter)
|
||||
del(src)
|
||||
@@ -172,6 +172,7 @@
|
||||
anchored = 1.0
|
||||
flags = FPRINT | CONDUCT
|
||||
pressure_resistance = 5*ONE_ATMOSPHERE
|
||||
layer = 2.9
|
||||
|
||||
/obj/securearea
|
||||
desc = "A warning sign which reads 'SECURE AREA'"
|
||||
@@ -467,7 +468,7 @@
|
||||
icon_state = "lattice"
|
||||
density = 0
|
||||
anchored = 1.0
|
||||
layer = 2.5
|
||||
layer = 2.3 //under pipes
|
||||
// flags = 64.0
|
||||
|
||||
/obj/list_container
|
||||
|
||||
@@ -88,3 +88,16 @@
|
||||
|
||||
usr << t
|
||||
return
|
||||
|
||||
/obj/machinery/meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
playsound(src.loc, 'Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src]..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src].", \
|
||||
"You hear ratchet.")
|
||||
new /obj/item/pipe_meter(src.loc)
|
||||
del(src)
|
||||
@@ -54,6 +54,7 @@
|
||||
var/datum/pipe_network/network = connected_port.return_network(src)
|
||||
if(network && !network.gases.Find(air_contents))
|
||||
network.gases += air_contents
|
||||
network.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ Buildable meters
|
||||
#define PIPE_INSULATED_STRAIGHT 11
|
||||
#define PIPE_INSULATED_BENT 12
|
||||
|
||||
/obj/item/weapon/pipe
|
||||
/obj/item/pipe
|
||||
name = "pipe"
|
||||
desc = "A pipe"
|
||||
var/pipe_type = 0
|
||||
@@ -28,8 +28,8 @@ Buildable meters
|
||||
flags = TABLEPASS|FPRINT
|
||||
w_class = 4
|
||||
level = 2
|
||||
//TODO: список номер_типа -> тип
|
||||
/obj/item/weapon/pipe/New(var/loc, var/pipe_type as num, var/dir as num, var/obj/machinery/atmospherics/make_from = null)
|
||||
|
||||
/obj/item/pipe/New(var/loc, var/pipe_type as num, var/dir as num, var/obj/machinery/atmospherics/make_from = null)
|
||||
..()
|
||||
if (make_from)
|
||||
src.dir = make_from.dir
|
||||
@@ -43,6 +43,8 @@ Buildable meters
|
||||
src.pipe_type = PIPE_JUNCTION
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/heat_exchanging))
|
||||
src.pipe_type = PIPE_HE_STRAIGHT + is_bent
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/insulated))
|
||||
src.pipe_type = PIPE_INSULATED_STRAIGHT + is_bent
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple))
|
||||
src.pipe_type = PIPE_SIMPLE_STRAIGHT + is_bent
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/portables_connector))
|
||||
@@ -57,19 +59,17 @@ Buildable meters
|
||||
src.pipe_type = PIPE_PUMP
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/unary/vent_scrubber))
|
||||
src.pipe_type = PIPE_SCRUBBER
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/insulated))
|
||||
src.pipe_type = PIPE_INSULATED_STRAIGHT + is_bent
|
||||
if (is_bent)
|
||||
src.dir = make_from.initialize_directions //workaround. Bent pipes with one node==null have cardinal direction. - rastaf0
|
||||
else
|
||||
src.pipe_type = pipe_type
|
||||
src.dir = dir
|
||||
//src.pipe_dir = get_pipe_dir()
|
||||
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
|
||||
|
||||
/obj/item/weapon/pipe/proc/update()
|
||||
/obj/item/pipe/proc/update()
|
||||
var/list/nlist = list( \
|
||||
"pipe", \
|
||||
"bent pipe", \
|
||||
@@ -102,31 +102,13 @@ Buildable meters
|
||||
"insulated", \
|
||||
)
|
||||
icon_state = islist[pipe_type + 1]
|
||||
updateicon()
|
||||
|
||||
//update the icon of the item
|
||||
|
||||
/obj/item/weapon/pipe/proc/updateicon()
|
||||
if(invisibility) // true if placed under floor
|
||||
icon -= rgb(0,0,0,128) // fade the icon
|
||||
else
|
||||
icon = initial(icon) // otherwise reset to inital icon
|
||||
|
||||
// called to hide or unhide a pipe
|
||||
// i=true if hiding
|
||||
|
||||
/obj/item/weapon/pipe/hide(var/i)
|
||||
|
||||
invisibility = i ? 101 : 0 // make hidden pipe items invisible
|
||||
updateicon()
|
||||
|
||||
|
||||
//called when a turf is attacked with a pipe item
|
||||
// place the pipe on the turf, setting pipe level to 1 (underfloor) if the turf is not intact
|
||||
|
||||
// rotate the pipe item clockwise
|
||||
|
||||
/obj/item/weapon/pipe/verb/rotate()
|
||||
/obj/item/pipe/verb/rotate()
|
||||
set name = "Rotate Pipe"
|
||||
set src in view(1)
|
||||
|
||||
@@ -134,18 +116,30 @@ Buildable meters
|
||||
return
|
||||
|
||||
src.dir = turn(src.dir, -90)
|
||||
|
||||
if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
|
||||
if(dir==2)
|
||||
dir = 1
|
||||
else if(dir==8)
|
||||
dir = 4
|
||||
//src.pipe_dir = get_pipe_dir()
|
||||
return
|
||||
|
||||
/obj/item/weapon/pipe/Move()
|
||||
var/dir = src.dir
|
||||
/obj/item/pipe/Move()
|
||||
..()
|
||||
src.dir = dir
|
||||
if ((pipe_type in list (PIPE_SIMPLE_BENT, PIPE_HE_BENT, PIPE_INSULATED_BENT)) \
|
||||
&& (src.dir in cardinal))
|
||||
src.dir = src.dir|turn(src.dir, 90)
|
||||
else if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
|
||||
if(dir==2)
|
||||
dir = 1
|
||||
else if(dir==8)
|
||||
dir = 4
|
||||
return
|
||||
|
||||
// returns all pipe's endpoints
|
||||
|
||||
/obj/item/weapon/pipe/proc/get_pipe_dir()
|
||||
/obj/item/pipe/proc/get_pipe_dir()
|
||||
if (!dir)
|
||||
return 0
|
||||
var/flip = turn(dir, 180)
|
||||
@@ -169,7 +163,7 @@ Buildable meters
|
||||
return flip|cw|acw
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/pipe/proc/get_pdir() //endpoints for regular pipes
|
||||
/obj/item/pipe/proc/get_pdir() //endpoints for regular pipes
|
||||
|
||||
var/flip = turn(dir, 180)
|
||||
// var/cw = turn(dir, -90)
|
||||
@@ -186,7 +180,7 @@ Buildable meters
|
||||
|
||||
// return the h_dir (heat-exchange pipes) from the type and the dir
|
||||
|
||||
/obj/item/weapon/pipe/proc/get_hdir() //endpoints for h/e pipes
|
||||
/obj/item/pipe/proc/get_hdir() //endpoints for h/e pipes
|
||||
|
||||
// var/flip = turn(dir, 180)
|
||||
// var/cw = turn(dir, -90)
|
||||
@@ -201,15 +195,20 @@ Buildable meters
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/pipe/attack_self(mob/user as mob)
|
||||
/obj/item/pipe/attack_self(mob/user as mob)
|
||||
return rotate()
|
||||
|
||||
/obj/item/weapon/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
/obj/item/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
//*
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!isturf(src.loc))
|
||||
return 1
|
||||
if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
|
||||
if(dir==2)
|
||||
dir = 1
|
||||
else if(dir==8)
|
||||
dir = 4
|
||||
var/pipe_dir = get_pipe_dir()
|
||||
|
||||
for(var/obj/machinery/atmospherics/M in src.loc)
|
||||
@@ -264,6 +263,8 @@ Buildable meters
|
||||
C.initialize_directions = pipe_dir
|
||||
if (pipename)
|
||||
C.name = pipename
|
||||
var/turf/T = C.loc
|
||||
C.level = T.intact ? 2 : 1
|
||||
C.initialize()
|
||||
C.build_network()
|
||||
if (C.node)
|
||||
@@ -311,20 +312,15 @@ Buildable meters
|
||||
if (P.node2)
|
||||
P.node2.initialize()
|
||||
P.node2.build_network()
|
||||
/*
|
||||
if(6) //junctions
|
||||
var/obj/machinery/junction/J = new( src.loc )
|
||||
J.dir = dir
|
||||
J.p_dir = src.get_pdir()
|
||||
J.h_dir = src.get_hdir()
|
||||
J.level = 2
|
||||
*/
|
||||
|
||||
if(PIPE_UVENT) //unary vent
|
||||
var/obj/machinery/atmospherics/unary/vent_pump/V = new( src.loc )
|
||||
V.dir = dir
|
||||
V.initialize_directions = pipe_dir
|
||||
if (pipename)
|
||||
V.name = pipename
|
||||
var/turf/T = V.loc
|
||||
V.level = T.intact ? 2 : 1
|
||||
V.initialize()
|
||||
V.build_network()
|
||||
if (V.node)
|
||||
@@ -338,6 +334,8 @@ Buildable meters
|
||||
V.initialize_directions = pipe_dir
|
||||
if (pipename)
|
||||
V.name = pipename
|
||||
var/turf/T = V.loc
|
||||
V.level = T.intact ? 2 : 1
|
||||
V.initialize()
|
||||
V.build_network()
|
||||
if (V.node1)
|
||||
@@ -355,6 +353,8 @@ Buildable meters
|
||||
P.initialize_directions = pipe_dir
|
||||
if (pipename)
|
||||
P.name = pipename
|
||||
var/turf/T = P.loc
|
||||
P.level = T.intact ? 2 : 1
|
||||
P.initialize()
|
||||
P.build_network()
|
||||
if (P.node1)
|
||||
@@ -371,6 +371,8 @@ Buildable meters
|
||||
S.initialize_directions = pipe_dir
|
||||
if (pipename)
|
||||
S.name = pipename
|
||||
var/turf/T = S.loc
|
||||
S.level = T.intact ? 2 : 1
|
||||
S.initialize()
|
||||
S.build_network()
|
||||
if (S.node)
|
||||
@@ -397,8 +399,8 @@ Buildable meters
|
||||
|
||||
playsound(src.loc, 'Ratchet.ogg', 50, 1)
|
||||
user.visible_message( \
|
||||
"[user] fastens the pipe.", \
|
||||
"\blue You have fastened the pipe.", \
|
||||
"[user] fastens the [src].", \
|
||||
"\blue You have fastened the [src].", \
|
||||
"You hear ratchet.")
|
||||
del(src) // remove the pipe item
|
||||
|
||||
@@ -409,7 +411,7 @@ Buildable meters
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/pipe_meter
|
||||
/obj/item/pipe_meter
|
||||
name = "meter"
|
||||
desc = "A meter that can be laid on pipes"
|
||||
icon = 'pipe-item.dmi'
|
||||
@@ -418,7 +420,7 @@ Buildable meters
|
||||
flags = TABLEPASS|FPRINT
|
||||
w_class = 4
|
||||
|
||||
/obj/item/weapon/pipe_meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
/obj/item/pipe_meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "autolathe"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
anchored = 1
|
||||
var/unwrenched = 0
|
||||
|
||||
/obj/machinery/pipedispenser/attack_paw(user as mob)
|
||||
return src.attack_hand(user)
|
||||
@@ -15,10 +16,11 @@
|
||||
<b>Regular pipes:</b><BR>
|
||||
<A href='?src=\ref[src];make=0;dir=1'>Pipe</A><BR>
|
||||
<A href='?src=\ref[src];make=1;dir=5'>Bent Pipe</A><BR>
|
||||
<A href='?src=\ref[src];make=4;dir=1'>Connector</A><BR>
|
||||
<A href='?src=\ref[src];make=5;dir=1'>Manifold</A><BR>
|
||||
<A href='?src=\ref[src];make=7;dir=1'>Unary Vent</A><BR>
|
||||
<A href='?src=\ref[src];make=8;dir=1'>Manual Valve</A><BR>
|
||||
<b>Devices:</b><BR>
|
||||
<A href='?src=\ref[src];make=4;dir=1'>Connector</A><BR>
|
||||
<A href='?src=\ref[src];make=7;dir=1'>Unary Vent</A><BR>
|
||||
<A href='?src=\ref[src];make=9;dir=1'>Gas Pump</A><BR>
|
||||
<A href='?src=\ref[src];make=10;dir=1'>Scrubber</A><BR>
|
||||
<A href='?src=\ref[src];makemeter=1'>Meter</A><BR>
|
||||
@@ -39,23 +41,57 @@
|
||||
/obj/machinery/pipedispenser/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(unwrenched)
|
||||
usr << browse(null, "window=pipedispenser")
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["make"])
|
||||
var/p_type = text2num(href_list["make"])
|
||||
var/p_dir = text2num(href_list["dir"])
|
||||
var/obj/item/weapon/pipe/P = new (usr.loc, pipe_type=p_type, dir=p_dir)
|
||||
var/obj/item/pipe/P = new (/*usr.loc*/ src.loc, pipe_type=p_type, dir=p_dir)
|
||||
P.update()
|
||||
if(href_list["makemeter"])
|
||||
new /obj/item/weapon/pipe_meter(usr.loc)
|
||||
new /obj/item/pipe_meter(/*usr.loc*/ src.loc)
|
||||
|
||||
/* for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)*/
|
||||
return
|
||||
|
||||
/obj/machinery/pipedispenser/New()
|
||||
..()
|
||||
/obj/machinery/pipedispenser/attackby(var/obj/item/W as obj, var/mob/user as mob)
|
||||
if (istype(W, /obj/item/pipe) || istype(W, /obj/item/pipe_meter))
|
||||
usr << "\blue You put [W] back to [src]."
|
||||
del(W)
|
||||
return
|
||||
else if (istype(W, /obj/item/weapon/wrench))
|
||||
if (unwrenched==0)
|
||||
playsound(src.loc, 'Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to unfasten \the [src] from the floor..."
|
||||
if (do_after(user, 40))
|
||||
user.visible_message( \
|
||||
"[user] unfastens \the [src].", \
|
||||
"\blue You have unfastened \the [src]. Now it can be pulled somewhere else.", \
|
||||
"You hear ratchet.")
|
||||
src.anchored = 0
|
||||
src.stat |= MAINT
|
||||
src.unwrenched = 1
|
||||
if (usr.machine==src)
|
||||
usr << browse(null, "window=pipedispenser")
|
||||
else /*if (unwrenched==1)*/
|
||||
playsound(src.loc, 'Ratchet.ogg', 50, 1)
|
||||
user << "\blue You begin to fasten \the [src] to the floor..."
|
||||
if (do_after(user, 20))
|
||||
user.visible_message( \
|
||||
"[user] fastens \the [src].", \
|
||||
"\blue You have fastened \the [src]. Now it can dispense pipes.", \
|
||||
"You hear ratchet.")
|
||||
src.anchored = 1
|
||||
src.stat &= ~MAINT
|
||||
src.unwrenched = 0
|
||||
power_change()
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/machinery/pipedispenser/disposal
|
||||
|
||||
@@ -57,6 +57,7 @@ However people seem to like it for some reason.
|
||||
icon_state = "Singularity"
|
||||
anchored = 1
|
||||
density = 1
|
||||
layer = 6
|
||||
unacidable = 1 //Don't comment this out.
|
||||
var/active = 0
|
||||
var/energy = 10
|
||||
@@ -770,6 +771,8 @@ However people seem to like it for some reason.
|
||||
|
||||
/obj/machinery/power/collector_array/proc/eject()
|
||||
var/obj/item/weapon/tank/plasma/Z = src.P
|
||||
if (!Z)
|
||||
return
|
||||
Z.loc = get_turf(src)
|
||||
Z.layer = initial(Z.layer)
|
||||
src.P = null
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
var/area/A = get_area()
|
||||
var/text = {"<HTML><head><title>[src]</title></head><BODY>
|
||||
<h2>[station_name()] blueprints</h2>
|
||||
<small>Property of Nanotrasen. For heads of stuff only. Store in high-secure storage.</small><hr>
|
||||
<small>Property of Nanotrasen. For heads of staff only. Store in high-secure storage.</small><hr>
|
||||
"}
|
||||
switch (get_area_type())
|
||||
if (AREA_SPACE)
|
||||
@@ -193,8 +193,13 @@ move an amendment</a> to the drawing.</p>
|
||||
for(var/obj/machinery/door/window/D in T2)
|
||||
if(turn(dir,180) == D.dir)
|
||||
return BORDER_BETWEEN
|
||||
for (var/obj/machinery/door/M in T2)
|
||||
if (locate(/obj/machinery/door) in T2)
|
||||
return BORDER_2NDTILE
|
||||
if (locate(/obj/falsewall) in T2)
|
||||
return BORDER_2NDTILE
|
||||
if (locate(/obj/falserwall) in T2)
|
||||
return BORDER_2NDTILE
|
||||
|
||||
return BORDER_NONE
|
||||
|
||||
/obj/item/blueprints/proc/detect_room(var/turf/first)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 4.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 833 B After Width: | Height: | Size: 2.8 KiB |
Reference in New Issue
Block a user