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:
@@ -2,7 +2,7 @@ namespace Content.Shared.Procedural;
|
||||
|
||||
public sealed class Dungeon
|
||||
{
|
||||
public readonly List<DungeonRoom> Rooms = new();
|
||||
public readonly List<DungeonRoom> Rooms;
|
||||
|
||||
/// <summary>
|
||||
/// Hashset of the tiles across all rooms.
|
||||
@@ -14,4 +14,14 @@ public sealed class Dungeon
|
||||
public readonly HashSet<Vector2i> CorridorTiles = new();
|
||||
|
||||
public readonly HashSet<Vector2i> CorridorExteriorTiles = new();
|
||||
|
||||
public Dungeon()
|
||||
{
|
||||
Rooms = new List<DungeonRoom>();
|
||||
}
|
||||
|
||||
public Dungeon(List<DungeonRoom> rooms)
|
||||
{
|
||||
Rooms = rooms;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using Content.Shared.Parallax.Biomes.Markers;
|
||||
using Content.Shared.Procedural.PostGeneration;
|
||||
using Content.Shared.Random;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// Spawns the specified marker layer on top of the dungeon rooms.
|
||||
/// </summary>
|
||||
public sealed partial class BiomeMarkerLayerPostGen : IPostDunGen
|
||||
{
|
||||
/// <summary>
|
||||
/// How many times to spawn marker layers; can duplicate.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public int Count = 6;
|
||||
|
||||
[DataField(required: true)]
|
||||
public ProtoId<WeightedRandomPrototype> MarkerTemplate;
|
||||
}
|
||||
15
Content.Shared/Procedural/PostGeneration/BiomePostGen.cs
Normal file
15
Content.Shared/Procedural/PostGeneration/BiomePostGen.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Content.Shared.Parallax.Biomes;
|
||||
using Content.Shared.Procedural.PostGeneration;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// Generates a biome on top of valid tiles, then removes the biome when done.
|
||||
/// Only works if no existing biome is present.
|
||||
/// </summary>
|
||||
public sealed partial class BiomePostGen : IPostDunGen
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public ProtoId<BiomeTemplatePrototype> BiomeTemplate;
|
||||
}
|
||||
Reference in New Issue
Block a user