StickyComponent.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using Content.Shared.Sticky.Systems;
  2. using Content.Shared.Whitelist;
  3. using Robust.Shared.GameStates;
  4. using Robust.Shared.Utility;
  5. namespace Content.Shared.Sticky.Components;
  6. /// <summary>
  7. /// Items that can be stuck to other structures or entities.
  8. /// For example, paper stickers or C4 charges.
  9. /// </summary>
  10. [RegisterComponent, NetworkedComponent, Access(typeof(StickySystem))]
  11. [AutoGenerateComponentState]
  12. public sealed partial class StickyComponent : Component
  13. {
  14. /// <summary>
  15. /// What target entities are valid to be surface for sticky entity.
  16. /// </summary>
  17. [DataField]
  18. public EntityWhitelist? Whitelist;
  19. /// <summary>
  20. /// What target entities can't be used as surface for sticky entity.
  21. /// </summary>
  22. [DataField]
  23. public EntityWhitelist? Blacklist;
  24. /// <summary>
  25. /// How much time it takes to stick the entity to a target.
  26. /// If zero, it will immediately be stuck.
  27. /// </summary>
  28. [DataField]
  29. public TimeSpan StickDelay = TimeSpan.Zero;
  30. /// <summary>
  31. /// Whether users can unstick the entity after it has been stuck.
  32. /// </summary>
  33. [DataField]
  34. public bool CanUnstick = true;
  35. /// <summary>
  36. /// How much time it takes to unstick the entity.
  37. /// If zero, it will immediately be unstuck.
  38. /// </summary>
  39. [DataField]
  40. public TimeSpan UnstickDelay = TimeSpan.Zero;
  41. /// <summary>
  42. /// Popup message shown when player starts sticking the entity to another entity.
  43. /// </summary>
  44. [DataField]
  45. public LocId? StickPopupStart;
  46. /// <summary>
  47. /// Popup message shown when a player successfully sticks the entity.
  48. /// </summary>
  49. [DataField]
  50. public LocId? StickPopupSuccess;
  51. /// <summary>
  52. /// Popup message shown when a player starts unsticking the entity from another entity.
  53. /// </summary>
  54. [DataField]
  55. public LocId? UnstickPopupStart;
  56. /// <summary>
  57. /// Popup message shown when a player successfully unsticks the entity.
  58. /// </summary>
  59. [DataField]
  60. public LocId? UnstickPopupSuccess;
  61. /// <summary>
  62. /// Entity that is used as a surface for the sticky entity.
  63. /// Null if entity isn't stuck to anything.
  64. /// </summary>
  65. [DataField, AutoNetworkedField]
  66. public EntityUid? StuckTo;
  67. /// <summary>
  68. /// Text to use for the unstick verb.
  69. /// </summary>
  70. [DataField]
  71. public LocId VerbText = "comp-sticky-unstick-verb-text";
  72. /// <summary>
  73. /// Icon to use for the unstick verb.
  74. /// </summary>
  75. [DataField]
  76. public SpriteSpecifier VerbIcon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/eject.svg.192dpi.png"));
  77. }