Update trivial components to use auto comp states (#20539)
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Movement.Components
|
||||
namespace Content.Shared.Movement.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Changes footstep sound
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class FootstepModifierComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Changes footstep sound
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class FootstepModifierComponent : Component
|
||||
{
|
||||
[DataField("footstepSoundCollection", required: true)]
|
||||
public SoundSpecifier Sound = default!;
|
||||
}
|
||||
[DataField(required: true), AutoNetworkedField]
|
||||
public SoundSpecifier FootstepSoundCollection = default!;
|
||||
}
|
||||
|
||||
@@ -6,8 +6,7 @@ using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Shared.Movement.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
[NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
|
||||
public sealed partial class InputMoverComponent : Component
|
||||
{
|
||||
// This class has to be able to handle server TPS being lower than client FPS.
|
||||
@@ -41,36 +40,40 @@ namespace Content.Shared.Movement.Components
|
||||
public Vector2 CurTickWalkMovement;
|
||||
public Vector2 CurTickSprintMovement;
|
||||
|
||||
[AutoNetworkedField]
|
||||
public MoveButtons HeldMoveButtons = MoveButtons.None;
|
||||
|
||||
/// <summary>
|
||||
/// Entity our movement is relative to.
|
||||
/// </summary>
|
||||
[AutoNetworkedField]
|
||||
public EntityUid? RelativeEntity;
|
||||
|
||||
/// <summary>
|
||||
/// Although our movement might be relative to a particular entity we may have an additional relative rotation
|
||||
/// e.g. if we've snapped to a different cardinal direction
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[ViewVariables, AutoNetworkedField]
|
||||
public Angle TargetRelativeRotation = Angle.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// The current relative rotation. This will lerp towards the <see cref="TargetRelativeRotation"/>.
|
||||
/// </summary>
|
||||
[ViewVariables] public Angle RelativeRotation;
|
||||
[ViewVariables, AutoNetworkedField]
|
||||
public Angle RelativeRotation;
|
||||
|
||||
/// <summary>
|
||||
/// If we traverse on / off a grid then set a timer to update our relative inputs.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("lerpTarget", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public TimeSpan LerpTarget;
|
||||
|
||||
public const float LerpTime = 1.0f;
|
||||
|
||||
public bool Sprinting => (HeldMoveButtons & MoveButtons.Walk) == 0x0;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
||||
public bool CanMove { get; set; } = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,9 @@ namespace Content.Shared.Movement.Components;
|
||||
/// <summary>
|
||||
/// Added to someone using a jetpack for movement purposes
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class JetpackUserComponent : Component
|
||||
{
|
||||
[AutoNetworkedField]
|
||||
public EntityUid Jetpack;
|
||||
}
|
||||
|
||||
@@ -6,14 +6,13 @@ namespace Content.Shared.Movement.Components
|
||||
/// <summary>
|
||||
/// Has additional movement data such as footsteps and weightless grab range for an entity.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[NetworkedComponent()]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class MobMoverComponent : Component
|
||||
{
|
||||
private float _stepSoundDistance;
|
||||
[DataField("grabRange")] public float GrabRange = 1.0f;
|
||||
[DataField] public float GrabRange = 1.0f;
|
||||
|
||||
[DataField("pushStrength")] public float PushStrength = 600f;
|
||||
[DataField] public float PushStrength = 600f;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public EntityCoordinates LastPosition { get; set; }
|
||||
@@ -32,7 +31,7 @@ namespace Content.Shared.Movement.Components
|
||||
}
|
||||
}
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
||||
public float GrabRangeVV
|
||||
{
|
||||
get => GrabRange;
|
||||
@@ -44,7 +43,7 @@ namespace Content.Shared.Movement.Components
|
||||
}
|
||||
}
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
||||
public float PushStrengthVV
|
||||
{
|
||||
get => PushStrength;
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Content.Shared.Movement.Components
|
||||
/// Applies basic movement speed and movement modifiers for an entity.
|
||||
/// If this is not present on the entity then they will use defaults for movement.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[NetworkedComponent, Access(typeof(MovementSpeedModifierSystem))]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
[Access(typeof(MovementSpeedModifierSystem))]
|
||||
public sealed partial class MovementSpeedModifierComponent : Component
|
||||
{
|
||||
// Weightless
|
||||
@@ -25,10 +25,10 @@ namespace Content.Shared.Movement.Components
|
||||
public const float DefaultBaseWalkSpeed = 2.5f;
|
||||
public const float DefaultBaseSprintSpeed = 4.5f;
|
||||
|
||||
[ViewVariables]
|
||||
[AutoNetworkedField, ViewVariables]
|
||||
public float WalkSpeedModifier = 1.0f;
|
||||
|
||||
[ViewVariables]
|
||||
[AutoNetworkedField, ViewVariables]
|
||||
public float SprintSpeedModifier = 1.0f;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
@@ -56,55 +56,56 @@ namespace Content.Shared.Movement.Components
|
||||
/// <summary>
|
||||
/// Minimum speed a mob has to be moving before applying movement friction.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("minimumFrictionSpeed")]
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public float MinimumFrictionSpeed = DefaultMinimumFrictionSpeed;
|
||||
|
||||
/// <summary>
|
||||
/// The negative velocity applied for friction when weightless and providing inputs.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("weightlessFriction")]
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public float WeightlessFriction = DefaultWeightlessFriction;
|
||||
|
||||
/// <summary>
|
||||
/// The negative velocity applied for friction when weightless and not providing inputs.
|
||||
/// This is essentially how much their speed decreases per second.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("weightlessFrictionNoInput")]
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public float WeightlessFrictionNoInput = DefaultWeightlessFrictionNoInput;
|
||||
|
||||
/// <summary>
|
||||
/// The movement speed modifier applied to a mob's total input velocity when weightless.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("weightlessModifier")]
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public float WeightlessModifier = DefaultWeightlessModifier;
|
||||
|
||||
/// <summary>
|
||||
/// The acceleration applied to mobs when moving and weightless.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("weightlessAcceleration")]
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public float WeightlessAcceleration = DefaultWeightlessAcceleration;
|
||||
|
||||
/// <summary>
|
||||
/// The acceleration applied to mobs when moving.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("acceleration")]
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public float Acceleration = DefaultAcceleration;
|
||||
|
||||
/// <summary>
|
||||
/// The negative velocity applied for friction.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("friction")]
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public float Friction = DefaultFriction;
|
||||
|
||||
/// <summary>
|
||||
/// The negative velocity applied for friction.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("frictionNoInput")] public float? FrictionNoInput = null;
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public float? FrictionNoInput;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("baseWalkSpeed")]
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
|
||||
public float BaseWalkSpeed { get; set; } = DefaultBaseWalkSpeed;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("baseSprintSpeed")]
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
|
||||
public float BaseSprintSpeed { get; set; } = DefaultBaseSprintSpeed;
|
||||
|
||||
[ViewVariables]
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.Movement.Systems
|
||||
{
|
||||
@@ -11,33 +8,6 @@ namespace Content.Shared.Movement.Systems
|
||||
{
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<MovementSpeedModifierComponent, ComponentGetState>(OnGetState);
|
||||
SubscribeLocalEvent<MovementSpeedModifierComponent, ComponentHandleState>(OnHandleState);
|
||||
}
|
||||
|
||||
private void OnGetState(EntityUid uid, MovementSpeedModifierComponent component, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new MovementSpeedModifierComponentState
|
||||
{
|
||||
BaseWalkSpeed = component.BaseWalkSpeed,
|
||||
BaseSprintSpeed = component.BaseSprintSpeed,
|
||||
WalkSpeedModifier = component.WalkSpeedModifier,
|
||||
SprintSpeedModifier = component.SprintSpeedModifier,
|
||||
};
|
||||
}
|
||||
|
||||
private void OnHandleState(EntityUid uid, MovementSpeedModifierComponent component, ref ComponentHandleState args)
|
||||
{
|
||||
if (args.Current is not MovementSpeedModifierComponentState state) return;
|
||||
component.BaseWalkSpeed = state.BaseWalkSpeed;
|
||||
component.BaseSprintSpeed = state.BaseSprintSpeed;
|
||||
component.WalkSpeedModifier = state.WalkSpeedModifier;
|
||||
component.SprintSpeedModifier = state.SprintSpeedModifier;
|
||||
}
|
||||
|
||||
public void RefreshMovementSpeedModifiers(EntityUid uid, MovementSpeedModifierComponent? move = null)
|
||||
{
|
||||
if (!Resolve(uid, ref move, false))
|
||||
@@ -68,15 +38,6 @@ namespace Content.Shared.Movement.Systems
|
||||
move.Acceleration = acceleration;
|
||||
Dirty(move);
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
private sealed class MovementSpeedModifierComponentState : ComponentState
|
||||
{
|
||||
public float BaseWalkSpeed;
|
||||
public float BaseSprintSpeed;
|
||||
public float WalkSpeedModifier;
|
||||
public float SprintSpeedModifier;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -5,7 +5,6 @@ using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Events;
|
||||
using Content.Shared.Popups;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -31,8 +30,6 @@ public abstract class SharedJetpackSystem : EntitySystem
|
||||
|
||||
SubscribeLocalEvent<JetpackUserComponent, CanWeightlessMoveEvent>(OnJetpackUserCanWeightless);
|
||||
SubscribeLocalEvent<JetpackUserComponent, EntParentChangedMessage>(OnJetpackUserEntParentChanged);
|
||||
SubscribeLocalEvent<JetpackUserComponent, ComponentGetState>(OnJetpackUserGetState);
|
||||
SubscribeLocalEvent<JetpackUserComponent, ComponentHandleState>(OnJetpackUserHandleState);
|
||||
|
||||
SubscribeLocalEvent<GravityChangedEvent>(OnJetpackUserGravityChanged);
|
||||
}
|
||||
@@ -60,22 +57,6 @@ public abstract class SharedJetpackSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
private void OnJetpackUserHandleState(EntityUid uid, JetpackUserComponent component, ref ComponentHandleState args)
|
||||
{
|
||||
if (args.Current is not JetpackUserComponentState state)
|
||||
return;
|
||||
|
||||
component.Jetpack = EnsureEntity<JetpackUserComponent>(state.Jetpack, uid);
|
||||
}
|
||||
|
||||
private void OnJetpackUserGetState(EntityUid uid, JetpackUserComponent component, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new JetpackUserComponentState()
|
||||
{
|
||||
Jetpack = GetNetEntity(component.Jetpack),
|
||||
};
|
||||
}
|
||||
|
||||
private void OnJetpackDropped(EntityUid uid, JetpackComponent component, DroppedEvent args)
|
||||
{
|
||||
SetEnabled(uid, component, false, args.User);
|
||||
@@ -204,12 +185,6 @@ public abstract class SharedJetpackSystem : EntitySystem
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
protected sealed class JetpackUserComponentState : ComponentState
|
||||
{
|
||||
public NetEntity Jetpack;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
using Content.Shared.Movement.Components;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Movement.Systems;
|
||||
|
||||
public abstract partial class SharedMoverController
|
||||
{
|
||||
private void InitializeFootsteps()
|
||||
{
|
||||
SubscribeLocalEvent<FootstepModifierComponent, ComponentGetState>(OnFootGetState);
|
||||
SubscribeLocalEvent<FootstepModifierComponent, ComponentHandleState>(OnFootHandleState);
|
||||
}
|
||||
|
||||
private void OnFootHandleState(EntityUid uid, FootstepModifierComponent component, ref ComponentHandleState args)
|
||||
{
|
||||
if (args.Current is not FootstepModifierComponentState state) return;
|
||||
component.Sound = state.Sound;
|
||||
}
|
||||
|
||||
private void OnFootGetState(EntityUid uid, FootstepModifierComponent component, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new FootstepModifierComponentState()
|
||||
{
|
||||
Sound = component.Sound,
|
||||
};
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
private sealed class FootstepModifierComponentState : ComponentState
|
||||
{
|
||||
public SoundSpecifier Sound = default!;
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ using Content.Shared.Follower.Components;
|
||||
using Content.Shared.Input;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Events;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Input;
|
||||
using Robust.Shared.Input.Binding;
|
||||
using Robust.Shared.Players;
|
||||
@@ -49,8 +48,7 @@ namespace Content.Shared.Movement.Systems
|
||||
.Register<SharedMoverController>();
|
||||
|
||||
SubscribeLocalEvent<InputMoverComponent, ComponentInit>(OnInputInit);
|
||||
SubscribeLocalEvent<InputMoverComponent, ComponentGetState>(OnInputGetState);
|
||||
SubscribeLocalEvent<InputMoverComponent, ComponentHandleState>(OnInputHandleState);
|
||||
SubscribeLocalEvent<InputMoverComponent, AfterAutoHandleStateEvent>(OnInputHandleState);
|
||||
SubscribeLocalEvent<InputMoverComponent, EntParentChangedMessage>(OnInputParentChange);
|
||||
|
||||
SubscribeLocalEvent<AutoOrientComponent, EntParentChangedMessage>(OnAutoParentChange);
|
||||
@@ -75,31 +73,10 @@ namespace Content.Shared.Movement.Systems
|
||||
Dirty(component);
|
||||
}
|
||||
|
||||
private void OnInputHandleState(EntityUid uid, InputMoverComponent component, ref ComponentHandleState args)
|
||||
private void OnInputHandleState(EntityUid uid, InputMoverComponent component, ref AfterAutoHandleStateEvent args)
|
||||
{
|
||||
if (args.Current is not InputMoverComponentState state)
|
||||
return;
|
||||
|
||||
component.HeldMoveButtons = state.Buttons;
|
||||
component.LastInputTick = GameTick.Zero;
|
||||
component.LastInputSubTick = 0;
|
||||
component.CanMove = state.CanMove;
|
||||
|
||||
component.RelativeRotation = state.RelativeRotation;
|
||||
component.TargetRelativeRotation = state.TargetRelativeRotation;
|
||||
component.RelativeEntity = EnsureEntity<InputMoverComponent>(state.RelativeEntity, uid);
|
||||
component.LerpTarget = state.LerpAccumulator;
|
||||
}
|
||||
|
||||
private void OnInputGetState(EntityUid uid, InputMoverComponent component, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new InputMoverComponentState(
|
||||
component.HeldMoveButtons,
|
||||
component.CanMove,
|
||||
component.RelativeRotation,
|
||||
component.TargetRelativeRotation,
|
||||
GetNetEntity(component.RelativeEntity),
|
||||
component.LerpTarget);
|
||||
}
|
||||
|
||||
private void ShutdownInput()
|
||||
@@ -564,35 +541,6 @@ namespace Content.Shared.Movement.Systems
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
private sealed class InputMoverComponentState : ComponentState
|
||||
{
|
||||
public MoveButtons Buttons { get; }
|
||||
public readonly bool CanMove;
|
||||
|
||||
/// <summary>
|
||||
/// Our current rotation for movement purposes. This is lerping towards <see cref="TargetRelativeRotation"/>
|
||||
/// </summary>
|
||||
public Angle RelativeRotation;
|
||||
|
||||
/// <summary>
|
||||
/// Target rotation relative to the <see cref="RelativeEntity"/>. Typically 0
|
||||
/// </summary>
|
||||
public Angle TargetRelativeRotation;
|
||||
public NetEntity? RelativeEntity;
|
||||
public TimeSpan LerpAccumulator;
|
||||
|
||||
public InputMoverComponentState(MoveButtons buttons, bool canMove, Angle relativeRotation, Angle targetRelativeRotation, NetEntity? relativeEntity, TimeSpan lerpTarget)
|
||||
{
|
||||
Buttons = buttons;
|
||||
CanMove = canMove;
|
||||
RelativeRotation = relativeRotation;
|
||||
TargetRelativeRotation = targetRelativeRotation;
|
||||
RelativeEntity = relativeEntity;
|
||||
LerpAccumulator = lerpTarget;
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class ShuttleInputCmdHandler : InputCmdHandler
|
||||
{
|
||||
private readonly SharedMoverController _controller;
|
||||
@@ -615,6 +563,7 @@ namespace Content.Shared.Movement.Systems
|
||||
}
|
||||
|
||||
[Flags]
|
||||
[Serializable, NetSerializable]
|
||||
public enum MoveButtons : byte
|
||||
{
|
||||
None = 0,
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
using Content.Shared.Movement.Components;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Movement.Systems;
|
||||
|
||||
public abstract partial class SharedMoverController
|
||||
{
|
||||
private void InitializeMob()
|
||||
{
|
||||
SubscribeLocalEvent<MobMoverComponent, ComponentGetState>(OnMobGetState);
|
||||
SubscribeLocalEvent<MobMoverComponent, ComponentHandleState>(OnMobHandleState);
|
||||
}
|
||||
|
||||
private void OnMobHandleState(EntityUid uid, MobMoverComponent component, ref ComponentHandleState args)
|
||||
{
|
||||
if (args.Current is not MobMoverComponentState state) return;
|
||||
component.GrabRangeVV = state.GrabRange;
|
||||
component.PushStrengthVV = state.PushStrength;
|
||||
}
|
||||
|
||||
private void OnMobGetState(EntityUid uid, MobMoverComponent component, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new MobMoverComponentState(component.GrabRange, component.PushStrength);
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
private sealed class MobMoverComponentState : ComponentState
|
||||
{
|
||||
public float GrabRange;
|
||||
public float PushStrength;
|
||||
|
||||
public MobMoverComponentState(float grabRange, float pushStrength)
|
||||
{
|
||||
GrabRange = grabRange;
|
||||
PushStrength = pushStrength;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Numerics;
|
||||
using Content.Shared.Bed.Sleep;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Friction;
|
||||
using Content.Shared.Gravity;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Maps;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Events;
|
||||
using Content.Shared.Pulling.Components;
|
||||
@@ -12,15 +16,11 @@ using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Controllers;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Numerics;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Content.Shared.Bed.Sleep;
|
||||
|
||||
namespace Content.Shared.Movement.Systems
|
||||
{
|
||||
@@ -88,9 +88,7 @@ namespace Content.Shared.Movement.Systems
|
||||
NoRotateQuery = GetEntityQuery<NoRotateOnMoveComponent>();
|
||||
CanMoveInAirQuery = GetEntityQuery<CanMoveInAirComponent>();
|
||||
|
||||
InitializeFootsteps();
|
||||
InitializeInput();
|
||||
InitializeMob();
|
||||
InitializeRelay();
|
||||
_configManager.OnValueChanged(CCVars.RelativeMovement, SetRelativeMovement, true);
|
||||
_configManager.OnValueChanged(CCVars.StopSpeed, SetStopSpeed, true);
|
||||
@@ -440,14 +438,14 @@ namespace Content.Shared.Movement.Systems
|
||||
|
||||
if (TryComp<FootstepModifierComponent>(uid, out var moverModifier))
|
||||
{
|
||||
sound = moverModifier.Sound;
|
||||
sound = moverModifier.FootstepSoundCollection;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_inventory.TryGetSlotEntity(uid, "shoes", out var shoes) &&
|
||||
TryComp<FootstepModifierComponent>(shoes, out var modifier))
|
||||
{
|
||||
sound = modifier.Sound;
|
||||
sound = modifier.FootstepSoundCollection;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -468,7 +466,7 @@ namespace Content.Shared.Movement.Systems
|
||||
{
|
||||
if (TryComp<FootstepModifierComponent>(xform.MapUid, out var modifier))
|
||||
{
|
||||
sound = modifier.Sound;
|
||||
sound = modifier.FootstepSoundCollection;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -494,7 +492,7 @@ namespace Content.Shared.Movement.Systems
|
||||
|
||||
if (TryComp<FootstepModifierComponent>(maybeFootstep, out var footstep))
|
||||
{
|
||||
sound = footstep.Sound;
|
||||
sound = footstep.FootstepSoundCollection;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user