Move step sound distance and footstep variation to MobMoverComponent (#27799)
This commit is contained in:
@@ -14,6 +14,15 @@ namespace Content.Shared.Movement.Components
|
|||||||
|
|
||||||
[DataField] public float PushStrength = 600f;
|
[DataField] public float PushStrength = 600f;
|
||||||
|
|
||||||
|
[DataField, AutoNetworkedField]
|
||||||
|
public float StepSoundMoveDistanceRunning = 2;
|
||||||
|
|
||||||
|
[DataField, AutoNetworkedField]
|
||||||
|
public float StepSoundMoveDistanceWalking = 1.5f;
|
||||||
|
|
||||||
|
[DataField, AutoNetworkedField]
|
||||||
|
public float FootstepVariation;
|
||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
public EntityCoordinates LastPosition { get; set; }
|
public EntityCoordinates LastPosition { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -58,11 +58,6 @@ namespace Content.Shared.Movement.Systems
|
|||||||
protected EntityQuery<CanMoveInAirComponent> CanMoveInAirQuery;
|
protected EntityQuery<CanMoveInAirComponent> CanMoveInAirQuery;
|
||||||
protected EntityQuery<NoRotateOnMoveComponent> NoRotateQuery;
|
protected EntityQuery<NoRotateOnMoveComponent> NoRotateQuery;
|
||||||
|
|
||||||
private const float StepSoundMoveDistanceRunning = 2;
|
|
||||||
private const float StepSoundMoveDistanceWalking = 1.5f;
|
|
||||||
|
|
||||||
private const float FootstepVariation = 0f;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <see cref="CCVars.StopSpeed"/>
|
/// <see cref="CCVars.StopSpeed"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -258,7 +253,7 @@ namespace Content.Shared.Movement.Systems
|
|||||||
|
|
||||||
var audioParams = sound.Params
|
var audioParams = sound.Params
|
||||||
.WithVolume(sound.Params.Volume + soundModifier)
|
.WithVolume(sound.Params.Volume + soundModifier)
|
||||||
.WithVariation(sound.Params.Variation ?? FootstepVariation);
|
.WithVariation(sound.Params.Variation ?? mobMover.FootstepVariation);
|
||||||
|
|
||||||
// If we're a relay target then predict the sound for all relays.
|
// If we're a relay target then predict the sound for all relays.
|
||||||
if (relayTarget != null)
|
if (relayTarget != null)
|
||||||
@@ -404,7 +399,9 @@ namespace Content.Shared.Movement.Systems
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
var coordinates = xform.Coordinates;
|
var coordinates = xform.Coordinates;
|
||||||
var distanceNeeded = mover.Sprinting ? StepSoundMoveDistanceRunning : StepSoundMoveDistanceWalking;
|
var distanceNeeded = mover.Sprinting
|
||||||
|
? mobMover.StepSoundMoveDistanceRunning
|
||||||
|
: mobMover.StepSoundMoveDistanceWalking;
|
||||||
|
|
||||||
// Handle footsteps.
|
// Handle footsteps.
|
||||||
if (!weightless)
|
if (!weightless)
|
||||||
|
|||||||
Reference in New Issue
Block a user