mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 00:21:11 +01:00
Repath obj/machinery to obj/structure/machinery [MDB Ignore] (#22500)
Repaths obj/machinery to obj/structure/machinery. **Note for reviewers:** the only meaningful changed code exists within **code/game/objects/structures.dm** and **code/game/objects/structures/_machinery.dm**, largely concerning damage procs. With the exception of moving airlock defines to their own file, ALL OTHER CHANGES ARE STRICTLY PATH CHANGES. Objects, _categorically_, are largely divided between those you can hold in your hand/inventory and those you can't. Machinery objects are already subtypes of Structures behaviorally, this PR just makes their pathing reflect that, and allows for future work (tool actions, more health/destruction functionality) to be developed without unnecessary code duplication. I have tested this PR by loading up the Horizon and dismantling various machines and structures with tools, shooting guns of various types throughout the ship, and detonating a bunch of explosions throughout the ship.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/obj/machinery/atmospherics/binary
|
||||
/obj/structure/machinery/atmospherics/binary
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH
|
||||
layer = EXPOSED_PIPE_LAYER
|
||||
@@ -9,7 +9,7 @@
|
||||
var/datum/pipe_network/network1
|
||||
var/datum/pipe_network/network2
|
||||
|
||||
/obj/machinery/atmospherics/binary/Initialize()
|
||||
/obj/structure/machinery/atmospherics/binary/Initialize()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
initialize_directions = NORTH|SOUTH
|
||||
@@ -27,7 +27,7 @@
|
||||
. = ..()
|
||||
|
||||
// Housekeeping and pipe network stuff below
|
||||
/obj/machinery/atmospherics/binary/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
||||
/obj/structure/machinery/atmospherics/binary/network_expand(datum/pipe_network/new_network, obj/structure/machinery/atmospherics/pipe/reference)
|
||||
if(reference == node1)
|
||||
network1 = new_network
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/binary/Destroy()
|
||||
/obj/structure/machinery/atmospherics/binary/Destroy()
|
||||
QDEL_NULL(air1)
|
||||
QDEL_NULL(air2)
|
||||
|
||||
@@ -57,19 +57,19 @@
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/atmos_init()
|
||||
/obj/structure/machinery/atmospherics/binary/atmos_init()
|
||||
if(node1 && node2) return
|
||||
|
||||
var/node2_connect = dir
|
||||
var/node1_connect = turn(dir, 180)
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node1_connect))
|
||||
for(var/obj/structure/machinery/atmospherics/target in get_step(src,node1_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
if (check_connect_types(target,src))
|
||||
node1 = target
|
||||
break
|
||||
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node2_connect))
|
||||
for(var/obj/structure/machinery/atmospherics/target in get_step(src,node2_connect))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
if (check_connect_types(target,src))
|
||||
node2 = target
|
||||
@@ -78,7 +78,7 @@
|
||||
update_icon()
|
||||
update_underlays()
|
||||
|
||||
/obj/machinery/atmospherics/binary/build_network()
|
||||
/obj/structure/machinery/atmospherics/binary/build_network()
|
||||
if(!network1 && node1)
|
||||
network1 = new /datum/pipe_network()
|
||||
network1.normal_members += src
|
||||
@@ -90,7 +90,7 @@
|
||||
network2.build_network(node2, src)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/binary/return_network(obj/machinery/atmospherics/reference)
|
||||
/obj/structure/machinery/atmospherics/binary/return_network(obj/structure/machinery/atmospherics/reference)
|
||||
build_network()
|
||||
|
||||
if(reference==node1)
|
||||
@@ -101,7 +101,7 @@
|
||||
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/binary/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
|
||||
/obj/structure/machinery/atmospherics/binary/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
|
||||
if(network1 == old_network)
|
||||
network1 = new_network
|
||||
if(network2 == old_network)
|
||||
@@ -109,7 +109,7 @@
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/return_network_air(datum/pipe_network/reference)
|
||||
/obj/structure/machinery/atmospherics/binary/return_network_air(datum/pipe_network/reference)
|
||||
var/list/results = list()
|
||||
|
||||
if(network1 == reference)
|
||||
@@ -119,7 +119,7 @@
|
||||
|
||||
return results
|
||||
|
||||
/obj/machinery/atmospherics/binary/disconnect(obj/machinery/atmospherics/reference)
|
||||
/obj/structure/machinery/atmospherics/binary/disconnect(obj/structure/machinery/atmospherics/reference)
|
||||
if(reference==node1)
|
||||
qdel(network1)
|
||||
node1 = null
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
return null
|
||||
|
||||
/obj/machinery/atmospherics/binary/AltClick(var/mob/user)
|
||||
/obj/structure/machinery/atmospherics/binary/AltClick(var/mob/user)
|
||||
if(src.anchored)
|
||||
if(!allowed(user))
|
||||
balloon_alert(user, "Access denied.")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//node1, air1, network1 correspond to input
|
||||
//node2, air2, network2 correspond to output
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator
|
||||
/obj/structure/machinery/atmospherics/binary/circulator
|
||||
name = "circulator"
|
||||
desc = "A gas circulator turbine and heat exchanger."
|
||||
icon = 'icons/obj/power.dmi'
|
||||
@@ -26,17 +26,17 @@
|
||||
|
||||
density = TRUE
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/mechanics_hints(mob/user, distance, is_adjacent)
|
||||
/obj/structure/machinery/atmospherics/binary/circulator/mechanics_hints(mob/user, distance, is_adjacent)
|
||||
. += ..()
|
||||
. += "This generates electricity, depending on the difference in temperature between each side of the machine."
|
||||
. += "The meter in the center of the machine gives an indicator of how much elecrtricity is being generated."
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/Initialize()
|
||||
/obj/structure/machinery/atmospherics/binary/circulator/Initialize()
|
||||
. = ..()
|
||||
desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
|
||||
air1.volume = 400
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/proc/return_transfer_air()
|
||||
/obj/structure/machinery/atmospherics/binary/circulator/proc/return_transfer_air()
|
||||
var/datum/gas_mixture/removed
|
||||
if(anchored && !(stat&BROKEN) && network1)
|
||||
var/input_starting_pressure = XGM_PRESSURE(air1)
|
||||
@@ -69,19 +69,19 @@
|
||||
update_icon()
|
||||
return removed
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/proc/return_stored_energy()
|
||||
/obj/structure/machinery/atmospherics/binary/circulator/proc/return_stored_energy()
|
||||
last_stored_energy_transferred = stored_energy
|
||||
stored_energy = 0
|
||||
return last_stored_energy_transferred
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/process()
|
||||
/obj/structure/machinery/atmospherics/binary/circulator/process()
|
||||
..()
|
||||
|
||||
if(last_worldtime_transfer < world.time - 50)
|
||||
recent_moles_transferred = 0
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/update_icon()
|
||||
/obj/structure/machinery/atmospherics/binary/circulator/update_icon()
|
||||
icon_state = anchored ? "circ-assembled" : "circ-unassembled"
|
||||
ClearOverlays()
|
||||
if (stat & (BROKEN|NOPOWER) || !anchored)
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/attackby(obj/item/attacking_item, mob/user)
|
||||
/obj/structure/machinery/atmospherics/binary/circulator/attackby(obj/item/attacking_item, mob/user)
|
||||
if(attacking_item.tool_behaviour == TOOL_WRENCH)
|
||||
attacking_item.play_tool_sound(get_turf(src), 50)
|
||||
anchored = !anchored
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/machinery/atmospherics/binary/oxyregenerator
|
||||
/obj/structure/machinery/atmospherics/binary/oxyregenerator
|
||||
name ="oxygen regenerator"
|
||||
desc = "A machine for breaking bonds in carbon dioxide and releasing pure oxygen."
|
||||
icon = 'icons/atmos/oxyregenerator.dmi'
|
||||
@@ -28,13 +28,13 @@
|
||||
var/datum/gas_mixture/inner_tank = new
|
||||
var/tank_volume = 400//Litres
|
||||
|
||||
/obj/machinery/atmospherics/binary/oxyregenerator/Initialize()
|
||||
/obj/structure/machinery/atmospherics/binary/oxyregenerator/Initialize()
|
||||
. = ..()
|
||||
anchored = TRUE
|
||||
RefreshParts()
|
||||
anchor_helper()
|
||||
|
||||
/obj/machinery/atmospherics/binary/oxyregenerator/RefreshParts()
|
||||
/obj/structure/machinery/atmospherics/binary/oxyregenerator/RefreshParts()
|
||||
carbon_efficiency = initial(carbon_efficiency)
|
||||
intake_power_efficiency = initial(intake_power_efficiency)
|
||||
power_rating = 1
|
||||
@@ -53,11 +53,11 @@
|
||||
power_rating *= initial(power_rating)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/oxyregenerator/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
|
||||
/obj/structure/machinery/atmospherics/binary/oxyregenerator/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
|
||||
. = ..()
|
||||
. += "Its outlet port is to the [dir2text(dir)]."
|
||||
|
||||
/obj/machinery/atmospherics/binary/oxyregenerator/attackby(obj/item/attacking_item, mob/user)
|
||||
/obj/structure/machinery/atmospherics/binary/oxyregenerator/attackby(obj/item/attacking_item, mob/user)
|
||||
if(attacking_item.tool_behaviour == TOOL_WRENCH)
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
anchored = !anchored
|
||||
@@ -67,7 +67,7 @@
|
||||
|
||||
anchor_helper()
|
||||
|
||||
/obj/machinery/atmospherics/binary/oxyregenerator/proc/anchor_helper()
|
||||
/obj/structure/machinery/atmospherics/binary/oxyregenerator/proc/anchor_helper()
|
||||
if(anchored)
|
||||
if(dir & (NORTH|SOUTH))
|
||||
initialize_directions = NORTH|SOUTH
|
||||
@@ -90,11 +90,11 @@
|
||||
node2.disconnect(src)
|
||||
qdel(network2)
|
||||
|
||||
/obj/machinery/atmospherics/binary/oxyregenerator/attack_hand(mob/user)
|
||||
/obj/structure/machinery/atmospherics/binary/oxyregenerator/attack_hand(mob/user)
|
||||
. = ..()
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/binary/oxyregenerator/process()
|
||||
/obj/structure/machinery/atmospherics/binary/oxyregenerator/process()
|
||||
. = ..()
|
||||
if((!operable()) || !use_power)
|
||||
return
|
||||
@@ -151,19 +151,19 @@
|
||||
if (XGM_PRESSURE(inner_tank) <= 0.1)
|
||||
phase = "filling"
|
||||
|
||||
/obj/machinery/atmospherics/binary/oxyregenerator/update_icon()
|
||||
/obj/structure/machinery/atmospherics/binary/oxyregenerator/update_icon()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
icon_state = "off"
|
||||
else
|
||||
icon_state = "[use_power ? "on" : "off"]"
|
||||
|
||||
/obj/machinery/atmospherics/binary/oxyregenerator/ui_interact(mob/user, datum/tgui/ui)
|
||||
/obj/structure/machinery/atmospherics/binary/oxyregenerator/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "OxyRegenerator")
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/atmospherics/binary/oxyregenerator/ui_data(mob/user)
|
||||
/obj/structure/machinery/atmospherics/binary/oxyregenerator/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["on"] = use_power ? 1 : 0
|
||||
data["powerSetting"] = power_setting
|
||||
@@ -181,7 +181,7 @@
|
||||
data["o2"] = 0
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/binary/oxyregenerator/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
/obj/structure/machinery/atmospherics/binary/oxyregenerator/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define REGULATE_INPUT 1 //shuts off when input side is below the target pressure
|
||||
#define REGULATE_OUTPUT 2 //shuts off when output side is above the target pressure
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate
|
||||
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."
|
||||
icon = 'icons/atmos/passive_gate.dmi'
|
||||
@@ -25,26 +25,26 @@
|
||||
|
||||
var/broadcast_status_next_process = FALSE
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/mechanics_hints(mob/user, distance, is_adjacent)
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/mechanics_hints(mob/user, distance, is_adjacent)
|
||||
. += ..()
|
||||
. += "This is a one-way regulator, allowing gas to flow only at a specific pressure and flow rate."
|
||||
. += "If the light is green, it is flowing."
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/on
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/on
|
||||
unlocked = 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/on/input
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/on/input
|
||||
regulate_mode = REGULATE_INPUT
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/on/output/max/Initialize()
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/on/output/max/Initialize()
|
||||
. = ..()
|
||||
target_pressure = max_pressure_setting
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/on/input/max/Initialize()
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/on/input/max/Initialize()
|
||||
. = ..()
|
||||
target_pressure = max_pressure_setting
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/scrubbers
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/scrubbers
|
||||
name = "scrubbers pressure regulator"
|
||||
desc = "A one-way air valve that can be used to regulate input or output pressure, and flow rate. This is one is for scrubber pipes."
|
||||
icon_state = "map-scrubbers"
|
||||
@@ -54,7 +54,7 @@
|
||||
unlocked = TRUE
|
||||
target_pressure = 200
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/supply
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/supply
|
||||
name = "supply pressure regulator"
|
||||
desc = "A one-way air valve that can be used to regulate input or output pressure, and flow rate. This is one is for supply pipes."
|
||||
icon_state = "map-supply"
|
||||
@@ -64,7 +64,7 @@
|
||||
unlocked = TRUE
|
||||
target_pressure = 200
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/fuel
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/fuel
|
||||
name = "fuel pressure regulator"
|
||||
desc = "A one-way air valve that can be used to regulate input or output pressure, and flow rate. This is one is for fuel pipes."
|
||||
icon_state = "map-fuel"
|
||||
@@ -74,7 +74,7 @@
|
||||
unlocked = TRUE
|
||||
target_pressure = 200
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/aux
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/aux
|
||||
name = "auxiliary pressure regulator"
|
||||
desc = "A one-way air valve that can be used to regulate input or output pressure, and flow rate. This is one is for auxiliary pipes."
|
||||
icon_state = "map-aux"
|
||||
@@ -84,15 +84,15 @@
|
||||
unlocked = TRUE
|
||||
target_pressure = 200
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/Initialize()
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/Initialize()
|
||||
. = ..()
|
||||
air1.volume = ATMOS_DEFAULT_VOLUME_PUMP * 2.5
|
||||
air2.volume = ATMOS_DEFAULT_VOLUME_PUMP * 2.5
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/update_icon()
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/update_icon()
|
||||
icon_state = (unlocked && flowing)? "on" + icon_connect_type : "off" + icon_connect_type
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/update_underlays()
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/update_underlays()
|
||||
if(..())
|
||||
underlays.Cut()
|
||||
var/turf/T = get_turf(src)
|
||||
@@ -101,10 +101,10 @@
|
||||
add_underlay(T, node1, turn(dir, 180), icon_connect_type)
|
||||
add_underlay(T, node2, dir, icon_connect_type)
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/hide(var/i)
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/hide(var/i)
|
||||
update_underlays()
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/process()
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/process()
|
||||
..()
|
||||
|
||||
if (broadcast_status_next_process)
|
||||
@@ -160,13 +160,13 @@
|
||||
|
||||
//Radio remote control
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/proc/set_frequency(new_frequency)
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/proc/set_frequency(new_frequency)
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA)
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/proc/broadcast_status()
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
@@ -188,12 +188,12 @@
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/atmos_init()
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/atmos_init()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/receive_signal(datum/signal/signal)
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/attack_hand(user as mob)
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
@@ -232,13 +232,13 @@
|
||||
ui_interact(user)
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/ui_interact(mob/user, datum/tgui/ui)
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "AtmosPressureRegulator", capitalize_first_letters(name))
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/ui_data()
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/ui_data()
|
||||
var/data = list()
|
||||
data["on"] = unlocked
|
||||
data["pressure"] = round(target_pressure)
|
||||
@@ -249,7 +249,7 @@
|
||||
data["regulate_mode"] = regulate_mode
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/ui_act(action, params)
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/ui_act(action, params)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
@@ -290,7 +290,7 @@
|
||||
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/attackby(obj/item/attacking_item, mob/user)
|
||||
/obj/structure/machinery/atmospherics/binary/passive_gate/attackby(obj/item/attacking_item, mob/user)
|
||||
if (attacking_item.tool_behaviour != TOOL_WRENCH)
|
||||
return ..()
|
||||
if (unlocked)
|
||||
|
||||
@@ -12,7 +12,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
but overall network volume is also increased as this increases...
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump
|
||||
/obj/structure/machinery/atmospherics/binary/pump
|
||||
name = "gas pump"
|
||||
desc = "A pump."
|
||||
icon = 'icons/atmos/pump.dmi'
|
||||
@@ -40,70 +40,70 @@ Thus, the two variables affect pump operation are set in New():
|
||||
var/measure_enabled = FALSE
|
||||
var/moles_pumped = 0
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/mechanics_hints(mob/user, distance, is_adjacent)
|
||||
/obj/structure/machinery/atmospherics/binary/pump/mechanics_hints(mob/user, distance, is_adjacent)
|
||||
. += ..()
|
||||
. += "This moves gas from one pipe to another. A higher target pressure demands more energy."
|
||||
. += "The side with the colored end is the output."
|
||||
. += "The normalized flow rate is the flow rate in L based on the moles transferred normalized to a preassure 1ATM and temperature of 20C."
|
||||
. += "The same applies to the measurement section."
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/Initialize()
|
||||
/obj/structure/machinery/atmospherics/binary/pump/Initialize()
|
||||
. = ..()
|
||||
air1.volume = ATMOS_DEFAULT_VOLUME_PUMP
|
||||
air2.volume = ATMOS_DEFAULT_VOLUME_PUMP
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/on
|
||||
/obj/structure/machinery/atmospherics/binary/pump/on
|
||||
icon_state = "map_on"
|
||||
use_power = POWER_USE_IDLE
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/fuel
|
||||
/obj/structure/machinery/atmospherics/binary/pump/fuel
|
||||
icon_state = "map_off-fuel"
|
||||
base_icon = "pump-fuel"
|
||||
icon_connect_type = "-fuel"
|
||||
connect_types = CONNECT_TYPE_FUEL
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/fuel/on
|
||||
/obj/structure/machinery/atmospherics/binary/pump/fuel/on
|
||||
icon_state = "map_on-fuel"
|
||||
use_power = POWER_USE_IDLE
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/aux
|
||||
/obj/structure/machinery/atmospherics/binary/pump/aux
|
||||
icon_state = "map_off-aux"
|
||||
base_icon = "pump-aux"
|
||||
icon_connect_type = "-aux"
|
||||
connect_types = CONNECT_TYPE_AUX
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/aux/on
|
||||
/obj/structure/machinery/atmospherics/binary/pump/aux/on
|
||||
icon_state = "map_on-aux"
|
||||
use_power = POWER_USE_IDLE
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/supply
|
||||
/obj/structure/machinery/atmospherics/binary/pump/supply
|
||||
icon_state = "map_off-supply"
|
||||
base_icon = "pump-supply"
|
||||
icon_connect_type = "-supply"
|
||||
connect_types = CONNECT_TYPE_SUPPLY
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/supply/on
|
||||
/obj/structure/machinery/atmospherics/binary/pump/supply/on
|
||||
icon_state = "map_on-supply"
|
||||
use_power = POWER_USE_IDLE
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/scrubber
|
||||
/obj/structure/machinery/atmospherics/binary/pump/scrubber
|
||||
icon_state = "map_off-scrubber"
|
||||
base_icon = "pump-scrubber"
|
||||
icon_connect_type = "-scrubber"
|
||||
connect_types = CONNECT_TYPE_SCRUBBER
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/scrubber/on
|
||||
/obj/structure/machinery/atmospherics/binary/pump/scrubber/on
|
||||
icon_state = "map_on-scrubber"
|
||||
use_power = POWER_USE_IDLE
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/update_icon()
|
||||
/obj/structure/machinery/atmospherics/binary/pump/update_icon()
|
||||
if(!powered())
|
||||
icon_state = "[base_icon]-off"
|
||||
else
|
||||
icon_state = "[use_power ? "[base_icon]-on" : "[base_icon]-off"]"
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/update_underlays()
|
||||
/obj/structure/machinery/atmospherics/binary/pump/update_underlays()
|
||||
if(..())
|
||||
underlays.Cut()
|
||||
var/turf/T = get_turf(src)
|
||||
@@ -112,10 +112,10 @@ Thus, the two variables affect pump operation are set in New():
|
||||
add_underlay(T, node1, turn(dir, -180), node1?.icon_connect_type)
|
||||
add_underlay(T, node2, dir, node2?.icon_connect_type)
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/hide(var/i)
|
||||
/obj/structure/machinery/atmospherics/binary/pump/hide(var/i)
|
||||
update_underlays()
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/process()
|
||||
/obj/structure/machinery/atmospherics/binary/pump/process()
|
||||
last_power_draw = 0
|
||||
last_flow_rate = 0
|
||||
last_mole_transfer = 0
|
||||
@@ -152,13 +152,13 @@ Thus, the two variables affect pump operation are set in New():
|
||||
|
||||
//Radio remote control
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/proc/set_frequency(new_frequency)
|
||||
/obj/structure/machinery/atmospherics/binary/pump/proc/set_frequency(new_frequency)
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA)
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/proc/broadcast_status()
|
||||
/obj/structure/machinery/atmospherics/binary/pump/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
@@ -178,13 +178,13 @@ Thus, the two variables affect pump operation are set in New():
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/ui_interact(mob/user, datum/tgui/ui)
|
||||
/obj/structure/machinery/atmospherics/binary/pump/ui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "AtmosPump", capitalize_first_letters(name))
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/ui_data()
|
||||
/obj/structure/machinery/atmospherics/binary/pump/ui_data()
|
||||
var/data = list()
|
||||
data["on"] = use_power
|
||||
data["pressure"] = round(target_pressure)
|
||||
@@ -198,7 +198,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
data["liters_pumped"] = round((moles_pumped * R_IDEAL_GAS_EQUATION * T20C) / ONE_ATMOSPHERE)
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/ui_act(action, params)
|
||||
/obj/structure/machinery/atmospherics/binary/pump/ui_act(action, params)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
@@ -222,12 +222,12 @@ Thus, the two variables affect pump operation are set in New():
|
||||
moles_pumped = 0
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/atmos_init()
|
||||
/obj/structure/machinery/atmospherics/binary/pump/atmos_init()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/receive_signal(datum/signal/signal)
|
||||
/obj/structure/machinery/atmospherics/binary/pump/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
@@ -254,7 +254,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
broadcast_status_next_process = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/attack_hand(user as mob)
|
||||
/obj/structure/machinery/atmospherics/binary/pump/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
@@ -265,13 +265,13 @@ Thus, the two variables affect pump operation are set in New():
|
||||
ui_interact(user)
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/power_change()
|
||||
/obj/structure/machinery/atmospherics/binary/pump/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/attackby(obj/item/attacking_item, mob/user)
|
||||
/obj/structure/machinery/atmospherics/binary/pump/attackby(obj/item/attacking_item, mob/user)
|
||||
if (attacking_item.tool_behaviour != TOOL_WRENCH && !istype(attacking_item, /obj/item/pipewrench))
|
||||
return ..()
|
||||
if (!(stat & NOPOWER) && use_power)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/machinery/atmospherics/binary/pump/high_power
|
||||
/obj/structure/machinery/atmospherics/binary/pump/high_power
|
||||
icon = 'icons/atmos/volume_pump.dmi'
|
||||
icon_state = "map_off"
|
||||
level = 1
|
||||
@@ -10,11 +10,11 @@
|
||||
|
||||
power_rating = 45000 //45000 W ~ 60 HP
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/high_power/on
|
||||
/obj/structure/machinery/atmospherics/binary/pump/high_power/on
|
||||
use_power = POWER_USE_IDLE
|
||||
icon_state = "map_on"
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/high_power/update_icon()
|
||||
/obj/structure/machinery/atmospherics/binary/pump/high_power/update_icon()
|
||||
if(!powered())
|
||||
icon_state = "off"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user