Pipe bursting.

This commit is contained in:
Rob Nelson
2014-11-24 22:46:28 -08:00
parent a2742580fb
commit c3b4c48ce1
9 changed files with 12210 additions and 12082 deletions

View File

@@ -63,6 +63,7 @@
#include "code\_onclick\hud\robot.dm"
#include "code\_onclick\hud\screen_objects.dm"
#include "code\ATMOSPHERICS\atmospherics.dm"
#include "code\ATMOSPHERICS\burstpipe.dm"
#include "code\ATMOSPHERICS\chiller.dm"
#include "code\ATMOSPHERICS\datum_pipe_network.dm"
#include "code\ATMOSPHERICS\datum_pipeline.dm"

View File

@@ -0,0 +1,41 @@
/obj/machinery/atmospherics/pipe/vent/burstpipe
icon = 'icons/obj/pipes.dmi'
icon_state = "burst"
name = "burst pipe"
desc = "A section of burst piping. Leaks like a sieve."
//level = 1
volume = 1000 // large volume
dir = SOUTH
initialize_directions = SOUTH
/obj/machinery/atmospherics/pipe/vent/burstpipe/New(var/_loc, var/setdir=SOUTH)
// Easier spawning.
dir=setdir
..(_loc)
/obj/machinery/atmospherics/pipe/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()
alpha = invisibility ? 128 : 255
if(!node1)
qdel(src) //TODO: silent deleting looks weird
/obj/machinery/atmospherics/pipe/vent/burstpipe/ex_act(var/severity)
return // We're already damaged. :^)
/obj/machinery/atmospherics/pipe/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)
playsound(T, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You begin to remove \the [src]..."
if (do_after(user, 40))
user.visible_message( \
"[user] removes \the [src].", \
"\blue You have removed \the [src].", \
"You hear a ratchet.")
//new /obj/item/pipe(T, make_from=src)
del(src)

View File

@@ -1,6 +1,6 @@
var/global/list/datum/pipe_network/pipe_networks = list()
datum/pipe_network
/datum/pipe_network
var/list/datum/gas_mixture/gases = list() //All of the gas_mixtures continuously connected in this network
var/list/obj/machinery/atmospherics/normal_members = list()
@@ -21,9 +21,11 @@ datum/pipe_network
update = 0
reconcile_air() //equalize_gases(gases)
#ifdef ATMOS_PIPELINE_PROCESSING
//Give pipelines their process call for pressure checking and what not. Have to remove pressure checks for the time being as pipes dont radiate heat - Mport
//for(var/datum/pipeline/line_member in line_members)
// line_member.process()
for(var/datum/pipeline/line_member in line_members)
line_member.process()
#endif
proc/build_network(obj/machinery/atmospherics/start_normal, obj/machinery/atmospherics/reference)
//Purpose: Generate membership roster

View File

@@ -94,9 +94,11 @@
var/obj/machinery/atmospherics/node2
var/minimum_temperature_difference = 300
var/thermal_conductivity = 0 //WALL_HEAT_TRANSFER_COEFFICIENT No
var/maximum_pressure = 70*ONE_ATMOSPHERE
var/fatigue_pressure = 55*ONE_ATMOSPHERE
alert_pressure = 55*ONE_ATMOSPHERE
var/maximum_pressure = 100*ONE_ATMOSPHERE // 10132.5 kPa
var/fatigue_pressure = 80 *ONE_ATMOSPHERE // 8106 kPa
alert_pressure = 80 *ONE_ATMOSPHERE
level = 1
/obj/machinery/atmospherics/pipe/simple/New()
@@ -184,28 +186,75 @@
/obj/machinery/atmospherics/pipe/simple/check_pressure(pressure)
if(!loc)
return
var/datum/gas_mixture/environment = loc.return_air()
var/pressure_difference = pressure - environment.return_pressure()
if(pressure_difference > maximum_pressure)
if(pressure_difference > maximum_pressure && prob(25))
burst()
else if(pressure_difference > fatigue_pressure && prob(5))
groan()
else
return 1
else if(pressure_difference > fatigue_pressure)
/obj/machinery/atmospherics/pipe/simple/examine()
..()
usr << "<span class='info'>This [src.name] is rated up to [format_num(alert_pressure)] kPa.</span>"
if(prob(5))
burst()
/obj/machinery/atmospherics/pipe/simple/proc/groan()
src.visible_message("<span class='warning'>\The [src] groans from the pressure!</span>");
else return 1
// Need SFX for groaning metal.
//playsound(get_turf(src), 'sound/effects/groan.ogg', 25, 1)
/obj/machinery/atmospherics/pipe/simple/proc/burst()
src.visible_message("\red \bold [src] bursts!");
src.visible_message("<span class='danger'>\The [src] bursts!</span>");
message_admins("Pipe burst in area [formatJumpTo(src.loc)]")
var/area/A=get_area_master(src)
log_game("Pipe burst in area [A.name] ")
var/node_id=0
for(var/direction in cardinal)
if(initialize_directions & direction)
node_id++
var/obj/machinery/atmospherics/found
var/node_type=getNodeType(node_id)
switch(node_type)
if(PIPE_TYPE_STANDARD)
found = findConnecting(direction)
if(PIPE_TYPE_HE)
found = findConnectingHE(direction)
else
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 (loc, setdir=direction)
BP.color=src.color
BP.invisibility=src.invisibility
BP.level=src.level
BP.initialize()
BP.update_icon()
BP.build_network()
if(prob(50))
explosion(get_turf(src), -1, 1, 2, adminlog=0)
else
explosion(get_turf(src), 0, 1, 2, adminlog=0)
if(src && src.loc!=null)
qdel(src)
/*
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()
@@ -337,9 +386,11 @@
icon = 'icons/obj/atmospherics/insulated.dmi'
minimum_temperature_difference = 10000
thermal_conductivity = 0
maximum_pressure = 1000*ONE_ATMOSPHERE
fatigue_pressure = 900*ONE_ATMOSPHERE
alert_pressure = 900*ONE_ATMOSPHERE
maximum_pressure = 1000000 // 1M kPa
fatigue_pressure = 900000 // 900k kPa
alert_pressure = 900000
available_colors = list(
"red"=IPIPE_COLOR_RED,
"blue"=IPIPE_COLOR_BLUE
@@ -360,6 +411,7 @@
/obj/machinery/atmospherics/pipe/simple/insulated/hidden/blue
color=IPIPE_COLOR_BLUE
_color = "blue"
/obj/machinery/atmospherics/pipe/tank
icon = 'icons/obj/atmospherics/pipe_tank.dmi'
icon_state = "intact"

View File

@@ -67,6 +67,11 @@
/proc/adminscrub(var/t,var/limit=MAX_MESSAGE_LEN)
return copytext((html_encode(strip_html_simple(t))),1,limit)
/proc/reverse_text(txt)
var/i = length(txt)+1
. = ""
while(--i)
. += copytext(txt,i,i+1)
/*
* returns null if there is any bad text in the string
@@ -322,8 +327,22 @@ proc/checkhtml(var/t)
count++
return count
/proc/reverse_text(var/text = "")
var/new_text = ""
for(var/i = length(text); i > 0; i--)
new_text += copytext(text, i, i+1)
return new_text
/**
* Format number with thousands seperators.
* @param number Number to format.
* @param sep Seperator to use
*/
/proc/format_num(var/number, var/sep=",")
var/c="" // Current char
var/origtext = "[number]"
var/len = length(origtext)
var/offset = len % 3
for(var/i=1;i<=len;i++)
c = copytext(origtext,i,i+1)
if(c==".")
. += copytext(origtext,i) // Just paste in everything else.
break
else
. += c
if((i%3)==offset && i!=len)
. += sep

View File

@@ -13,6 +13,17 @@
var/turf/x2y2 = locate(((Center.x+Dist)>world.maxx ? world.maxx : Center.x+Dist),((Center.y+Dist)>world.maxy ? world.maxy : Center.y+Dist),Center.z)
return block(x1y1, x2y2)
/**
* Make boom
*
* @param epicenter Where explosion is centered
* @param devastation_range
* @param heavy_impact_range
* @param light_impact_range
* @param flash_range Unused
* @param adminlog Log to admins
* @param squelch Do not notify explosion listeners
*/
/proc/explosion(turf/epicenter, const/devastation_range, const/heavy_impact_range, const/light_impact_range, const/flash_range, adminlog = 1, squelch = 0)
src = null //so we don't abort once src is deleted

View File

@@ -934,4 +934,7 @@ var/list/RESTRICTED_CAMERA_NETWORKS = list( //Those networks can only be accesse
// EMOTES!
#define VISIBLE 1
#define HEARABLE 2
#define HEARABLE 2
// /vg/ - Pipeline processing (enables exploding pipes and whatnot)
#define ATMOS_PIPELINE_PROCESSING 1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 78 KiB

File diff suppressed because it is too large Load Diff