RandomSpawnerComponent.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using Robust.Shared.Prototypes;
  2. namespace Content.Server.Spawners.Components
  3. {
  4. [RegisterComponent, EntityCategory("Spawner")]
  5. public sealed partial class RandomSpawnerComponent : ConditionalSpawnerComponent
  6. {
  7. /// <summary>
  8. /// A list of rarer entities that can spawn with the RareChance
  9. /// instead of one of the entities in the Prototypes list.
  10. /// </summary>
  11. [ViewVariables(VVAccess.ReadWrite)]
  12. [DataField]
  13. public List<EntProtoId> RarePrototypes { get; set; } = new();
  14. /// <summary>
  15. /// The chance that a rare prototype may spawn instead of a common prototype
  16. /// </summary>
  17. [ViewVariables(VVAccess.ReadWrite)]
  18. [DataField]
  19. public float RareChance { get; set; } = 0.05f;
  20. /// <summary>
  21. /// Scatter of entity spawn coordinates
  22. /// </summary>
  23. [ViewVariables(VVAccess.ReadWrite)]
  24. [DataField]
  25. public float Offset { get; set; } = 0.2f;
  26. /// <summary>
  27. /// A variable meaning whether the spawn will
  28. /// be able to be used again or whether
  29. /// it will be destroyed after the first use
  30. /// </summary>
  31. [DataField]
  32. public bool DeleteSpawnerAfterSpawn = true;
  33. }
  34. }