MovementSpeedModifierComponent (#721)

* movement modifier system

* update default exposedata values

* changing base speed marks as dirty

* formatting

* movement speed modifier component

* Moves slowdown component to the prototype

AIController respects slowdown

* reset dirty flag
This commit is contained in:
4dplanner
2020-02-22 23:37:56 +00:00
committed by GitHub
parent ffe55648b6
commit b0e3ab3393
9 changed files with 231 additions and 49 deletions

View File

@@ -32,8 +32,8 @@ namespace Content.Server.GameObjects.Components.Movement
public override string Name => "ShuttleController";
[ViewVariables(VVAccess.ReadWrite)]
public float WalkMoveSpeed { get; set; } = 8;
public float SprintMoveSpeed { get; set; }
public float CurrentWalkSpeed { get; set; } = 8;
public float CurrentSprintSpeed { get; set; }
public bool Sprinting { get; set; }
public Vector2 VelocityDir { get; } = Vector2.Zero;
public GridCoordinates LastPosition { get; set; }
@@ -61,7 +61,7 @@ namespace Content.Server.GameObjects.Components.Movement
collideComp.PhysicsShapes.Add(new PhysShapeGrid(grid));
}
physComp.LinearVelocity = CalcNewVelocity(direction, enabled) * WalkMoveSpeed;
physComp.LinearVelocity = CalcNewVelocity(direction, enabled) * CurrentWalkSpeed;
}
}