CatStation/Content.Server/Spawners/Components/EntityTableSpawnerComponent.cs
Fildrance 0687a19cd7
feat: ConditionalSpawnerComponent can now stack items it spawns automatically (#39096)
* feat: ConditionalSpawnerComponent can now stack items it spawns automatically

* refactor: StackComponent quick cleanup, while we are at it

* refactor: replace custom code with StackSystem.SpawnMultiple

* refactor: update for RT changes

* refactor: update after merge

* refactor: cleanup + fix GetRadomOffset using full range

* fix: change GetRandomOffset to not pass negative offset to NextVector2Box, NextVector2Box negates value by itself

* refactor: now artifact spawns stacks of resrouces, as god intended

* refactor: modernize

---------

Co-authored-by: pa.pecherskij <pa.pecherskij@interfax.ru>
2026-07-28 19:46:57 +00:00

36 lines
1 KiB
C#

using Content.Server.Spawners.EntitySystems;
using Content.Shared.EntityTable.EntitySelectors;
using Robust.Shared.Prototypes;
namespace Content.Server.Spawners.Components;
[RegisterComponent, EntityCategory("Spawner"), Access(typeof(ConditionalSpawnerSystem))]
public sealed partial class EntityTableSpawnerComponent : Component
{
/// <summary>
/// Table that determines what gets spawned.
/// </summary>
[DataField(required: true)]
public EntityTableSelector Table = default!;
/// <summary>
/// Scatter of entity spawn coordinates
/// </summary>
[DataField]
public float Offset = 0.2f;
/// <summary>
/// A variable meaning whether the spawn will
/// be able to be used again or whether
/// it will be destroyed after the first use
/// </summary>
[DataField]
public bool DeleteSpawnerAfterSpawn = true;
/// <summary>
/// Marker, if produced entities should be spawned stacked if they could be.
/// </summary>
[DataField]
public bool AutoStack = false;
}