Salvage magnet revamp (#23119)
* Generic offering window * More work * weh * Parity * Progression meter * magnet * rona * PG asteroid work * code red * Asteroid spawnings * clams * a * Marker fixes * More fixes * Workings of biome asteroids * A * Fix this loading code * a * Fix masking * weh * Fixes * Magnet claiming * toe * petogue * magnet * Bunch of fixes * Fix default * Fixes * asteroids * Fix offerings * Localisation and a bunch of fixes * a * Fixes * Preliminary draft * Announcement fixes * Fixes and bump spawn rate * Fix asteroid spawns and UI * More fixes * Expeditions fix * fix * Gravity * Fix announcement rounding * a * Offset tweak * sus * jankass * Fix merge
This commit is contained in:
58
Content.Shared/Procedural/DungeonGenerators/NoiseDunGen.cs
Normal file
58
Content.Shared/Procedural/DungeonGenerators/NoiseDunGen.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Noise;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
||||
|
||||
namespace Content.Shared.Procedural.DungeonGenerators;
|
||||
|
||||
/// <summary>
|
||||
/// Generates dungeon flooring based on the specified noise.
|
||||
/// </summary>
|
||||
public sealed partial class NoiseDunGen : IDunGen
|
||||
{
|
||||
/*
|
||||
* Floodfills out from 0 until it finds a valid tile.
|
||||
* From here it then floodfills until it can no longer fill in an area and generates a dungeon from that.
|
||||
*/
|
||||
|
||||
// At some point we may want layers masking each other like a simpler version of biome code but for now
|
||||
// we'll just make it circular.
|
||||
|
||||
/// <summary>
|
||||
/// How many areas of noise to fill out. Useful if we just want 1 blob area to fill out.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public int Iterations = int.MaxValue;
|
||||
|
||||
/// <summary>
|
||||
/// Cap on how many tiles to include.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public int TileCap = 128;
|
||||
|
||||
/// <summary>
|
||||
/// Standard deviation of tilecap.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float CapStd = 8f;
|
||||
|
||||
[DataField(required: true)]
|
||||
public List<NoiseDunGenLayer> Layers = new();
|
||||
}
|
||||
|
||||
[DataRecord]
|
||||
public record struct NoiseDunGenLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// If the noise value is above this then it gets output.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float Threshold;
|
||||
|
||||
[DataField(required: true)]
|
||||
public string Tile;
|
||||
|
||||
[DataField(required: true)]
|
||||
public FastNoiseLite Noise;
|
||||
}
|
||||
Reference in New Issue
Block a user