mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-27 15:18:09 +01:00
Merge branch 'master' of https://github.com/Yawn-Wider/YWPolarisVore into UpstreamMergeApril2020
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
set name = "Toggle Debug Messages"
|
||||
set category = "Debug"
|
||||
M.debug = !M.debug
|
||||
usr << "[M]: Debug messages toggled [M.debug? "on" : "off"]."
|
||||
to_chat(usr, "[M]: Debug messages toggled [M.debug? "on" : "off"].")
|
||||
|
||||
//Generalized gas pumping proc.
|
||||
//Moves gas from one gas_mixture to another and returns the amount of power needed (assuming 1 second), or -1 if no gas was pumped.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#define MATERIAL_ALGAE "algae"
|
||||
#define MATERIAL_CARBON "carbon"
|
||||
#define MAT_ALGAE "algae"
|
||||
|
||||
/obj/machinery/atmospherics/binary/algae_farm
|
||||
name = "algae oxygen generator"
|
||||
@@ -10,15 +9,15 @@
|
||||
anchored = 1
|
||||
density = 1
|
||||
power_channel = EQUIP
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
idle_power_usage = 100 // Minimal lights to keep algae alive
|
||||
active_power_usage = 5000 // Powerful grow lights to stimulate oxygen production
|
||||
//power_rating = 7500 //7500 W ~ 10 HP
|
||||
pipe_flags = PIPING_DEFAULT_LAYER_ONLY|PIPING_ONE_PER_TURF
|
||||
|
||||
var/list/stored_material = list(MATERIAL_ALGAE = 0, MATERIAL_CARBON = 0)
|
||||
var/list/stored_material = list(MAT_ALGAE = 0, MAT_GRAPHITE = 0)
|
||||
// Capacity increases with matter bin quality
|
||||
var/list/storage_capacity = list(MATERIAL_ALGAE = 10000, MATERIAL_CARBON = 10000)
|
||||
var/list/storage_capacity = list(MAT_ALGAE = 10000, MAT_GRAPHITE = 10000)
|
||||
// Speed at which we convert CO2 to O2. Increases with manipulator quality
|
||||
var/moles_per_tick = 1
|
||||
// Power required to convert one mole of CO2 to O2 (this is powering the grow lights). Improves with capacitors
|
||||
@@ -35,7 +34,7 @@
|
||||
var/const/output_gas = "oxygen"
|
||||
|
||||
/obj/machinery/atmospherics/binary/algae_farm/filled
|
||||
stored_material = list(MATERIAL_ALGAE = 10000, MATERIAL_CARBON = 0)
|
||||
stored_material = list(MAT_ALGAE = 10000, MAT_GRAPHITE = 0)
|
||||
|
||||
/obj/machinery/atmospherics/binary/algae_farm/New()
|
||||
..()
|
||||
@@ -58,10 +57,10 @@
|
||||
..()
|
||||
recent_moles_transferred = 0
|
||||
|
||||
if(inoperable() || use_power < 2)
|
||||
if(inoperable() || use_power < USE_POWER_ACTIVE)
|
||||
ui_error = null
|
||||
update_icon()
|
||||
if(use_power == 1)
|
||||
if(use_power == USE_POWER_IDLE)
|
||||
last_power_draw = idle_power_usage
|
||||
else
|
||||
last_power_draw = 0
|
||||
@@ -70,17 +69,17 @@
|
||||
last_power_draw = active_power_usage
|
||||
|
||||
// STEP 1 - Check material resources
|
||||
if(stored_material[MATERIAL_ALGAE] < algae_per_mole)
|
||||
ui_error = "Insufficient [material_display_name(MATERIAL_ALGAE)] to process."
|
||||
if(stored_material[MAT_ALGAE] < algae_per_mole)
|
||||
ui_error = "Insufficient [material_display_name(MAT_ALGAE)] to process."
|
||||
update_icon()
|
||||
return
|
||||
if(stored_material[MATERIAL_CARBON] + carbon_per_mole > storage_capacity[MATERIAL_CARBON])
|
||||
ui_error = "[material_display_name(MATERIAL_CARBON)] output storage is full."
|
||||
if(stored_material[MAT_GRAPHITE] + carbon_per_mole > storage_capacity[MAT_GRAPHITE])
|
||||
ui_error = "[material_display_name(MAT_GRAPHITE)] output storage is full."
|
||||
update_icon()
|
||||
return
|
||||
var/moles_to_convert = min(moles_per_tick,\
|
||||
stored_material[MATERIAL_ALGAE] * algae_per_mole,\
|
||||
storage_capacity[MATERIAL_CARBON] - stored_material[MATERIAL_CARBON])
|
||||
stored_material[MAT_ALGAE] * algae_per_mole,\
|
||||
storage_capacity[MAT_GRAPHITE] - stored_material[MAT_GRAPHITE])
|
||||
|
||||
// STEP 2 - Take the CO2 out of the input!
|
||||
var/power_draw = scrub_gas(src, list(input_gas), air1, internal, moles_to_convert)
|
||||
@@ -101,8 +100,8 @@
|
||||
var/converted_moles = min(co2_moles, moles_per_tick)
|
||||
use_power(converted_moles * power_per_mole)
|
||||
last_power_draw += converted_moles * power_per_mole
|
||||
stored_material[MATERIAL_ALGAE] -= converted_moles * algae_per_mole
|
||||
stored_material[MATERIAL_CARBON] += converted_moles * carbon_per_mole
|
||||
stored_material[MAT_ALGAE] -= converted_moles * algae_per_mole
|
||||
stored_material[MAT_GRAPHITE] += converted_moles * carbon_per_mole
|
||||
|
||||
// STEP 5 - Output the converted oxygen. Fow now we output for free!
|
||||
internal.adjust_gas(input_gas, -converted_moles)
|
||||
@@ -114,7 +113,7 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/binary/algae_farm/update_icon()
|
||||
if(inoperable() || !anchored || use_power < 2)
|
||||
if(inoperable() || !anchored || use_power < USE_POWER_ACTIVE)
|
||||
icon_state = "algae-off"
|
||||
else if(recent_moles_transferred >= moles_per_tick)
|
||||
icon_state = "algae-full"
|
||||
@@ -215,13 +214,13 @@
|
||||
|
||||
// Queue management can be done even while busy
|
||||
if(href_list["activate"])
|
||||
update_use_power(2)
|
||||
update_use_power(USE_POWER_ACTIVE)
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
if(href_list["deactivate"])
|
||||
update_use_power(1)
|
||||
update_use_power(USE_POWER_IDLE)
|
||||
update_icon()
|
||||
updateUsrDialog()
|
||||
return
|
||||
@@ -275,7 +274,7 @@
|
||||
return 1
|
||||
|
||||
/material/algae
|
||||
name = MATERIAL_ALGAE
|
||||
name = MAT_ALGAE
|
||||
stack_type = /obj/item/stack/material/algae
|
||||
icon_colour = "#557722"
|
||||
shard_type = SHARD_STONE_PIECE
|
||||
@@ -288,29 +287,9 @@
|
||||
name = "algae sheet"
|
||||
icon_state = "sheet-uranium"
|
||||
color = "#557722"
|
||||
default_type = MATERIAL_ALGAE
|
||||
default_type = MAT_ALGAE
|
||||
|
||||
/obj/item/stack/material/algae/ten
|
||||
amount = 10
|
||||
|
||||
/material/carbon
|
||||
name = MATERIAL_CARBON
|
||||
stack_type = /obj/item/stack/material/carbon
|
||||
icon_colour = "#303030"
|
||||
shard_type = SHARD_SPLINTER
|
||||
weight = 5
|
||||
hardness = 20
|
||||
icon_base = "stone"
|
||||
icon_reinf = "reinf_stone"
|
||||
door_icon_base = "stone"
|
||||
sheet_singular_name = "sheet"
|
||||
sheet_plural_name = "sheets"
|
||||
|
||||
/obj/item/stack/material/carbon
|
||||
name = "carbon sheet"
|
||||
icon_state = "sheet-metal"
|
||||
color = "#303030"
|
||||
default_type = MATERIAL_CARBON
|
||||
|
||||
#undef MATERIAL_ALGAE
|
||||
#undef MATERIAL_CARBON
|
||||
#undef MAT_ALGAE
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/obj/machinery/atmospherics/binary
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
|
||||
var/datum/gas_mixture/air1
|
||||
var/datum/gas_mixture/air2
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
level = 1
|
||||
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 7500 //7500 W ~ 10 HP
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
|
||||
to_chat(user, "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W")
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/power_change()
|
||||
@@ -214,10 +214,10 @@
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
if(signal.data["power"])
|
||||
use_power = text2num(signal.data["power"])
|
||||
update_use_power(text2num(signal.data["power"]))
|
||||
|
||||
if(signal.data["power_toggle"])
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
|
||||
if(signal.data["direction"])
|
||||
pump_direction = text2num(signal.data["direction"])
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
name = "pressure regulator"
|
||||
desc = "A one-way air valve that can be used to regulate input or output pressure, and flow rate. Does not require power."
|
||||
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
|
||||
var/unlocked = 0 //If 0, then the valve is locked closed, otherwise it is open(-able, it's a one-way valve so it closes if gas would flow backwards).
|
||||
var/target_pressure = ONE_ATMOSPHERE
|
||||
@@ -67,6 +67,8 @@
|
||||
pressure_delta = input_starting_pressure - target_pressure
|
||||
if (REGULATE_OUTPUT)
|
||||
pressure_delta = target_pressure - output_starting_pressure
|
||||
if (REGULATE_NONE)
|
||||
pressure_delta = input_starting_pressure - output_starting_pressure
|
||||
|
||||
//-1 if pump_gas() did not move any gas, >= 0 otherwise
|
||||
var/returnval = -1
|
||||
@@ -82,9 +84,46 @@
|
||||
transfer_moles = min(transfer_moles, calculate_transfer_moles(air2, air1, pressure_delta, (network1)? network1.volume : 0))
|
||||
if (REGULATE_OUTPUT)
|
||||
transfer_moles = min(transfer_moles, calculate_transfer_moles(air1, air2, pressure_delta, (network2)? network2.volume : 0))
|
||||
if (REGULATE_NONE)
|
||||
var/source = air1
|
||||
var/sink = air2
|
||||
// If node1 is a network of more than 1 pipe, we want to transfer from that whole network, otw use just node1, as current
|
||||
if(istype(node1, /obj/machinery/atmospherics/pipe))
|
||||
var/obj/machinery/atmospherics/pipe/p = node1
|
||||
if(istype(p.parent, /datum/pipeline)) // Nested if-blocks to avoid the mystical :
|
||||
var/datum/pipeline/l = p.parent
|
||||
if(istype(l.air, /datum/gas_mixture))
|
||||
source = l.air
|
||||
// If node2 is a network of more than 1 pipe, we want to transfer to that whole network, otw use just node2, as current
|
||||
if(istype(node2, /obj/machinery/atmospherics/pipe))
|
||||
var/obj/machinery/atmospherics/pipe/p = node2
|
||||
if(istype(p.parent, /datum/pipeline))
|
||||
var/datum/pipeline/l = p.parent
|
||||
if(istype(l.air, /datum/gas_mixture))
|
||||
sink = l.air
|
||||
transfer_moles = max(0, calculate_equalize_moles(source, sink)) // Not regulated, don't care about flow rate
|
||||
|
||||
//pump_gas() will return a negative number if no flow occurred
|
||||
returnval = pump_gas_passive(src, air1, air2, transfer_moles)
|
||||
if(regulate_mode == REGULATE_NONE) // ACTUALLY move gases from the whole network, not just the immediate pipes
|
||||
var/source = air1
|
||||
var/sink = air2
|
||||
// If node1 is a network of more than 1 pipe, we want to transfer from that whole network, otw use just node1, as current
|
||||
if(istype(node1, /obj/machinery/atmospherics/pipe))
|
||||
var/obj/machinery/atmospherics/pipe/p = node1
|
||||
if(istype(p.parent, /datum/pipeline)) // Nested if-blocks to avoid the mystical :
|
||||
var/datum/pipeline/l = p.parent
|
||||
if(istype(l.air, /datum/gas_mixture))
|
||||
source = l.air
|
||||
// If node2 is a network of more than 1 pipe, we want to transfer to that whole network, otw use just node2, as current
|
||||
if(istype(node2, /obj/machinery/atmospherics/pipe))
|
||||
var/obj/machinery/atmospherics/pipe/p = node2
|
||||
if(istype(p.parent, /datum/pipeline))
|
||||
var/datum/pipeline/l = p.parent
|
||||
if(istype(l.air, /datum/gas_mixture))
|
||||
sink = l.air
|
||||
returnval = pump_gas_passive(src, source, sink, transfer_moles)
|
||||
else
|
||||
returnval = pump_gas_passive(src, air1, air2, transfer_moles)
|
||||
|
||||
if (returnval >= 0)
|
||||
if(network1)
|
||||
|
||||
@@ -237,10 +237,9 @@
|
||||
var/kin_to_el_ratio = 0.1 //How much kinetic energy will be taken from turbine and converted into electricity
|
||||
var/obj/machinery/atmospherics/pipeturbine/turbine
|
||||
|
||||
/obj/machinery/power/turbinemotor/New()
|
||||
..()
|
||||
spawn(1)
|
||||
updateConnection()
|
||||
/obj/machinery/power/turbinemotor/Initialize()
|
||||
. = ..()
|
||||
updateConnection()
|
||||
|
||||
/obj/machinery/power/turbinemotor/proc/updateConnection()
|
||||
turbine = null
|
||||
|
||||
@@ -26,7 +26,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
|
||||
//var/max_volume_transfer = 10000
|
||||
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 7500 //7500 W ~ 10 HP
|
||||
|
||||
@@ -47,7 +47,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/on
|
||||
icon_state = "map_on"
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/update_icon()
|
||||
@@ -160,12 +160,12 @@ Thus, the two variables affect pump operation are set in New():
|
||||
|
||||
if(signal.data["power"])
|
||||
if(text2num(signal.data["power"]))
|
||||
use_power = 1
|
||||
update_use_power(USE_POWER_IDLE)
|
||||
else
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
|
||||
if("power_toggle" in signal.data)
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
|
||||
if(signal.data["set_output_pressure"])
|
||||
target_pressure = between(
|
||||
@@ -199,7 +199,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
if(..()) return 1
|
||||
|
||||
if(href_list["power"])
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
|
||||
switch(href_list["set_press"])
|
||||
if ("min")
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
power_rating = 15000 //15000 W ~ 20 HP
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/high_power/on
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
icon_state = "map_on"
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/high_power/update_icon()
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
var/datum/omni_port/input
|
||||
var/datum/omni_port/output
|
||||
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 7500 //7500 W ~ 10 HP
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/omni/atmos_filter/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
|
||||
usr.set_machine(src)
|
||||
user.set_machine(src)
|
||||
|
||||
var/list/data = new()
|
||||
|
||||
@@ -161,13 +161,13 @@
|
||||
switch(href_list["command"])
|
||||
if("power")
|
||||
if(!configuring)
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
else
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
if("configure")
|
||||
configuring = !configuring
|
||||
if(configuring)
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
|
||||
//only allows config changes when in configuring mode ~otherwise you'll get weird pressure stuff going on
|
||||
if(configuring && !use_power)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
icon_state = "map_mixer"
|
||||
pipe_state = "omni_mixer"
|
||||
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 3700 //3700 W ~ 5 HP
|
||||
|
||||
@@ -178,13 +178,13 @@
|
||||
switch(href_list["command"])
|
||||
if("power")
|
||||
if(!configuring)
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
else
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
if("configure")
|
||||
configuring = !configuring
|
||||
if(configuring)
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
|
||||
//only allows config changes when in configuring mode ~otherwise you'll get weird pressure stuff going on
|
||||
if(configuring && !use_power)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
name = "omni device"
|
||||
icon = 'icons/atmos/omni_devices_vr.dmi' //VOREStation Edit - New Icon
|
||||
icon_state = "base"
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
initialize_directions = 0
|
||||
construction_type = /obj/item/pipe/quaternary
|
||||
level = 1
|
||||
@@ -67,7 +67,7 @@
|
||||
last_flow_rate = 0
|
||||
|
||||
if(error_check())
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
|
||||
if((stat & (NOPOWER|BROKEN)) || !use_power)
|
||||
return 0
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
var/datum/pipe_network/network
|
||||
|
||||
var/on = 0
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
level = 1
|
||||
|
||||
/obj/machinery/atmospherics/portables_connector/init_dir()
|
||||
|
||||
@@ -7,6 +7,7 @@ GLOBAL_LIST_EMPTY(shutoff_valves)
|
||||
|
||||
name = "automatic shutoff valve"
|
||||
desc = "An automatic valve with control circuitry and pipe integrity sensor, capable of automatically isolating damaged segments of the pipe network."
|
||||
description_info = "Clicking this will toggle the automatic control. Alt-clicking this when the automatic control is disabled will manually open or close the valve."
|
||||
var/close_on_leaks = TRUE // If false it will be always open
|
||||
level = 1
|
||||
|
||||
@@ -37,21 +38,97 @@ GLOBAL_LIST_EMPTY(shutoff_valves)
|
||||
to_chat(user, "You [close_on_leaks ? "enable" : "disable"] the automatic shutoff circuit.")
|
||||
return TRUE
|
||||
|
||||
// Alt+Click now toggles the open/close function, when the autoseal is disabled
|
||||
/obj/machinery/atmospherics/valve/shutoff/AltClick(var/mob/user)
|
||||
if(isliving(user))
|
||||
if(close_on_leaks)
|
||||
to_chat(user, "You try to manually [open ? "close" : "open"] the valve, but it [open ? "opens" : "closes"] automatically again.")
|
||||
return
|
||||
|
||||
open ? close() : open()
|
||||
to_chat(user, "You manually [open ? "open" : "close"] the valve.")
|
||||
|
||||
/obj/machinery/atmospherics/valve/shutoff/process()
|
||||
..()
|
||||
|
||||
if (!network_node1 || !network_node2)
|
||||
if(open)
|
||||
if(!network_node1 || !network_node2 || !node1 || !node2)
|
||||
if(open && close_on_leaks)
|
||||
close()
|
||||
return
|
||||
|
||||
if (!close_on_leaks)
|
||||
if (!open)
|
||||
if(close_on_leaks)
|
||||
if(open && (network_node1.leaks.len || network_node2.leaks.len))
|
||||
find_leaks() // If we can see the leak, then this will find it, close the valve, and cut off that network
|
||||
// If we cannot see the leak, then this will not close the valve, and any valves that can see the leak will cut it off from us
|
||||
else if(!open && !network_node1.leaks.len && !network_node2.leaks.len)
|
||||
open()
|
||||
return
|
||||
|
||||
// Breadth-first search for any leaking pipes that we can directly see
|
||||
/obj/machinery/atmospherics/valve/shutoff/proc/find_leaks()
|
||||
var/obj/machinery/atmospherics/list/search = list()
|
||||
|
||||
// We're the leak!
|
||||
if(!node1 || !node2)
|
||||
close()
|
||||
return
|
||||
|
||||
if (network_node1.leaks.len || network_node2.leaks.len)
|
||||
if (open)
|
||||
close()
|
||||
else if (!open)
|
||||
open()
|
||||
// Only searching pipes
|
||||
if(istype(node1, /obj/machinery/atmospherics))
|
||||
search |= node1
|
||||
if(istype(node2, /obj/machinery/atmospherics))
|
||||
search |= node2
|
||||
|
||||
// Breadth-first search
|
||||
for(var/i = 1, i <= search.len, i++) // wooo, proper for loop syntax!
|
||||
var/obj/machinery/atmospherics/A = search[i]
|
||||
if(!A)
|
||||
continue
|
||||
|
||||
if(istype(A, /obj/machinery/atmospherics/pipe))
|
||||
var/obj/machinery/atmospherics/pipe/L = A
|
||||
if(L.leaking)
|
||||
close() // Found the leak!
|
||||
return
|
||||
|
||||
|
||||
if(istype(A, /obj/machinery/atmospherics/valve/shutoff))
|
||||
var/obj/machinery/atmospherics/valve/shutoff/S = A
|
||||
if(S.close_on_leaks || !S.open)
|
||||
continue // Either it will close, or it is closed. We don't care what's on the other side
|
||||
search |= list(S.node1, S.node2) // |= skips existing nodes, so we don't search loops infinitely
|
||||
|
||||
else if(istype(A, /obj/machinery/atmospherics/valve)) // Putting the shutoff before this means this won't catch shutoffs
|
||||
var/obj/machinery/atmospherics/valve/V = A
|
||||
if(V.open)
|
||||
search |= list(V.node1, V.node2)
|
||||
else
|
||||
continue // Closed valve, dead end
|
||||
|
||||
else if(istype(A, /obj/machinery/atmospherics/tvalve))
|
||||
var/obj/machinery/atmospherics/tvalve/T = A
|
||||
if(T.state)
|
||||
search |= list(T.node1, T.node2)
|
||||
else
|
||||
search |= list(T.node1, T.node3)
|
||||
|
||||
else if(istype(A, /obj/machinery/atmospherics/pipe/zpipe))
|
||||
var/obj/machinery/atmospherics/pipe/zpipe/P = A
|
||||
search |= list(P.node1, P.node2)
|
||||
|
||||
else if(istype(A, /obj/machinery/atmospherics/pipe/simple))
|
||||
var/obj/machinery/atmospherics/pipe/P = A
|
||||
search |= list(P.node1, P.node2)
|
||||
|
||||
else if(istype(A, /obj/machinery/atmospherics/pipe/manifold))
|
||||
var/obj/machinery/atmospherics/pipe/manifold/M = A
|
||||
search |= list(M.node1, M.node2, M.node3)
|
||||
|
||||
else if(istype(A, /obj/machinery/atmospherics/pipe/manifold4w))
|
||||
var/obj/machinery/atmospherics/pipe/manifold4w/M = A
|
||||
search |= list(M.node1, M.node2, M.node3, M.node4)
|
||||
|
||||
// else continue, dead end
|
||||
// We broke out of the loop, so we see no leaks
|
||||
// The leaks therefore must be on the other side of another shutoff valve
|
||||
return
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
name = "Gas filter"
|
||||
desc = "Filters one type of gas from an input, and pushes it out the side."
|
||||
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 7500 //This also doubles as a measure of how powerful the filter is, in Watts. 7500 W ~ 10 HP
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
icon_state += use_power ? "on" : "off"
|
||||
else
|
||||
icon_state += "off"
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/atmos_filter/process()
|
||||
..()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
name = "Gas mixer"
|
||||
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 3700 //This also doubles as a measure of how powerful the mixer is, in Watts. 3700 W ~ 5 HP
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
icon_state += use_power ? "on" : "off"
|
||||
else
|
||||
icon_state += "off"
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/mixer/New()
|
||||
..()
|
||||
@@ -114,7 +114,7 @@
|
||||
/obj/machinery/atmospherics/trinary/mixer/Topic(href,href_list)
|
||||
if(..()) return 1
|
||||
if(href_list["power"])
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
if(href_list["set_press"])
|
||||
var/max_flow_rate = min(air1.volume, air2.volume)
|
||||
var/new_flow_rate = input(usr,"Enter new flow rate limit (0-[max_flow_rate]L/s)","Flow Rate Control",src.set_flow_rate) as num
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/obj/machinery/atmospherics/trinary
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH|WEST
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
pipe_flags = PIPING_DEFAULT_LAYER_ONLY|PIPING_ONE_PER_TURF
|
||||
|
||||
var/mirrored = FALSE
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
icon_state = "freezer_0"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
idle_power_usage = 5 // 5 Watts for thermostat related circuitry
|
||||
circuit = /obj/item/weapon/circuitboard/unary_atmos/cooler
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
if(..())
|
||||
return 1
|
||||
if(href_list["toggleStatus"])
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
update_icon()
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
icon_state = "heater_0"
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
idle_power_usage = 5 //5 Watts for thermostat related circuitry
|
||||
circuit = /obj/item/weapon/circuitboard/unary_atmos/heater
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
if(..())
|
||||
return 1
|
||||
if(href_list["toggleStatus"])
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
update_icon()
|
||||
if(href_list["temp"])
|
||||
var/amount = text2num(href_list["temp"])
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
name = "air injector"
|
||||
desc = "Passively injects air into its surroundings. Has a valve attached to it that can control flow rate."
|
||||
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 15000 //15000 W ~ 20 HP
|
||||
|
||||
@@ -132,10 +132,10 @@
|
||||
return 0
|
||||
|
||||
if(signal.data["power"])
|
||||
use_power = text2num(signal.data["power"])
|
||||
update_use_power(text2num(signal.data["power"]))
|
||||
|
||||
if(signal.data["power_toggle"])
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
|
||||
if(signal.data["inject"])
|
||||
spawn inject()
|
||||
@@ -160,7 +160,7 @@
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/attack_hand(mob/user as mob)
|
||||
to_chat(user, "<span class='notice'>You toggle \the [src].</span>")
|
||||
injecting = !injecting
|
||||
use_power = injecting
|
||||
update_use_power(injecting ? USE_POWER_IDLE : USE_POWER_OFF)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
name = "Air Vent"
|
||||
desc = "Has a valve and pump attached to it"
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 30000 //7500 W ~ 10 HP //VOREStation Edit - 30000 W
|
||||
|
||||
@@ -50,18 +50,18 @@
|
||||
var/datum/looping_sound/air_pump/soundloop //Yawn Edit
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/on
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
icon_state = "map_vent_out"
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/siphon
|
||||
pump_direction = 0
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/siphon/on
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
icon_state = "map_vent_in"
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/siphon/on/atmos
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
icon_state = "map_vent_in"
|
||||
external_pressure_bound = 0
|
||||
external_pressure_bound_default = 0
|
||||
@@ -189,7 +189,7 @@
|
||||
return 1
|
||||
|
||||
if (!node)
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
if(!can_pump())
|
||||
return 0
|
||||
|
||||
@@ -311,10 +311,10 @@
|
||||
pump_direction = 1
|
||||
|
||||
if(signal.data["power"] != null)
|
||||
use_power = text2num(signal.data["power"])
|
||||
update_use_power(text2num(signal.data["power"]))
|
||||
|
||||
if(signal.data["power_toggle"] != null)
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
|
||||
if(signal.data["checks"] != null)
|
||||
if (signal.data["checks"] == "default")
|
||||
@@ -405,11 +405,11 @@
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
|
||||
to_chat(user, "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W")
|
||||
else
|
||||
user << "You are too far away to read the gauge."
|
||||
to_chat(user, "You are too far away to read the gauge.")
|
||||
if(welded)
|
||||
user << "It seems welded shut."
|
||||
to_chat(user, "It seems welded shut.")
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/power_change()
|
||||
var/old_stat = stat
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
name = "Air Scrubber"
|
||||
desc = "Has a valve and pump attached to it"
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
idle_power_usage = 150 //internal circuitry, friction losses and stuff
|
||||
power_rating = 7500 //7500 W ~ 10 HP
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
var/radio_filter_in
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/on
|
||||
use_power = 1
|
||||
use_power = USE_POWER_IDLE
|
||||
icon_state = "map_scrubber_on"
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/New()
|
||||
@@ -135,7 +135,7 @@
|
||||
return 1
|
||||
|
||||
if (!node)
|
||||
use_power = 0
|
||||
update_use_power(USE_POWER_OFF)
|
||||
//broadcast_status()
|
||||
if(!use_power || (stat & (NOPOWER|BROKEN)))
|
||||
return 0
|
||||
@@ -180,21 +180,21 @@
|
||||
return 0
|
||||
|
||||
if(signal.data["power"] != null)
|
||||
use_power = text2num(signal.data["power"])
|
||||
update_use_power(text2num(signal.data["power"]))
|
||||
if(signal.data["power_toggle"] != null)
|
||||
use_power = !use_power
|
||||
update_use_power(!use_power)
|
||||
|
||||
if(signal.data["panic_siphon"]) //must be before if("scrubbing" thing
|
||||
panic = text2num(signal.data["panic_siphon"])
|
||||
if(panic)
|
||||
use_power = 1
|
||||
update_use_power(USE_POWER_IDLE)
|
||||
scrubbing = 0
|
||||
else
|
||||
scrubbing = 1
|
||||
if(signal.data["toggle_panic_siphon"] != null)
|
||||
panic = !panic
|
||||
if(panic)
|
||||
use_power = 1
|
||||
update_use_power(USE_POWER_IDLE)
|
||||
scrubbing = 0
|
||||
else
|
||||
scrubbing = 1
|
||||
@@ -288,6 +288,6 @@
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
|
||||
to_chat(user, "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W")
|
||||
else
|
||||
user << "You are too far away to read the gauge."
|
||||
to_chat(user, "You are too far away to read the gauge.")
|
||||
|
||||
@@ -308,4 +308,4 @@
|
||||
|
||||
/obj/machinery/atmospherics/valve/examine(mob/user)
|
||||
..()
|
||||
user << "It is [open ? "open" : "closed"]."
|
||||
to_chat(user, "It is [open ? "open" : "closed"].")
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
var/leaking = FALSE // Do not set directly, use set_leaking(TRUE/FALSE)
|
||||
|
||||
layer = PIPES_LAYER
|
||||
use_power = 0
|
||||
use_power = USE_POWER_OFF
|
||||
|
||||
pipe_flags = 0 // Does not have PIPING_DEFAULT_LAYER_ONLY flag.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user