ReplaceFloorOnSpawnComponent.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using Content.Shared.Maps;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Prototypes;
  4. namespace Content.Shared.Tiles;
  5. /// <summary>
  6. /// Replaces floor tiles around this entity when it spawns
  7. /// </summary>
  8. [RegisterComponent, NetworkedComponent, Access(typeof(ReplaceFloorOnSpawnSystem))]
  9. public sealed partial class ReplaceFloorOnSpawnComponent : Component
  10. {
  11. /// <summary>
  12. /// The floor tiles that will be replaced. If null, will replace all.
  13. /// </summary>
  14. [DataField]
  15. public List<ProtoId<ContentTileDefinition>>? ReplaceableTiles = new();
  16. /// <summary>
  17. /// The tiles that it will replace. Randomly picked from the list.
  18. /// </summary>
  19. [DataField]
  20. public List<ProtoId<ContentTileDefinition>> ReplacementTiles = new();
  21. /// <summary>
  22. /// Whether or not there has to be a tile in the location to be replaced.
  23. /// </summary>
  24. [DataField]
  25. public bool ReplaceSpace = true;
  26. /// <summary>
  27. /// List of offsets from the base tile, used to determine which tiles will be replaced.
  28. /// </summary>
  29. [DataField]
  30. public List<Vector2i> Offsets = new() { Vector2i.Up, Vector2i.Down, Vector2i.Left, Vector2i.Right, Vector2i.Zero };
  31. }