CatStation/Content.Server/Power/Components/SpawnOnBatteryFullComponent.cs
Samuka ab96ec8b20
SpawnOnBatteryFull component (#43727)
* code stuff

* fix error

* now its fixed

* use the charge from the arg

* only on battery full

* remove whitespace

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* use default! instead of null!

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* use set charge

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2026-04-25 22:32:31 +00:00

25 lines
685 B
C#

using Content.Shared.EntityTable.EntitySelectors;
using Robust.Shared.Prototypes;
namespace Content.Server.Power.Components;
/// <summary>
/// Spawns a entity when the battery reaches max charge.
/// It also consumes all power when spawning the entity.
/// </summary>
[RegisterComponent]
public sealed partial class SpawnOnBatteryFullComponent : Component
{
/// <summary>
/// A entity proto to spawn.
/// </summary>
/// <remarks>Takes priority over <see cref="Table"/></remarks>
[DataField]
public EntProtoId? Proto;
/// <summary>
/// A entity table to spawn stuff from.
/// </summary>
[DataField]
public EntityTableSelector? Table;
}