This reverts commit 03d6b0ced7.
This commit is contained in:
@@ -31,7 +31,7 @@ public sealed partial class AtmosphereSystem : SharedAtmosphereSystem
|
|||||||
[Dependency] private readonly TransformSystem _transformSystem = default!;
|
[Dependency] private readonly TransformSystem _transformSystem = default!;
|
||||||
[Dependency] private readonly TileSystem _tile = default!;
|
[Dependency] private readonly TileSystem _tile = default!;
|
||||||
|
|
||||||
public const float ExposedUpdateDelay = 1f;
|
private const float ExposedUpdateDelay = 1f;
|
||||||
private float _exposedTimer = 0f;
|
private float _exposedTimer = 0f;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -142,9 +142,6 @@
|
|||||||
- type: SolutionContainerManager
|
- type: SolutionContainerManager
|
||||||
solutions:
|
solutions:
|
||||||
puddle: { maxVol: 1000 }
|
puddle: { maxVol: 1000 }
|
||||||
- type: AtmosExposed
|
|
||||||
- type: SolutionGasHeatConductivity
|
|
||||||
solution: puddle
|
|
||||||
- type: Puddle
|
- type: Puddle
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
- type: EdgeSpreader
|
- type: EdgeSpreader
|
||||||
|
|||||||
@@ -30,9 +30,6 @@
|
|||||||
solution: drink
|
solution: drink
|
||||||
- type: DrainableSolution
|
- type: DrainableSolution
|
||||||
solution: drink
|
solution: drink
|
||||||
- type: AtmosExposed
|
|
||||||
- type: SolutionGasHeatConductivity
|
|
||||||
solution: drink
|
|
||||||
- type: UserInterface
|
- type: UserInterface
|
||||||
interfaces:
|
interfaces:
|
||||||
- key: enum.TransferAmountUiKey.Key
|
- key: enum.TransferAmountUiKey.Key
|
||||||
|
|||||||
@@ -34,9 +34,6 @@
|
|||||||
solution: drink
|
solution: drink
|
||||||
- type: DrainableSolution
|
- type: DrainableSolution
|
||||||
solution: drink
|
solution: drink
|
||||||
- type: AtmosExposed
|
|
||||||
- type: SolutionGasHeatConductivity
|
|
||||||
solution: drink
|
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
- type: GenericVisualizer
|
- type: GenericVisualizer
|
||||||
visuals:
|
visuals:
|
||||||
|
|||||||
@@ -21,9 +21,6 @@
|
|||||||
- type: SolutionTransfer
|
- type: SolutionTransfer
|
||||||
canChangeTransferAmount: true
|
canChangeTransferAmount: true
|
||||||
maxTransferAmount: 10
|
maxTransferAmount: 10
|
||||||
- type: AtmosExposed
|
|
||||||
- type: SolutionGasHeatConductivity
|
|
||||||
solution: drink
|
|
||||||
- type: UserInterface
|
- type: UserInterface
|
||||||
interfaces:
|
interfaces:
|
||||||
- key: enum.TransferAmountUiKey.Key
|
- key: enum.TransferAmountUiKey.Key
|
||||||
|
|||||||
@@ -22,9 +22,6 @@
|
|||||||
canChangeTransferAmount: true
|
canChangeTransferAmount: true
|
||||||
- type: Spillable
|
- type: Spillable
|
||||||
solution: drink
|
solution: drink
|
||||||
- type: AtmosExposed
|
|
||||||
- type: SolutionGasHeatConductivity
|
|
||||||
solution: drink
|
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Consumable/Drinks/shaker.rsi
|
sprite: Objects/Consumable/Drinks/shaker.rsi
|
||||||
state: icon
|
state: icon
|
||||||
|
|||||||
@@ -33,9 +33,6 @@
|
|||||||
solution: drink
|
solution: drink
|
||||||
- type: DrainableSolution
|
- type: DrainableSolution
|
||||||
solution: drink
|
solution: drink
|
||||||
- type: AtmosExposed
|
|
||||||
- type: SolutionGasHeatConductivity
|
|
||||||
solution: drink
|
|
||||||
- type: UserInterface
|
- type: UserInterface
|
||||||
interfaces:
|
interfaces:
|
||||||
- key: enum.TransferAmountUiKey.Key
|
- key: enum.TransferAmountUiKey.Key
|
||||||
|
|||||||
@@ -40,9 +40,6 @@
|
|||||||
solution: beaker
|
solution: beaker
|
||||||
- type: SolutionTransfer
|
- type: SolutionTransfer
|
||||||
canChangeTransferAmount: true
|
canChangeTransferAmount: true
|
||||||
- type: AtmosExposed
|
|
||||||
- type: SolutionGasHeatConductivity
|
|
||||||
solution: beaker
|
|
||||||
- type: UserInterface
|
- type: UserInterface
|
||||||
interfaces:
|
interfaces:
|
||||||
- key: enum.TransferAmountUiKey.Key
|
- key: enum.TransferAmountUiKey.Key
|
||||||
@@ -134,9 +131,6 @@
|
|||||||
solution: beaker
|
solution: beaker
|
||||||
- type: SolutionTransfer
|
- type: SolutionTransfer
|
||||||
canChangeTransferAmount: true
|
canChangeTransferAmount: true
|
||||||
- type: AtmosExposed
|
|
||||||
- type: SolutionGasHeatConductivity
|
|
||||||
solution: beaker
|
|
||||||
- type: UserInterface
|
- type: UserInterface
|
||||||
interfaces:
|
interfaces:
|
||||||
- key: enum.TransferAmountUiKey.Key
|
- key: enum.TransferAmountUiKey.Key
|
||||||
|
|||||||
Reference in New Issue
Block a user