2022-01-31 17:36:49 +11:00
|
|
|
using Robust.Shared.Prototypes;
|
2020-07-11 16:49:54 -05:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Spawners.Components
|
2020-07-11 16:49:54 -05:00
|
|
|
{
|
2024-06-02 16:08:15 +12:00
|
|
|
[RegisterComponent, EntityCategory("Spawner")]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class RandomSpawnerComponent : ConditionalSpawnerComponent
|
2020-07-11 16:49:54 -05:00
|
|
|
{
|
2024-07-31 19:09:51 +03:00
|
|
|
/// <summary>
|
|
|
|
|
/// A list of rarer entities that can spawn with the RareChance
|
|
|
|
|
/// instead of one of the entities in the Prototypes list.
|
|
|
|
|
/// </summary>
|
2020-07-11 16:49:54 -05:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2024-01-21 04:31:12 +03:00
|
|
|
[DataField]
|
|
|
|
|
public List<EntProtoId> RarePrototypes { get; set; } = new();
|
2020-07-11 16:49:54 -05:00
|
|
|
|
2024-07-31 19:09:51 +03:00
|
|
|
/// <summary>
|
|
|
|
|
/// The chance that a rare prototype may spawn instead of a common prototype
|
|
|
|
|
/// </summary>
|
2020-07-11 16:49:54 -05:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2024-01-21 04:31:12 +03:00
|
|
|
[DataField]
|
2020-07-11 16:49:54 -05:00
|
|
|
public float RareChance { get; set; } = 0.05f;
|
|
|
|
|
|
2024-07-31 19:09:51 +03:00
|
|
|
/// <summary>
|
|
|
|
|
/// Scatter of entity spawn coordinates
|
|
|
|
|
/// </summary>
|
2020-07-11 16:49:54 -05:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2024-01-21 04:31:12 +03:00
|
|
|
[DataField]
|
2020-07-11 16:49:54 -05:00
|
|
|
public float Offset { get; set; } = 0.2f;
|
2024-01-21 04:31:12 +03:00
|
|
|
|
2024-07-31 19:09:51 +03:00
|
|
|
/// <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>
|
2024-01-21 04:31:12 +03:00
|
|
|
[DataField]
|
|
|
|
|
public bool DeleteSpawnerAfterSpawn = true;
|
2020-07-11 16:49:54 -05:00
|
|
|
}
|
|
|
|
|
}
|