Add heat conduction (#1653)
This commit is contained in:
committed by
GitHub
parent
619386a04a
commit
ca68fbe818
@@ -63,6 +63,11 @@ namespace Content.Shared.Atmos
|
||||
/// </summary>
|
||||
public const float MolesCellStandard = (OneAtmosphere * CellVolume / (T20C * R));
|
||||
|
||||
/// <summary>
|
||||
/// Compared against for superconduction.
|
||||
/// </summary>
|
||||
public const float MCellWithRatio = (MolesCellStandard * 0.005f);
|
||||
|
||||
public const float OxygenStandard = 0.21f;
|
||||
public const float NitrogenStandard = 0.79f;
|
||||
|
||||
@@ -83,6 +88,11 @@ namespace Content.Shared.Atmos
|
||||
|
||||
public const float OpenHeatTransferCoefficient = 0.4f;
|
||||
|
||||
/// <summary>
|
||||
/// Hack to make vacuums cold, sacrificing realism for gameplay.
|
||||
/// </summary>
|
||||
public const float HeatCapacityVacuum = 7000f;
|
||||
|
||||
/// <summary>
|
||||
/// Ratio of air that must move to/from a tile to reset group processing
|
||||
/// </summary>
|
||||
@@ -116,6 +126,7 @@ namespace Content.Shared.Atmos
|
||||
/// Minimum temperature for starting superconduction.
|
||||
/// </summary>
|
||||
public const float MinimumTemperatureStartSuperConduction = (T20C + 200f);
|
||||
public const float MinimumTemperatureForSuperconduction = (T20C + 10f);
|
||||
|
||||
/// <summary>
|
||||
/// Minimum heat capacity.
|
||||
@@ -214,6 +225,8 @@ namespace Content.Shared.Atmos
|
||||
/// so it just applies this flat value).
|
||||
/// </summary>
|
||||
public const int LowPressureDamage = 4;
|
||||
|
||||
public const float WindowHeatTransferCoefficient = 0.1f;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace Content.Shared.Maps
|
||||
public bool CanCrowbar { get; private set; }
|
||||
public string FootstepSounds { get; private set; }
|
||||
public float Friction { get; set; }
|
||||
public float ThermalConductivity { get; set; }
|
||||
public string ItemDropPrototypeName { get; private set; }
|
||||
|
||||
public void AssignTileId(ushort id)
|
||||
@@ -68,6 +69,15 @@ namespace Content.Shared.Maps
|
||||
Friction = 0;
|
||||
}
|
||||
|
||||
if (mapping.TryGetNode("thermalConductivity", out node))
|
||||
{
|
||||
ThermalConductivity = node.AsFloat();
|
||||
}
|
||||
else
|
||||
{
|
||||
ThermalConductivity = 0.05f;
|
||||
}
|
||||
|
||||
if (mapping.TryGetNode("item_drop", out node))
|
||||
{
|
||||
ItemDropPrototypeName = node.ToString();
|
||||
|
||||
@@ -12,6 +12,34 @@ namespace Content.Shared.Maps
|
||||
{
|
||||
public static class TurfHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the content tile definition for a tile.
|
||||
/// </summary>
|
||||
public static ContentTileDefinition GetContentTileDefinition(this Tile tile)
|
||||
{
|
||||
var tileDefinitionManager = IoCManager.Resolve<ITileDefinitionManager>();
|
||||
return (ContentTileDefinition)tileDefinitionManager[tile.TypeId];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to get the turf at map indices with grid id or null if no such turf is found.
|
||||
/// </summary>
|
||||
public static TileRef? GetTileRef(this MapIndices mapIndices, GridId gridId)
|
||||
{
|
||||
if (!gridId.IsValid())
|
||||
return null;
|
||||
|
||||
var mapManager = IoCManager.Resolve<IMapManager>();
|
||||
|
||||
if (!mapManager.TryGetGrid(gridId, out var grid))
|
||||
return null;
|
||||
|
||||
if (!grid.TryGetTileRef(mapIndices, out var tile))
|
||||
return null;
|
||||
|
||||
return tile;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to get the turf at a certain coordinates or null if no such turf is found.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user