Files
tbd-station-14/Content.Server/Spawners/Components/RandomSpawnerComponent.cs
2022-01-31 17:36:49 +11:00

27 lines
1.0 KiB
C#

using System.Collections.Generic;
using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
using Robust.Shared.ViewVariables;
namespace Content.Server.Spawners.Components
{
[RegisterComponent, ComponentProtoName("RandomSpawner")]
public class RandomSpawnerComponent : ConditionalSpawnerComponent
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField("rarePrototypes", customTypeSerializer:typeof(PrototypeIdListSerializer<EntityPrototype>))]
public List<string> RarePrototypes { get; set; } = new();
[ViewVariables(VVAccess.ReadWrite)]
[DataField("rareChance")]
public float RareChance { get; set; } = 0.05f;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("offset")]
public float Offset { get; set; } = 0.2f;
}
}