Escape pods (#14809)

* Namespace adjustments for days

* pod

* thanks rider

* Fix the oop launch

* Fixes

* Fix stuff

* eeeeeeeee

* Fix

* access

* map

* forgor

* thing

* Genericise escape pod fill
This commit is contained in:
metalgearsloth
2023-03-24 12:54:41 +11:00
committed by GitHub
parent 9aadc77b92
commit 448165ffda
28 changed files with 1417 additions and 747 deletions

View File

@@ -1,15 +1,16 @@
using Content.Server.Doors.Systems;
using Content.Server.Shuttles.Components;
using Content.Shared.CCVar;
using Content.Server.Stunnable;
using Content.Shared.GameTicking;
using Content.Shared.Shuttles.Systems;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Configuration;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Random;
namespace Content.Server.Shuttles.Systems
{
@@ -17,9 +18,18 @@ namespace Content.Server.Shuttles.Systems
public sealed partial class ShuttleSystem : SharedShuttleSystem
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly AirlockSystem _airlock = default!;
[Dependency] private readonly DockingSystem _dockSystem = default!;
[Dependency] private readonly DoorSystem _doors = default!;
[Dependency] private readonly FixtureSystem _fixtures = default!;
[Dependency] private readonly MapLoaderSystem _loader = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly ShuttleConsoleSystem _console = default!;
[Dependency] private readonly StunSystem _stuns = default!;
[Dependency] private readonly ThrusterSystem _thruster = default!;
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
private ISawmill _sawmill = default!;
@@ -34,9 +44,8 @@ namespace Content.Server.Shuttles.Systems
base.Initialize();
_sawmill = Logger.GetSawmill("shuttles");
InitializeEmergencyConsole();
InitializeEscape();
InitializeFTL();
InitializeGridFills();
InitializeIFF();
InitializeImpact();
@@ -53,24 +62,14 @@ namespace Content.Server.Shuttles.Systems
public override void Update(float frameTime)
{
base.Update(frameTime);
UpdateEmergencyConsole(frameTime);
UpdateHyperspace(frameTime);
}
private void OnRoundRestart(RoundRestartCleanupEvent ev)
{
CleanupEmergencyConsole();
CleanupEmergencyShuttle();
CleanupHyperspace();
}
public override void Shutdown()
{
base.Shutdown();
ShutdownEscape();
ShutdownEmergencyConsole();
}
private void OnShuttleAdd(EntityUid uid, ShuttleComponent component, ComponentAdd args)
{
// Easier than doing it in the comp and they don't have constructors.
@@ -83,7 +82,8 @@ namespace Content.Server.Shuttles.Systems
private void OnGridFixtureChange(GridFixtureChangeEvent args)
{
// Look this is jank but it's a placeholder until we design it.
if (args.NewFixtures.Count == 0) return;
if (args.NewFixtures.Count == 0)
return;
var uid = args.NewFixtures[0].Body.Owner;
var manager = Comp<FixturesComponent>(uid);
@@ -107,12 +107,12 @@ namespace Content.Server.Shuttles.Systems
private void OnShuttleStartup(EntityUid uid, ShuttleComponent component, ComponentStartup args)
{
if (!EntityManager.HasComponent<MapGridComponent>(component.Owner))
if (!EntityManager.HasComponent<MapGridComponent>(uid))
{
return;
}
if (!EntityManager.TryGetComponent(component.Owner, out PhysicsComponent? physicsComponent))
if (!EntityManager.TryGetComponent(uid, out PhysicsComponent? physicsComponent))
{
return;
}
@@ -125,7 +125,8 @@ namespace Content.Server.Shuttles.Systems
public void Toggle(EntityUid uid, ShuttleComponent component)
{
if (!EntityManager.TryGetComponent(component.Owner, out PhysicsComponent? physicsComponent)) return;
if (!EntityManager.TryGetComponent(uid, out PhysicsComponent? physicsComponent))
return;
component.Enabled = !component.Enabled;
@@ -164,7 +165,7 @@ namespace Content.Server.Shuttles.Systems
// None of the below is necessary for any cleanup if we're just deleting.
if (EntityManager.GetComponent<MetaDataComponent>(uid).EntityLifeStage >= EntityLifeStage.Terminating) return;
if (!EntityManager.TryGetComponent(component.Owner, out PhysicsComponent? physicsComponent))
if (!EntityManager.TryGetComponent(uid, out PhysicsComponent? physicsComponent))
{
return;
}