The real movement refactor (#9645)

* The real movement refactor

* ref events

* Jetpack cleanup

* a

* Vehicles partially working

* Balance tweaks

* Restore some shitcode

* AAAAAAAA

* Even more prediction

* ECS compstate trying to fix this

* yml

* vehicles kill me

* Don't lock keys

* a

* Fix problem

* Fix sounds

* shuttle inputs

* Shuttle controls

* space brakes

* Keybinds

* Fix merge

* Handle shutdown

* Fix keys

* Bump friction

* fix buckle offset

* Fix relay and friction

* Fix jetpack turning

* contexts amirite
This commit is contained in:
metalgearsloth
2022-07-16 13:51:52 +10:00
committed by GitHub
parent e0b7b48cae
commit b9e876ca92
109 changed files with 1752 additions and 1584 deletions

View File

@@ -3,12 +3,27 @@ using Robust.Shared.GameStates;
namespace Content.Shared.Movement.Components
{
/// <summary>
/// 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))]
public sealed class MovementSpeedModifierComponent : Component
{
public const float DefaultBaseWalkSpeed = 3.0f;
public const float DefaultBaseSprintSpeed = 5.0f;
// Weightless
public const float DefaultMinimumFrictionSpeed = 0.005f;
public const float DefaultWeightlessFriction = 1f;
public const float DefaultWeightlessFrictionNoInput = 0.2f;
public const float DefaultWeightlessModifier = 0.7f;
public const float DefaultWeightlessAcceleration = 1f;
public const float DefaultAcceleration = 20f;
public const float DefaultFriction = 20f;
public const float DefaultFrictionNoInput = 20f;
public const float DefaultBaseWalkSpeed = 2.5f;
public const float DefaultBaseSprintSpeed = 4.5f;
[ViewVariables]
public float WalkSpeedModifier = 1.0f;
@@ -38,6 +53,54 @@ namespace Content.Shared.Movement.Components
}
}
/// <summary>
/// Minimum speed a mob has to be moving before applying movement friction.
/// </summary>
[DataField("minimumFrictionSpeed")]
public float MinimumFrictionSpeed = DefaultMinimumFrictionSpeed;
/// <summary>
/// The negative velocity applied for friction when weightless and providing inputs.
/// </summary>
[DataField("weightlessFriction")]
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>
[DataField("weightlessFrictionNoInput")]
public float WeightlessFrictionNoInput = DefaultWeightlessFrictionNoInput;
/// <summary>
/// The movement speed modifier applied to a mob's total input velocity when weightless.
/// </summary>
[DataField("weightlessModifier")]
public float WeightlessModifier = DefaultWeightlessModifier;
/// <summary>
/// The acceleration applied to mobs when moving and weightless.
/// </summary>
[DataField("weightlessAcceleration")]
public float WeightlessAcceleration = DefaultWeightlessAcceleration;
/// <summary>
/// The acceleration applied to mobs when moving.
/// </summary>
[DataField("acceleration")]
public float Acceleration = DefaultAcceleration;
/// <summary>
/// The negative velocity applied for friction.
/// </summary>
[DataField("friction")]
public float Friction = DefaultFriction;
/// <summary>
/// The negative velocity applied for friction.
/// </summary>
[DataField("frictionNoInput")] public float? FrictionNoInput = null;
[DataField("baseWalkSpeed")]
public float BaseWalkSpeed { get; set; } = DefaultBaseWalkSpeed;