1
0

CargoDeliveryDataComponent.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  2. namespace Content.Server.Delivery;
  3. /// <summary>
  4. /// Component given to a station to indicate it can have deliveries spawn on it.
  5. /// </summary>
  6. [RegisterComponent, AutoGenerateComponentPause]
  7. public sealed partial class CargoDeliveryDataComponent : Component
  8. {
  9. /// <summary>
  10. /// The time at which the next delivery will spawn.
  11. /// </summary>
  12. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
  13. public TimeSpan NextDelivery;
  14. /// <summary>
  15. /// Minimum cooldown after a delivery spawns.
  16. /// </summary>
  17. [DataField]
  18. public TimeSpan MinDeliveryCooldown = TimeSpan.FromMinutes(3);
  19. /// <summary>
  20. /// Maximum cooldown after a delivery spawns.
  21. /// </summary>
  22. [DataField]
  23. public TimeSpan MaxDeliveryCooldown = TimeSpan.FromMinutes(7);
  24. /// <summary>
  25. /// The ratio at which deliveries will spawn, based on the amount of people in the crew manifest.
  26. /// 1 delivery per X players.
  27. /// </summary>
  28. [DataField]
  29. public float PlayerToDeliveryRatio = 7f;
  30. /// <summary>
  31. /// The minimum amount of deliveries that will spawn.
  32. /// This is not per spawner unless DistributeRandomly is false.
  33. /// </summary>
  34. [DataField]
  35. public int MinimumDeliverySpawn = 1;
  36. /// <summary>
  37. /// Should deliveries be randomly split between spawners?
  38. /// If true, the amount of deliveries will be spawned randomly across all spawners.
  39. /// If false, an amount of mail based on PlayerToDeliveryRatio will be spawned on all spawners.
  40. /// </summary>
  41. [DataField]
  42. public bool DistributeRandomly = true;
  43. }