2023-07-10 04:06:07 +03:00
|
|
|
|
using System.Numerics;
|
|
|
|
|
|
using Robust.Shared.GameStates;
|
2023-07-09 18:36:37 -04:00
|
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Nutrition.AnimalHusbandry;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// This is used for marking entities as infants.
|
|
|
|
|
|
/// Infants have half the size, visually, and cannot breed.
|
|
|
|
|
|
/// </summary>
|
2024-02-26 04:36:19 +01:00
|
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
|
2023-08-22 18:14:33 -07:00
|
|
|
|
public sealed partial class InfantComponent : Component
|
2023-07-09 18:36:37 -04:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// How long the entity remains an infant.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField("infantDuration")]
|
|
|
|
|
|
public TimeSpan InfantDuration = TimeSpan.FromMinutes(3);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The base scale of the entity
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField("defaultScale")]
|
|
|
|
|
|
public Vector2 DefaultScale = Vector2.One;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The size difference of the entity while it's an infant.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField("visualScale")]
|
|
|
|
|
|
public Vector2 VisualScale = new(.5f, .5f);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// When the entity will stop being an infant.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField("infantEndTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
2024-02-26 04:36:19 +01:00
|
|
|
|
[AutoPausedField]
|
2023-07-09 18:36:37 -04:00
|
|
|
|
public TimeSpan InfantEndTime;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The entity's name before the "baby" prefix is added.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[DataField("originalName")]
|
|
|
|
|
|
public string OriginalName = string.Empty;
|
|
|
|
|
|
}
|