TraitPrototype.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using Content.Shared.Whitelist;
  2. using Robust.Shared.Prototypes;
  3. namespace Content.Shared.Traits;
  4. /// <summary>
  5. /// Describes a trait.
  6. /// </summary>
  7. [Prototype]
  8. public sealed partial class TraitPrototype : IPrototype
  9. {
  10. [ViewVariables]
  11. [IdDataField]
  12. public string ID { get; private set; } = default!;
  13. /// <summary>
  14. /// The name of this trait.
  15. /// </summary>
  16. [DataField]
  17. public LocId Name { get; private set; } = string.Empty;
  18. /// <summary>
  19. /// The description of this trait.
  20. /// </summary>
  21. [DataField]
  22. public LocId? Description { get; private set; }
  23. /// <summary>
  24. /// Don't apply this trait to entities this whitelist IS NOT valid for.
  25. /// </summary>
  26. [DataField]
  27. public EntityWhitelist? Whitelist;
  28. /// <summary>
  29. /// Don't apply this trait to entities this whitelist IS valid for. (hence, a blacklist)
  30. /// </summary>
  31. [DataField]
  32. public EntityWhitelist? Blacklist;
  33. /// <summary>
  34. /// The components that get added to the player, when they pick this trait.
  35. /// </summary>
  36. [DataField]
  37. public ComponentRegistry Components { get; private set; } = default!;
  38. /// <summary>
  39. /// Gear that is given to the player, when they pick this trait.
  40. /// </summary>
  41. [DataField]
  42. public EntProtoId? TraitGear;
  43. /// <summary>
  44. /// Trait Price. If negative number, points will be added.
  45. /// </summary>
  46. [DataField]
  47. public int Cost = 0;
  48. /// <summary>
  49. /// Adds a trait to a category, allowing you to limit the selection of some traits to the settings of that category.
  50. /// </summary>
  51. [DataField]
  52. public ProtoId<TraitCategoryPrototype>? Category;
  53. }