using Content.Server.Physics.Controllers; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Server.Physics.Components; /// /// A component which makes its entity chasing entity with selected component. /// [RegisterComponent, Access(typeof(ChasingWalkSystem)), AutoGenerateComponentPause] public sealed partial class ChasingWalkComponent : Component { /// /// The next moment in time when the entity is pushed toward its goal /// [DataField, ViewVariables(VVAccess.ReadWrite)] [AutoPausedField] public TimeSpan NextImpulseTime; /// /// Push-to-target frequency. /// [DataField, ViewVariables(VVAccess.ReadWrite)] public float ImpulseInterval = 2f; /// /// The minimum speed at which this entity will move. /// [DataField, ViewVariables(VVAccess.ReadWrite)] public float MinSpeed = 1.5f; /// /// The maximum speed at which this entity will move. /// [DataField, ViewVariables(VVAccess.ReadWrite)] public float MaxSpeed = 3f; /// /// The current speed. /// [DataField, ViewVariables(VVAccess.ReadWrite)] public float Speed; /// /// The minimum time interval in which an object can change its motion target. /// [DataField, ViewVariables(VVAccess.ReadWrite)] public float ChangeVectorMinInterval = 5f; /// /// The maximum time interval in which an object can change its motion target. /// [DataField, ViewVariables(VVAccess.ReadWrite)] public float ChangeVectorMaxInterval = 25f; /// /// The next change of direction time. /// [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] [AutoPausedField] public TimeSpan NextChangeVectorTime; /// /// The component that the entity is chasing /// [DataField(required: true)] public ComponentRegistry ChasingComponent = default!; /// /// The maximum radius in which the entity chooses the target component to follow /// [DataField, ViewVariables(VVAccess.ReadWrite)] public float MaxChaseRadius = 25; /// /// The entity uid, chasing by the component owner /// [DataField, ViewVariables(VVAccess.ReadWrite)] public EntityUid? ChasingEntity; }