CargoBountyPrototype.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using Content.Shared.Whitelist;
  2. using Robust.Shared.Prototypes;
  3. using Robust.Shared.Serialization;
  4. namespace Content.Shared.Cargo.Prototypes;
  5. /// <summary>
  6. /// This is a prototype for a cargo bounty, a set of items
  7. /// that must be sold together in a labeled container in order
  8. /// to receive a monetary reward.
  9. /// </summary>
  10. [Prototype, Serializable, NetSerializable]
  11. public sealed partial class CargoBountyPrototype : IPrototype
  12. {
  13. /// <inheritdoc/>
  14. [IdDataField]
  15. public string ID { get; private set; } = default!;
  16. /// <summary>
  17. /// The monetary reward for completing the bounty
  18. /// </summary>
  19. [DataField(required: true)]
  20. public int Reward;
  21. /// <summary>
  22. /// A description for flava purposes.
  23. /// </summary>
  24. [DataField]
  25. public LocId Description = string.Empty;
  26. /// <summary>
  27. /// The entries that must be satisfied for the cargo bounty to be complete.
  28. /// </summary>
  29. [DataField(required: true)]
  30. public List<CargoBountyItemEntry> Entries = new();
  31. /// <summary>
  32. /// A prefix appended to the beginning of a bounty's ID.
  33. /// </summary>
  34. [DataField]
  35. public string IdPrefix = "NT";
  36. }
  37. [DataDefinition, Serializable, NetSerializable]
  38. public readonly partial record struct CargoBountyItemEntry()
  39. {
  40. /// <summary>
  41. /// A whitelist for determining what items satisfy the entry.
  42. /// </summary>
  43. [DataField(required: true)]
  44. public EntityWhitelist Whitelist { get; init; } = default!;
  45. /// <summary>
  46. /// A blacklist that can be used to exclude items in the whitelist.
  47. /// </summary>
  48. [DataField]
  49. public EntityWhitelist? Blacklist { get; init; } = null;
  50. // todo: implement some kind of simple generic condition system
  51. /// <summary>
  52. /// How much of the item must be present to satisfy the entry
  53. /// </summary>
  54. [DataField]
  55. public int Amount { get; init; } = 1;
  56. /// <summary>
  57. /// A player-facing name for the item.
  58. /// </summary>
  59. [DataField]
  60. public LocId Name { get; init; } = string.Empty;
  61. }