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].", \
|
"[user] unfastens \the [src].", \
|
||||||
"\blue You have unfastened \the [src].", \
|
"\blue You have unfastened \the [src].", \
|
||||||
"You hear ratchet.")
|
"You hear ratchet.")
|
||||||
new /obj/item/weapon/pipe(loc, make_from=src)
|
new /obj/item/pipe(loc, make_from=src)
|
||||||
del(src)
|
del(src)
|
||||||
|
|||||||
@@ -134,6 +134,8 @@
|
|||||||
if (connected_device)
|
if (connected_device)
|
||||||
user << "\red You cannot unwrench this [src], dettach [connected_device] first."
|
user << "\red You cannot unwrench this [src], dettach [connected_device] first."
|
||||||
return 1
|
return 1
|
||||||
|
if (locate(/obj/machinery/portable_atmospherics, src.loc))
|
||||||
|
return 1
|
||||||
var/turf/T = src.loc
|
var/turf/T = src.loc
|
||||||
if (level==1 && isturf(T) && T.intact)
|
if (level==1 && isturf(T) && T.intact)
|
||||||
user << "\red You must remove the plating first."
|
user << "\red You must remove the plating first."
|
||||||
@@ -151,5 +153,5 @@
|
|||||||
"[user] unfastens \the [src].", \
|
"[user] unfastens \the [src].", \
|
||||||
"\blue You have unfastened \the [src].", \
|
"\blue You have unfastened \the [src].", \
|
||||||
"You hear ratchet.")
|
"You hear ratchet.")
|
||||||
new /obj/item/weapon/pipe(loc, make_from=src)
|
new /obj/item/pipe(loc, make_from=src)
|
||||||
del(src)
|
del(src)
|
||||||
|
|||||||
@@ -274,5 +274,5 @@
|
|||||||
"[user] unfastens \the [src].", \
|
"[user] unfastens \the [src].", \
|
||||||
"\blue You have unfastened \the [src].", \
|
"\blue You have unfastened \the [src].", \
|
||||||
"You hear ratchet.")
|
"You hear ratchet.")
|
||||||
new /obj/item/weapon/pipe(loc, make_from=src)
|
new /obj/item/pipe(loc, make_from=src)
|
||||||
del(src)
|
del(src)
|
||||||
|
|||||||
@@ -213,5 +213,5 @@
|
|||||||
"[user] unfastens \the [src].", \
|
"[user] unfastens \the [src].", \
|
||||||
"\blue You have unfastened \the [src].", \
|
"\blue You have unfastened \the [src].", \
|
||||||
"You hear ratchet.")
|
"You hear ratchet.")
|
||||||
new /obj/item/weapon/pipe(loc, make_from=src)
|
new /obj/item/pipe(loc, make_from=src)
|
||||||
del(src)
|
del(src)
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ obj/machinery/atmospherics/valve
|
|||||||
initialize()
|
initialize()
|
||||||
if(node1 && node2) return
|
if(node1 && node2) return
|
||||||
|
|
||||||
var/connect_directions
|
/* var/connect_directions
|
||||||
|
|
||||||
switch(dir)
|
switch(dir)
|
||||||
if(NORTH)
|
if(NORTH)
|
||||||
@@ -162,7 +162,16 @@ obj/machinery/atmospherics/valve
|
|||||||
node2 = target
|
node2 = target
|
||||||
break
|
break
|
||||||
if(node1)
|
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()
|
build_network()
|
||||||
if(!network_node1 && node1)
|
if(!network_node1 && node1)
|
||||||
@@ -283,5 +292,5 @@ obj/machinery/atmospherics/valve
|
|||||||
"[user] unfastens \the [src].", \
|
"[user] unfastens \the [src].", \
|
||||||
"\blue You have unfastened \the [src].", \
|
"\blue You have unfastened \the [src].", \
|
||||||
"You hear ratchet.")
|
"You hear ratchet.")
|
||||||
new /obj/item/weapon/pipe(loc, make_from=src)
|
new /obj/item/pipe(loc, make_from=src)
|
||||||
del(src)
|
del(src)
|
||||||
|
|||||||
@@ -155,6 +155,9 @@ obj/machinery/atmospherics/pipe
|
|||||||
proc/burst()
|
proc/burst()
|
||||||
src.visible_message("\red \bold [src] bursts!");
|
src.visible_message("\red \bold [src] bursts!");
|
||||||
playsound(src.loc, 'bang.ogg', 25, 1)
|
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(src)
|
||||||
|
|
||||||
Del()
|
Del()
|
||||||
@@ -187,36 +190,34 @@ obj/machinery/atmospherics/pipe
|
|||||||
//dir = node1_direction|node2_direction
|
//dir = node1_direction|node2_direction
|
||||||
|
|
||||||
else
|
else
|
||||||
|
if(!node1&&!node2)
|
||||||
|
del(src) //TODO: silent deleting looks weird
|
||||||
var/have_node1 = node1?1:0
|
var/have_node1 = node1?1:0
|
||||||
var/have_node2 = node2?1:0
|
var/have_node2 = node2?1:0
|
||||||
icon_state = "exposed[have_node1][have_node2][invisibility ? "-f" : "" ]"
|
icon_state = "exposed[have_node1][have_node2][invisibility ? "-f" : "" ]"
|
||||||
|
|
||||||
if(!node1&&!node2)
|
|
||||||
del(src)
|
|
||||||
|
|
||||||
initialize()
|
initialize()
|
||||||
var/connect_directions = initialize_directions
|
var/node1_dir
|
||||||
|
var/node2_dir
|
||||||
|
|
||||||
for(var/direction in cardinal)
|
for(var/direction in cardinal)
|
||||||
if(direction&connect_directions)
|
if(direction&initialize_directions)
|
||||||
for(var/obj/machinery/atmospherics/target in get_step(src,direction))
|
if (!node1_dir)
|
||||||
if(target.initialize_directions & get_dir(target,src))
|
node1_dir = direction
|
||||||
node1 = target
|
else if (!node2_dir)
|
||||||
connect_directions &= ~direction
|
node2_dir = direction
|
||||||
break
|
|
||||||
if (node1)
|
for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir))
|
||||||
break
|
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
|
||||||
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
var/turf/T = src.loc // hide if turf is not intact
|
var/turf/T = src.loc // hide if turf is not intact
|
||||||
hide(T.intact)
|
hide(T.intact)
|
||||||
update_icon()
|
update_icon()
|
||||||
@@ -268,16 +269,14 @@ obj/machinery/atmospherics/pipe
|
|||||||
del(src)
|
del(src)
|
||||||
|
|
||||||
initialize()
|
initialize()
|
||||||
if(!node1)
|
for(var/obj/machinery/atmospherics/target in get_step(src,initialize_directions))
|
||||||
for(var/obj/machinery/atmospherics/pipe/simple/target in get_step(src,initialize_directions))
|
if(target.initialize_directions & get_dir(target,src))
|
||||||
if(target.initialize_directions & get_dir(target,src))
|
node1 = target
|
||||||
node1 = target
|
break
|
||||||
break
|
for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,initialize_directions_he))
|
||||||
if(!node2)
|
if(target.initialize_directions_he & get_dir(target,src))
|
||||||
for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,initialize_directions_he))
|
node2 = target
|
||||||
if(target.initialize_directions_he & get_dir(target,src))
|
break
|
||||||
node2 = target
|
|
||||||
break
|
|
||||||
|
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
@@ -291,26 +290,25 @@ obj/machinery/atmospherics/pipe
|
|||||||
thermal_conductivity = WINDOW_HEAT_TRANSFER_COEFFICIENT
|
thermal_conductivity = WINDOW_HEAT_TRANSFER_COEFFICIENT
|
||||||
|
|
||||||
initialize()
|
initialize()
|
||||||
var/connect_directions = initialize_directions_he
|
var/node1_dir
|
||||||
|
var/node2_dir
|
||||||
|
|
||||||
for(var/direction in cardinal)
|
for(var/direction in cardinal)
|
||||||
if(direction&connect_directions)
|
if(direction&initialize_directions_he)
|
||||||
for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,direction))
|
if (!node1_dir)
|
||||||
if(target.initialize_directions_he & get_dir(target,src))
|
node1_dir = direction
|
||||||
node1 = target
|
else if (!node2_dir)
|
||||||
connect_directions &= ~direction
|
node2_dir = direction
|
||||||
break
|
|
||||||
if (node1)
|
for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,node1_dir))
|
||||||
break
|
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
|
||||||
|
|
||||||
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
|
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
|
|
||||||
@@ -711,9 +709,9 @@ obj/machinery/atmospherics/pipe
|
|||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
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 ..()
|
return ..()
|
||||||
if (istype(W, /obj/machinery/atmospherics/pipe/vent))
|
if (istype(src, /obj/machinery/atmospherics/pipe/vent))
|
||||||
return ..()
|
return ..()
|
||||||
if (!istype(W, /obj/item/weapon/wrench))
|
if (!istype(W, /obj/item/weapon/wrench))
|
||||||
return ..()
|
return ..()
|
||||||
@@ -734,5 +732,9 @@ obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/u
|
|||||||
"[user] unfastens \the [src].", \
|
"[user] unfastens \the [src].", \
|
||||||
"\blue You have unfastened \the [src].", \
|
"\blue You have unfastened \the [src].", \
|
||||||
"You hear ratchet.")
|
"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)
|
del(src)
|
||||||
@@ -172,6 +172,7 @@
|
|||||||
anchored = 1.0
|
anchored = 1.0
|
||||||
flags = FPRINT | CONDUCT
|
flags = FPRINT | CONDUCT
|
||||||
pressure_resistance = 5*ONE_ATMOSPHERE
|
pressure_resistance = 5*ONE_ATMOSPHERE
|
||||||
|
layer = 2.9
|
||||||
|
|
||||||
/obj/securearea
|
/obj/securearea
|
||||||
desc = "A warning sign which reads 'SECURE AREA'"
|
desc = "A warning sign which reads 'SECURE AREA'"
|
||||||
@@ -467,7 +468,7 @@
|
|||||||
icon_state = "lattice"
|
icon_state = "lattice"
|
||||||
density = 0
|
density = 0
|
||||||
anchored = 1.0
|
anchored = 1.0
|
||||||
layer = 2.5
|
layer = 2.3 //under pipes
|
||||||
// flags = 64.0
|
// flags = 64.0
|
||||||
|
|
||||||
/obj/list_container
|
/obj/list_container
|
||||||
|
|||||||
@@ -88,3 +88,16 @@
|
|||||||
|
|
||||||
usr << t
|
usr << t
|
||||||
return
|
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)
|
var/datum/pipe_network/network = connected_port.return_network(src)
|
||||||
if(network && !network.gases.Find(air_contents))
|
if(network && !network.gases.Find(air_contents))
|
||||||
network.gases += air_contents
|
network.gases += air_contents
|
||||||
|
network.update = 1
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ Buildable meters
|
|||||||
#define PIPE_INSULATED_STRAIGHT 11
|
#define PIPE_INSULATED_STRAIGHT 11
|
||||||
#define PIPE_INSULATED_BENT 12
|
#define PIPE_INSULATED_BENT 12
|
||||||
|
|
||||||
/obj/item/weapon/pipe
|
/obj/item/pipe
|
||||||
name = "pipe"
|
name = "pipe"
|
||||||
desc = "A pipe"
|
desc = "A pipe"
|
||||||
var/pipe_type = 0
|
var/pipe_type = 0
|
||||||
@@ -28,8 +28,8 @@ Buildable meters
|
|||||||
flags = TABLEPASS|FPRINT
|
flags = TABLEPASS|FPRINT
|
||||||
w_class = 4
|
w_class = 4
|
||||||
level = 2
|
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)
|
if (make_from)
|
||||||
src.dir = make_from.dir
|
src.dir = make_from.dir
|
||||||
@@ -43,6 +43,8 @@ Buildable meters
|
|||||||
src.pipe_type = PIPE_JUNCTION
|
src.pipe_type = PIPE_JUNCTION
|
||||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/heat_exchanging))
|
else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/heat_exchanging))
|
||||||
src.pipe_type = PIPE_HE_STRAIGHT + is_bent
|
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))
|
else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple))
|
||||||
src.pipe_type = PIPE_SIMPLE_STRAIGHT + is_bent
|
src.pipe_type = PIPE_SIMPLE_STRAIGHT + is_bent
|
||||||
else if(istype(make_from, /obj/machinery/atmospherics/portables_connector))
|
else if(istype(make_from, /obj/machinery/atmospherics/portables_connector))
|
||||||
@@ -57,19 +59,17 @@ Buildable meters
|
|||||||
src.pipe_type = PIPE_PUMP
|
src.pipe_type = PIPE_PUMP
|
||||||
else if(istype(make_from, /obj/machinery/atmospherics/unary/vent_scrubber))
|
else if(istype(make_from, /obj/machinery/atmospherics/unary/vent_scrubber))
|
||||||
src.pipe_type = PIPE_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
|
else
|
||||||
src.pipe_type = pipe_type
|
src.pipe_type = pipe_type
|
||||||
src.dir = dir
|
src.dir = dir
|
||||||
//src.pipe_dir = get_pipe_dir()
|
//src.pipe_dir = get_pipe_dir()
|
||||||
update()
|
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
|
//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( \
|
var/list/nlist = list( \
|
||||||
"pipe", \
|
"pipe", \
|
||||||
"bent pipe", \
|
"bent pipe", \
|
||||||
@@ -102,31 +102,13 @@ Buildable meters
|
|||||||
"insulated", \
|
"insulated", \
|
||||||
)
|
)
|
||||||
icon_state = islist[pipe_type + 1]
|
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
|
//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
|
// place the pipe on the turf, setting pipe level to 1 (underfloor) if the turf is not intact
|
||||||
|
|
||||||
// rotate the pipe item clockwise
|
// rotate the pipe item clockwise
|
||||||
|
|
||||||
/obj/item/weapon/pipe/verb/rotate()
|
/obj/item/pipe/verb/rotate()
|
||||||
set name = "Rotate Pipe"
|
set name = "Rotate Pipe"
|
||||||
set src in view(1)
|
set src in view(1)
|
||||||
|
|
||||||
@@ -134,18 +116,30 @@ Buildable meters
|
|||||||
return
|
return
|
||||||
|
|
||||||
src.dir = turn(src.dir, -90)
|
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()
|
//src.pipe_dir = get_pipe_dir()
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/item/weapon/pipe/Move()
|
/obj/item/pipe/Move()
|
||||||
var/dir = src.dir
|
|
||||||
..()
|
..()
|
||||||
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
|
return
|
||||||
|
|
||||||
// returns all pipe's endpoints
|
// returns all pipe's endpoints
|
||||||
|
|
||||||
/obj/item/weapon/pipe/proc/get_pipe_dir()
|
/obj/item/pipe/proc/get_pipe_dir()
|
||||||
if (!dir)
|
if (!dir)
|
||||||
return 0
|
return 0
|
||||||
var/flip = turn(dir, 180)
|
var/flip = turn(dir, 180)
|
||||||
@@ -169,7 +163,7 @@ Buildable meters
|
|||||||
return flip|cw|acw
|
return flip|cw|acw
|
||||||
return 0
|
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/flip = turn(dir, 180)
|
||||||
// var/cw = turn(dir, -90)
|
// var/cw = turn(dir, -90)
|
||||||
@@ -186,7 +180,7 @@ Buildable meters
|
|||||||
|
|
||||||
// return the h_dir (heat-exchange pipes) from the type and the dir
|
// 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/flip = turn(dir, 180)
|
||||||
// var/cw = turn(dir, -90)
|
// var/cw = turn(dir, -90)
|
||||||
@@ -201,15 +195,20 @@ Buildable meters
|
|||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
/obj/item/weapon/pipe/attack_self(mob/user as mob)
|
/obj/item/pipe/attack_self(mob/user as mob)
|
||||||
return rotate()
|
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))
|
if (!istype(W, /obj/item/weapon/wrench))
|
||||||
return ..()
|
return ..()
|
||||||
if (!isturf(src.loc))
|
if (!isturf(src.loc))
|
||||||
return 1
|
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()
|
var/pipe_dir = get_pipe_dir()
|
||||||
|
|
||||||
for(var/obj/machinery/atmospherics/M in src.loc)
|
for(var/obj/machinery/atmospherics/M in src.loc)
|
||||||
@@ -264,6 +263,8 @@ Buildable meters
|
|||||||
C.initialize_directions = pipe_dir
|
C.initialize_directions = pipe_dir
|
||||||
if (pipename)
|
if (pipename)
|
||||||
C.name = pipename
|
C.name = pipename
|
||||||
|
var/turf/T = C.loc
|
||||||
|
C.level = T.intact ? 2 : 1
|
||||||
C.initialize()
|
C.initialize()
|
||||||
C.build_network()
|
C.build_network()
|
||||||
if (C.node)
|
if (C.node)
|
||||||
@@ -311,20 +312,15 @@ Buildable meters
|
|||||||
if (P.node2)
|
if (P.node2)
|
||||||
P.node2.initialize()
|
P.node2.initialize()
|
||||||
P.node2.build_network()
|
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
|
if(PIPE_UVENT) //unary vent
|
||||||
var/obj/machinery/atmospherics/unary/vent_pump/V = new( src.loc )
|
var/obj/machinery/atmospherics/unary/vent_pump/V = new( src.loc )
|
||||||
V.dir = dir
|
V.dir = dir
|
||||||
V.initialize_directions = pipe_dir
|
V.initialize_directions = pipe_dir
|
||||||
if (pipename)
|
if (pipename)
|
||||||
V.name = pipename
|
V.name = pipename
|
||||||
|
var/turf/T = V.loc
|
||||||
|
V.level = T.intact ? 2 : 1
|
||||||
V.initialize()
|
V.initialize()
|
||||||
V.build_network()
|
V.build_network()
|
||||||
if (V.node)
|
if (V.node)
|
||||||
@@ -338,6 +334,8 @@ Buildable meters
|
|||||||
V.initialize_directions = pipe_dir
|
V.initialize_directions = pipe_dir
|
||||||
if (pipename)
|
if (pipename)
|
||||||
V.name = pipename
|
V.name = pipename
|
||||||
|
var/turf/T = V.loc
|
||||||
|
V.level = T.intact ? 2 : 1
|
||||||
V.initialize()
|
V.initialize()
|
||||||
V.build_network()
|
V.build_network()
|
||||||
if (V.node1)
|
if (V.node1)
|
||||||
@@ -355,6 +353,8 @@ Buildable meters
|
|||||||
P.initialize_directions = pipe_dir
|
P.initialize_directions = pipe_dir
|
||||||
if (pipename)
|
if (pipename)
|
||||||
P.name = pipename
|
P.name = pipename
|
||||||
|
var/turf/T = P.loc
|
||||||
|
P.level = T.intact ? 2 : 1
|
||||||
P.initialize()
|
P.initialize()
|
||||||
P.build_network()
|
P.build_network()
|
||||||
if (P.node1)
|
if (P.node1)
|
||||||
@@ -371,6 +371,8 @@ Buildable meters
|
|||||||
S.initialize_directions = pipe_dir
|
S.initialize_directions = pipe_dir
|
||||||
if (pipename)
|
if (pipename)
|
||||||
S.name = pipename
|
S.name = pipename
|
||||||
|
var/turf/T = S.loc
|
||||||
|
S.level = T.intact ? 2 : 1
|
||||||
S.initialize()
|
S.initialize()
|
||||||
S.build_network()
|
S.build_network()
|
||||||
if (S.node)
|
if (S.node)
|
||||||
@@ -397,8 +399,8 @@ Buildable meters
|
|||||||
|
|
||||||
playsound(src.loc, 'Ratchet.ogg', 50, 1)
|
playsound(src.loc, 'Ratchet.ogg', 50, 1)
|
||||||
user.visible_message( \
|
user.visible_message( \
|
||||||
"[user] fastens the pipe.", \
|
"[user] fastens the [src].", \
|
||||||
"\blue You have fastened the pipe.", \
|
"\blue You have fastened the [src].", \
|
||||||
"You hear ratchet.")
|
"You hear ratchet.")
|
||||||
del(src) // remove the pipe item
|
del(src) // remove the pipe item
|
||||||
|
|
||||||
@@ -409,7 +411,7 @@ Buildable meters
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/obj/item/weapon/pipe_meter
|
/obj/item/pipe_meter
|
||||||
name = "meter"
|
name = "meter"
|
||||||
desc = "A meter that can be laid on pipes"
|
desc = "A meter that can be laid on pipes"
|
||||||
icon = 'pipe-item.dmi'
|
icon = 'pipe-item.dmi'
|
||||||
@@ -418,7 +420,7 @@ Buildable meters
|
|||||||
flags = TABLEPASS|FPRINT
|
flags = TABLEPASS|FPRINT
|
||||||
w_class = 4
|
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))
|
if (!istype(W, /obj/item/weapon/wrench))
|
||||||
return ..()
|
return ..()
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
icon = 'stationobjs.dmi'
|
icon = 'stationobjs.dmi'
|
||||||
icon_state = "autolathe"
|
icon_state = "autolathe"
|
||||||
density = 1
|
density = 1
|
||||||
anchored = 1.0
|
anchored = 1
|
||||||
|
var/unwrenched = 0
|
||||||
|
|
||||||
/obj/machinery/pipedispenser/attack_paw(user as mob)
|
/obj/machinery/pipedispenser/attack_paw(user as mob)
|
||||||
return src.attack_hand(user)
|
return src.attack_hand(user)
|
||||||
@@ -15,10 +16,11 @@
|
|||||||
<b>Regular pipes:</b><BR>
|
<b>Regular pipes:</b><BR>
|
||||||
<A href='?src=\ref[src];make=0;dir=1'>Pipe</A><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=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=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>
|
<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=9;dir=1'>Gas Pump</A><BR>
|
||||||
<A href='?src=\ref[src];make=10;dir=1'>Scrubber</A><BR>
|
<A href='?src=\ref[src];make=10;dir=1'>Scrubber</A><BR>
|
||||||
<A href='?src=\ref[src];makemeter=1'>Meter</A><BR>
|
<A href='?src=\ref[src];makemeter=1'>Meter</A><BR>
|
||||||
@@ -39,23 +41,57 @@
|
|||||||
/obj/machinery/pipedispenser/Topic(href, href_list)
|
/obj/machinery/pipedispenser/Topic(href, href_list)
|
||||||
if(..())
|
if(..())
|
||||||
return
|
return
|
||||||
|
if(unwrenched)
|
||||||
|
usr << browse(null, "window=pipedispenser")
|
||||||
|
return
|
||||||
usr.machine = src
|
usr.machine = src
|
||||||
src.add_fingerprint(usr)
|
src.add_fingerprint(usr)
|
||||||
if(href_list["make"])
|
if(href_list["make"])
|
||||||
var/p_type = text2num(href_list["make"])
|
var/p_type = text2num(href_list["make"])
|
||||||
var/p_dir = text2num(href_list["dir"])
|
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()
|
P.update()
|
||||||
if(href_list["makemeter"])
|
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))
|
/* for(var/mob/M in viewers(1, src))
|
||||||
if ((M.client && M.machine == src))
|
if ((M.client && M.machine == src))
|
||||||
src.attack_hand(M)*/
|
src.attack_hand(M)*/
|
||||||
return
|
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
|
/obj/machinery/pipedispenser/disposal
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ However people seem to like it for some reason.
|
|||||||
icon_state = "Singularity"
|
icon_state = "Singularity"
|
||||||
anchored = 1
|
anchored = 1
|
||||||
density = 1
|
density = 1
|
||||||
|
layer = 6
|
||||||
unacidable = 1 //Don't comment this out.
|
unacidable = 1 //Don't comment this out.
|
||||||
var/active = 0
|
var/active = 0
|
||||||
var/energy = 10
|
var/energy = 10
|
||||||
@@ -770,6 +771,8 @@ However people seem to like it for some reason.
|
|||||||
|
|
||||||
/obj/machinery/power/collector_array/proc/eject()
|
/obj/machinery/power/collector_array/proc/eject()
|
||||||
var/obj/item/weapon/tank/plasma/Z = src.P
|
var/obj/item/weapon/tank/plasma/Z = src.P
|
||||||
|
if (!Z)
|
||||||
|
return
|
||||||
Z.loc = get_turf(src)
|
Z.loc = get_turf(src)
|
||||||
Z.layer = initial(Z.layer)
|
Z.layer = initial(Z.layer)
|
||||||
src.P = null
|
src.P = null
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
var/area/A = get_area()
|
var/area/A = get_area()
|
||||||
var/text = {"<HTML><head><title>[src]</title></head><BODY>
|
var/text = {"<HTML><head><title>[src]</title></head><BODY>
|
||||||
<h2>[station_name()] blueprints</h2>
|
<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())
|
switch (get_area_type())
|
||||||
if (AREA_SPACE)
|
if (AREA_SPACE)
|
||||||
@@ -193,8 +193,13 @@ move an amendment</a> to the drawing.</p>
|
|||||||
for(var/obj/machinery/door/window/D in T2)
|
for(var/obj/machinery/door/window/D in T2)
|
||||||
if(turn(dir,180) == D.dir)
|
if(turn(dir,180) == D.dir)
|
||||||
return BORDER_BETWEEN
|
return BORDER_BETWEEN
|
||||||
for (var/obj/machinery/door/M in T2)
|
if (locate(/obj/machinery/door) in T2)
|
||||||
return BORDER_2NDTILE
|
return BORDER_2NDTILE
|
||||||
|
if (locate(/obj/falsewall) in T2)
|
||||||
|
return BORDER_2NDTILE
|
||||||
|
if (locate(/obj/falserwall) in T2)
|
||||||
|
return BORDER_2NDTILE
|
||||||
|
|
||||||
return BORDER_NONE
|
return BORDER_NONE
|
||||||
|
|
||||||
/obj/item/blueprints/proc/detect_room(var/turf/first)
|
/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