Modify damage logging. (#5579)
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Alert;
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Alert;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Damage;
|
||||
@@ -15,6 +17,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
{
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
|
||||
private const float UpdateTimer = 1f;
|
||||
|
||||
@@ -105,6 +108,12 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
// Deal damage and ignore resistances. Resistance to pressure damage should be done via pressure protection gear.
|
||||
_damageableSystem.TryChangeDamage(uid, barotrauma.Damage * Atmospherics.LowPressureDamage, true, false);
|
||||
|
||||
if (!barotrauma.TakingDamage)
|
||||
{
|
||||
barotrauma.TakingDamage = true;
|
||||
_logSystem.Add(LogType.Barotrauma, $"{barotrauma.Owner} started taking low pressure damage");
|
||||
}
|
||||
|
||||
if (status == null) break;
|
||||
|
||||
if (pressure <= Atmospherics.HazardLowPressure)
|
||||
@@ -128,6 +137,12 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
// Deal damage and ignore resistances. Resistance to pressure damage should be done via pressure protection gear.
|
||||
_damageableSystem.TryChangeDamage(uid, barotrauma.Damage * damageScale, true, false);
|
||||
|
||||
if (!barotrauma.TakingDamage)
|
||||
{
|
||||
barotrauma.TakingDamage = true;
|
||||
_logSystem.Add(LogType.Barotrauma, $"{barotrauma.Owner} started taking high pressure damage");
|
||||
}
|
||||
|
||||
if (status == null) break;
|
||||
|
||||
if (pressure >= Atmospherics.HazardHighPressure)
|
||||
@@ -141,6 +156,11 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
|
||||
// Normal pressure.
|
||||
default:
|
||||
if (barotrauma.TakingDamage)
|
||||
{
|
||||
barotrauma.TakingDamage = false;
|
||||
_logSystem.Add(LogType.Barotrauma, $"{barotrauma.Owner} stopped taking pressure damage");
|
||||
}
|
||||
status?.ClearAlertCategory(AlertCategory.Pressure);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Alert;
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Server.Stunnable;
|
||||
using Content.Server.Temperature.Systems;
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Alert;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Damage;
|
||||
@@ -26,6 +28,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
[Dependency] private readonly StunSystem _stunSystem = default!;
|
||||
[Dependency] private readonly TemperatureSystem _temperatureSystem = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly AdminLogSystem _logSystem = default!;
|
||||
|
||||
private const float MinimumFireStacks = -10f;
|
||||
private const float MaximumFireStacks = 20f;
|
||||
@@ -140,6 +143,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
if (!flammable.OnFire)
|
||||
return;
|
||||
|
||||
_logSystem.Add(LogType.Flammable, $"{flammable.Owner} stopped being on fire damage");
|
||||
flammable.OnFire = false;
|
||||
flammable.FireStacks = 0;
|
||||
|
||||
@@ -155,6 +159,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
|
||||
if (flammable.FireStacks > 0 && !flammable.OnFire)
|
||||
{
|
||||
_logSystem.Add(LogType.Flammable, $"{flammable.Owner} is on fire");
|
||||
flammable.OnFire = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user