mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-31 07:57:47 +01:00
Singularity now wont leave floor under eaten walls.
Cryo wont spit out beaker. Fixed message "You don't have the dexterity to do this" for machinery. PIPES: - Heat exchange pipes are constructable now. - Insulated pipes also were added to pipe dispenser; - And meters too; - Easy pipe rotating in hands; - bent pipes actually looks bent under construction (may be glitches, please report); - pipes now wont cover wires; - pipes unwrenching now possible; - large vent pumps now uses power as equipment, not environment - pumps now uses power; Air alarm improvements: - all alarms in area controls all environment machines in area; - machines initializes itself automatically and without interloping with existing ones; - air alarms wont duplicates it air monitoring and can clear itself; Some other typos and small issues were fixed. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@816 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -38,18 +38,19 @@ obj/machinery/atmospherics/binary/pump
|
||||
icon_state = "exposed_2_off"
|
||||
else
|
||||
icon_state = "exposed_3_off"
|
||||
on = 0
|
||||
|
||||
return
|
||||
|
||||
process()
|
||||
..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(!on)
|
||||
return 0
|
||||
use_power(5)
|
||||
|
||||
var/output_starting_pressure = air2.return_pressure()
|
||||
|
||||
if(output_starting_pressure >= target_pressure)
|
||||
if( (target_pressure - output_starting_pressure) < 0.01)
|
||||
//No need to pump gas if target is already reached!
|
||||
return 1
|
||||
|
||||
@@ -68,6 +69,7 @@ obj/machinery/atmospherics/binary/pump
|
||||
if(network2)
|
||||
network2.update = 1
|
||||
|
||||
use_power(round(air2.volume/12))
|
||||
return 1
|
||||
|
||||
//Radio remote control
|
||||
@@ -95,6 +97,22 @@ obj/machinery/atmospherics/binary/pump
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
return 1
|
||||
interact(mob/user as mob)
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output pressure: </b>
|
||||
<a href='?src=\ref[src];out_press=-1000'><b>-</b></a>
|
||||
<a href='?src=\ref[src];out_press=-100'><b>-</b></a>
|
||||
<a href='?src=\ref[src];out_press=-10'><b>-</b></a>
|
||||
<a href='?src=\ref[src];out_press=-1'>-</a>
|
||||
[round(target_pressure,0.1)]kPa
|
||||
<a href='?src=\ref[src];out_press=1'>+</a>
|
||||
<a href='?src=\ref[src];out_press=10'><b>+</b></a>
|
||||
<a href='?src=\ref[src];out_press=100'><b>+</b></a>
|
||||
<a href='?src=\ref[src];out_press=1000'><b>+</b></a>
|
||||
"}
|
||||
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_pump")
|
||||
onclose(user, "atmo_pump")
|
||||
|
||||
var/frequency = 0
|
||||
var/id = null
|
||||
@@ -138,19 +156,7 @@ obj/machinery/atmospherics/binary/pump
|
||||
user << "\red Access denied."
|
||||
return
|
||||
usr.machine = src
|
||||
var/dat = {"<b>Power: </b><a href='?src=\ref[src];power=1'>[on?"On":"Off"]</a><br>
|
||||
<b>Desirable output pressure: </b>
|
||||
<a href='?src=\ref[src];out_press=-100'><b>-</b></a>
|
||||
<a href='?src=\ref[src];out_press=-10'><b>-</b></a>
|
||||
<a href='?src=\ref[src];out_press=-1'>-</a>
|
||||
[round(target_pressure,0.1)]kPa
|
||||
<a href='?src=\ref[src];out_press=1'>+</a>
|
||||
<a href='?src=\ref[src];out_press=10'><b>+</b></a>
|
||||
<a href='?src=\ref[src];out_press=100'><b>+</b></a>
|
||||
"}
|
||||
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD><TT>[dat]</TT>", "window=atmo_pump")
|
||||
onclose(user, "atmo_pump")
|
||||
interact(user)
|
||||
return
|
||||
|
||||
Topic(href,href_list)
|
||||
@@ -158,6 +164,37 @@ obj/machinery/atmospherics/binary/pump
|
||||
on = !on
|
||||
if(href_list["out_press"])
|
||||
src.target_pressure = max(0, min(4500, src.target_pressure + text2num(href_list["out_press"])))
|
||||
usr.machine = src
|
||||
src.update_icon()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
power_change()
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.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(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/weapon/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
@@ -347,6 +347,7 @@ obj/machinery/atmospherics/filter/attack_hand(user as mob) // -- TLE
|
||||
<A href='?src=\ref[src];filterset=4'>Nitrous Oxide</A><BR>
|
||||
<A href='?src=\ref[src];filterset=-1'>Nothing</A><BR>
|
||||
<HR><B>Desirable output pressure:</B>
|
||||
<a href='?src=\ref[src];out_press=-1000'><b>-</b></a>
|
||||
<a href='?src=\ref[src];out_press=-100'><b>-</b></a>
|
||||
<a href='?src=\ref[src];out_press=-10'><b>-</b></a>
|
||||
<a href='?src=\ref[src];out_press=-1'>-</a>
|
||||
@@ -354,6 +355,7 @@ obj/machinery/atmospherics/filter/attack_hand(user as mob) // -- TLE
|
||||
<a href='?src=\ref[src];out_press=1'>+</a>
|
||||
<a href='?src=\ref[src];out_press=10'><b>+</b></a>
|
||||
<a href='?src=\ref[src];out_press=100'><b>+</b></a>
|
||||
<a href='?src=\ref[src];out_press=1000'><b>+</b></a>
|
||||
"}
|
||||
/*
|
||||
user << browse("<HEAD><TITLE>[src.name] control</TITLE></HEAD>[dat]","window=atmo_filter")
|
||||
|
||||
@@ -127,3 +127,29 @@
|
||||
|
||||
return null
|
||||
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (connected_device)
|
||||
user << "\red You cannot unwrench this [src], dettach [connected_device] first."
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.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(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/weapon/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
@@ -6,14 +6,9 @@
|
||||
desc = "Has a valve and pump attached to it"
|
||||
|
||||
level = 1
|
||||
|
||||
high_volume
|
||||
name = "Large Air Vent"
|
||||
|
||||
New()
|
||||
..()
|
||||
|
||||
air_contents.volume = 1000
|
||||
var/channel = ENVIRON
|
||||
var/area_uid
|
||||
var/id = null
|
||||
|
||||
var/on = 0
|
||||
var/pump_direction = 1 //0 = siphoning, 1 = releasing
|
||||
@@ -28,6 +23,26 @@
|
||||
|
||||
var/welded = 0 // Added for aliens -- TLE
|
||||
|
||||
var/frequency = 1439
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
|
||||
New()
|
||||
var/area/A = get_area(loc)
|
||||
if (A.master)
|
||||
A = A.master
|
||||
area_uid = A.uid
|
||||
..()
|
||||
if (!id)
|
||||
id = "\ref[src]"
|
||||
|
||||
high_volume
|
||||
name = "Large Air Vent"
|
||||
New()
|
||||
..()
|
||||
channel = EQUIP
|
||||
air_contents.volume = 1000
|
||||
|
||||
update_icon()
|
||||
if(on && !(stat & (NOPOWER|BROKEN)))
|
||||
if(pump_direction)
|
||||
@@ -38,6 +53,7 @@
|
||||
icon_state = "[level == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
|
||||
return
|
||||
|
||||
process()
|
||||
..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
@@ -45,9 +61,10 @@
|
||||
if (!node)
|
||||
on = 0
|
||||
broadcast_status()
|
||||
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
use_power(5, channel)
|
||||
if(welded)
|
||||
return 0
|
||||
|
||||
@@ -67,8 +84,8 @@
|
||||
var/transfer_moles = pressure_delta*environment.volume/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
|
||||
|
||||
use_power(10, ENVIRON)
|
||||
|
||||
use_power(round(air_contents.volume/12), channel)
|
||||
loc.assume_air(removed)
|
||||
|
||||
if(network)
|
||||
@@ -76,7 +93,6 @@
|
||||
|
||||
else //external -> internal
|
||||
var/pressure_delta = 10000
|
||||
|
||||
if(pressure_checks&1)
|
||||
pressure_delta = min(pressure_delta, (environment_pressure - external_pressure_bound))
|
||||
if(pressure_checks&2)
|
||||
@@ -89,7 +105,9 @@
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
if (isnull(removed)) //in space
|
||||
return
|
||||
use_power(10, ENVIRON)
|
||||
|
||||
|
||||
use_power(round(air_contents.volume/12), channel)
|
||||
air_contents.merge(removed)
|
||||
|
||||
if(network)
|
||||
@@ -114,21 +132,20 @@
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data["tag"] = id
|
||||
signal.data["area"] = src.area_uid
|
||||
signal.data["tag"] = src.id
|
||||
signal.data["device"] = "AVP"
|
||||
signal.data["power"] = on?("on"):("off")
|
||||
signal.data["direction"] = pump_direction?("release"):("siphon")
|
||||
signal.data["checks"] = pressure_checks
|
||||
signal.data["internal"] = internal_pressure_bound
|
||||
signal.data["external"] = external_pressure_bound
|
||||
signal.data["timestamp"] = air_master.current_cycle
|
||||
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
return 1
|
||||
|
||||
var/frequency = 0
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
initialize()
|
||||
..()
|
||||
@@ -137,7 +154,7 @@
|
||||
update_icon()
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(signal.data["tag"] && (signal.data["tag"] != id))
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id))
|
||||
return 0
|
||||
|
||||
switch(signal.data["command"])
|
||||
@@ -185,6 +202,9 @@
|
||||
|
||||
external_pressure_bound = number
|
||||
|
||||
if("init")
|
||||
name = signal.data["parameter"]
|
||||
|
||||
if(signal.data["tag"])
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
@@ -225,8 +245,34 @@
|
||||
usr << "It seems welded shut."
|
||||
|
||||
power_change()
|
||||
if(powered(ENVIRON))
|
||||
if(powered(channel))
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
stat |= NOPOWER
|
||||
update_icon()
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.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(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/weapon/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
@@ -20,6 +20,16 @@
|
||||
var/volume_rate = 120
|
||||
var/panic = 0 //is this scrubber panicked?
|
||||
|
||||
var/area_uid
|
||||
|
||||
New()
|
||||
var/area/A = get_area(loc)
|
||||
if (A.master)
|
||||
A = A.master
|
||||
area_uid = A.uid
|
||||
id_tag = "\ref[src]"
|
||||
..()
|
||||
|
||||
update_icon()
|
||||
if(node && on && !(stat & (NOPOWER|BROKEN)))
|
||||
if(scrubbing)
|
||||
@@ -42,6 +52,8 @@
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
signal.data["area"] = area_uid
|
||||
signal.data["tag"] = id_tag
|
||||
signal.data["device"] = "AScr"
|
||||
signal.data["timestamp"] = air_master.current_cycle
|
||||
@@ -57,8 +69,8 @@
|
||||
|
||||
initialize()
|
||||
..()
|
||||
set_frequency(frequency)
|
||||
update_icon()
|
||||
if (frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
|
||||
process()
|
||||
@@ -82,7 +94,8 @@
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
if (isnull(removed)) //in space
|
||||
return
|
||||
use_power(30, ENVIRON)
|
||||
var/power = (scrub_Toxins+scrub_CO2+scrub_N2O)*volume_rate/12
|
||||
use_power(round(power+5), ENVIRON)
|
||||
//Filter it
|
||||
var/datum/gas_mixture/filtered_out = new
|
||||
filtered_out.temperature = removed.temperature
|
||||
@@ -112,7 +125,9 @@
|
||||
network.update = 1
|
||||
|
||||
else //Just siphoning all air
|
||||
use_power(volume_rate/12, ENVIRON)
|
||||
if (air_contents.return_pressure()>=50*ONE_ATMOSPHERE)
|
||||
return
|
||||
use_power(round(volume_rate/12)+5, ENVIRON)
|
||||
var/transfer_moles = environment.total_moles()*(volume_rate/environment.volume)
|
||||
|
||||
var/datum/gas_mixture/removed = loc.remove_air(transfer_moles)
|
||||
@@ -137,7 +152,7 @@
|
||||
*/
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(signal.data["tag"] && (signal.data["tag"] != id_tag))
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag))
|
||||
return ..()
|
||||
|
||||
switch(signal.data["command"])
|
||||
@@ -160,6 +175,8 @@
|
||||
else
|
||||
scrubbing = 1
|
||||
volume_rate = initial(volume_rate)
|
||||
if("init")
|
||||
name = signal.data["parameter"]
|
||||
if(signal.data["tag"])
|
||||
spawn(2)
|
||||
broadcast_status()
|
||||
@@ -172,3 +189,29 @@
|
||||
else
|
||||
stat |= NOPOWER
|
||||
update_icon()
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && on)
|
||||
user << "\red You cannot unwrench this [src], turn it off first."
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.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(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/weapon/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
@@ -150,19 +150,19 @@ obj/machinery/atmospherics/valve
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,direction))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
connect_directions &= ~direction
|
||||
|
||||
node1 = target
|
||||
break
|
||||
break
|
||||
if(node1)
|
||||
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
|
||||
break
|
||||
break
|
||||
if(node1)
|
||||
break
|
||||
|
||||
build_network()
|
||||
if(!network_node1 && node1)
|
||||
@@ -258,4 +258,30 @@ obj/machinery/atmospherics/valve
|
||||
if(open)
|
||||
close()
|
||||
else
|
||||
open()
|
||||
open()
|
||||
|
||||
attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
if (!istype(W, /obj/item/weapon/wrench))
|
||||
return ..()
|
||||
if (istype(src, /obj/machinery/atmospherics/valve/digital))
|
||||
user << "\red You cannot unwrench this [src], it's too complicated."
|
||||
return 1
|
||||
var/turf/T = src.loc
|
||||
if (level==1 && isturf(T) && T.intact)
|
||||
user << "\red You must remove the plating first."
|
||||
return 1
|
||||
var/datum/gas_mixture/int_air = return_air()
|
||||
var/datum/gas_mixture/env_air = loc.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(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/weapon/pipe(loc, make_from=src)
|
||||
del(src)
|
||||
|
||||
Reference in New Issue
Block a user