CargoGiftsRuleComponent.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using Content.Server.StationEvents.Events;
  2. using Content.Shared.Cargo.Prototypes;
  3. using Robust.Shared.Prototypes;
  4. namespace Content.Server.StationEvents.Components;
  5. /// <summary>
  6. /// Used an event that gifts the station with certian cargo
  7. /// </summary>
  8. [RegisterComponent, Access(typeof(CargoGiftsRule))]
  9. public sealed partial class CargoGiftsRuleComponent : Component
  10. {
  11. /// <summary>
  12. /// The base announcement string (which then incorporates the strings below)
  13. /// </summary>
  14. [DataField, ViewVariables(VVAccess.ReadWrite)]
  15. public LocId Announce = "cargo-gifts-event-announcement";
  16. /// <summary>
  17. /// What is being sent
  18. /// </summary>
  19. [DataField, ViewVariables(VVAccess.ReadWrite)]
  20. public LocId Description = "cargo-gift-default-description";
  21. /// <summary>
  22. /// Sender of the gifts
  23. /// </summary>
  24. [DataField, ViewVariables(VVAccess.ReadWrite)]
  25. public LocId Sender = "cargo-gift-default-sender";
  26. /// <summary>
  27. /// Destination of the gifts (who they get sent to on the station)
  28. /// </summary>
  29. [DataField, ViewVariables(VVAccess.ReadWrite)]
  30. public LocId Dest = "cargo-gift-default-dest";
  31. /// <summary>
  32. /// Cargo that you would like gifted to the station, with the quantity for each
  33. /// Use Ids from cargoProduct Prototypes
  34. /// </summary>
  35. [DataField(required: true), ViewVariables(VVAccess.ReadWrite)]
  36. public Dictionary<ProtoId<CargoProductPrototype>, int> Gifts = new();
  37. /// <summary>
  38. /// How much space (minimum) you want to leave in the order database for supply to actually do their work
  39. /// </summary>
  40. [DataField, ViewVariables(VVAccess.ReadWrite)]
  41. public int OrderSpaceToLeave = 5;
  42. /// <summary>
  43. /// Time until we consider next lot of gifts (if supply is overflowing with orders)
  44. /// </summary>
  45. [DataField, ViewVariables(VVAccess.ReadWrite)]
  46. public float TimeUntilNextGifts = 10.0f;
  47. }