Climbing refactor (#20516)

This commit is contained in:
metalgearsloth
2023-10-11 10:41:11 +11:00
committed by GitHub
parent ab75941bc0
commit edbfef22d6
30 changed files with 637 additions and 661 deletions

View File

@@ -0,0 +1,36 @@
using System.Numerics;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Climbing.Components;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class ClimbingComponent : Component
{
/// <summary>
/// Whether the owner is climbing on a climbable entity.
/// </summary>
[AutoNetworkedField, DataField]
public bool IsClimbing;
/// <summary>
/// Whether the owner is being moved onto the climbed entity.
/// </summary>
[AutoNetworkedField, DataField(customTypeSerializer:typeof(TimeOffsetSerializer))]
public TimeSpan? NextTransition;
/// <summary>
/// Direction to move when transition.
/// </summary>
[AutoNetworkedField, DataField]
public Vector2 Direction;
/// <summary>
/// How fast the entity is moved when climbing.
/// </summary>
[DataField]
public float TransitionRate = 5f;
[AutoNetworkedField, DataField]
public Dictionary<string, int> DisabledFixtureMasks = new();
}