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:
@@ -1,14 +1,12 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Content.Server.GameObjects.Components.Mobs;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Server.Interfaces.GameObjects;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.GameObjects.Components.Damage;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.GameObjects.Components.Mobs;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Atmos
|
||||
@@ -19,21 +17,14 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
[RegisterComponent]
|
||||
public class BarotraumaComponent : Component
|
||||
{
|
||||
[Robust.Shared.IoC.Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
public override string Name => "Barotrauma";
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Update(float frameTime)
|
||||
public void Update(float airPressure)
|
||||
{
|
||||
if (!Owner.TryGetComponent(out IDamageableComponent damageable)) return;
|
||||
Owner.TryGetComponent(out ServerStatusEffectsComponent status);
|
||||
|
||||
var coordinates = Owner.Transform.Coordinates;
|
||||
var gridAtmos = EntitySystem.Get<AtmosphereSystem>().GetGridAtmosphere(coordinates.GetGridId(_entityManager));
|
||||
var tile = gridAtmos?.GetTile(coordinates);
|
||||
|
||||
var pressure = 1f;
|
||||
var highPressureMultiplier = 1f;
|
||||
var lowPressureMultiplier = 1f;
|
||||
|
||||
@@ -43,8 +34,7 @@ namespace Content.Server.GameObjects.Components.Atmos
|
||||
lowPressureMultiplier *= protection.LowPressureMultiplier;
|
||||
}
|
||||
|
||||
if (tile?.Air != null)
|
||||
pressure = MathF.Max(tile.Air.Pressure, 1f);
|
||||
var pressure = MathF.Max(airPressure, 1f);
|
||||
|
||||
switch (pressure)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user