Evac shuttle (#8931)
Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
@@ -901,6 +901,28 @@ namespace Content.Shared.CCVar
|
||||
CVarDef.Create("shuttle.idle_angular_damping", 100f, CVar.SERVERONLY);
|
||||
|
||||
|
||||
/*
|
||||
* Emergency
|
||||
*/
|
||||
|
||||
/// <summary>
|
||||
/// How long the emergency shuttle remains docked with the station, in seconds.
|
||||
/// </summary>
|
||||
public static readonly CVarDef<float> EmergencyShuttleDockTime =
|
||||
CVarDef.Create("shuttle.emergency_dock_time", 180f, CVar.SERVERONLY);
|
||||
|
||||
/// <summary>
|
||||
/// How long after the console is authorized for the shuttle to early launch.
|
||||
/// </summary>
|
||||
public static readonly CVarDef<float> EmergencyShuttleAuthorizeTime =
|
||||
CVarDef.Create("shuttle.emergency_authorize_time", 10f, CVar.SERVERONLY);
|
||||
|
||||
/// <summary>
|
||||
/// How long after the console is authorized for the shuttle to early launch.
|
||||
/// </summary>
|
||||
public static readonly CVarDef<float> EmergencyShuttleTransitTime =
|
||||
CVarDef.Create("shuttle.emergency_transit_time", 120f, CVar.SERVERONLY);
|
||||
|
||||
/*
|
||||
* VIEWPORT
|
||||
*/
|
||||
|
||||
@@ -33,10 +33,10 @@ namespace Content.Shared.Movement.Components
|
||||
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
private GameTick _lastInputTick;
|
||||
private ushort _lastInputSubTick;
|
||||
private Vector2 _curTickWalkMovement;
|
||||
private Vector2 _curTickSprintMovement;
|
||||
public GameTick _lastInputTick;
|
||||
public ushort _lastInputSubTick;
|
||||
public Vector2 CurTickWalkMovement;
|
||||
public Vector2 CurTickSprintMovement;
|
||||
|
||||
private MoveButtons _heldMoveButtons = MoveButtons.None;
|
||||
|
||||
@@ -89,8 +89,8 @@ namespace Content.Shared.Movement.Components
|
||||
}
|
||||
else
|
||||
{
|
||||
walk = _curTickWalkMovement;
|
||||
sprint = _curTickSprintMovement;
|
||||
walk = CurTickWalkMovement;
|
||||
sprint = CurTickSprintMovement;
|
||||
remainingFraction = (ushort.MaxValue - _lastInputSubTick) / (float) ushort.MaxValue;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,6 @@ namespace Content.Shared.Movement.Components
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
Owner.EnsureComponentWarn<PhysicsComponent>();
|
||||
LastGridAngle = _entityManager.GetComponent<TransformComponent>(Owner).Parent?.WorldRotation ?? new Angle(0);
|
||||
}
|
||||
|
||||
@@ -154,8 +153,8 @@ namespace Content.Shared.Movement.Components
|
||||
|
||||
if (_gameTiming.CurTick > _lastInputTick)
|
||||
{
|
||||
_curTickWalkMovement = Vector2.Zero;
|
||||
_curTickSprintMovement = Vector2.Zero;
|
||||
CurTickWalkMovement = Vector2.Zero;
|
||||
CurTickSprintMovement = Vector2.Zero;
|
||||
_lastInputTick = _gameTiming.CurTick;
|
||||
_lastInputSubTick = 0;
|
||||
}
|
||||
@@ -164,7 +163,7 @@ namespace Content.Shared.Movement.Components
|
||||
{
|
||||
var fraction = (subTick - _lastInputSubTick) / (float) ushort.MaxValue;
|
||||
|
||||
ref var lastMoveAmount = ref Sprinting ? ref _curTickSprintMovement : ref _curTickWalkMovement;
|
||||
ref var lastMoveAmount = ref Sprinting ? ref CurTickSprintMovement : ref CurTickWalkMovement;
|
||||
|
||||
lastMoveAmount += DirVecForButtons(_heldMoveButtons) * fraction;
|
||||
|
||||
|
||||
@@ -59,15 +59,6 @@ namespace Content.Shared.Movement.Components
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
if (!IoCManager.Resolve<IEntityManager>().HasComponent<IMoverComponent>(Owner))
|
||||
{
|
||||
Owner.EnsureComponentWarn<SharedPlayerInputMoverComponent>();
|
||||
}
|
||||
}
|
||||
|
||||
public override ComponentState GetComponentState()
|
||||
{
|
||||
return new PlayerMobMoverComponentState(_grabRange, _pushStrength);
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Shuttles.BUIStates;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class EmergencyConsoleBoundUserInterfaceState : BoundUserInterfaceState
|
||||
{
|
||||
/// <summary>
|
||||
/// null if we're not early launching.
|
||||
/// </summary>
|
||||
public TimeSpan? EarlyLaunchTime;
|
||||
public List<string> Authorizations = new();
|
||||
public int AuthorizationsRequired;
|
||||
|
||||
public TimeSpan? TimeToLaunch;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Shuttles.Events;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class EmergencyShuttleAuthorizeMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Shuttles.Events;
|
||||
|
||||
/// <summary>
|
||||
/// For debugging the expected emergency shuttle position.
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class EmergencyShuttlePositionMessage : EntityEventArgs
|
||||
{
|
||||
public EntityUid? StationUid;
|
||||
public Box2? Position;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Shuttles.Events;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class EmergencyShuttleRepealAllMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Shuttles.Events;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class EmergencyShuttleRepealMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Shuttles.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Raised on the client to request the expected position of the emergency shuttle for debugging.
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class EmergencyShuttleRequestPositionMessage : EntityEventArgs
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Shuttles.Systems;
|
||||
|
||||
public abstract partial class SharedShuttleSystem
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum EmergencyConsoleUiKey : byte
|
||||
{
|
||||
Key,
|
||||
}
|
||||
6
Content.Shared/Shuttles/Systems/SharedShuttleSystem.cs
Normal file
6
Content.Shared/Shuttles/Systems/SharedShuttleSystem.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Content.Shared.Shuttles.Systems;
|
||||
|
||||
public abstract partial class SharedShuttleSystem : EntitySystem
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user