mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-16 18:45:22 +01:00
21b4095dfd
Upstream 04/17/2026 fixes https://github.com/Bubberstation/Bubberstation/issues/5549 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com> Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com> Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com> Co-authored-by: rageguy505 <54517726+rageguy505@users.noreply.github.com> Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Co-authored-by: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com> Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com> Co-authored-by: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com> Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com> Co-authored-by: Maxipat <108554989+Maxipat112@users.noreply.github.com> Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com> Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com> Co-authored-by: loganuk <fakeemail123@aol.com> Co-authored-by: Leland Kemble <70413276+lelandkemble@users.noreply.github.com> Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com> Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com> Co-authored-by: Lucy <lucy@absolucy.moe> Co-authored-by: siliconOpossum <138069572+siliconOpossum@users.noreply.github.com> Co-authored-by: Isratosh <Isratosh@hotmail.com> Co-authored-by: TheRyeGuyWhoWillNowDie <70169560+TheRyeGuyWhoWillNowDie@users.noreply.github.com> Co-authored-by: Neocloudy <88008002+Neocloudy@users.noreply.github.com> Co-authored-by: Alexander V. <volas@ya.ru> Co-authored-by: ElGitificador <168473461+ElGitificador@users.noreply.github.com> Co-authored-by: Twaticus <46540570+Twaticus@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> Co-authored-by: Cameron Lennox <killer65311@gmail.com> Co-authored-by: Tim <timothymtorres@gmail.com> Co-authored-by: Iamgoofball <iamgoofball@gmail.com> Co-authored-by: Layzu666 <121319428+Layzu666@users.noreply.github.com> Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com> Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com> Co-authored-by: mrmanlikesbt <99309552+mrmanlikesbt@users.noreply.github.com> Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com> Co-authored-by: John F. Kennedy <54908920+MacaroniCritter@users.noreply.github.com> Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com> Co-authored-by: Josh <josh.adam.powell@gmail.com> Co-authored-by: Josh Powell <josh.powell@softwire.com> Co-authored-by: Yobrocharlie <Charliemiller5617@gmail.com> Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com> Co-authored-by: shayoki <96078776+shayoki@users.noreply.github.com> Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
184 lines
5.1 KiB
Plaintext
184 lines
5.1 KiB
Plaintext
/*
|
|
|
|
Skyrat removal START, moved to modular file
|
|
|
|
//node2, air2, network2 correspond to input
|
|
//node1, air1, network1 correspond to output
|
|
|
|
/obj/machinery/atmospherics/components/binary/circulator
|
|
name = "circulator/heat exchanger"
|
|
desc = "A gas circulator pump and heat exchanger."
|
|
icon_state = "circ_base"
|
|
pipe_flags = PIPING_ONE_PER_TURF | PIPING_DEFAULT_LAYER_ONLY
|
|
vent_movement = VENTCRAWL_CAN_SEE
|
|
density = TRUE
|
|
circuit = /obj/item/circuitboard/machine/circulator
|
|
|
|
var/active = FALSE
|
|
var/last_pressure_delta = 0
|
|
var/flipped = 0
|
|
///Which circulator mode we are on, the generator requires one of each to work.
|
|
var/mode = CIRCULATOR_HOT
|
|
///The generator we are connected to.
|
|
var/obj/machinery/power/thermoelectric_generator/generator
|
|
|
|
/obj/machinery/atmospherics/components/binary/circulator/Initialize(mapload)
|
|
. = ..()
|
|
AddElement(/datum/element/simple_rotation)
|
|
|
|
//default cold circ for mappers
|
|
/obj/machinery/atmospherics/components/binary/circulator/cold
|
|
mode = CIRCULATOR_COLD
|
|
|
|
/obj/machinery/atmospherics/components/binary/circulator/Destroy()
|
|
if(generator)
|
|
disconnectFromGenerator()
|
|
return ..()
|
|
|
|
/obj/machinery/atmospherics/components/binary/circulator/proc/return_transfer_air()
|
|
|
|
var/datum/gas_mixture/air1 = airs[1]
|
|
var/datum/gas_mixture/air2 = airs[2]
|
|
|
|
var/output_starting_pressure = air1.return_pressure()
|
|
var/input_starting_pressure = air2.return_pressure()
|
|
|
|
if(output_starting_pressure >= input_starting_pressure-10)
|
|
//Need at least 10 KPa difference to overcome friction in the mechanism
|
|
last_pressure_delta = 0
|
|
return null
|
|
|
|
//Calculate necessary moles to transfer using PV = nRT
|
|
if(air2.temperature <= 0)
|
|
last_pressure_delta = 0
|
|
return
|
|
var/pressure_delta = (input_starting_pressure - output_starting_pressure)/2
|
|
var/transfer_moles = (pressure_delta*air1.volume)/(air2.temperature * R_IDEAL_GAS_EQUATION)
|
|
last_pressure_delta = pressure_delta
|
|
//Actually transfer the gas
|
|
var/datum/gas_mixture/removed = air2.remove(transfer_moles)
|
|
update_parents()
|
|
return removed
|
|
|
|
/obj/machinery/atmospherics/components/binary/circulator/process_atmos()
|
|
update_appearance(UPDATE_ICON)
|
|
|
|
/obj/machinery/atmospherics/components/binary/circulator/update_overlays()
|
|
. = ..()
|
|
cut_overlays()
|
|
if(anchored)
|
|
add_overlay("circ_anchor")
|
|
add_overlay("panel_[panel_open]")
|
|
|
|
if(!is_operational)
|
|
add_overlay("fan_[mode]")
|
|
add_overlay("flow")
|
|
add_overlay("display")
|
|
return
|
|
|
|
add_overlay("flow_on")
|
|
add_overlay("display_[mode]")
|
|
if(last_pressure_delta > 0)
|
|
add_overlay("fan_[mode]_[last_pressure_delta > ONE_ATMOSPHERE]")
|
|
else
|
|
add_overlay("fan_[mode]")
|
|
|
|
/obj/machinery/atmospherics/components/binary/circulator/wrench_act(mob/living/user, obj/item/I)
|
|
if(!panel_open)
|
|
balloon_alert(user, "open the panel!")
|
|
return
|
|
set_anchored(!anchored)
|
|
I.play_tool_sound(src)
|
|
if(generator)
|
|
disconnectFromGenerator()
|
|
balloon_alert(user, "[anchored ? "secure" : "unsecure"]")
|
|
|
|
var/obj/machinery/atmospherics/node1 = nodes[1]
|
|
var/obj/machinery/atmospherics/node2 = nodes[2]
|
|
|
|
if(node1)
|
|
node1.disconnect(src)
|
|
nodes[1] = null
|
|
if(parents[1])
|
|
nullify_pipenet(parents[1])
|
|
|
|
if(node2)
|
|
node2.disconnect(src)
|
|
nodes[2] = null
|
|
if(parents[2])
|
|
nullify_pipenet(parents[2])
|
|
|
|
if(anchored)
|
|
set_init_directions()
|
|
atmos_init()
|
|
node1 = nodes[1]
|
|
if(node1)
|
|
node1.atmos_init()
|
|
node1.add_member(src)
|
|
node2 = nodes[2]
|
|
if(node2)
|
|
node2.atmos_init()
|
|
node2.add_member(src)
|
|
SSair.add_to_rebuild_queue(src)
|
|
|
|
return TRUE
|
|
|
|
/obj/machinery/atmospherics/components/binary/circulator/set_init_directions()
|
|
switch(dir)
|
|
if(NORTH, SOUTH)
|
|
initialize_directions = EAST|WEST
|
|
if(EAST, WEST)
|
|
initialize_directions = NORTH|SOUTH
|
|
|
|
/obj/machinery/atmospherics/components/binary/circulator/get_node_connects()
|
|
if(flipped)
|
|
return list(turn(dir, 270), turn(dir, 90))
|
|
return list(turn(dir, 90), turn(dir, 270))
|
|
|
|
/obj/machinery/atmospherics/components/binary/circulator/can_be_node(obj/machinery/atmospherics/target)
|
|
if(anchored)
|
|
return ..(target)
|
|
return FALSE
|
|
|
|
/obj/machinery/atmospherics/components/binary/circulator/multitool_act(mob/living/user, obj/item/I)
|
|
if(generator)
|
|
disconnectFromGenerator()
|
|
mode = !mode
|
|
balloon_alert(user, "set to [mode ? "cold" : "hot"]")
|
|
return TRUE
|
|
|
|
/obj/machinery/atmospherics/components/binary/circulator/screwdriver_act(mob/user, obj/item/I)
|
|
if(!anchored)
|
|
balloon_alert(user, "anchor it down!")
|
|
return
|
|
toggle_panel_open()
|
|
I.play_tool_sound(src)
|
|
balloon_alert(user, "panel [panel_open ? "open" : "closed"]")
|
|
return TRUE
|
|
|
|
/obj/machinery/atmospherics/components/binary/circulator/crowbar_act(mob/user, obj/item/I)
|
|
if(default_deconstruction_crowbar(user, I))
|
|
return TRUE
|
|
return ..()
|
|
|
|
/obj/machinery/atmospherics/components/binary/circulator/on_deconstruction(disassembled)
|
|
if(generator)
|
|
disconnectFromGenerator()
|
|
|
|
/obj/machinery/atmospherics/components/binary/circulator/proc/disconnectFromGenerator()
|
|
if(mode)
|
|
generator.cold_circ = null
|
|
else
|
|
generator.hot_circ = null
|
|
generator.update_appearance(UPDATE_ICON)
|
|
generator = null
|
|
|
|
/obj/machinery/atmospherics/components/binary/circulator/set_piping_layer(new_layer)
|
|
..()
|
|
pixel_x = 0
|
|
pixel_y = 0
|
|
|
|
|
|
Skyrat removal END
|
|
*/
|