2024-01-30 03:50:41 -07:00
|
|
|
using System.Numerics;
|
2021-10-12 21:58:11 +02:00
|
|
|
using Robust.Shared.GameStates;
|
|
|
|
|
using Robust.Shared.Serialization;
|
2023-10-06 17:43:54 -07:00
|
|
|
using Robust.Shared.Timing;
|
2021-03-08 04:09:59 +11:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Shared.Throwing
|
2021-03-08 04:09:59 +11:00
|
|
|
{
|
2024-02-26 04:36:19 +01:00
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true), AutoGenerateComponentPause]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class ThrownItemComponent : Component
|
2021-03-08 04:09:59 +11:00
|
|
|
{
|
2024-03-19 14:30:56 +11:00
|
|
|
/// <summary>
|
|
|
|
|
/// Should the in-air throwing animation play.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField, AutoNetworkedField]
|
|
|
|
|
public bool Animate = true;
|
|
|
|
|
|
2023-10-06 17:43:54 -07:00
|
|
|
/// <summary>
|
|
|
|
|
/// The entity that threw this entity.
|
|
|
|
|
/// </summary>
|
2024-01-30 03:50:41 -07:00
|
|
|
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
2024-01-06 13:38:37 +11:00
|
|
|
public EntityUid? Thrower;
|
2023-10-06 17:43:54 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The <see cref="IGameTiming.CurTime"/> timestamp at which this entity was thrown.
|
|
|
|
|
/// </summary>
|
2024-01-30 03:50:41 -07:00
|
|
|
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
2024-01-06 13:38:37 +11:00
|
|
|
public TimeSpan? ThrownTime;
|
2023-10-06 17:43:54 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Compared to <see cref="IGameTiming.CurTime"/> to land this entity, if any.
|
|
|
|
|
/// </summary>
|
2024-01-30 03:50:41 -07:00
|
|
|
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
2024-02-26 04:36:19 +01:00
|
|
|
[AutoPausedField]
|
2024-01-06 13:38:37 +11:00
|
|
|
public TimeSpan? LandTime;
|
2023-10-06 17:43:54 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether or not this entity was already landed.
|
|
|
|
|
/// </summary>
|
2024-01-30 03:50:41 -07:00
|
|
|
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
2024-01-06 13:38:37 +11:00
|
|
|
public bool Landed;
|
2023-10-06 17:43:54 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether or not to play a sound when the entity lands.
|
|
|
|
|
/// </summary>
|
2024-01-30 03:50:41 -07:00
|
|
|
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
2024-01-06 13:38:37 +11:00
|
|
|
public bool PlayLandSound;
|
|
|
|
|
|
2024-01-30 03:50:41 -07:00
|
|
|
/// <summary>
|
|
|
|
|
/// Used to restore state after the throwing scale animation is finished.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField]
|
|
|
|
|
public Vector2? OriginalScale = null;
|
2021-10-12 21:58:11 +02:00
|
|
|
}
|
2021-03-08 04:09:59 +11:00
|
|
|
}
|