1
0

ChasmFallingComponent.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Numerics;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  4. namespace Content.Shared.Chasm;
  5. /// <summary>
  6. /// Added to entities which have started falling into a chasm.
  7. /// </summary>
  8. [RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
  9. public sealed partial class ChasmFallingComponent : Component
  10. {
  11. /// <summary>
  12. /// Time it should take for the falling animation (scaling down) to complete.
  13. /// </summary>
  14. [DataField("animationTime")]
  15. public TimeSpan AnimationTime = TimeSpan.FromSeconds(1.5f);
  16. /// <summary>
  17. /// Time it should take in seconds for the entity to actually delete
  18. /// </summary>
  19. [DataField("deletionTime")]
  20. public TimeSpan DeletionTime = TimeSpan.FromSeconds(1.8f);
  21. [DataField("nextDeletionTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
  22. [AutoPausedField]
  23. public TimeSpan NextDeletionTime = TimeSpan.Zero;
  24. /// <summary>
  25. /// Original scale of the object so it can be restored if the component is removed in the middle of the animation
  26. /// </summary>
  27. public Vector2 OriginalScale = Vector2.Zero;
  28. /// <summary>
  29. /// Scale that the animation should bring entities to.
  30. /// </summary>
  31. public Vector2 AnimationScale = new Vector2(0.01f, 0.01f);
  32. }