1
0

SubFloorHideComponent.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using Robust.Shared.GameStates;
  2. namespace Content.Shared.SubFloor
  3. {
  4. /// <summary>
  5. /// Simple component that automatically hides the sibling
  6. /// <see cref="SpriteComponent" /> when the tile it's on is not a sub floor
  7. /// (plating).
  8. /// </summary>
  9. /// <seealso cref="P:Content.Shared.Maps.ContentTileDefinition.IsSubFloor" />
  10. [NetworkedComponent]
  11. [RegisterComponent]
  12. [Access(typeof(SharedSubFloorHideSystem))]
  13. public sealed partial class SubFloorHideComponent : Component
  14. {
  15. /// <summary>
  16. /// Whether the entity's current position has a "Floor-type" tile above its current position.
  17. /// </summary>
  18. [ViewVariables]
  19. public bool IsUnderCover { get; set; } = false;
  20. /// <summary>
  21. /// Whether interactions with this entity should be blocked while it is under floor tiles.
  22. /// </summary>
  23. /// <remarks>
  24. /// Useful for entities like vents, which are only partially hidden. Anchor attempts will still be blocked.
  25. /// </remarks>
  26. [DataField]
  27. public bool BlockInteractions { get; set; } = true;
  28. /// <summary>
  29. /// Whether this entity's ambience should be disabled when underneath the floor.
  30. /// </summary>
  31. /// <remarks>
  32. /// Useful for cables and piping, gives maint it's distinct noise.
  33. /// </remarks>
  34. [DataField]
  35. public bool BlockAmbience { get; set; } = true;
  36. /// <summary>
  37. /// Sprite layer keys for the layers that are always visible, even if the entity is below a floor tile. E.g.,
  38. /// the vent part of a vent is always visible, even though the piping is hidden.
  39. /// </summary>
  40. [DataField]
  41. public HashSet<Enum> VisibleLayers = new();
  42. /// <summary>
  43. /// This is used for storing the original draw depth of a t-ray revealed entity.
  44. /// e.g. when a t-ray revealed cable is drawn above a carpet.
  45. /// </summary>
  46. [DataField]
  47. public int? OriginalDrawDepth;
  48. }
  49. }