mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Pipe fixes, vent standardization, AI announce fixes.
This commit is contained in:
@@ -71,6 +71,7 @@
|
||||
#include "code\ATMOSPHERICS\datum_pipeline.dm"
|
||||
#include "code\ATMOSPHERICS\he_pipes.dm"
|
||||
#include "code\ATMOSPHERICS\pipes.dm"
|
||||
#include "code\ATMOSPHERICS\utils.dm"
|
||||
#include "code\ATMOSPHERICS\components\portables_connector.dm"
|
||||
#include "code\ATMOSPHERICS\components\tvalve.dm"
|
||||
#include "code\ATMOSPHERICS\components\valve.dm"
|
||||
@@ -92,6 +93,7 @@
|
||||
#include "code\ATMOSPHERICS\components\unary\oxygen_generator.dm"
|
||||
#include "code\ATMOSPHERICS\components\unary\thermal_plate.dm"
|
||||
#include "code\ATMOSPHERICS\components\unary\unary_base.dm"
|
||||
#include "code\ATMOSPHERICS\components\unary\vent.dm"
|
||||
#include "code\ATMOSPHERICS\components\unary\vent_pump.dm"
|
||||
#include "code\ATMOSPHERICS\components\unary\vent_scrubber.dm"
|
||||
#include "code\controllers\_DynamicAreaLighting_TG.dm"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/machinery/atmospherics/pipe/vent/burstpipe
|
||||
/obj/machinery/atmospherics/unary/vent/burstpipe
|
||||
icon = 'icons/obj/pipes.dmi'
|
||||
icon_state = "burst"
|
||||
name = "burst pipe"
|
||||
@@ -8,34 +8,37 @@
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/burstpipe/New(var/_loc, var/setdir=SOUTH)
|
||||
/obj/machinery/atmospherics/unary/vent/burstpipe/New(var/_loc, var/setdir=SOUTH)
|
||||
// Easier spawning.
|
||||
dir=setdir
|
||||
..(_loc)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/burstpipe/hide(var/i)
|
||||
/obj/machinery/atmospherics/unary/vent/burstpipe/hide(var/i)
|
||||
if(level == 1 && istype(loc, /turf/simulated))
|
||||
invisibility = i ? 101 : 0
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/burstpipe/update_icon()
|
||||
/obj/machinery/atmospherics/unary/vent/burstpipe/update_icon()
|
||||
alpha = invisibility ? 128 : 255
|
||||
if(!node1 || istype(node1,type)) // No connection, or the connection is another burst pipe
|
||||
if(!node || istype(node,type)) // No connection, or the connection is another burst pipe
|
||||
qdel(src) //TODO: silent deleting looks weird
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/burstpipe/ex_act(var/severity)
|
||||
/obj/machinery/atmospherics/unary/vent/burstpipe/ex_act(var/severity)
|
||||
return // We're already damaged. :^)
|
||||
|
||||
// Tell nodes to fix their networks.
|
||||
/obj/machinery/atmospherics/pipe/vent/burstpipe/proc/do_connect()
|
||||
/obj/machinery/atmospherics/unary/vent/burstpipe/proc/do_connect()
|
||||
//var/flip = turn(dir, 180)
|
||||
initialize_directions = dir
|
||||
var/turf/T = loc
|
||||
level = T.intact ? 2 : 1
|
||||
initialize()
|
||||
build_network()
|
||||
if (node1)
|
||||
node1.initialize()
|
||||
node1.build_network()
|
||||
if (node)
|
||||
node.initialize()
|
||||
node.build_network()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/burstpipe/attackby(var/obj/item/weapon/W, var/mob/user)
|
||||
/obj/machinery/atmospherics/unary/vent/burstpipe/attackby(var/obj/item/weapon/W, var/mob/user)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
var/turf/T = get_turf(src)
|
||||
@@ -49,7 +52,7 @@
|
||||
//new /obj/item/pipe(T, make_from=src)
|
||||
del(src)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/burstpipe/heat_exchanging
|
||||
/obj/machinery/atmospherics/unary/vent/burstpipe/heat_exchanging
|
||||
icon_state = "burst_he"
|
||||
name = "burst heat exchange pipe"
|
||||
desc = "Looks like an overturned bowl of spaghetti ravaged by wolves."
|
||||
@@ -58,5 +61,5 @@
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/burstpipe/heat_exchanging/getNodeType(var/node_id)
|
||||
/obj/machinery/atmospherics/unary/vent/burstpipe/heat_exchanging/getNodeType(var/node_id)
|
||||
return PIPE_TYPE_HE
|
||||
98
code/ATMOSPHERICS/components/unary/vent.dm
Normal file
98
code/ATMOSPHERICS/components/unary/vent.dm
Normal file
@@ -0,0 +1,98 @@
|
||||
/obj/machinery/atmospherics/unary/vent
|
||||
icon = 'icons/obj/atmospherics/pipe_vent.dmi'
|
||||
icon_state = "intact"
|
||||
name = "Vent"
|
||||
desc = "A large air vent"
|
||||
level = 1
|
||||
var/volume = 250
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH
|
||||
var/build_killswitch = 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent/high_volume
|
||||
name = "Larger vent"
|
||||
volume = 1000
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent/New()
|
||||
..()
|
||||
air_contents.volume=volume
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent/process()
|
||||
..()
|
||||
|
||||
CHECK_DISABLED(vents)
|
||||
if (!node)
|
||||
return // Turning off the vent is a PITA. - N3X
|
||||
|
||||
// New GC does this sometimes
|
||||
if(!loc) return
|
||||
|
||||
//air_contents.mingle_with_turf(loc)
|
||||
|
||||
var/datum/gas_mixture/removed = air_contents.remove(volume)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent/update_icon()
|
||||
if(node)
|
||||
icon_state = "intact"
|
||||
//dir = get_dir(src, node)
|
||||
|
||||
else
|
||||
icon_state = "exposed"
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent/initialize()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent/disconnect(obj/machinery/atmospherics/reference)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent/hide(var/i)
|
||||
if(node)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact"
|
||||
dir = get_dir(src, node)
|
||||
else
|
||||
icon_state = "exposed"
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent/buildFrom(var/mob/usr,var/obj/item/pipe/pipe)
|
||||
if(pipe)
|
||||
dir = pipe.dir
|
||||
initialize_directions = pipe.get_pipe_dir()
|
||||
if (pipe.pipename)
|
||||
name = pipe.pipename
|
||||
else
|
||||
initialize_directions = dir
|
||||
var/turf/T = loc
|
||||
level = T.intact ? 2 : 1
|
||||
initialize()
|
||||
build_network()
|
||||
if (node)
|
||||
node.initialize()
|
||||
node.build_network()
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent/attackby(var/obj/item/weapon/W, var/mob/user)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
var/turf/T = get_turf(src)
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = T.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot remove this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(T, 'sound/items/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(T, make_from=src)
|
||||
del(src)
|
||||
@@ -12,7 +12,7 @@
|
||||
// Plate value is 30000, increased it a bit because of additional surface area. - N3X
|
||||
var/const/ENERGY_MULT = 6.4 // Not sure what this is, keeping it the same as plates.
|
||||
|
||||
burst_type = /obj/machinery/atmospherics/pipe/vent/burstpipe/heat_exchanging
|
||||
burst_type = /obj/machinery/atmospherics/unary/vent/burstpipe/heat_exchanging
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/getNodeType(var/node_id)
|
||||
return PIPE_TYPE_HE
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/pipe/Destroy()
|
||||
del(parent)
|
||||
if(air_temporary)
|
||||
if(air_temporary && loc)
|
||||
loc.assume_air(air_temporary)
|
||||
|
||||
..()
|
||||
@@ -100,7 +100,7 @@
|
||||
alert_pressure = 80 *ONE_ATMOSPHERE
|
||||
|
||||
// Type of burstpipe to use on burst()
|
||||
var/burst_type = /obj/machinery/atmospherics/pipe/vent/burstpipe
|
||||
var/burst_type = /obj/machinery/atmospherics/unary/vent/burstpipe
|
||||
|
||||
level = 1
|
||||
|
||||
@@ -224,21 +224,26 @@
|
||||
/obj/machinery/atmospherics/pipe/simple/proc/burst()
|
||||
src.visible_message("<span class='danger'>\The [src] bursts!</span>");
|
||||
|
||||
message_admins("Pipe burst in area [formatJumpTo(src.loc)]")
|
||||
var/turf/T=get_turf(src)
|
||||
|
||||
message_admins("Pipe burst in area [formatJumpTo(T)]")
|
||||
var/area/A=get_area_master(src)
|
||||
log_game("Pipe burst in area [A.name] ")
|
||||
|
||||
if(prob(50))
|
||||
explosion(get_turf(src), -1, 1, 2, adminlog=0)
|
||||
else
|
||||
explosion(get_turf(src), 0, 1, 2, adminlog=0)
|
||||
|
||||
// Disconnect first.
|
||||
for(var/obj/machinery/atmospherics/node in pipeline_expansion())
|
||||
if(node)
|
||||
node.disconnect(src)
|
||||
|
||||
// Now connect.
|
||||
// Move away from explosion
|
||||
loc=null
|
||||
|
||||
if(prob(50))
|
||||
explosion(T, -1, 1, 2, adminlog=0)
|
||||
else
|
||||
explosion(T, 0, 1, 2, adminlog=0)
|
||||
|
||||
// Now connect burstpipes.
|
||||
var/node_id=0
|
||||
for(var/direction in cardinal)
|
||||
if(initialize_directions & direction)
|
||||
@@ -254,22 +259,14 @@
|
||||
error("UNKNOWN RESPONSE FROM [src.type]/getNodeType([node_id]): [node_type]")
|
||||
return
|
||||
if(!found) continue
|
||||
//var/node_var="node[node_id]" // For debugging.
|
||||
var/obj/machinery/atmospherics/pipe/vent/burstpipe/BP = new burst_type(loc, setdir=direction)
|
||||
|
||||
var/obj/machinery/atmospherics/unary/vent/burstpipe/BP = new burst_type(T, setdir=direction)
|
||||
BP.color=src.color
|
||||
BP.invisibility=src.invisibility
|
||||
BP.level=src.level
|
||||
BP.do_connect()
|
||||
|
||||
if(src && src.loc!=null)
|
||||
del(src) // NOT qdel.
|
||||
/*
|
||||
playsound(get_turf(src), 'sound/effects/bang.ogg', 25, 1)
|
||||
var/datum/effect/effect/system/smoke_spread/smoke = new
|
||||
smoke.set_up(1,0, src.loc, 0)
|
||||
smoke.start()
|
||||
qdel(src)
|
||||
*/
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/proc/normalize_dir()
|
||||
@@ -608,127 +605,6 @@
|
||||
else
|
||||
user << "\blue Tank is empty!"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent
|
||||
icon = 'icons/obj/atmospherics/pipe_vent.dmi'
|
||||
icon_state = "intact"
|
||||
name = "Vent"
|
||||
desc = "A large air vent"
|
||||
level = 1
|
||||
volume = 250
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH
|
||||
var/build_killswitch = 1
|
||||
var/obj/machinery/atmospherics/node1
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/New()
|
||||
initialize_directions = dir
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/high_volume
|
||||
name = "Larger vent"
|
||||
volume = 1000
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/process()
|
||||
if(!parent)
|
||||
if(build_killswitch <= 0)
|
||||
. = PROCESS_KILL
|
||||
else
|
||||
build_killswitch--
|
||||
..()
|
||||
return
|
||||
else
|
||||
parent.mingle_with_turf(loc, volume)
|
||||
/*
|
||||
if(!node1)
|
||||
if(!nodealert)
|
||||
//world << "Missing node from [src] at [src.x],[src.y],[src.z]"
|
||||
nodealert = 1
|
||||
else if (nodealert)
|
||||
nodealert = 0
|
||||
*/
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/Destroy()
|
||||
if(node1)
|
||||
node1.disconnect(src)
|
||||
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/pipeline_expansion()
|
||||
return list(node1)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/update_icon()
|
||||
if(node1)
|
||||
icon_state = "intact"
|
||||
|
||||
dir = get_dir(src, node1)
|
||||
|
||||
else
|
||||
icon_state = "exposed"
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/initialize()
|
||||
var/connect_direction = dir
|
||||
|
||||
node1=findConnecting(connect_direction)
|
||||
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/disconnect(obj/machinery/atmospherics/reference)
|
||||
if(reference == node1)
|
||||
if(istype(node1, /obj/machinery/atmospherics/pipe))
|
||||
del(parent)
|
||||
node1 = null
|
||||
|
||||
update_icon()
|
||||
|
||||
return null
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/hide(var/i)
|
||||
if(node1)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact"
|
||||
dir = get_dir(src, node1)
|
||||
else
|
||||
icon_state = "exposed"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/buildFrom(var/mob/usr,var/obj/item/pipe/pipe)
|
||||
dir = pipe.dir
|
||||
initialize_directions = pipe.get_pipe_dir()
|
||||
if (pipe.pipename)
|
||||
name = pipe.pipename
|
||||
var/turf/T = loc
|
||||
level = T.intact ? 2 : 1
|
||||
initialize()
|
||||
build_network()
|
||||
if (node1)
|
||||
node1.initialize()
|
||||
node1.build_network()
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/pipe/vent/attackby(var/obj/item/weapon/W, var/mob/user)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
var/turf/T = get_turf(src)
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = T.return_air()
|
||||
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
||||
user << "\red You cannot unwrench this [src], it too exerted due to internal pressure."
|
||||
add_fingerprint(user)
|
||||
return 1
|
||||
playsound(T, 'sound/items/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(T, make_from=src)
|
||||
del(src)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold
|
||||
icon = 'icons/obj/atmospherics/pipe_manifold.dmi'
|
||||
icon_state = "manifold"
|
||||
@@ -1205,7 +1081,7 @@
|
||||
return // Coloring pipes.
|
||||
if (istype(src, /obj/machinery/atmospherics/pipe/tank))
|
||||
return ..()
|
||||
if (istype(src, /obj/machinery/atmospherics/pipe/vent))
|
||||
if (istype(src, /obj/machinery/atmospherics/unary/vent))
|
||||
return ..()
|
||||
|
||||
if(istype(W, /obj/item/weapon/reagent_containers/glass/paint/red))
|
||||
|
||||
29
code/ATMOSPHERICS/utils.dm
Normal file
29
code/ATMOSPHERICS/utils.dm
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Atmospherics-related utilities
|
||||
*/
|
||||
|
||||
// Shapes
|
||||
#define PIPE_BINARY 0
|
||||
#define PIPE_STRAIGHT 1 // Like binary, but rotates differently.
|
||||
#define PIPE_BENT 2
|
||||
#define PIPE_TRINARY 3
|
||||
#define PIPE_UNARY 4
|
||||
#define PIPE_4W 5
|
||||
|
||||
// For straight pipes
|
||||
/proc/rotate_pipe_straight(var/newdir)
|
||||
switch(newdir)
|
||||
if(SOUTH) // 2->1
|
||||
return NORTH
|
||||
if(WEST) // 8->4
|
||||
return EAST
|
||||
// New - N3X
|
||||
if(NORTHWEST)
|
||||
return NORTH
|
||||
if(NORTHEAST)
|
||||
return EAST
|
||||
if(SOUTHWEST)
|
||||
return NORTH
|
||||
if(SOUTHEAST)
|
||||
return EAST
|
||||
return newdir
|
||||
@@ -28,6 +28,8 @@ Buildable meters
|
||||
#define PIPE_INJECTOR 23
|
||||
#define PIPE_DP_VENT 24
|
||||
#define PIPE_PASV_VENT 25
|
||||
#define PIPE_BURST_PIPE 26
|
||||
#define PIPE_BURST_HPIPE 27
|
||||
|
||||
/obj/item/pipe_spawner
|
||||
name = "Pipe Spawner"
|
||||
@@ -123,7 +125,11 @@ Buildable meters
|
||||
src.pipe_type = PIPE_INJECTOR
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/binary/dp_vent_pump))
|
||||
src.pipe_type = PIPE_DP_VENT
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/pipe/vent))
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/unary/vent/burstpipe/heat_exchanging))
|
||||
src.pipe_type = PIPE_BURST_HPIPE
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/unary/vent/burstpipe))
|
||||
src.pipe_type = PIPE_BURST_PIPE
|
||||
else if(istype(make_from, /obj/machinery/atmospherics/unary/vent))
|
||||
src.pipe_type = PIPE_PASV_VENT
|
||||
else
|
||||
src.pipe_type = pipe_type
|
||||
@@ -161,7 +167,9 @@ var/global/list/pipeID2State = list(
|
||||
"thermalplate",
|
||||
"injector",
|
||||
"binary vent",
|
||||
"passive vent"
|
||||
"passive vent",
|
||||
"",
|
||||
"",
|
||||
)
|
||||
/obj/item/pipe/proc/update()
|
||||
var/list/nlist = list( \
|
||||
@@ -190,7 +198,9 @@ var/global/list/pipeID2State = list(
|
||||
"thermal plate", \
|
||||
"injector", \
|
||||
"dual-port vent", \
|
||||
"passive vent"
|
||||
"passive vent",
|
||||
"burst pipe",
|
||||
"burst he pipe",
|
||||
)
|
||||
name = nlist[pipe_type+1] + " fitting"
|
||||
icon = 'icons/obj/pipe-item.dmi'
|
||||
@@ -212,10 +222,7 @@ var/global/list/pipeID2State = list(
|
||||
src.dir = turn(src.dir, -90)
|
||||
|
||||
if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE, PIPE_DVALVE))
|
||||
if(dir==2)
|
||||
dir = 1
|
||||
else if(dir==8)
|
||||
dir = 4
|
||||
dir=rotate_pipe_straight(dir)
|
||||
else if (pipe_type == PIPE_MANIFOLD4W)
|
||||
dir = 2
|
||||
//src.pipe_dir = get_pipe_dir()
|
||||
@@ -227,10 +234,7 @@ var/global/list/pipeID2State = list(
|
||||
&& (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, PIPE_DVALVE))
|
||||
if(dir==2)
|
||||
dir = 1
|
||||
else if(dir==8)
|
||||
dir = 4
|
||||
dir=rotate_pipe_straight(dir)
|
||||
return
|
||||
|
||||
// returns all pipe's endpoints
|
||||
@@ -256,7 +260,7 @@ var/global/list/pipeID2State = list(
|
||||
return dir|flip
|
||||
if(PIPE_SIMPLE_BENT, PIPE_INSULATED_BENT, PIPE_HE_BENT)
|
||||
return dir //dir|acw
|
||||
if(PIPE_CONNECTOR,PIPE_UVENT,PIPE_PASV_VENT,PIPE_SCRUBBER,PIPE_HEAT_EXCHANGE,PIPE_THERMAL_PLATE,PIPE_INJECTOR)
|
||||
if(PIPE_CONNECTOR,PIPE_UVENT,PIPE_PASV_VENT,PIPE_SCRUBBER,PIPE_HEAT_EXCHANGE,PIPE_THERMAL_PLATE,PIPE_INJECTOR,PIPE_BURST_PIPE)
|
||||
return dir
|
||||
if(PIPE_MANIFOLD4W)
|
||||
return dir|flip|cw|acw
|
||||
@@ -274,10 +278,10 @@ var/global/list/pipeID2State = list(
|
||||
// var/cw = turn(dir, -90)
|
||||
// var/acw = turn(dir, 90)
|
||||
|
||||
if (!(pipe_type in list(PIPE_HE_STRAIGHT, PIPE_HE_BENT, PIPE_JUNCTION)))
|
||||
if (!(pipe_type in list(PIPE_HE_STRAIGHT, PIPE_HE_BENT, PIPE_JUNCTION,PIPE_BURST_HPIPE)))
|
||||
return get_pipe_dir()
|
||||
switch(pipe_type)
|
||||
if(PIPE_HE_STRAIGHT,PIPE_HE_BENT)
|
||||
if(PIPE_HE_STRAIGHT,PIPE_HE_BENT,PIPE_BURST_HPIPE)
|
||||
return 0
|
||||
if(PIPE_JUNCTION)
|
||||
return flip
|
||||
@@ -311,10 +315,7 @@ var/global/list/pipeID2State = list(
|
||||
if (!isturf(src.loc))
|
||||
return 1
|
||||
if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE, PIPE_DVALVE))
|
||||
if(dir==2)
|
||||
dir = 1
|
||||
else if(dir==8)
|
||||
dir = 4
|
||||
dir=rotate_pipe_straight(dir)
|
||||
else if (pipe_type == PIPE_MANIFOLD4W)
|
||||
dir = 2
|
||||
var/pipe_dir = get_pipe_dir()
|
||||
@@ -394,7 +395,13 @@ var/global/list/pipeID2State = list(
|
||||
P=new /obj/machinery/atmospherics/binary/dp_vent_pump(src.loc)
|
||||
|
||||
if(PIPE_PASV_VENT)
|
||||
P=new /obj/machinery/atmospherics/pipe/vent(src.loc)
|
||||
P=new /obj/machinery/atmospherics/unary/vent(src.loc)
|
||||
|
||||
if(PIPE_BURST_PIPE)
|
||||
P=new /obj/machinery/atmospherics/unary/vent/burstpipe(loc)
|
||||
|
||||
if(PIPE_BURST_HPIPE)
|
||||
P=new /obj/machinery/atmospherics/unary/vent/burstpipe/heat_exchanging(loc)
|
||||
|
||||
if(P.buildFrom(usr,src))
|
||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
var/mode = "grey"
|
||||
|
||||
/obj/item/device/pipe_painter/afterattack(atom/A, mob/user as mob)
|
||||
if(!istype(A,/obj/machinery/atmospherics/pipe) || istype(A,/obj/machinery/atmospherics/pipe/tank) || istype(A,/obj/machinery/atmospherics/pipe/vent) || istype(A,/obj/machinery/atmospherics/pipe/simple/heat_exchanging) || istype(A,/obj/machinery/atmospherics/pipe/simple/insulated))
|
||||
if(!istype(A,/obj/machinery/atmospherics/pipe) || istype(A,/obj/machinery/atmospherics/pipe/tank) || istype(A,/obj/machinery/atmospherics/unary/vent) || istype(A,/obj/machinery/atmospherics/pipe/simple/heat_exchanging) || istype(A,/obj/machinery/atmospherics/pipe/simple/insulated))
|
||||
return
|
||||
var/obj/machinery/atmospherics/pipe/P = A
|
||||
if(!(mode in P.available_colors))
|
||||
|
||||
@@ -433,7 +433,7 @@ var/global/list/RPD_recipes=list(
|
||||
|
||||
switch(p_class)
|
||||
if(-2) // Paint pipes
|
||||
if(!istype(A,/obj/machinery/atmospherics/pipe) || istype(A,/obj/machinery/atmospherics/pipe/tank) || istype(A,/obj/machinery/atmospherics/pipe/vent) || istype(A,/obj/machinery/atmospherics/pipe/simple/heat_exchanging) || istype(A,/obj/machinery/atmospherics/pipe/simple/insulated))
|
||||
if(!istype(A,/obj/machinery/atmospherics/pipe) || istype(A,/obj/machinery/atmospherics/pipe/tank) || istype(A,/obj/machinery/atmospherics/unary/vent) || istype(A,/obj/machinery/atmospherics/pipe/simple/heat_exchanging) || istype(A,/obj/machinery/atmospherics/pipe/simple/insulated))
|
||||
// Avoid spewing errors about invalid mode -2 when clicking on stuff that aren't pipes.
|
||||
user << "\The [src]'s error light flickers. Perhaps you need to only use it on pipes and pipe meters?"
|
||||
return 0
|
||||
|
||||
@@ -117,9 +117,7 @@ var/const/VOX_DELAY = 600
|
||||
play_vox_word(word, src.z, null)
|
||||
|
||||
|
||||
var/list/vox_digits=list(
|
||||
// First index is digit position, second is digit value.
|
||||
list(
|
||||
var/list/vox_units=list(
|
||||
'sound/vox_fem/one.ogg',
|
||||
'sound/vox_fem/two.ogg',
|
||||
'sound/vox_fem/three.ogg',
|
||||
@@ -128,9 +126,20 @@ var/list/vox_digits=list(
|
||||
'sound/vox_fem/six.ogg',
|
||||
'sound/vox_fem/seven.ogg',
|
||||
'sound/vox_fem/eight.ogg',
|
||||
'sound/vox_fem/nine.ogg'
|
||||
),
|
||||
list(
|
||||
'sound/vox_fem/nine.ogg',
|
||||
'sound/vox_fem/ten.ogg',
|
||||
'sound/vox_fem/eleven.ogg',
|
||||
'sound/vox_fem/twelve.ogg',
|
||||
'sound/vox_fem/thirteen.ogg',
|
||||
'sound/vox_fem/fourteen.ogg',
|
||||
'sound/vox_fem/fifteen.ogg',
|
||||
'sound/vox_fem/sixteen.ogg',
|
||||
'sound/vox_fem/seventeen.ogg',
|
||||
'sound/vox_fem/eighteen.ogg',
|
||||
'sound/vox_fem/nineteen.ogg'
|
||||
)
|
||||
|
||||
var/list/vox_tens=list(
|
||||
'sound/vox_fem/ten.ogg',
|
||||
'sound/vox_fem/twenty.ogg',
|
||||
'sound/vox_fem/thirty.ogg',
|
||||
@@ -141,7 +150,6 @@ var/list/vox_digits=list(
|
||||
'sound/vox_fem/eighty.ogg',
|
||||
'sound/vox_fem/ninety.ogg'
|
||||
)
|
||||
)
|
||||
|
||||
var/list/vox_digit_suffixes = list(
|
||||
null,
|
||||
@@ -154,33 +162,49 @@ var/list/vox_digit_suffixes = list(
|
||||
null,
|
||||
'sound/vox_fem/hundred.ogg',
|
||||
)
|
||||
/proc/vox_num2list_digit(var/digit, var/dpos)
|
||||
var/list/out[0]
|
||||
if(dpos <= vox_digit_suffixes.len)
|
||||
var/sdig=1
|
||||
for(var/i = 1;i<=dpos;i++)
|
||||
if(!isnull(vox_digit_suffixes[i]) || dpos==1)
|
||||
sdig = 1
|
||||
else
|
||||
sdig += 1
|
||||
if(digit != 0)
|
||||
out.Add(vox_digits[sdig][digit])
|
||||
if(!isnull(vox_digit_suffixes[dpos]))
|
||||
out.Add(vox_digit_suffixes[dpos])
|
||||
return out
|
||||
|
||||
|
||||
// Stolen from here: http://stackoverflow.com/questions/2729752/converting-numbers-in-to-words-c-sharp
|
||||
/proc/vox_num2list(var/number)
|
||||
var/list/generated[0]
|
||||
if(!isnum(number))
|
||||
warning("vox_num2list fed a non-number: [number]")
|
||||
return list()
|
||||
if(number == 0)
|
||||
return list('sound/vox_fem/zero.ogg')
|
||||
var/numtxt = reverse_text(num2text(number,9))
|
||||
for(var/i=1;i<=length(numtxt);i++)
|
||||
generated = vox_num2list_digit(text2num(copytext(numtxt,i,i+1)),i) + generated
|
||||
testing("[number] => [list2text(generated," ")]")
|
||||
return generated
|
||||
|
||||
if(number < 0)
|
||||
return list('sound/vox_fem/minus.ogg') + vox_num2list(abs(number))
|
||||
|
||||
var/list/words=list()
|
||||
|
||||
if ((number / 1000000) > 0)
|
||||
words += vox_num2list(number / 1000000)
|
||||
words += 'sound/vox_fem/million.ogg'
|
||||
number %= 1000000
|
||||
|
||||
if ((number / 1000) > 0)
|
||||
words += vox_num2list(number / 1000)
|
||||
words += 'sound/vox_fem/thousand.ogg'
|
||||
number %= 1000
|
||||
|
||||
if ((number / 100) > 0)
|
||||
words += vox_num2list(number / 100)
|
||||
words += 'sound/vox_fem/hundred.ogg'
|
||||
number %= 100
|
||||
|
||||
if (number > 0)
|
||||
// Sounds fine without the and.
|
||||
//if (words != "")
|
||||
// words += "and "
|
||||
|
||||
if (number < 20)
|
||||
words += vox_units[number]
|
||||
else
|
||||
words += vox_tens[number / 10]
|
||||
if ((number % 10) > 0)
|
||||
words += 'sound/vox_fem/minus.ogg' + vox_num2list[number % 10]
|
||||
|
||||
return words
|
||||
|
||||
/proc/play_vox_word(var/word, var/z_level, var/mob/only_listener)
|
||||
word = lowertext(word)
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
for(var/obj/effect/beam/emitter/B in beams)
|
||||
power += B.get_damage() * config_bullet_energy
|
||||
|
||||
var/stability = num2text(round((damage / explosion_point) * 100))
|
||||
var/stability = round((damage / explosion_point) * 100)
|
||||
if(damage > warning_point) // while the core is still damaged and it's still worth noting its status
|
||||
|
||||
var/list/audio_sounds = list('sound/AI/supermatter_integrity_before.ogg')
|
||||
|
||||
Reference in New Issue
Block a user