InfantComponent.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Numerics;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  4. namespace Content.Shared.Nutrition.AnimalHusbandry;
  5. /// <summary>
  6. /// This is used for marking entities as infants.
  7. /// Infants have half the size, visually, and cannot breed.
  8. /// </summary>
  9. [RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
  10. public sealed partial class InfantComponent : Component
  11. {
  12. /// <summary>
  13. /// How long the entity remains an infant.
  14. /// </summary>
  15. [DataField("infantDuration")]
  16. public TimeSpan InfantDuration = TimeSpan.FromMinutes(3);
  17. /// <summary>
  18. /// The base scale of the entity
  19. /// </summary>
  20. [DataField("defaultScale")]
  21. public Vector2 DefaultScale = Vector2.One;
  22. /// <summary>
  23. /// The size difference of the entity while it's an infant.
  24. /// </summary>
  25. [DataField("visualScale")]
  26. public Vector2 VisualScale = new(.5f, .5f);
  27. /// <summary>
  28. /// When the entity will stop being an infant.
  29. /// </summary>
  30. [DataField("infantEndTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
  31. [AutoPausedField]
  32. public TimeSpan InfantEndTime;
  33. }