Revert "Add chem solution atmos heating and cooling (#17854)" (#17871)

This reverts commit 03d6b0ced7.
This commit is contained in:
Chief-Engineer 2023-07-06 23:53:19 -05:00 committed by GitHub
parent 440b7c0d37
commit 1960dd2620
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 1 additions and 84 deletions

View File

@ -31,7 +31,7 @@ public sealed partial class AtmosphereSystem : SharedAtmosphereSystem
[Dependency] private readonly TransformSystem _transformSystem = default!;
[Dependency] private readonly TileSystem _tile = default!;
public const float ExposedUpdateDelay = 1f;
private const float ExposedUpdateDelay = 1f;
private float _exposedTimer = 0f;
public override void Initialize()

View File

@ -1,22 +0,0 @@
namespace Content.Server.Chemistry.Components.SolutionManager;
/// <summary>
/// Lets the solution conduct heat to/from atmos gases.
/// </summary>
[RegisterComponent]
public sealed class SolutionGasHeatConductivityComponent : Component
{
/// <summary>
/// Solution that conducts heat.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("solution")]
public string Solution { get; set; } = "default";
/// <summary>
/// The heat conductivity between the gas and solution.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("wattsPerKelvin")]
public float WattsPerKelvin = 1;
}

View File

@ -1,37 +0,0 @@
using Content.Server.Atmos.EntitySystems;
using Content.Server.Chemistry.Components.SolutionManager;
using Robust.Shared.Timing;
namespace Content.Server.Chemistry.EntitySystems;
public sealed class SolutionGasHeatConductivitySystem : EntitySystem
{
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
/// <inheritdoc/>
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SolutionGasHeatConductivityComponent, AtmosExposedUpdateEvent>(AtmosUpdate);
}
private void AtmosUpdate(EntityUid uid, SolutionGasHeatConductivityComponent solutionGasHeatConductivity, ref AtmosExposedUpdateEvent args)
{
if (!_solutionContainerSystem.TryGetSolution(uid, solutionGasHeatConductivity.Solution, out var solution) || solution.Volume == 0)
return;
var heatDifferenceKelvin = args.GasMixture.Temperature - solution.Temperature;
if (Math.Abs(heatDifferenceKelvin) < 0.5)
return; // close enough
var thermalEnergyTransferWatts = heatDifferenceKelvin * solutionGasHeatConductivity.WattsPerKelvin;
var thermalEnergyTransferJoules = thermalEnergyTransferWatts * AtmosphereSystem.ExposedUpdateDelay;
_solutionContainerSystem.AddThermalEnergy(uid, solution, thermalEnergyTransferJoules);
var gasHeatCapacity = _atmosphereSystem.GetHeatCapacity(args.GasMixture);
args.GasMixture.Temperature += gasHeatCapacity == 0 ? 0 : -thermalEnergyTransferJoules / gasHeatCapacity;
}
}

View File

@ -142,9 +142,6 @@
- type: SolutionContainerManager
solutions:
puddle: { maxVol: 1000 }
- type: AtmosExposed
- type: SolutionGasHeatConductivity
solution: puddle
- type: Puddle
- type: Appearance
- type: EdgeSpreader

View File

@ -30,9 +30,6 @@
solution: drink
- type: DrainableSolution
solution: drink
- type: AtmosExposed
- type: SolutionGasHeatConductivity
solution: drink
- type: UserInterface
interfaces:
- key: enum.TransferAmountUiKey.Key

View File

@ -34,9 +34,6 @@
solution: drink
- type: DrainableSolution
solution: drink
- type: AtmosExposed
- type: SolutionGasHeatConductivity
solution: drink
- type: Appearance
- type: GenericVisualizer
visuals:

View File

@ -21,9 +21,6 @@
- type: SolutionTransfer
canChangeTransferAmount: true
maxTransferAmount: 10
- type: AtmosExposed
- type: SolutionGasHeatConductivity
solution: drink
- type: UserInterface
interfaces:
- key: enum.TransferAmountUiKey.Key

View File

@ -22,9 +22,6 @@
canChangeTransferAmount: true
- type: Spillable
solution: drink
- type: AtmosExposed
- type: SolutionGasHeatConductivity
solution: drink
- type: Sprite
sprite: Objects/Consumable/Drinks/shaker.rsi
state: icon

View File

@ -33,9 +33,6 @@
solution: drink
- type: DrainableSolution
solution: drink
- type: AtmosExposed
- type: SolutionGasHeatConductivity
solution: drink
- type: UserInterface
interfaces:
- key: enum.TransferAmountUiKey.Key

View File

@ -40,9 +40,6 @@
solution: beaker
- type: SolutionTransfer
canChangeTransferAmount: true
- type: AtmosExposed
- type: SolutionGasHeatConductivity
solution: beaker
- type: UserInterface
interfaces:
- key: enum.TransferAmountUiKey.Key
@ -134,9 +131,6 @@
solution: beaker
- type: SolutionTransfer
canChangeTransferAmount: true
- type: AtmosExposed
- type: SolutionGasHeatConductivity
solution: beaker
- type: UserInterface
interfaces:
- key: enum.TransferAmountUiKey.Key