ConditionalSpawnerComponent.cs 1022 B

1234567891011121314151617181920212223242526272829303132
  1. using Robust.Shared.Prototypes;
  2. namespace Content.Server.Spawners.Components
  3. {
  4. [RegisterComponent, EntityCategory("Spawner")]
  5. [Virtual]
  6. public partial class ConditionalSpawnerComponent : Component
  7. {
  8. /// <summary>
  9. /// A list of entities, one of which can spawn in after calling Spawn()
  10. /// </summary>
  11. [ViewVariables(VVAccess.ReadWrite)]
  12. [DataField]
  13. public List<EntProtoId> Prototypes { get; set; } = new();
  14. /// <summary>
  15. /// A list of game rules.
  16. /// If at least one of them was launched in the game,
  17. /// an attempt will occur to spawn one of the objects in the Prototypes list
  18. /// </summary>
  19. [ViewVariables(VVAccess.ReadWrite)]
  20. [DataField]
  21. public List<EntProtoId> GameRules = new();
  22. /// <summary>
  23. /// Chance of spawning an entity
  24. /// </summary>
  25. [ViewVariables(VVAccess.ReadWrite)]
  26. [DataField]
  27. public float Chance { get; set; } = 1.0f;
  28. }
  29. }