Files
wwdpublic/Content.Server/StationEvents/Components/RandomSpawnRuleComponent.cs
vanx d45adc90ac [Add] Random Spawn Event Location (#953)
* location located

* Update Content.Server/StationEvents/Components/RandomSpawnRuleComponent.cs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com>

* fix

---------

Co-authored-by: vanx <vanxxxx@discord>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Spatison <137375981+Spatison@users.noreply.github.com>
2025-12-29 17:15:14 +03:00

43 lines
1.2 KiB
C#

using Content.Server.StationEvents.Events;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.StationEvents.Components;
/// <summary>
/// Spawns entities at random tiles on a station.
/// </summary>
[RegisterComponent, Access(typeof(RandomSpawnRule))]
public sealed partial class RandomSpawnRuleComponent : Component
{
/// <summary>
/// The entity to be spawned.
/// </summary>
[DataField("prototype", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string Prototype = string.Empty;
/// <summary>
/// Minimum number of entities to spawn | WWDP
/// </summary>
[DataField("minCount")]
public int MinCount = 1;
/// <summary>
/// Maximum number of entities to spawn | WWDP
/// </summary>
[DataField("maxCount")]
public int MaxCount = 1;
/// <summary>
/// Should the station receive an announcement with the approximate spawn location? | WWDP
/// </summary>
[DataField]
public bool Announce;
/// <summary>
/// Locale to use for the announcement | WWDP
/// </summary>
[DataField]
public string? LocId;
}