* Moved the uplink creation code to the PresetSuspicion.Start method to ensure uplink created when we give the traitor role Moved the starting TC balance to cvars * Added component to handle interaction with Atmospheric system Added damage from high and cold temperature * renamed AtmoExposable to AtmosExposed moved AtmosExposed updates to its own system refactored TemperatureComponent renamed fire to heat added null check for Air added self-heating and self-cooling to body system * small refactoring for checking on airless tile in MetabolismComponent * Added component to handle interaction with Atmospheric system Added damage from high and cold temperature * renamed AtmoExposable to AtmosExposed moved AtmosExposed updates to its own system refactored TemperatureComponent renamed fire to heat added null check for Air added self-heating and self-cooling to body system * small refactoring for checking on airless tile in MetabolismComponent * Removed Pressure property from BarotraumaComponent Changed CanShiver method to match style of other CanX method in ActionBlockerSystem * Merged EntityCoordinates and changed components to reflect the change * Fix typo * Wrapped string to Loc.GetString Added CanSweat Refactored dead state check
39 lines
1.3 KiB
C#
39 lines
1.3 KiB
C#
using Content.Server.Atmos;
|
|
using Content.Server.GameObjects.Components.Temperature;
|
|
using Content.Shared.Atmos;
|
|
using Robust.Shared.GameObjects;
|
|
|
|
namespace Content.Server.GameObjects.Components.Atmos
|
|
{
|
|
/// <summary>
|
|
/// Represents that entity can be exposed to Atmo
|
|
/// </summary>
|
|
[RegisterComponent]
|
|
public class AtmosExposedComponent
|
|
: Component
|
|
{
|
|
public override string Name => "AtmosExposed";
|
|
|
|
public void Update(TileAtmosphere tile, float timeDelta)
|
|
{
|
|
if (Owner.TryGetComponent<TemperatureComponent>(out var temperatureComponent))
|
|
{
|
|
if (tile.Air != null)
|
|
{
|
|
var temperatureDelta = tile.Air.Temperature - temperatureComponent.CurrentTemperature;
|
|
var heat = temperatureDelta * (tile.Air.HeatCapacity * temperatureComponent.HeatCapacity / (tile.Air.HeatCapacity + temperatureComponent.HeatCapacity));
|
|
temperatureComponent.ReceiveHeat(heat);
|
|
}
|
|
temperatureComponent.Update();
|
|
}
|
|
|
|
if (Owner.TryGetComponent<BarotraumaComponent>(out var barotraumaComponent))
|
|
{
|
|
barotraumaComponent.Update(tile.Air?.Pressure ?? 0);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|