Fix 3000 errors

This commit is contained in:
DrSmugleaf
2021-12-05 18:09:01 +01:00
parent 2bfec7ec62
commit 2a3b7d809d
569 changed files with 2979 additions and 3280 deletions

View File

@@ -1,6 +1,4 @@
using System.Linq;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Station;
using Content.Shared.Atmos;
using Content.Shared.Station;
using Robust.Shared.Audio;
@@ -16,18 +14,18 @@ namespace Content.Server.StationEvents.Events
{
internal sealed class GasLeak : StationEvent
{
[Dependency] private IRobustRandom _robustRandom = default!;
[Dependency] private IEntityManager _entityManager = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
public override string Name => "GasLeak";
public override string? StartAnnouncement =>
public override string StartAnnouncement =>
"Attention crew, there is a gas leak on the station. We advise you to avoid the area and wear suit internals in the meantime.";
// Sourced from https://github.com/vgstation-coders/vgstation13/blob/2c5a491446ab824a8fbbf39bcf656b590e0228df/sound/misc/bloblarm.ogg
public override string? StartAudio => "/Audio/Announcements/bloblarm.ogg";
public override string StartAudio => "/Audio/Announcements/bloblarm.ogg";
protected override string? EndAnnouncement => "The source of the gas leak has been fixed. Please be cautious around areas with gas remaining.";
protected override string EndAnnouncement => "The source of the gas leak has been fixed. Please be cautious around areas with gas remaining.";
private static readonly Gas[] LeakableGases = {
Gas.Plasma,
@@ -62,7 +60,7 @@ namespace Content.Server.StationEvents.Events
private StationId _targetStation;
private IEntity? _targetGrid;
private EntityUid _targetGrid;
private Vector2i _targetTile;
@@ -122,15 +120,15 @@ namespace Content.Server.StationEvents.Events
var atmosphereSystem = EntitySystem.Get<AtmosphereSystem>();
if (!_foundTile ||
_targetGrid == null ||
(!IoCManager.Resolve<IEntityManager>().EntityExists(_targetGrid) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(_targetGrid).EntityLifeStage) >= EntityLifeStage.Deleted ||
!atmosphereSystem.IsSimulatedGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_targetGrid).GridID))
_targetGrid == default ||
(!_entityManager.EntityExists(_targetGrid) ? EntityLifeStage.Deleted : _entityManager.GetComponent<MetaDataComponent>(_targetGrid).EntityLifeStage) >= EntityLifeStage.Deleted ||
!atmosphereSystem.IsSimulatedGrid(_entityManager.GetComponent<TransformComponent>(_targetGrid).GridID))
{
Running = false;
return;
}
var environment = atmosphereSystem.GetTileMixture(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_targetGrid).GridID, _targetTile, true);
var environment = atmosphereSystem.GetTileMixture(_entityManager.GetComponent<TransformComponent>(_targetGrid).GridID, _targetTile, true);
environment?.AdjustMoles(_leakGas, LeakCooldown * _molesPerSecond);
}
@@ -142,7 +140,7 @@ namespace Content.Server.StationEvents.Events
Spark();
_foundTile = false;
_targetGrid = null;
_targetGrid = default;
_targetTile = default;
_targetCoords = default;
_leakGas = Gas.Oxygen;
@@ -155,16 +153,16 @@ namespace Content.Server.StationEvents.Events
if (_robustRandom.NextFloat() <= SparkChance)
{
if (!_foundTile ||
_targetGrid == null ||
(!IoCManager.Resolve<IEntityManager>().EntityExists(_targetGrid) ? EntityLifeStage.Deleted : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(_targetGrid).EntityLifeStage) >= EntityLifeStage.Deleted ||
!atmosphereSystem.IsSimulatedGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_targetGrid).GridID))
_targetGrid == default ||
(!_entityManager.EntityExists(_targetGrid) ? EntityLifeStage.Deleted : _entityManager.GetComponent<MetaDataComponent>(_targetGrid).EntityLifeStage) >= EntityLifeStage.Deleted ||
!atmosphereSystem.IsSimulatedGrid(_entityManager.GetComponent<TransformComponent>(_targetGrid).GridID))
{
return;
}
// Don't want it to be so obnoxious as to instantly murder anyone in the area but enough that
// it COULD start potentially start a bigger fire.
atmosphereSystem.HotspotExpose(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(_targetGrid).GridID, _targetTile, 700f, 50f, true);
atmosphereSystem.HotspotExpose(_entityManager.GetComponent<TransformComponent>(_targetGrid).GridID, _targetTile, 700f, 50f, true);
SoundSystem.Play(Filter.Pvs(_targetCoords), "/Audio/Effects/sparks4.ogg", _targetCoords);
}
}

View File

@@ -1,4 +1,3 @@
using Content.Shared.Station;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
@@ -31,7 +30,7 @@ public class KudzuGrowth : StationEvent
// Give crew at least 9 minutes to either have it gone, or to suffer another event. Kudzu is not actually required to be dead for another event to roll.
protected override float EndAfter => 60*4;
private IEntity? _targetGrid;
private EntityUid _targetGrid;
private Vector2i _targetTile;

View File

@@ -28,7 +28,7 @@ namespace Content.Server.StationEvents.Events
private CancellationTokenSource? _announceCancelToken;
private readonly List<IEntity> _powered = new();
private readonly List<EntityUid> _powered = new();
public override void Announce()
{

View File

@@ -3,9 +3,8 @@ using Content.Server.Administration.Logs;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Chat.Managers;
using Content.Server.Station;
using Content.Shared.Administration.Logs;
using Content.Shared.Station;
using Content.Shared.Database;
using Content.Shared.Station;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
@@ -187,7 +186,7 @@ namespace Content.Server.StationEvents.Events
}
public static bool TryFindRandomTile(out Vector2i tile, out StationId targetStation, out IEntity? targetGrid, out EntityCoordinates targetCoords, IRobustRandom? robustRandom = null, IEntityManager? entityManager = null)
public static bool TryFindRandomTile(out Vector2i tile, out StationId targetStation, out EntityUid targetGrid, out EntityCoordinates targetCoords, IRobustRandom? robustRandom = null, IEntityManager? entityManager = null)
{
tile = default;
robustRandom ??= IoCManager.Resolve<IRobustRandom>();