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\datum_pipeline.dm"
|
||||||
#include "code\ATMOSPHERICS\he_pipes.dm"
|
#include "code\ATMOSPHERICS\he_pipes.dm"
|
||||||
#include "code\ATMOSPHERICS\pipes.dm"
|
#include "code\ATMOSPHERICS\pipes.dm"
|
||||||
|
#include "code\ATMOSPHERICS\utils.dm"
|
||||||
#include "code\ATMOSPHERICS\components\portables_connector.dm"
|
#include "code\ATMOSPHERICS\components\portables_connector.dm"
|
||||||
#include "code\ATMOSPHERICS\components\tvalve.dm"
|
#include "code\ATMOSPHERICS\components\tvalve.dm"
|
||||||
#include "code\ATMOSPHERICS\components\valve.dm"
|
#include "code\ATMOSPHERICS\components\valve.dm"
|
||||||
@@ -92,6 +93,7 @@
|
|||||||
#include "code\ATMOSPHERICS\components\unary\oxygen_generator.dm"
|
#include "code\ATMOSPHERICS\components\unary\oxygen_generator.dm"
|
||||||
#include "code\ATMOSPHERICS\components\unary\thermal_plate.dm"
|
#include "code\ATMOSPHERICS\components\unary\thermal_plate.dm"
|
||||||
#include "code\ATMOSPHERICS\components\unary\unary_base.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_pump.dm"
|
||||||
#include "code\ATMOSPHERICS\components\unary\vent_scrubber.dm"
|
#include "code\ATMOSPHERICS\components\unary\vent_scrubber.dm"
|
||||||
#include "code\controllers\_DynamicAreaLighting_TG.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 = 'icons/obj/pipes.dmi'
|
||||||
icon_state = "burst"
|
icon_state = "burst"
|
||||||
name = "burst pipe"
|
name = "burst pipe"
|
||||||
@@ -8,34 +8,37 @@
|
|||||||
dir = SOUTH
|
dir = SOUTH
|
||||||
initialize_directions = 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.
|
// Easier spawning.
|
||||||
dir=setdir
|
dir=setdir
|
||||||
..(_loc)
|
..(_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))
|
if(level == 1 && istype(loc, /turf/simulated))
|
||||||
invisibility = i ? 101 : 0
|
invisibility = i ? 101 : 0
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
/obj/machinery/atmospherics/pipe/vent/burstpipe/update_icon()
|
/obj/machinery/atmospherics/unary/vent/burstpipe/update_icon()
|
||||||
alpha = invisibility ? 128 : 255
|
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
|
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. :^)
|
return // We're already damaged. :^)
|
||||||
|
|
||||||
// Tell nodes to fix their networks.
|
// 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
|
initialize_directions = dir
|
||||||
|
var/turf/T = loc
|
||||||
|
level = T.intact ? 2 : 1
|
||||||
initialize()
|
initialize()
|
||||||
build_network()
|
build_network()
|
||||||
if (node1)
|
if (node)
|
||||||
node1.initialize()
|
node.initialize()
|
||||||
node1.build_network()
|
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))
|
if (!istype(W, /obj/item/weapon/wrench))
|
||||||
return ..()
|
return ..()
|
||||||
var/turf/T = get_turf(src)
|
var/turf/T = get_turf(src)
|
||||||
@@ -49,7 +52,7 @@
|
|||||||
//new /obj/item/pipe(T, make_from=src)
|
//new /obj/item/pipe(T, make_from=src)
|
||||||
del(src)
|
del(src)
|
||||||
|
|
||||||
/obj/machinery/atmospherics/pipe/vent/burstpipe/heat_exchanging
|
/obj/machinery/atmospherics/unary/vent/burstpipe/heat_exchanging
|
||||||
icon_state = "burst_he"
|
icon_state = "burst_he"
|
||||||
name = "burst heat exchange pipe"
|
name = "burst heat exchange pipe"
|
||||||
desc = "Looks like an overturned bowl of spaghetti ravaged by wolves."
|
desc = "Looks like an overturned bowl of spaghetti ravaged by wolves."
|
||||||
@@ -58,5 +61,5 @@
|
|||||||
dir = SOUTH
|
dir = SOUTH
|
||||||
initialize_directions = 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
|
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
|
// 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.
|
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)
|
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/getNodeType(var/node_id)
|
||||||
return PIPE_TYPE_HE
|
return PIPE_TYPE_HE
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
|
|
||||||
/obj/machinery/atmospherics/pipe/Destroy()
|
/obj/machinery/atmospherics/pipe/Destroy()
|
||||||
del(parent)
|
del(parent)
|
||||||
if(air_temporary)
|
if(air_temporary && loc)
|
||||||
loc.assume_air(air_temporary)
|
loc.assume_air(air_temporary)
|
||||||
|
|
||||||
..()
|
..()
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
alert_pressure = 80 *ONE_ATMOSPHERE
|
alert_pressure = 80 *ONE_ATMOSPHERE
|
||||||
|
|
||||||
// Type of burstpipe to use on burst()
|
// 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
|
level = 1
|
||||||
|
|
||||||
@@ -224,21 +224,26 @@
|
|||||||
/obj/machinery/atmospherics/pipe/simple/proc/burst()
|
/obj/machinery/atmospherics/pipe/simple/proc/burst()
|
||||||
src.visible_message("<span class='danger'>\The [src] bursts!</span>");
|
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)
|
var/area/A=get_area_master(src)
|
||||||
log_game("Pipe burst in area [A.name] ")
|
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.
|
// Disconnect first.
|
||||||
for(var/obj/machinery/atmospherics/node in pipeline_expansion())
|
for(var/obj/machinery/atmospherics/node in pipeline_expansion())
|
||||||
if(node)
|
if(node)
|
||||||
node.disconnect(src)
|
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
|
var/node_id=0
|
||||||
for(var/direction in cardinal)
|
for(var/direction in cardinal)
|
||||||
if(initialize_directions & direction)
|
if(initialize_directions & direction)
|
||||||
@@ -254,22 +259,14 @@
|
|||||||
error("UNKNOWN RESPONSE FROM [src.type]/getNodeType([node_id]): [node_type]")
|
error("UNKNOWN RESPONSE FROM [src.type]/getNodeType([node_id]): [node_type]")
|
||||||
return
|
return
|
||||||
if(!found) continue
|
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.color=src.color
|
||||||
BP.invisibility=src.invisibility
|
BP.invisibility=src.invisibility
|
||||||
BP.level=src.level
|
BP.level=src.level
|
||||||
BP.do_connect()
|
BP.do_connect()
|
||||||
|
|
||||||
if(src && src.loc!=null)
|
del(src) // NOT qdel.
|
||||||
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()
|
/obj/machinery/atmospherics/pipe/simple/proc/normalize_dir()
|
||||||
@@ -608,127 +605,6 @@
|
|||||||
else
|
else
|
||||||
user << "\blue Tank is empty!"
|
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
|
/obj/machinery/atmospherics/pipe/manifold
|
||||||
icon = 'icons/obj/atmospherics/pipe_manifold.dmi'
|
icon = 'icons/obj/atmospherics/pipe_manifold.dmi'
|
||||||
icon_state = "manifold"
|
icon_state = "manifold"
|
||||||
@@ -1205,7 +1081,7 @@
|
|||||||
return // Coloring pipes.
|
return // Coloring pipes.
|
||||||
if (istype(src, /obj/machinery/atmospherics/pipe/tank))
|
if (istype(src, /obj/machinery/atmospherics/pipe/tank))
|
||||||
return ..()
|
return ..()
|
||||||
if (istype(src, /obj/machinery/atmospherics/pipe/vent))
|
if (istype(src, /obj/machinery/atmospherics/unary/vent))
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
if(istype(W, /obj/item/weapon/reagent_containers/glass/paint/red))
|
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_INJECTOR 23
|
||||||
#define PIPE_DP_VENT 24
|
#define PIPE_DP_VENT 24
|
||||||
#define PIPE_PASV_VENT 25
|
#define PIPE_PASV_VENT 25
|
||||||
|
#define PIPE_BURST_PIPE 26
|
||||||
|
#define PIPE_BURST_HPIPE 27
|
||||||
|
|
||||||
/obj/item/pipe_spawner
|
/obj/item/pipe_spawner
|
||||||
name = "Pipe Spawner"
|
name = "Pipe Spawner"
|
||||||
@@ -123,7 +125,11 @@ Buildable meters
|
|||||||
src.pipe_type = PIPE_INJECTOR
|
src.pipe_type = PIPE_INJECTOR
|
||||||
else if(istype(make_from, /obj/machinery/atmospherics/binary/dp_vent_pump))
|
else if(istype(make_from, /obj/machinery/atmospherics/binary/dp_vent_pump))
|
||||||
src.pipe_type = PIPE_DP_VENT
|
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
|
src.pipe_type = PIPE_PASV_VENT
|
||||||
else
|
else
|
||||||
src.pipe_type = pipe_type
|
src.pipe_type = pipe_type
|
||||||
@@ -161,7 +167,9 @@ var/global/list/pipeID2State = list(
|
|||||||
"thermalplate",
|
"thermalplate",
|
||||||
"injector",
|
"injector",
|
||||||
"binary vent",
|
"binary vent",
|
||||||
"passive vent"
|
"passive vent",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
)
|
)
|
||||||
/obj/item/pipe/proc/update()
|
/obj/item/pipe/proc/update()
|
||||||
var/list/nlist = list( \
|
var/list/nlist = list( \
|
||||||
@@ -190,7 +198,9 @@ var/global/list/pipeID2State = list(
|
|||||||
"thermal plate", \
|
"thermal plate", \
|
||||||
"injector", \
|
"injector", \
|
||||||
"dual-port vent", \
|
"dual-port vent", \
|
||||||
"passive vent"
|
"passive vent",
|
||||||
|
"burst pipe",
|
||||||
|
"burst he pipe",
|
||||||
)
|
)
|
||||||
name = nlist[pipe_type+1] + " fitting"
|
name = nlist[pipe_type+1] + " fitting"
|
||||||
icon = 'icons/obj/pipe-item.dmi'
|
icon = 'icons/obj/pipe-item.dmi'
|
||||||
@@ -212,10 +222,7 @@ var/global/list/pipeID2State = list(
|
|||||||
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, PIPE_DVALVE))
|
if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE, PIPE_DVALVE))
|
||||||
if(dir==2)
|
dir=rotate_pipe_straight(dir)
|
||||||
dir = 1
|
|
||||||
else if(dir==8)
|
|
||||||
dir = 4
|
|
||||||
else if (pipe_type == PIPE_MANIFOLD4W)
|
else if (pipe_type == PIPE_MANIFOLD4W)
|
||||||
dir = 2
|
dir = 2
|
||||||
//src.pipe_dir = get_pipe_dir()
|
//src.pipe_dir = get_pipe_dir()
|
||||||
@@ -227,10 +234,7 @@ var/global/list/pipeID2State = list(
|
|||||||
&& (src.dir in cardinal))
|
&& (src.dir in cardinal))
|
||||||
src.dir = src.dir|turn(src.dir, 90)
|
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))
|
else if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE, PIPE_DVALVE))
|
||||||
if(dir==2)
|
dir=rotate_pipe_straight(dir)
|
||||||
dir = 1
|
|
||||||
else if(dir==8)
|
|
||||||
dir = 4
|
|
||||||
return
|
return
|
||||||
|
|
||||||
// returns all pipe's endpoints
|
// returns all pipe's endpoints
|
||||||
@@ -256,7 +260,7 @@ var/global/list/pipeID2State = list(
|
|||||||
return dir|flip
|
return dir|flip
|
||||||
if(PIPE_SIMPLE_BENT, PIPE_INSULATED_BENT, PIPE_HE_BENT)
|
if(PIPE_SIMPLE_BENT, PIPE_INSULATED_BENT, PIPE_HE_BENT)
|
||||||
return dir //dir|acw
|
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
|
return dir
|
||||||
if(PIPE_MANIFOLD4W)
|
if(PIPE_MANIFOLD4W)
|
||||||
return dir|flip|cw|acw
|
return dir|flip|cw|acw
|
||||||
@@ -274,10 +278,10 @@ var/global/list/pipeID2State = list(
|
|||||||
// var/cw = turn(dir, -90)
|
// var/cw = turn(dir, -90)
|
||||||
// var/acw = 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()
|
return get_pipe_dir()
|
||||||
switch(pipe_type)
|
switch(pipe_type)
|
||||||
if(PIPE_HE_STRAIGHT,PIPE_HE_BENT)
|
if(PIPE_HE_STRAIGHT,PIPE_HE_BENT,PIPE_BURST_HPIPE)
|
||||||
return 0
|
return 0
|
||||||
if(PIPE_JUNCTION)
|
if(PIPE_JUNCTION)
|
||||||
return flip
|
return flip
|
||||||
@@ -311,10 +315,7 @@ var/global/list/pipeID2State = list(
|
|||||||
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, PIPE_DVALVE))
|
if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE, PIPE_DVALVE))
|
||||||
if(dir==2)
|
dir=rotate_pipe_straight(dir)
|
||||||
dir = 1
|
|
||||||
else if(dir==8)
|
|
||||||
dir = 4
|
|
||||||
else if (pipe_type == PIPE_MANIFOLD4W)
|
else if (pipe_type == PIPE_MANIFOLD4W)
|
||||||
dir = 2
|
dir = 2
|
||||||
var/pipe_dir = get_pipe_dir()
|
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)
|
P=new /obj/machinery/atmospherics/binary/dp_vent_pump(src.loc)
|
||||||
|
|
||||||
if(PIPE_PASV_VENT)
|
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))
|
if(P.buildFrom(usr,src))
|
||||||
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
var/mode = "grey"
|
var/mode = "grey"
|
||||||
|
|
||||||
/obj/item/device/pipe_painter/afterattack(atom/A, mob/user as mob)
|
/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
|
return
|
||||||
var/obj/machinery/atmospherics/pipe/P = A
|
var/obj/machinery/atmospherics/pipe/P = A
|
||||||
if(!(mode in P.available_colors))
|
if(!(mode in P.available_colors))
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ var/global/list/RPD_recipes=list(
|
|||||||
|
|
||||||
switch(p_class)
|
switch(p_class)
|
||||||
if(-2) // Paint pipes
|
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.
|
// 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?"
|
user << "\The [src]'s error light flickers. Perhaps you need to only use it on pipes and pipe meters?"
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -117,30 +117,38 @@ var/const/VOX_DELAY = 600
|
|||||||
play_vox_word(word, src.z, null)
|
play_vox_word(word, src.z, null)
|
||||||
|
|
||||||
|
|
||||||
var/list/vox_digits=list(
|
var/list/vox_units=list(
|
||||||
// First index is digit position, second is digit value.
|
'sound/vox_fem/one.ogg',
|
||||||
list(
|
'sound/vox_fem/two.ogg',
|
||||||
'sound/vox_fem/one.ogg',
|
'sound/vox_fem/three.ogg',
|
||||||
'sound/vox_fem/two.ogg',
|
'sound/vox_fem/four.ogg',
|
||||||
'sound/vox_fem/three.ogg',
|
'sound/vox_fem/five.ogg',
|
||||||
'sound/vox_fem/four.ogg',
|
'sound/vox_fem/six.ogg',
|
||||||
'sound/vox_fem/five.ogg',
|
'sound/vox_fem/seven.ogg',
|
||||||
'sound/vox_fem/six.ogg',
|
'sound/vox_fem/eight.ogg',
|
||||||
'sound/vox_fem/seven.ogg',
|
'sound/vox_fem/nine.ogg',
|
||||||
'sound/vox_fem/eight.ogg',
|
'sound/vox_fem/ten.ogg',
|
||||||
'sound/vox_fem/nine.ogg'
|
'sound/vox_fem/eleven.ogg',
|
||||||
),
|
'sound/vox_fem/twelve.ogg',
|
||||||
list(
|
'sound/vox_fem/thirteen.ogg',
|
||||||
'sound/vox_fem/ten.ogg',
|
'sound/vox_fem/fourteen.ogg',
|
||||||
'sound/vox_fem/twenty.ogg',
|
'sound/vox_fem/fifteen.ogg',
|
||||||
'sound/vox_fem/thirty.ogg',
|
'sound/vox_fem/sixteen.ogg',
|
||||||
'sound/vox_fem/fourty.ogg',
|
'sound/vox_fem/seventeen.ogg',
|
||||||
'sound/vox_fem/fifty.ogg',
|
'sound/vox_fem/eighteen.ogg',
|
||||||
'sound/vox_fem/sixty.ogg',
|
'sound/vox_fem/nineteen.ogg'
|
||||||
'sound/vox_fem/seventy.ogg',
|
)
|
||||||
'sound/vox_fem/eighty.ogg',
|
|
||||||
'sound/vox_fem/ninety.ogg'
|
var/list/vox_tens=list(
|
||||||
)
|
'sound/vox_fem/ten.ogg',
|
||||||
|
'sound/vox_fem/twenty.ogg',
|
||||||
|
'sound/vox_fem/thirty.ogg',
|
||||||
|
'sound/vox_fem/fourty.ogg',
|
||||||
|
'sound/vox_fem/fifty.ogg',
|
||||||
|
'sound/vox_fem/sixty.ogg',
|
||||||
|
'sound/vox_fem/seventy.ogg',
|
||||||
|
'sound/vox_fem/eighty.ogg',
|
||||||
|
'sound/vox_fem/ninety.ogg'
|
||||||
)
|
)
|
||||||
|
|
||||||
var/list/vox_digit_suffixes = list(
|
var/list/vox_digit_suffixes = list(
|
||||||
@@ -154,33 +162,49 @@ var/list/vox_digit_suffixes = list(
|
|||||||
null,
|
null,
|
||||||
'sound/vox_fem/hundred.ogg',
|
'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)
|
/proc/vox_num2list(var/number)
|
||||||
var/list/generated[0]
|
|
||||||
if(!isnum(number))
|
if(!isnum(number))
|
||||||
|
warning("vox_num2list fed a non-number: [number]")
|
||||||
return list()
|
return list()
|
||||||
if(number == 0)
|
if(number == 0)
|
||||||
return list('sound/vox_fem/zero.ogg')
|
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)
|
/proc/play_vox_word(var/word, var/z_level, var/mob/only_listener)
|
||||||
word = lowertext(word)
|
word = lowertext(word)
|
||||||
|
|||||||
@@ -113,7 +113,7 @@
|
|||||||
for(var/obj/effect/beam/emitter/B in beams)
|
for(var/obj/effect/beam/emitter/B in beams)
|
||||||
power += B.get_damage() * config_bullet_energy
|
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
|
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')
|
var/list/audio_sounds = list('sound/AI/supermatter_integrity_before.ogg')
|
||||||
|
|||||||
Reference in New Issue
Block a user