ReplaceTileDunGen.cs 713 B

123456789101112131415161718192021222324252627282930
  1. using Content.Shared.Maps;
  2. using Robust.Shared.Noise;
  3. using Robust.Shared.Prototypes;
  4. namespace Content.Shared.Procedural.DungeonGenerators;
  5. /// <summary>
  6. /// Replaces existing tiles if they're not empty.
  7. /// </summary>
  8. public sealed partial class ReplaceTileDunGen : IDunGenLayer
  9. {
  10. /// <summary>
  11. /// Chance for a non-variant tile to be used, in case they're too noisy.
  12. /// </summary>
  13. [DataField]
  14. public float VariantWeight = 0.1f;
  15. [DataField(required: true)]
  16. public List<ReplaceTileLayer> Layers = new();
  17. }
  18. [DataRecord]
  19. public partial record struct ReplaceTileLayer
  20. {
  21. public ProtoId<ContentTileDefinition> Tile;
  22. public float Threshold;
  23. public FastNoiseLite Noise;
  24. }