Fire damage (#2024)

* 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
This commit is contained in:
creadth
2020-09-09 18:03:27 +03:00
committed by GitHub
parent 5120627ca2
commit 7baa0a4391
16 changed files with 355 additions and 108 deletions

View File

@@ -0,0 +1,34 @@
using Content.Server.Atmos;
using Content.Server.GameObjects.Components.Atmos;
using JetBrains.Annotations;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.GameObjects.EntitySystems
{
[UsedImplicitly]
public class AtmosExposedSystem
: EntitySystem
{
[Dependency] private readonly IEntityManager _entityManager = default!;
private const float UpdateDelay = 3f;
private float _lastUpdate;
public override void Update(float frameTime)
{
_lastUpdate += frameTime;
if (_lastUpdate < UpdateDelay) return;
var atmoSystem = EntitySystemManager.GetEntitySystem<AtmosphereSystem>();
// creadth: everything exposable by atmo should be updated as well
foreach (var atmosExposedComponent in EntityManager.ComponentManager.EntityQuery<AtmosExposedComponent>())
{
var tile = atmosExposedComponent.Owner.Transform.Coordinates.GetTileAtmosphere(_entityManager);
if (tile == null) continue;
atmosExposedComponent.Update(tile, _lastUpdate);
}
_lastUpdate = 0;
}
}
}

View File

@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Linq;
using Content.Server.Atmos;
using Content.Server.Atmos.Reactions;
using Content.Server.GameObjects.Components.Atmos;
using Content.Server.Interfaces;
using Content.Shared.GameObjects.EntitySystems.Atmos;
using JetBrains.Annotations;
@@ -64,8 +65,7 @@ namespace Content.Server.GameObjects.EntitySystems
foreach (var (mapGridComponent, gridAtmosphereComponent) in EntityManager.ComponentManager.EntityQuery<IMapGridComponent, IGridAtmosphereComponent>())
{
if (_pauseManager.IsGridPaused(mapGridComponent.GridIndex))
continue;
if (_pauseManager.IsGridPaused(mapGridComponent.GridIndex)) continue;
gridAtmosphereComponent.Update(frameTime);
}

View File

@@ -1,29 +0,0 @@
using Content.Server.GameObjects.Components.Atmos;
using JetBrains.Annotations;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
{
[UsedImplicitly]
public class BarotraumaSystem : EntitySystem
{
private const float TimePerUpdate = 3f;
private float _timer = 0f;
/// <inheritdoc />
public override void Update(float frameTime)
{
_timer += frameTime;
if (_timer < TimePerUpdate) return;
_timer = 0f;
foreach (var barotraumaComp in ComponentManager.EntityQuery<BarotraumaComponent>())
{
barotraumaComp.Update(frameTime);
}
}
}
}

View File

@@ -1,18 +0,0 @@
using Content.Server.GameObjects.Components.Temperature;
using JetBrains.Annotations;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
{
[UsedImplicitly]
internal sealed class TemperatureSystem : EntitySystem
{
public override void Update(float frameTime)
{
foreach (var comp in ComponentManager.EntityQuery<TemperatureComponent>())
{
comp.OnUpdate(frameTime);
}
}
}
}