CatStation/Content.Shared/Storage/Components/SpawnAfterInteractComponent.cs
phönix d6a8071e81
Predict SpawnAfterInteractSystem (#45955)
* init

* hmmmm

* huh

* final

* hmmm

* test

* test2

* huhhuh

* minor cleanup

---------

Co-authored-by: Pok245 <113675512+Pok27@users.noreply.github.com>
2026-09-20 00:30:58 +00:00

35 lines
974 B
C#

using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.Storage.Components;
/// <summary>
/// This component enables the spawn of a specific entity upon being interacted with.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class SpawnAfterInteractComponent : Component
{
/// <summary>
/// The prototype id of the entity to be spawned in.
/// </summary>
[DataField(required: true)]
public EntProtoId Prototype;
/// <summary>
/// Stops the spawn if the target space is no longer in reach, unless true.
/// </summary>
[DataField]
public bool IgnoreDistance;
/// <summary>
/// The length of the interact action.
/// </summary>
[DataField("doAfter")]
public float DoAfterTime;
/// <summary>
/// If the entity with this component should be deleted upon a successful spawn.
/// </summary>
[DataField]
public bool RemoveOnInteract;
}