forked from vgstation-coders/vgstation13.5
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ports /vg/ tile movement v1.0 from other repo.
- Loading branch information
1 parent
19e0b0c
commit 2a4ab25
Showing
2 changed files
with
490 additions
and
29 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
Content.Shared/Movement/Components/TileMovementComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using System.Numerics; | ||
using Content.Shared.Movement.Systems; | ||
using Robust.Shared.GameStates; | ||
using Robust.Shared.Map; | ||
|
||
namespace Content.Shared.TileMovement; | ||
|
||
/// <summary> | ||
/// When attached to an entity with an InputMoverComponent, all mob movement on that entity will | ||
/// be tile-based. Contains info used to facilitate that movement. | ||
/// </summary> | ||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] | ||
public sealed partial class TileMovementComponent : Component | ||
{ | ||
/// <summary> | ||
/// Whether a tile movement slide is currently in progress. | ||
/// </summary> | ||
[AutoNetworkedField] | ||
public bool SlideActive; | ||
|
||
/// <summary> | ||
/// Local coordinates from which the current slide first began. | ||
/// </summary> | ||
[AutoNetworkedField] | ||
public EntityCoordinates Origin; | ||
|
||
/// <summary> | ||
/// Local coordinates of the target of the current slide. | ||
/// </summary> | ||
[AutoNetworkedField] | ||
public Vector2 Destination; | ||
|
||
/// <summary> | ||
/// This helps determine how long a slide should last. A slide will continue so long | ||
/// as a movement key (WASD) is being held down, but if it was held down for less than | ||
/// a certain time period then it will continue for a minimum period. | ||
/// </summary> | ||
[AutoNetworkedField] | ||
public TimeSpan? MovementKeyInitialDownTime; | ||
|
||
/// <summary> | ||
/// Move buttons used to initiate the current slide. | ||
/// </summary> | ||
[AutoNetworkedField] | ||
public MoveButtons CurrentSlideMoveButtons; | ||
|
||
/// <summary> | ||
/// Local coordinates of the entity on the last physics tick. | ||
/// </summary> | ||
[AutoNetworkedField] | ||
public Vector2 LastTickPosition; | ||
|
||
/// <summary> | ||
/// Whether this entity was weightless last physics tick. | ||
/// </summary> | ||
[AutoNetworkedField] | ||
public bool WasWeightlessLastTick; | ||
} |
Oops, something went wrong.