ThrownItemComponent.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System.Numerics;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Serialization;
  4. using Robust.Shared.Timing;
  5. namespace Content.Shared.Throwing
  6. {
  7. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true), AutoGenerateComponentPause]
  8. public sealed partial class ThrownItemComponent : Component
  9. {
  10. /// <summary>
  11. /// Should the in-air throwing animation play.
  12. /// </summary>
  13. [DataField, AutoNetworkedField]
  14. public bool Animate = true;
  15. /// <summary>
  16. /// The entity that threw this entity.
  17. /// </summary>
  18. [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
  19. public EntityUid? Thrower;
  20. /// <summary>
  21. /// The <see cref="IGameTiming.CurTime"/> timestamp at which this entity was thrown.
  22. /// </summary>
  23. [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
  24. public TimeSpan? ThrownTime;
  25. /// <summary>
  26. /// Compared to <see cref="IGameTiming.CurTime"/> to land this entity, if any.
  27. /// </summary>
  28. [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
  29. [AutoPausedField]
  30. public TimeSpan? LandTime;
  31. /// <summary>
  32. /// Whether or not this entity was already landed.
  33. /// </summary>
  34. [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
  35. public bool Landed;
  36. /// <summary>
  37. /// Whether or not to play a sound when the entity lands.
  38. /// </summary>
  39. [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
  40. public bool PlayLandSound;
  41. /// <summary>
  42. /// Used to restore state after the throwing scale animation is finished.
  43. /// </summary>
  44. [DataField]
  45. public Vector2? OriginalScale = null;
  46. }
  47. }